[xen master] x86/vmx: Simplify PAT handling during vcpu construction

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen master] x86/vmx: Simplify PAT handling during vcpu construction

patchbot
commit e29acab49b97bdcbae74592831994430ab861170
Author:     Andrew Cooper <[hidden email]>
AuthorDate: Thu May 24 14:15:32 2018 +0100
Commit:     Andrew Cooper <[hidden email]>
CommitDate: Thu Jun 28 11:31:00 2018 +0100

    x86/vmx: Simplify PAT handling during vcpu construction
   
    The host PAT value is a compile time constant, and doesn't need to be read out
    of hardware.  Merge this if block into the previous block, which has an
    identical condition.
   
    Signed-off-by: Andrew Cooper <[hidden email]>
    Reviewed-by: Jan Beulich <[hidden email]>
    Acked-by: Kevin Tian <[hidden email]>
    Reviewed-by: Roger Pau Monné <[hidden email]>
---
 xen/arch/x86/hvm/vmx/vmcs.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 258fc08f72..13b9cc5dbe 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1248,17 +1248,9 @@ static int construct_vmcs(struct vcpu *v)
 
         ept->mfn = pagetable_get_pfn(p2m_get_pagetable(p2m));
         __vmwrite(EPT_POINTER, ept->eptp);
-    }
-
-    if ( paging_mode_hap(d) )
-    {
-        u64 host_pat, guest_pat;
-
-        rdmsrl(MSR_IA32_CR_PAT, host_pat);
-        guest_pat = MSR_IA32_CR_PAT_RESET;
 
-        __vmwrite(HOST_PAT, host_pat);
-        __vmwrite(GUEST_PAT, guest_pat);
+        __vmwrite(HOST_PAT, XEN_MSR_PAT);
+        __vmwrite(GUEST_PAT, MSR_IA32_CR_PAT_RESET);
     }
     if ( cpu_has_vmx_mpx )
         __vmwrite(GUEST_BNDCFGS, 0);
--
generated by git-patchbot for /home/xen/git/xen.git#master


_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog