Re: [PATCH v3 06/17] x86/apic: Add support to send IPI for Secure AVIC
From: Neeraj Upadhyay
Date: Thu Apr 03 2025 - 08:00:55 EST
On 4/3/2025 5:15 PM, Thomas Gleixner wrote:
> On Tue, Apr 01 2025 at 17:06, Neeraj Upadhyay wrote:
>> --- a/arch/x86/kernel/apic/x2apic_savic.c
>> +++ b/arch/x86/kernel/apic/x2apic_savic.c
>> @@ -46,6 +46,25 @@ static __always_inline void set_reg(unsigned int offset, u32 val)
>>
>> #define SAVIC_ALLOWED_IRR 0x204
>>
>> +static inline void update_vector(unsigned int cpu, unsigned int offset,
>> + unsigned int vector, bool set)
>
> Why aren't you placing that function right away there instead of adding
> it first somewhere else and then shuffle it around?
>
Ok. Intent was to move this logic to a function only when second usage came during
the series. I will move it to "05/17 x86/apic: Add update_vector callback for Secure AVIC"
>> -static void __send_ipi_mask(const struct cpumask *mask, int vector, bool excl_self)
>> +static void send_ipi_mask(const struct cpumask *mask, unsigned int vector, bool excl_self)
>> {
>> - unsigned long query_cpu;
>> - unsigned long this_cpu;
>> + unsigned int this_cpu;
>> + unsigned int cpu;
>
> Again. Do it right in the first place and not later. Same for the
> underscores of the function name.
>
Ok. Another approach I was thinking to try next was, to remove IPI callbacks
definition from "01/17 x86/apic: Add new driver for Secure AVIC" (where I mostly copy
logic from x2apic_phys.c) and add define then in this patch. Then the diff
will be clearer.
- Neeraj