On 30.10.2025 00:54, Grygorii Strashko wrote:
> 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 IS_ENABLED(CONFIG_SHADOW_PAGING).
> 
> bloat-o-meter
>  add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-290 (-290)
> 
> Signed-off-by: Grygorii Strashko <[email protected]>

Requested-by: <me> (or some other of the available tags)?

> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -1506,7 +1506,7 @@ static int cf_check vmx_get_guest_pat(struct vcpu *v, 
> u64 *gpat)
>  
>  static void cf_check vmx_handle_cd(struct vcpu *v, unsigned long value)
>  {
> -    if ( !paging_mode_hap(v->domain) )
> +    if ( IS_ENABLED(CONFIG_SHADOW_PAGING) && !paging_mode_hap(v->domain) )

I don't think there's a need for IS_ENABLED() here - you can simply switch to
using paging_mode_shadow(). That would be more correct anyway, for the abstract
case of there being a 3rd paging mode. With the adjustment:
Reviewed-by: Jan Beulich <[email protected]>

Jan

Reply via email to