[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <777c2e42-d669-18de-af1f-675df0ca701f@amd.com>
Date: Thu, 17 Oct 2024 10:54:46 +0530
From: "Nikunj A. Dadhania" <nikunj@....com>
To: Tom Lendacky <thomas.lendacky@....com>, linux-kernel@...r.kernel.org,
x86@...nel.org
Cc: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>,
Michael Roth <michael.roth@....com>, Ashish Kalra <ashish.kalra@....com>
Subject: Re: [PATCH v3 1/8] x86/sev: Prepare for using the RMPREAD instruction
to access the RMP
On 10/16/2024 8:13 PM, Tom Lendacky wrote:
> On 10/16/24 03:52, Nikunj A. Dadhania wrote:
>> On 9/30/2024 8:52 PM, Tom Lendacky wrote:
>>> The RMPREAD instruction returns an architecture defined format of an
>>> RMP entry. This is the preferred method for examining RMP entries.
>>>
>>> +static int __snp_lookup_rmpentry(u64 pfn, struct rmpentry *entry, int *level)
>>> +{
>>> + struct rmpentry large_entry;
>>> + int ret;
>>> +
>>> + if (!cc_platform_has(CC_ATTR_HOST_SEV_SNP))
>>> + return -ENODEV;
>>
>> Can we rely on rmp_table check in __get_rmpentry() and remove the above check ?
>> If rmp_table is NULL, CC_ATTR_HOST_SEV_SNP is always cleared.
>
> I'm trying to not change the logic and just add the new struct usage.
> Once RMPREAD is used there is no checking of the table address and if
> SNP is not enabled in the SYSCFG MSR the instruction will #UD.
Sure, makes sense.
> The table address check is just to ensure we don't accidentally call
> this function without checking CC_ATTR_HOST_SEV_SNP in the future to
> avoid a possible crash. If anything, I can remove the table address
> check that I added here, but I would like to keep it just to be safe.
Regards
Nikunj
Powered by blists - more mailing lists