Re: [RFC PATCH v6 07/32] KVM: x86: apic_test_vector() to common code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
> ---
> 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




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux