On 24.03.2023 00:46, Andrew Cooper wrote:
> Gitlab Randconfig found:
> 
>   arch/x86/mm/shadow/common.c: In function 'shadow_prealloc':
>   arch/x86/mm/shadow/common.c:1023:18: error: implicit declaration of function
>       'paging_logdirty_levels'; did you mean 'paging_log_dirty_init'? 
> [-Werror=implicit-function-declaration]
>    1023 |         count += paging_logdirty_levels();
>         |                  ^~~~~~~~~~~~~~~~~~~~~~
>         |                  paging_log_dirty_init
>   arch/x86/mm/shadow/common.c:1023:18: error: nested extern declaration of 
> 'paging_logdirty_levels' [-Werror=nested-externs]

Okay, that's SHADOW_PAGING && !HVM && PV_SHIM_EXCLUSIVE - I can see
how I missed to test that case.

> Move the declaration outside of #if PG_log_dirty.
> 
> Fixes: 33fb3a661223 ("x86/shadow: account for log-dirty mode when 
> pre-allocating")
> Signed-off-by: Andrew Cooper <[email protected]>

Reviewed-by: Jan Beulich <[email protected]>

> An alternative would be to double paging_logdirty_levels() up in the else
> case, returning 0.  The underlying logc in shadow_prealloc() succumbs to DCE
> either way.

I think I prefer the way you have it.

Jan

Reply via email to