[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <175b29fa-40b4-46c7-b33f-ad6ffe89a33c@amd.com>
Date: Tue, 10 Jun 2025 09:56:03 +0530
From: Neeraj Upadhyay <Neeraj.Upadhyay@....com>
To: Sean Christopherson <seanjc@...gle.com>
Cc: Borislav Petkov <bp@...en8.de>, 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, 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 6/7/2025 12:26 AM, Sean Christopherson wrote:
> On Fri, Jun 06, 2025, Sean Christopherson wrote:
>> Actually, looking at the end usage, just drop VEC_POS/REG_POS entirely. IIRC, I
>> suggested keeping the shorthand versions for KVM, but I didn't realize there would
>> literally be two helpers left. At that point, keeping VEC_POS and REG_POS is
>> pure stubborness :-)
>>
>> 1. Rename VEC_POS/REG_POS => APIC_VECTOR_TO_BIT_NUMBER/APIC_VECTOR_TO_REG_OFFSET
>> 2. Rename all of the KVM helpers you intend to move out of KVM.
>
> Looking at the earlier patches again, I vote to add a 4th:
>
> 2a. Replace all "char *" with "void *" in all affected helpers.
>
> Pointer arithmetic for "void *" and "char *" operate identically, and AFAICT that's
> the only reason why e.g. __kvm_lapic_set_reg64() takes a "char *". That way there
> is even less of a chance of doing the wrong thing, e.g. neglecting to cast and
> reading a byte instead of the desired size.
>
Sounds good. Will include this in the next version.
- Neeraj
>> 3. Move all of the helpers out of KVM.
Powered by blists - more mailing lists