[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] x86/svm: Remove the pdpe fields from struct vmcb



These fields have existed since the SVM code was first introduced.

The earliest reference I can find is c/s d1bd157fbc9 which is unforunately a
rebase & squash of a separate dev tree.  Looking a the commit message, I'm
guessing it was introduced by:

  > user:        twoller@xxxxxxxxxxxxx
  > date:        Tue Dec 13 19:49:53 2005 -0500
  > files:       ... xen/include/asm-x86/svm_vmcb.h ...
  > description:
  > Add SVM base files to repository.

Anyway, the AMD SDM has no mention of PDPE fields in the VMCB and marks this
part of the VMCB as reserved.  The manual does explicitly say that 32bit PAE
paging may read the PDPE fields from memory rather from the CPU registers.

Chances are very good that this is a vestigial remnent of an early design.
Xen doesn't use the fields at all, except to copy them on virtual
vmentry/vmexit.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
CC: Suravee Suthikulpanit <suravee.suthikulpanit@xxxxxxx>
CC: Brian Woods <brian.woods@xxxxxxx>
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 xen/arch/x86/hvm/svm/nestedsvm.c   | 12 ------------
 xen/include/asm-x86/hvm/svm/vmcb.h |  7 ++-----
 2 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 3f4f403..78a1016 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -636,12 +636,6 @@ static int nsvm_vmcb_prepare4vmrun(struct vcpu *v, struct 
cpu_user_regs *regs)
      * sysenter_eip. These are handled via VMSAVE/VMLOAD emulation.
      */
 
-    /* Page tables */
-    n2vmcb->pdpe0 = ns_vmcb->pdpe0;
-    n2vmcb->pdpe1 = ns_vmcb->pdpe1;
-    n2vmcb->pdpe2 = ns_vmcb->pdpe2;
-    n2vmcb->pdpe3 = ns_vmcb->pdpe3;
-
     /* PAT */
     if (!vcleanbit_set(np)) {
         n2vmcb->_g_pat = ns_vmcb->_g_pat;
@@ -1177,12 +1171,6 @@ nsvm_vmcb_prepare4vmexit(struct vcpu *v, struct 
cpu_user_regs *regs)
     /* CR2 */
     ns_vmcb->_cr2 = n2vmcb->_cr2;
 
-    /* Page tables */
-    ns_vmcb->pdpe0 = n2vmcb->pdpe0;
-    ns_vmcb->pdpe1 = n2vmcb->pdpe1;
-    ns_vmcb->pdpe2 = n2vmcb->pdpe2;
-    ns_vmcb->pdpe3 = n2vmcb->pdpe3;
-
     /* PAT */
     ns_vmcb->_g_pat = n2vmcb->_g_pat;
 
diff --git a/xen/include/asm-x86/hvm/svm/vmcb.h 
b/xen/include/asm-x86/hvm/svm/vmcb.h
index 3a514f8..48aed78 100644
--- a/xen/include/asm-x86/hvm/svm/vmcb.h
+++ b/xen/include/asm-x86/hvm/svm/vmcb.h
@@ -479,17 +479,14 @@ struct vmcb_struct {
     u64 sysenter_esp;
     u64 sysenter_eip;
     u64 _cr2;                   /* cleanbit 9 */
-    u64 pdpe0;
-    u64 pdpe1;
-    u64 pdpe2;
-    u64 pdpe3;
+    u64 res16[4];
     u64 _g_pat;                 /* cleanbit 4 */
     u64 _debugctlmsr;           /* cleanbit 10 */
     u64 _lastbranchfromip;      /* cleanbit 10 */
     u64 _lastbranchtoip;        /* cleanbit 10 */
     u64 _lastintfromip;         /* cleanbit 10 */
     u64 _lastinttoip;           /* cleanbit 10 */
-    u64 res16[301];
+    u64 res17[301];
 };
 
 struct svm_domain {
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.