[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2f698346-879f-46c3-b054-c5cc8984b36d@amd.com>
Date: Thu, 27 Mar 2025 18:00:30 +0530
From: Neeraj Upadhyay <Neeraj.Upadhyay@....com>
To: Thomas Gleixner <tglx@...utronix.de>, linux-kernel@...r.kernel.org
Cc: bp@...en8.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
Subject: Re: [RFC v2 05/17] x86/apic: Add update_vector callback for Secure
AVIC
On 3/27/2025 5:48 PM, Thomas Gleixner wrote:
> On Thu, Mar 27 2025 at 16:47, Neeraj Upadhyay wrote:
>> On 3/27/2025 3:57 PM, Thomas Gleixner wrote:
>>> The relevant registers are starting at regs[SAVIC_ALLOWED_IRR]. Due to
>>> the 16-byte alignment the vector number obviously cannot be used for
>>> linear bitmap addressing.
>>>
>>> But the resulting bit number can be trivially calculated with:
>>>
>>> bit = vector + 32 * (vector / 32);
>>>
>>
>> Somehow, this math is not working for me. I will think more on how this
>> works. From what I understand, bit number is:
>>
>> bit = vector % 32 + (vector / 32) * 16 * 8
>>
>> So, for example, vector number 32, bit number need to be 128.
>> With you formula, it comes as 64.
>
> Duh. I did the math for 8 byte alignment. But for 16 byte it's obviously
> exactly the same formula just with a different multiplicator:
>
> bit = vector + 96 * (vector / 32);
>
> No?
>
Ah ok. Got it. Makes sense. 96 * (vector / 32) counts all unused space.
- Neeraj
Powered by blists - more mailing lists