[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250623114910.GGaFk_NqzGmR81fG8f@fat_crate.local>
Date: Mon, 23 Jun 2025 13:49:10 +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 v7 03/37] x86/apic: KVM: Deduplicate APIC vector =>
register+bit math
On Tue, Jun 10, 2025 at 11:23:50PM +0530, Neeraj Upadhyay wrote:
> diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
> index 23d86c9750b9..c84d4e86fe4e 100644
> --- a/arch/x86/include/asm/apic.h
> +++ b/arch/x86/include/asm/apic.h
> @@ -488,11 +488,14 @@ static inline void apic_setup_apic_calls(void) { }
>
> extern void apic_ack_irq(struct irq_data *data);
>
> +#define APIC_VECTOR_TO_BIT_NUMBER(v) ((unsigned int)(v) % 32)
> +#define APIC_VECTOR_TO_REG_OFFSET(v) ((unsigned int)(v) / 32 * 0x10)
Dunno - I'd probably shorten those macro names:
APIC_VEC_TO_BITNUM()
APIC_VEC_TO_REGOFF()
because this way of shortening those words is very common and is still very
readable, even if not fully written out...
LGTM regardless.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists