diff options
author | neel <neel@FreeBSD.org> | 2014-08-08 03:49:01 +0000 |
---|---|---|
committer | neel <neel@FreeBSD.org> | 2014-08-08 03:49:01 +0000 |
commit | 6e79e6c83b9eecdab73c3fca732ad619ba898217 (patch) | |
tree | 5b848875c85bd774fc8b28deed87688d34dc702c /sys/amd64/vmm | |
parent | 7727a3c21521a720a63dfae179944a2c6272e150 (diff) | |
download | FreeBSD-src-6e79e6c83b9eecdab73c3fca732ad619ba898217.zip FreeBSD-src-6e79e6c83b9eecdab73c3fca732ad619ba898217.tar.gz |
Support PCI extended config space in bhyve.
Add the ACPI MCFG table to advertise the extended config memory window.
Introduce a new flag MEM_F_IMMUTABLE for memory ranges that cannot be deleted
or moved in the guest's address space. The PCI extended config space is an
example of an immutable memory range.
Add emulation for the "movzw" instruction. This instruction is used by FreeBSD
to read a 16-bit extended config space register.
CR: https://phabric.freebsd.org/D505
Reviewed by: jhb, grehan
Requested by: tychon
Diffstat (limited to 'sys/amd64/vmm')
-rw-r--r-- | sys/amd64/vmm/vmm_instruction_emul.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sys/amd64/vmm/vmm_instruction_emul.c b/sys/amd64/vmm/vmm_instruction_emul.c index 2e77ece..a65b125 100644 --- a/sys/amd64/vmm/vmm_instruction_emul.c +++ b/sys/amd64/vmm/vmm_instruction_emul.c @@ -82,6 +82,10 @@ static const struct vie_op two_byte_opcodes[256] = { .op_byte = 0xB6, .op_type = VIE_OP_TYPE_MOVZX, }, + [0xB7] = { + .op_byte = 0xB7, + .op_type = VIE_OP_TYPE_MOVZX, + }, [0xBE] = { .op_byte = 0xBE, .op_type = VIE_OP_TYPE_MOVSX, @@ -505,6 +509,25 @@ emulate_movx(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, /* write the result */ error = vie_update_register(vm, vcpuid, reg, val, size); break; + case 0xB7: + /* + * MOV and zero extend word from mem (ModRM:r/m) to + * reg (ModRM:reg). + * + * 0F B7/r movzx r32, r/m16 + * REX.W + 0F B7/r movzx r64, r/m16 + */ + error = memread(vm, vcpuid, gpa, &val, 2, arg); + if (error) + return (error); + + reg = gpr_map[vie->reg]; + + /* zero-extend word */ + val = (uint16_t)val; + + error = vie_update_register(vm, vcpuid, reg, val, size); + break; case 0xBE: /* * MOV and sign extend byte from mem (ModRM:r/m) to |