Re: [PATCH 1/9] KVM: x86: Move the "APIC attention" macros from kvm_host.h => lapic.c
From: Huang, Kai
Date: Thu Jun 25 2026 - 20:11:22 EST
On Thu, 2026-06-25 at 15:04 -0700, Sean Christopherson wrote:
> Move the macros that define the mostly-obsolete apic_attention bits into
> lapic.c, as the gory details of PV EOIs and the pre-APICv TPR acceleration
> are 100% internal to KVM's local APIC emulation.
>
> No functional change intended.
>
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
The code movement LGTM:
Reviewed-by: Kai Huang <kai.huang@xxxxxxxxx>
> ---
> arch/x86/include/asm/kvm_host.h | 10 ----------
> arch/x86/kvm/lapic.c | 10 ++++++++++
> 2 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
> index b517257a6315..9ba8aa739f93 100644
> --- a/arch/x86/include/asm/kvm_host.h
> +++ b/arch/x86/include/asm/kvm_host.h
> @@ -290,16 +290,6 @@ enum x86_intercept_stage;
> #define PFERR_PRIVATE_ACCESS BIT_ULL(49)
> #define PFERR_SYNTHETIC_MASK (PFERR_IMPLICIT_ACCESS | PFERR_PRIVATE_ACCESS)
>
> -/* apic attention bits */
> -#define KVM_APIC_CHECK_VAPIC 0
> -/*
> - * The following bit is set with PV-EOI, unset on EOI.
> - * We detect PV-EOI changes by guest by comparing
> - * this bit with PV-EOI in guest memory.
> - * See the implementation in apic_update_pv_eoi.
> - */
> -#define KVM_APIC_PV_EOI_PENDING 1
> -
>
Nit:
'apic_update_pv_eoi' is a typo. AFAICT it even didn't exist either when PV_EOI
was initially added in commit ae7a2a3fb6f8b ("KVM: host side for eoi
optimization").
I think it's a typo which was introduced by that commit, and my best guessing is
the correct one should be apic_sync_pv_eoi_from_guest().
Btw, the comment isn't easy to understand either IMHO. Maybe just delete it (in
another patch perhaps, if it's worth)?