Commit 9a29d449 authored by Liran Alon's avatar Liran Alon Committed by Paolo Bonzini

KVM: x86: Always allow access to VMware backdoor I/O ports

VMware allows access to these ports even if denied
by TSS I/O permission bitmap. Mimic behavior.
Signed-off-by: default avatarLiran Alon <liran.alon@oracle.com>
Reviewed-by: default avatarNikita Leshenko <nikita.leshchenko@oracle.com>
Reviewed-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent c4ae60e4
...@@ -2887,6 +2887,9 @@ static bool emulator_bad_iopl(struct x86_emulate_ctxt *ctxt) ...@@ -2887,6 +2887,9 @@ static bool emulator_bad_iopl(struct x86_emulate_ctxt *ctxt)
return ctxt->ops->cpl(ctxt) > iopl; return ctxt->ops->cpl(ctxt) > iopl;
} }
#define VMWARE_PORT_VMPORT (0x5658)
#define VMWARE_PORT_VMRPC (0x5659)
static bool emulator_io_port_access_allowed(struct x86_emulate_ctxt *ctxt, static bool emulator_io_port_access_allowed(struct x86_emulate_ctxt *ctxt,
u16 port, u16 len) u16 port, u16 len)
{ {
...@@ -2898,6 +2901,14 @@ static bool emulator_io_port_access_allowed(struct x86_emulate_ctxt *ctxt, ...@@ -2898,6 +2901,14 @@ static bool emulator_io_port_access_allowed(struct x86_emulate_ctxt *ctxt,
unsigned mask = (1 << len) - 1; unsigned mask = (1 << len) - 1;
unsigned long base; unsigned long base;
/*
* VMware allows access to these ports even if denied
* by TSS I/O permission bitmap. Mimic behavior.
*/
if (enable_vmware_backdoor &&
((port == VMWARE_PORT_VMPORT) || (port == VMWARE_PORT_VMRPC)))
return true;
ops->get_segment(ctxt, &tr, &tr_seg, &base3, VCPU_SREG_TR); ops->get_segment(ctxt, &tr, &tr_seg, &base3, VCPU_SREG_TR);
if (!tr_seg.p) if (!tr_seg.p)
return false; return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment