Hi,

On 8/17/25 08:37, ~myrslint wrote:
> From: myrslint <[email protected]>
> 
> On x86_64, where most CPUs support self-snoop, it is preferrable to
> always honor guest PAT. Not doing so is a quirk. There is a default
> enabled KVM quirk flag which enforces not doing so due to a former bug
> in Bochs display driver.
> 
> The bug has been fixed but not enough has yet passed since so we only
> disable said quirk flag if a Bochs display is not configured for the
> virtual machine.
> 
> This commit also moves around a bit of code that would be called when
> the initialization of a VM is done.
> ---
>  hw/display/bochs-display.c |  4 +++
>  include/system/kvm.h       |  1 +
>  target/i386/kvm/kvm.c      | 52 ++++++++++++++++++++++++++++++++------
>  3 files changed, 49 insertions(+), 8 deletions(-)
...

> diff --git a/include/system/kvm.h b/include/system/kvm.h
> index 3c7d314736..c6ba3905dc 100644
> --- a/include/system/kvm.h
> +++ b/include/system/kvm.h
> @@ -208,6 +208,7 @@ void kvm_close(void);
>   */
>  bool kvm_arm_supports_user_irq(void);
>  
> +void kvm_hack_do_not_enable_guest_pat(void);

This will fail to compile if KVM is disabled or if target != i386.
AFAICT, you'll need to check whether KVM is available at build time and
move common code to kvm-all.c.

#if defined(CONFIG_KVM_IS_POSSIBLE)
void kvm_hack_do_not_enable_guest_pat(void);
#else
static inline void kvm_hack_do_not_enable_guest_pat(void)
{
}
#endif

-- 
Best regards,
Dmitry

Reply via email to