public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: "Kalra, Ashish" <ashish.kalra@amd.com>
Cc: Borislav Petkov <bp@alien8.de>,
	thomas.lendacky@amd.com, michael.roth@amd.com, x86@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] x86/sev: Add callback to apply RMP table fixups for kexec.
Date: Fri, 15 Nov 2024 16:52:07 -0800	[thread overview]
Message-ID: <Zzfst1FwR/DJqtGg@kernel.org> (raw)
In-Reply-To: <5d515e4e-5db8-4840-a200-a67e7df8043b@amd.com>

Hi,

(sorry for jumping really late, I've just found this accidentally)

On Fri, Apr 26, 2024 at 09:56:25AM -0500, Kalra, Ashish wrote:
> On 4/26/2024 7:58 AM, Borislav Petkov wrote:
> 
> > On Wed, Apr 24, 2024 at 06:48:08PM -0500, Kalra, Ashish wrote:
> > > This callback needs to be invoked as part of setup_arch() as it needs e820
> > > table to be setup in e820__memory_setup() before the callback is invoked and
> > > snp_init() is called from sme_enable() in kernel/head_64.S (startup_64),
> > > which is much before start_kernel() -> setup_arch() is invoked.
> > So?
> > 
> > snp_init() still runs before e820__memory_setup(). So what's stopping
> > you?
> 
> As i have already explained above, snp_init() runs before
> e820__memory_setup() so we can't invoke this callback in snp_init() as e820
> tables have still not been setup. Again to summarize, the e820 tables are
> setup in e820__memory_setup() which runs after snp_init().

I agree that snp_fixup_e820_tables() should run after e820__memory_setup(),
but I wonder if it's ok for it to run *after* e820__memblock_setup().

At the very least making changes to e820 table after they were translated
to memblock creates inconsistency between the e820 and core mm views of the
memory. 

So I wonder what would happen if the memory from the problematic chunk was
allocated by kernel rather than by kexec? Couldn't it cause RMP fault?

-  
Sincerely yours,
Mike.

  reply	other threads:[~2024-11-16  0:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15 21:08 [PATCH v2 0/2] Apply RMP table fixups for kexec Ashish Kalra
2024-04-15 21:09 ` [PATCH v2 1/2] x86/e820: Expose API to update e820 kexec and firmware tables externally Ashish Kalra
2024-04-20 11:20   ` Borislav Petkov
2024-04-15 21:09 ` [PATCH v2 2/2] x86/sev: Add callback to apply RMP table fixups for kexec Ashish Kalra
2024-04-20 13:05   ` Borislav Petkov
2024-04-24 23:48     ` Kalra, Ashish
2024-04-26 12:58       ` Borislav Petkov
2024-04-26 14:56         ` Kalra, Ashish
2024-11-16  0:52           ` Mike Rapoport [this message]
2024-11-16  1:11             ` Kalra, Ashish
2024-04-20 11:08 ` [PATCH v2 0/2] Apply " Borislav Petkov
2024-04-24 19:10   ` Kalra, Ashish
2024-04-26 12:49     ` Borislav Petkov

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=Zzfst1FwR/DJqtGg@kernel.org \
    --to=rppt@kernel.org \
    --cc=ashish.kalra@amd.com \
    --cc=bp@alien8.de \
    --cc=linux-kernel@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