struct nestedvm uses mostly plain integer types, except for virt_ext_t which
is a union wrapping two bitfield names.  But the nested virt logic only ever
deals with it as full opaque register.

Switch it to being a plain uint64_t, allowing us to hide even more of the SVM
internal infrastructure.

Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>
---
CC: Jan Beulich <jbeul...@suse.com>
CC: Xenia Ragiadakou <burzalod...@gmail.com>

This allows virt_ext_t to move out of the public vmcb.h along with all other
vmcb types.
---
 xen/arch/x86/hvm/svm/nestedsvm.c             | 4 ++--
 xen/arch/x86/include/asm/hvm/svm/nestedsvm.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 92316c6624ce..153a37f2f227 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -164,7 +164,7 @@ int cf_check nsvm_vcpu_reset(struct vcpu *v)
     svm->ns_exception_intercepts = 0;
     svm->ns_general1_intercepts = 0;
     svm->ns_general2_intercepts = 0;
-    svm->ns_virt_ext.bytes = 0;
+    svm->ns_virt_ext = 0;
 
     svm->ns_hap_enabled = 0;
     svm->ns_vmcb_guestcr3 = 0;
@@ -526,7 +526,7 @@ static int nsvm_vmcb_prepare4vmrun(struct vcpu *v, struct 
cpu_user_regs *regs)
 
     /* LBR and other virtualization */
     if ( !clean.lbr )
-        svm->ns_virt_ext = ns_vmcb->virt_ext;
+        svm->ns_virt_ext = ns_vmcb->virt_ext.bytes;
 
     n2vmcb->virt_ext.bytes =
         n1vmcb->virt_ext.bytes | ns_vmcb->virt_ext.bytes;
diff --git a/xen/arch/x86/include/asm/hvm/svm/nestedsvm.h 
b/xen/arch/x86/include/asm/hvm/svm/nestedsvm.h
index 94d45d2e8d47..184248bbd7c5 100644
--- a/xen/arch/x86/include/asm/hvm/svm/nestedsvm.h
+++ b/xen/arch/x86/include/asm/hvm/svm/nestedsvm.h
@@ -44,7 +44,7 @@ struct nestedsvm {
     uint32_t ns_general2_intercepts;
 
     /* Cached real lbr and other virtual extentions of the l2 guest */
-    virt_ext_t ns_virt_ext;
+    uint64_t ns_virt_ext;
 
     /* Cached real MSR permission bitmaps of the l2 guest */
     unsigned long *ns_cached_msrpm;
-- 
2.30.2


Reply via email to