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

[xen staging] x86/vmx: account for SHADOW_PAGING when use hvm_shadow_handle_cd()



commit 0545f53aa9c20086419334ded217650c316a5ef8
Author:     Grygorii Strashko <grygorii_strashko@xxxxxxxx>
AuthorDate: Thu Nov 20 11:22:42 2025 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Nov 20 11:22:42 2025 +0100

    x86/vmx: account for SHADOW_PAGING when use hvm_shadow_handle_cd()
    
    The shadow_handle_cd() can be used only with SHADOW_PAGING=y, so guard
    shadow_handle_cd() call with paging_mode_shadow() which accounts for
    SHADOW_PAGING state.
    
    bloat-o-meter
     add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-290 (-290)
    
    Suggested-by: Jan Beulich <jbeulich@xxxxxxxx>
    Signed-off-by: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 7d4cf997d7..67b67442b4 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1508,7 +1508,7 @@ static void shadow_handle_cd(struct vcpu *v, unsigned 
long value)
 
 static void cf_check vmx_handle_cd(struct vcpu *v, unsigned long value)
 {
-    if ( !paging_mode_hap(v->domain) )
+    if ( paging_mode_shadow(v->domain) )
     {
         /*
          * For shadow, 'load IA32_PAT' VM-entry control is 0, so it cannot
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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