public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Kalra, Ashish" <ashish.kalra@amd.com>
To: bp@kernel.org, thomas.lendacky@amd.com
Cc: bp@alien8.de, linux-kernel@vger.kernel.org,
	linux-tip-commits@vger.kernel.org, michael.roth@amd.com,
	x86@kernel.org
Subject: Re: [PATCH] x86/sev: Apply RMP table fixups for kexec.
Date: Tue, 2 Apr 2024 12:11:03 -0500	[thread overview]
Message-ID: <359264a1-e4ef-438c-8f24-32848e131272@amd.com> (raw)
In-Reply-To: <6f0d2ccf-243c-4073-a470-21e2f404595a@amd.com>


On 4/2/2024 12:06 PM, Kalra, Ashish wrote:
> On 4/2/2024 11:34 AM, bp@kernel.org wrote:
>
>> From: Borislav Petkov <bp@alien8.de>
>>
>> On Tue, Apr 02, 2024 at 10:54:50AM -0500, Tom Lendacky wrote:
>>> There's no requirement from a hardware/RMP usage perspective that 
>>> requires a
>>> 2MB alignment, so BIOS is not doing anything wrong. The problem occurs
>>> because kexec is initially using 2MB mappings that overlap the start 
>>> and/or
>>> end of the RMP which then results in an RMP fault when memory within 
>>> one of
>>> those 2MB mappings, that is not part of the RMP, is referenced.
>> Then this explanation is misleading. And that whole bla about alignment
>> is nonsense either.
>>
>>> Additionally, we have BIOSes out there since Milan that don't do 
>>> this 2MB
>>> alignment. And do you really trust that BIOS will do this properly 
>>> all the
>>> time?
>> I don't trust the BIOS to do anything properly.
>>
>> So why isn't the fix for this simply to reserve the space for the RMP
>> table to start at 2M page - even if it doesn't - and to cover the last
>> chunk *also* with a 2M page and be done with it?
>
> But, it is the BIOS which reserves the space for the RMP table.
>
> And if you mean the reservation in the kernel page tables (directmap) 
> then that will not help as kexec uses it's own identity mapped page 
> tables.
>
>>
>> Not this silly overriding dance.
>
> This overriding dance is required to fixup all the three kexec tables, 
> as there is no interface/API available to do modifications/fixups in 
> all the three possible kexec tables.
>
I meant the three e820 tables out of which two are used for kexec, the 
e820_table_firmware and e820_table_kexec.

Thanks, Ashish

>
>> Thx.
>>

  reply	other threads:[~2024-04-02 17:11 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-12 18:47 [PATCH] x86/sev: Apply RMP table fixups for kexec Ashish Kalra
2024-03-13 10:58 ` Aithal, Srikanth
2024-04-02 14:45 ` bp
2024-04-02 15:54   ` Tom Lendacky
2024-04-02 16:34     ` bp
2024-04-02 17:06       ` Kalra, Ashish
2024-04-02 17:11         ` Kalra, Ashish [this message]
2024-04-02 17:45           ` Borislav Petkov
2024-04-02 18:41             ` Kalra, Ashish
2024-04-02 18:50               ` Borislav Petkov
2024-04-02 19:33                 ` Kalra, Ashish
2024-04-02 20:21                   ` Borislav Petkov
2024-04-02 21:00                     ` Kalra, Ashish
2024-04-02 21:17                       ` Kalra, Ashish
2024-04-02 21:20                       ` Borislav Petkov
2024-04-02 21:31                         ` Kalra, Ashish
2024-04-02 21:40                           ` Borislav Petkov
2024-04-02 22:09 ` Tom Lendacky
2024-04-02 22:31   ` Kalra, Ashish
2024-04-02 22:42     ` Michael Roth
2024-04-03 21:08       ` Kalra, Ashish
2024-04-04  8:17         ` Jeremi Piotrowski
2024-04-04 18:07           ` Kalra, Ashish

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=359264a1-e4ef-438c-8f24-32848e131272@amd.com \
    --to=ashish.kalra@amd.com \
    --cc=bp@alien8.de \
    --cc=bp@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=michael.roth@amd.com \
    --cc=thomas.lendacky@amd.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox