Re: [PATCH v3 02/13] KVM: x86/xen: Introduce kvm_xen_has_64bit_shinfo() macro

From: Paul Durrant

Date: Wed Sep 02 2026 - 08:22:21 EST


On 31/08/2026 22:26, David Woodhouse wrote:
From: David Woodhouse <dwmw@xxxxxxxxxxxx>

Add a kvm_xen_has_64bit_shinfo() helper macro to replace the repeated
pattern of 'IS_ENABLED(CONFIG_64BIT) && kvm->arch.xen.long_mode'
throughout the Xen emulation code. The macro uses READ_ONCE() to
ensure a consistent snapshot of the flag, which can be changed by
another vCPU at any time.

This is the KVM equivalent of Xen's !has_32bit_shinfo().

Assisted-by: Kiro:claude-opus-4.6-1m
Signed-off-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
---
arch/x86/kvm/xen.c | 16 ++++++++--------
arch/x86/kvm/xen.h | 5 +++++
2 files changed, 13 insertions(+), 8 deletions(-)

Reviewed-by: Paul Durrant <paul@xxxxxxx>

...although adding kvm_xen_has_32bit_shinfo() for consistency with Xen might be slightly neater.