[RFC PATCH v7 10/37] KVM: lapic: Mark apic_find_highest_vector() inline

Neeraj Upadhyay posted 37 patches 4 months ago
There is a newer version of this series
[RFC PATCH v7 10/37] KVM: lapic: Mark apic_find_highest_vector() inline
Posted by Neeraj Upadhyay 4 months ago
In preparation for moving apic_find_highest_vector() to
common apic.h header, annotate apic_find_highest_vector() as
inline.

This results (on gcc-13) in slight increase in text size of the
binaries:

Obj-file    Old-bytes    New-bytes
lapic.o     28455        28563
kvm.o       664638       664746
kvm.ko      701907       702015

Signed-off-by: Neeraj Upadhyay <Neeraj.Upadhyay@amd.com>
---
Changes since v6:

 - New change.

 arch/x86/kvm/lapic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 20e2ceb965b7..1f44bbc63f17 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -616,7 +616,7 @@ static const unsigned int apic_lvt_mask[KVM_APIC_MAX_NR_LVT_ENTRIES] = {
 	[LVT_CMCI] = LVT_MASK | APIC_MODE_MASK
 };
 
-static int apic_find_highest_vector(void *bitmap)
+static inline int apic_find_highest_vector(void *bitmap)
 {
 	int vec;
 	u32 *reg;
-- 
2.34.1
Re: [RFC PATCH v7 10/37] KVM: lapic: Mark apic_find_highest_vector() inline
Posted by Sean Christopherson 3 months, 2 weeks ago
On Tue, Jun 10, 2025, Neeraj Upadhyay wrote:
> In preparation for moving apic_find_highest_vector() to
> common apic.h header, annotate apic_find_highest_vector() as
> inline.

This is way, way too fine-grained of a patch.  If placing the helper in apic.h
is the desired state, then mark it inline when the code is moved.