From: Grygorii Strashko <grygorii_strashko@epam.com>
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 <grygorii_strashko@epam.com>
---
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 a7ee0519957a..05b394840e59 100644
--- 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) )
{
/*
* For shadow, 'load IA32_PAT' VM-entry control is 0, so it cannot
--
2.34.1
On 30.10.2025 00:54, Grygorii Strashko wrote:
> From: Grygorii Strashko <grygorii_strashko@epam.com>
>
> 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 <grygorii_strashko@epam.com>
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 <jbeulich@suse.com>
Jan
On 30.10.25 13:12, Jan Beulich wrote:
> On 30.10.2025 00:54, Grygorii Strashko wrote:
>> From: Grygorii Strashko <grygorii_strashko@epam.com>
>>
>> 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 <grygorii_strashko@epam.com>
>
> Requested-by: <me> (or some other of the available tags)?
Will do. or Suggested-by:?
>
>> --- 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.
Will do. I've seen it, but was not sure :(
>With the adjustment:
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
--
Best regards,
-grygorii
On 30.10.2025 13:07, Grygorii Strashko wrote: > > > On 30.10.25 13:12, Jan Beulich wrote: >> On 30.10.2025 00:54, Grygorii Strashko wrote: >>> From: Grygorii Strashko <grygorii_strashko@epam.com> >>> >>> 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 <grygorii_strashko@epam.com> >> >> Requested-by: <me> (or some other of the available tags)? > > Will do. or Suggested-by:? Your choice. Jan
© 2016 - 2025 Red Hat, Inc.