[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250502133032.GAaBTI-AsaIVn4hOS8@fat_crate.local>
Date: Fri, 2 May 2025 15:30:32 +0200
From: Borislav Petkov <bp@...en8.de>
To: Tom Lendacky <thomas.lendacky@....com>
Cc: Ashish Kalra <Ashish.Kalra@....com>, tglx@...utronix.de,
mingo@...hat.com, dave.hansen@...ux.intel.com, x86@...nel.org,
hpa@...or.com, michael.roth@....com, nikunj@....com,
seanjc@...gle.com, ardb@...nel.org, stable@...r.kernel.org,
linux-kernel@...r.kernel.org, kexec@...ts.infradead.org,
linux-coco@...ts.linux.dev
Subject: Re: [PATCH v3] x86/sev: Fix making shared pages private during kdump
On Thu, May 01, 2025 at 08:56:00AM -0500, Tom Lendacky wrote:
> On 4/30/25 18:17, Ashish Kalra wrote:
> > From: Ashish Kalra <ashish.kalra@....com>
> >
> > When the shared pages are being made private during kdump preparation
> > there are additional checks to handle shared GHCB pages.
> >
> > These additional checks include handling the case of GHCB page being
> > contained within a huge page.
> >
> > While handling the case of GHCB page contained within a huge page
> > any shared page just below the GHCB page gets skipped from being
> > transitioned back to private during kdump preparation.
>
> Why this was occurring is because the original check was incorrect. The
> check for
>
> ghcb <= addr + size
>
> can result in skipping a range that should not have been skipped because
> the "addr + size" is actually the start of a page/range after the end of
> the range being checked. If the ghcb address was equal to addr + size,
> then it was mistakenly considered part of the range when it really wasn't.
>
> I think the check could have just been changed to:
>
> if (addr <= ghcb && ghcb < addr + size) {
>
> The new checks are a bit clearer in showing normal pages vs huge pages,
> though, but you can clearly see the "ghcb < addr + size" change to do the
> right thing in the huge page case.
>
> While it is likely that a GHCB page hasn't been part of a huge page during
> all the testing, the change in snp_kexec_finish() to mask the address is
> the proper thing to do. It probably doesn't even need the if check as the
> mask can just be applied no matter what.
Sounds like I'll be getting a v3.1 with Tom's suggestions?
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists