Message ID | 20230227113533.2848119-1-andrew.cooper3@citrix.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2] x86/svm: Decouple types in struct nestedsvm | expand |
On 27.02.2023 12:35, Andrew Cooper wrote: > struct nestedvm uses mostly plain integer types, except for virt_ext_t which > is a union wrapping two bitfield names. > > However, it turns out that this is a write-only variable. Delete it, allowing > us to drop the include of vmcb.h > > Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> > --- > CC: Jan Beulich <JBeulich@suse.com> > CC: Xenia Ragiadakou <burzalodowa@gmail.com> > > v2: > * Delete the variable entirely. > > This probably means that nested lbr/vmloadsave is broken, but that wouldn't be > a surprise at all. Well, yes, short of figuring out what's missing this is probably the least bad option: Reviewed-by: Jan Beulich <jbeulich@suse.com> Jan
On 27/02/2023 11:41 am, Jan Beulich wrote: > On 27.02.2023 12:35, Andrew Cooper wrote: >> struct nestedvm uses mostly plain integer types, except for virt_ext_t which >> is a union wrapping two bitfield names. >> >> However, it turns out that this is a write-only variable. Delete it, allowing >> us to drop the include of vmcb.h >> >> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> >> --- >> CC: Jan Beulich <JBeulich@suse.com> >> CC: Xenia Ragiadakou <burzalodowa@gmail.com> >> >> v2: >> * Delete the variable entirely. >> >> This probably means that nested lbr/vmloadsave is broken, but that wouldn't be >> a surprise at all. > Well, yes, short of figuring out what's missing this is probably the least > bad option: > Reviewed-by: Jan Beulich <jbeulich@suse.com> Thanks. I'm pretty certain a working version of nested virt won't need this cached information like this at all. I'm pretty sure it's buggy not to be referencing the appropriate one of the 3 relevant VMCBs. ~Andrew
diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c index 92316c6624ce..63ed9fc248e1 100644 --- a/xen/arch/x86/hvm/svm/nestedsvm.c +++ b/xen/arch/x86/hvm/svm/nestedsvm.c @@ -164,7 +164,6 @@ 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_hap_enabled = 0; svm->ns_vmcb_guestcr3 = 0; @@ -524,10 +523,6 @@ static int nsvm_vmcb_prepare4vmrun(struct vcpu *v, struct cpu_user_regs *regs) /* Pending Interrupts */ n2vmcb->event_inj = ns_vmcb->event_inj; - /* LBR and other virtualization */ - if ( !clean.lbr ) - svm->ns_virt_ext = ns_vmcb->virt_ext; - 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..230f818df80c 100644 --- a/xen/arch/x86/include/asm/hvm/svm/nestedsvm.h +++ b/xen/arch/x86/include/asm/hvm/svm/nestedsvm.h @@ -20,8 +20,6 @@ #include <xen/types.h> -#include <asm/hvm/svm/vmcb.h> - struct nestedsvm { bool ns_gif; uint64_t ns_msr_hsavepa; /* MSR HSAVE_PA value */ @@ -43,9 +41,6 @@ struct nestedsvm { uint32_t ns_general1_intercepts; uint32_t ns_general2_intercepts; - /* Cached real lbr and other virtual extentions of the l2 guest */ - virt_ext_t ns_virt_ext; - /* Cached real MSR permission bitmaps of the l2 guest */ unsigned long *ns_cached_msrpm; /* Merged MSR permission bitmap */
struct nestedvm uses mostly plain integer types, except for virt_ext_t which is a union wrapping two bitfield names. However, it turns out that this is a write-only variable. Delete it, allowing us to drop the include of vmcb.h Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> --- CC: Jan Beulich <JBeulich@suse.com> CC: Xenia Ragiadakou <burzalodowa@gmail.com> v2: * Delete the variable entirely. This probably means that nested lbr/vmloadsave is broken, but that wouldn't be a surprise at all. --- xen/arch/x86/hvm/svm/nestedsvm.c | 5 ----- xen/arch/x86/include/asm/hvm/svm/nestedsvm.h | 5 ----- 2 files changed, 10 deletions(-)