[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b3616456-25ef-49ed-9b4a-65a38a1e50ae@amd.com>
Date: Tue, 12 Nov 2024 08:31:06 +0530
From: Neeraj Upadhyay <Neeraj.Upadhyay@....com>
To: "Melody (Huibo) Wang" <huibo.wang@....com>, linux-kernel@...r.kernel.org
Cc: 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, bp@...en8.de,
David.Kaplan@....com, x86@...nel.org, hpa@...or.com, peterz@...radead.org,
seanjc@...gle.com, pbonzini@...hat.com, kvm@...r.kernel.org
Subject: Re: [RFC 04/14] x86/apic: Initialize APIC backing page for Secure
AVIC
On 11/12/2024 4:13 AM, Melody (Huibo) Wang wrote:
> Hi Neeraj,
>
> On 9/13/2024 4:36 AM, Neeraj Upadhyay wrote:
>
>> +static void init_backing_page(void *backing_page)
>> +{
>> + u32 val;
>> + int i;
>> +
>> + val = read_msr_from_hv(APIC_LVR);
>> + set_reg(backing_page, APIC_LVR, val);
>> +
>
> When you read the register from hypervisor, there is certain value defined in APM Table 16-2. APIC Registers, says APIC_LVR has value 80??0010h out of reset.
> > More specifically, Bit 31 is set which means the presence of extended APIC registers, and Bit 4 is set which is part of version number: "The local APIC implementation is identified with a value=1Xh (20h-FFh are
> reserved)".
>
> I think you should verify those values instead of just reading from the hypervisor. Also, I think you probably should verify all of registers you read from the hypervisor before you use them in the guest. In other words, sanitize the inputs from the hypervisor.
>
Ok, I will add this verification of hv read data (wherever applicable) as incremental patches.
- Neeraj
> Thanks,
> Melody
Powered by blists - more mailing lists