x86/VT-x: Don't rewrite HOST_TR_SELECTOR on every context switch
PATCH 1/1 x86/VT-x: Don't rewrite HOST_TR_SELECTOR on every context switch
TSS_ENTRY is a compile time constant, so HOST_TR_SELECTOR can be set up during VMCS construction and left alone thereafter, rather than rewriting it on every context switch.
---
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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/hvm/vmx/vmcs.c +1 -1
@@ -806,7 +806,6 @@ static void vmx_set_host_env(struct vcpu *v) (unsigned long)(this_cpu(gdt_table) - FIRST_RESERVED_GDT_ENTRY));__vmwrite (HOST_IDTR_BASE , (unsigned long )idt_tables[cpu]); -__vmwrite (HOST_TR_SELECTOR ,TSS_ENTRY <<3 );__vmwrite (HOST_TR_BASE , (unsigned long )&per_cpu (init_tss, cpu));__vmwrite (HOST_SYSENTER_ESP ,get_stack_bottom ());
@@ -1144,6 +1143,7 @@ static int construct_vmcs(struct vcpu *v)__vmwrite (HOST_GS_SELECTOR ,0 );__vmwrite (HOST_FS_BASE ,0 );__vmwrite (HOST_GS_BASE ,0 ); +__vmwrite (HOST_TR_SELECTOR ,TSS_ENTRY <<3 );/* Host control registers. */ v->arch.hvm_vmx.host_cr0 =read_cr0 () |X86_CR0_TS ;
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 17.10.17 at 19:16, <[email protected]> wrote:
TSS_ENTRYis a compile time constant, soHOST_TR_SELECTORcan be set up during VMCS construction and left alone thereafter, rather than rewriting it on every context switch.Signed-off-by Andrew Cooper <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 10 lines
From: Andrew Cooper [mailto:[email protected]]
Sent: Wednesday, October 18, 2017 1:16 AM
TSS_ENTRYis a compile time constant, soHOST_TR_SELECTORcan be set up during
VMCS construction and left alone thereafter, rather than rewriting it on every
context switch.Signed-off-by Andrew Cooper <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel