Messages in this thread Patch in this message | | | From | Vitaly Kuznetsov <> | Subject | [PATCH 2/3] x86/kvm/vmx: read MSR_KERNEL_GS_BASE from current->thread | Date | Mon, 12 Mar 2018 15:02:59 +0100 |
| |
vmx_save_host_state() is only called from kvm_arch_vcpu_ioctl_run() so the context is pretty well defined and as we're past 'swapgs' MSR_KERNEL_GS_BASE is equal to current->thread.gsbase (after previous save_current_fsgs() call).
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> --- arch/x86/kvm/vmx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index e46b7b24ebae..d4d9bb2fd91e 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -2167,7 +2167,7 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu) #endif #ifdef CONFIG_X86_64 - rdmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base); + vmx->msr_host_kernel_gs_base = current->thread.gsbase; if (is_long_mode(&vmx->vcpu)) wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base); #endif -- 2.14.3
| |