diff mbox series

[XEN,v1,1/4] x86:svm: use nsvm_efer_svm_enabled() to check guest's EFER.SVME

Message ID 67e52e38695be12aca828025077a378e92174952.1742465624.git.Sergiy_Kibrik@epam.com (mailing list archive)
State New
Headers show
Series make nested virtualization support optional | expand

Commit Message

Sergiy Kibrik March 20, 2025, 10:34 a.m. UTC
There's a macro for this, might improve readability a bit & save a bit of space.

Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
---
 xen/arch/x86/hvm/svm/nestedsvm.c | 2 +-
 xen/arch/x86/hvm/svm/svm.c       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Jan Beulich March 20, 2025, 2:07 p.m. UTC | #1
On 20.03.2025 11:34, Sergiy Kibrik wrote:
> There's a macro for this, might improve readability a bit & save a bit of space.
> 
> Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>

Acked-by: Jan Beulich <jbeulich@suse.com>
diff mbox series

Patch

diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 35a2cbfd7d..dc2b6a4253 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -1616,7 +1616,7 @@  void svm_nested_features_on_efer_update(struct vcpu *v)
      * Need state for transfering the nested gif status so only write on
      * the hvm_vcpu EFER.SVME changing.
      */
-    if ( v->arch.hvm.guest_efer & EFER_SVME )
+    if ( nsvm_efer_svm_enabled(v) )
     {
         if ( !vmcb->virt_ext.fields.vloadsave_enable &&
              paging_mode_hap(v->domain) &&
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 4b24891096..e33a38c1e4 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -253,7 +253,7 @@  static void cf_check svm_update_guest_efer(struct vcpu *v)
     vmcb_set_efer(vmcb, guest_efer);
 
     ASSERT(nestedhvm_enabled(v->domain) ||
-           !(v->arch.hvm.guest_efer & EFER_SVME));
+           !nsvm_efer_svm_enabled(v));
 
     if ( nestedhvm_enabled(v->domain) )
         svm_nested_features_on_efer_update(v);