mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Kalra, Ashish" <ashish.kalra@amd.com>
To: Borislav Petkov <bp@alien8.de>
Cc: bp@kernel.org, thomas.lendacky@amd.com,
	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 14:33:44 -0500	[thread overview]
Message-ID: <8daf448f-eb52-4b1f-9f98-099a83665321@amd.com> (raw)
In-Reply-To: <20240402185039.GBZgxTfwvEP45OxVjm@fat_crate.local>


On 4/2/2024 1:50 PM, Borislav Petkov wrote:
> On Tue, Apr 02, 2024 at 01:41:05PM -0500, Kalra, Ashish wrote:
>> But, that's what the e820 table fixup is doing,
> And can it be doing it in snp_probe_rmptable_info() where all the RMP
> table stuff is being done?

The e820 fixups has to be done on both e820_table_kexec and 
e820_table_firmware (to handle both kexec variants) and this has to be 
done when e820_table is used to populate both e820_table_kexec and 
e820_table_firmware and this is done in e820__memory_setup().

But, snp_probe_rmptable_info() is called as part of early_cpu_init() -> 
early_identify_cpu() which is called earlier than e820__memory_setup() 
and e820 tables are setup much later e820__memory_setup().

And we can't do this in snp_rmptable_init() as e820_table_firmware can't 
be fixed at that point and by that time this table has been mapped into 
sysfs (/sys/firmware) which is used by kexec -c variant.

The function e820__memory_setup() has an optional platform quirk 
available to override/pick up the firmware/bootloader e820 map, and 
that's why i am using this platform specific quirk to override it with 
the SNP specific RMP table e820 fixup function which internally calls 
e820__memory_setup_default() to pass the firmware/bootloader e820 map 
(set in e820_table) and then add RMP table fixups on top of it.

Thanks, Ashish


  reply	other threads:[~2024-04-02 19:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-12 18:47 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
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 [this message]
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=8daf448f-eb52-4b1f-9f98-099a83665321@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

all inboxes | Powered by JetHome®