[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250524121241.GKaDG3uWICZGPubp-k@fat_crate.local>
Date: Sat, 24 May 2025 14:12:41 +0200
From: Borislav Petkov <bp@...en8.de>
To: Neeraj Upadhyay <Neeraj.Upadhyay@....com>
Cc: linux-kernel@...r.kernel.org, tglx@...utronix.de, mingo@...hat.com,
dave.hansen@...ux.intel.com, Thomas.Lendacky@....com,
nikunj@....com, Santosh.Shukla@....com, Vasant.Hegde@....com,
Suravee.Suthikulpanit@....com, David.Kaplan@....com, x86@...nel.org,
hpa@...or.com, peterz@...radead.org, seanjc@...gle.com,
pbonzini@...hat.com, kvm@...r.kernel.org,
kirill.shutemov@...ux.intel.com, huibo.wang@....com,
naveen.rao@....com, francescolavra.fl@...il.com,
tiala@...rosoft.com
Subject: Re: [RFC PATCH v6 07/32] KVM: x86: apic_test_vector() to common code
On Wed, May 14, 2025 at 12:47:38PM +0530, Neeraj Upadhyay wrote:
> Move apic_test_vector() to apic.h in order to reuse it in the
> Secure AVIC guest APIC driver in later patches to test vector
> state in the APIC backing page.
>
> No function changes intended.
>
> Signed-off-by: Neeraj Upadhyay <Neeraj.Upadhyay@....com>
> ---
> Changes since v5:
>
> - New change.
>
> arch/x86/include/asm/apic.h | 5 +++++
> arch/x86/kvm/lapic.c | 5 -----
> 2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
> index ef5b1be5eeab..d7377615d93a 100644
> --- a/arch/x86/include/asm/apic.h
> +++ b/arch/x86/include/asm/apic.h
> @@ -557,6 +557,11 @@ static inline void apic_set_vector(int vec, void *bitmap)
> set_bit(APIC_VECTOR_TO_BIT_NUMBER(vec), (bitmap) + APIC_VECTOR_TO_REG_OFFSET(vec));
> }
>
> +static inline int apic_test_vector(int vec, void *bitmap)
> +{
> + return test_bit(APIC_VECTOR_TO_BIT_NUMBER(vec), (bitmap) + APIC_VECTOR_TO_REG_OFFSET(vec));
> +}
> +
> /*
> * Warm reset vector position:
> */
> diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
> index 25fd4ad72554..8ecc3e960121 100644
> --- a/arch/x86/kvm/lapic.c
> +++ b/arch/x86/kvm/lapic.c
> @@ -96,11 +96,6 @@ static __always_inline void kvm_lapic_set_reg64(struct kvm_lapic *apic,
> apic_set_reg64(apic->regs, reg, val);
> }
>
> -static inline int apic_test_vector(int vec, void *bitmap)
> -{
> - return test_bit(VEC_POS(vec), (bitmap) + REG_POS(vec));
> -}
> -
> bool kvm_apic_pending_eoi(struct kvm_vcpu *vcpu, int vector)
> {
> struct kvm_lapic *apic = vcpu->arch.apic;
> --
The previous patch is moving those *_POS() macros to arch/x86/kvm/lapic.c, now
this patch is doing rename-during-move to the new macros.
Why can't you simply do the purely mechanical moves first and then do the
renames? Didn't I explain it the last time? Or is it still unclear?
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists