summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/vmm_instruction_emul.h
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2014-05-23 05:15:17 +0000
committerneel <neel@FreeBSD.org>2014-05-23 05:15:17 +0000
commit8f99933d8230d3e7da7e3faebeca2536fa117b6b (patch)
treebe2b310758f6bb7d7e91c4b4594bc520fe6c5898 /sys/amd64/include/vmm_instruction_emul.h
parent062bfb5ea330c00e34b73aa892bccbd5ea82da22 (diff)
downloadFreeBSD-src-8f99933d8230d3e7da7e3faebeca2536fa117b6b.zip
FreeBSD-src-8f99933d8230d3e7da7e3faebeca2536fa117b6b.tar.gz
Add emulation of the "outsb" instruction. NetBSD guests use this to write to
the UART FIFO. The emulation is constrained in a number of ways: 64-bit only, doesn't check for all exception conditions, limited to i/o ports emulated in userspace. Some of these constraints will be relaxed in followup commits. Requested by: grehan Reviewed by: tychon (partially and a much earlier version)
Diffstat (limited to 'sys/amd64/include/vmm_instruction_emul.h')
-rw-r--r--sys/amd64/include/vmm_instruction_emul.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/amd64/include/vmm_instruction_emul.h b/sys/amd64/include/vmm_instruction_emul.h
index 02cb922..d2cfdef 100644
--- a/sys/amd64/include/vmm_instruction_emul.h
+++ b/sys/amd64/include/vmm_instruction_emul.h
@@ -29,6 +29,8 @@
#ifndef _VMM_INSTRUCTION_EMUL_H_
#define _VMM_INSTRUCTION_EMUL_H_
+enum vm_reg_name;
+
enum vie_cpu_mode {
CPU_MODE_COMPATIBILITY, /* IA-32E mode (CS.L = 0) */
CPU_MODE_64BIT, /* IA-32E mode (CS.L = 1) */
@@ -111,6 +113,9 @@ int vmm_emulate_instruction(void *vm, int cpuid, uint64_t gpa, struct vie *vie,
mem_region_read_t mrr, mem_region_write_t mrw,
void *mrarg);
+int vie_update_register(void *vm, int vcpuid, enum vm_reg_name reg,
+ uint64_t val, int size);
+
#ifdef _KERNEL
/*
* APIs to fetch and decode the instruction from nested page fault handler.
@@ -134,6 +139,11 @@ int vmm_gla2gpa(struct vm *vm, int vcpuid, uint64_t gla, uint64_t cr3,
void vie_init(struct vie *vie);
+uint64_t vie_size2mask(int size);
+
+uint64_t vie_segbase(enum vm_reg_name segment, enum vie_cpu_mode cpu_mode,
+ const struct seg_desc *desc);
+
/*
* Decode the instruction fetched into 'vie' so it can be emulated.
*
OpenPOWER on IntegriCloud