From: Grygorii Strashko <[email protected]>

The hvm_shadow_handle_cd() can be used only with SHADOW_PAGING=y, so guard
hvm_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 <[email protected]>
Signed-off-by: Grygorii Strashko <[email protected]>
Reviewed-by: Jan Beulich <[email protected]>
---
changes in v2:
- s/!paging_mode_hap()/paging_mode_shadow()

 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 d7efd0a73add..67861bc8bccf 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1514,7 +1514,7 @@ static void hvm_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
-- 
2.34.1

Reply via email to