x86/VT-x: Don't use rdmsr() to fill HOST_SYSENTER_{CS, EIP}
PATCH 1/1 x86/VT-x: Don't use rdmsr() to fill HOST_SYSENTER_{CS, EIP}
These are compile-time constants, and don't need to be read back from hardware.
---
CC: Jan Beulich <[email protected]>
CC: Wei Liu <[email protected]>
CC: Jun Nakajima <[email protected]>
CC: Kevin Tian <[email protected]>
--- xen/arch/x86/hvm/vmx/vmcs.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
xen/arch/x86/hvm/vmx/vmcs.c +2 -6
@@ -994,8 +994,6 @@ static void pi_desc_init(struct vcpu *v)static int construct_vmcs (struct vcpu *v) {struct domain *d = v->domain; -uint16_t sysenter_cs; -unsigned long sysenter_eip;u32 vmexit_ctl = vmx_vmexit_control;u32 vmentry_ctl = vmx_vmentry_control;
@@ -1155,10 +1153,8 @@ static int construct_vmcs(struct vcpu *v)__vmwrite (HOST_RIP , (unsigned long )vmx_asm_vmexit_handler);/* Host SYSENTER CS:RIP. */ -rdmsrl (MSR_IA32_SYSENTER_CS , sysenter_cs); -__vmwrite (HOST_SYSENTER_CS , sysenter_cs); -rdmsrl (MSR_IA32_SYSENTER_EIP , sysenter_eip); -__vmwrite (HOST_SYSENTER_EIP , sysenter_eip); +__vmwrite (HOST_SYSENTER_CS , __HYPERVISOR_CS); +__vmwrite (HOST_SYSENTER_EIP , (unsigned long )sysenter_entry);/* MSR intercepts. */ __vmwrite (VM_EXIT_MSR_LOAD_COUNT ,0 );
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 20.10.17 at 16:01, <[email protected]> wrote:
These are compile-time constants, and don't need to be read back from hardware.
Signed-off-by Andrew Cooper <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 4 lines · Andrew Cooper
These are compile-time constants, and don't need to be read back from hardware.
Signed-off-by Andrew Cooper <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 7 lines
From: Andrew Cooper [mailto:[email protected]]
Sent: Friday, October 20, 2017 10:02 PMThese are compile-time constants, and don't need to be read back from hardware.
Signed-off-by Andrew Cooper <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel