All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Myrrh Periwinkle <myrrhperiwinkle@qtmlabs.xyz>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Roberto Ricci <io@r-ricci.it>
Subject: Re: [PATCH v3] x86/e820: Fix handling of subpage regions when calculating nosave ranges
Date: Mon, 7 Apr 2025 19:33:54 +0200	[thread overview]
Message-ID: <Z_QMghKBVFz_EDap@gmail.com> (raw)
In-Reply-To: <78346ff0-d5ee-48f0-ac4d-762a5ec18eb7@qtmlabs.xyz>


* Myrrh Periwinkle <myrrhperiwinkle@qtmlabs.xyz> wrote:

> On 4/7/25 01:36, Ingo Molnar wrote:
> 
> > * Ingo Molnar<mingo@kernel.org> wrote:
> > 
> > > * Myrrh Periwinkle<myrrhperiwinkle@qtmlabs.xyz> wrote:
> > > 
> > > > The current implementation of e820__register_nosave_regions suffers from
> > > > multiple serious issues:
> > > >   - The end of last region is tracked by PFN, causing it to find holes
> > > >     that aren't there if two consecutive subpage regions are present
> > > >   - The nosave PFN ranges derived from holes are rounded out (instead of
> > > >     rounded in) which makes it inconsistent with how explicitly reserved
> > > >     regions are handled
> > > > 
> > > > Fix this by:
> > > >   - Treating reserved regions as if they were holes, to ensure consistent
> > > >     handling (rounding out nosave PFN ranges is more correct as the
> > > >     kernel does not use partial pages)
> > > >   - Tracking the end of the last RAM region by address instead of pages
> > > >     to detect holes more precisely
> > > > 
> > > > Cc:stable@vger.kernel.org
> > > > Fixes: e5540f875404 ("x86/boot/e820: Consolidate 'struct e820_entry *entry' local variable names")
> > > So why is this SHA1 indicated as the root cause? AFAICS that commit
> > > does nothing but cleanups, so it cannot cause such regressions.
> > BTW.:
> > 
> >   A) "It was the first random commit that seemed related, sry"
> >   B) "It's a 15 years old bug, but I wanted to indicate a fresh, 8-year old bug to get this into -stable. Busted!"
> 
> You got me :) How did you know that this is a 15 years old bug?

Call it a 'regression radar' that every kernel maintainer develops 
after their first 20 years or so - each bug has a distinct feeling
to them, and this one felt genuinely *ancient*.

> [...] (although I didn't think the age of the bug a patch fixes would 
> affect its chances of getting to -stable)

Yeah, it doesn't really affect its -stable elibility much once we move 
outside the ~6-12 months window that upstream recognizes as a 
semi-recent regression - it was mostly my lame attempt at deadpan 
humor, trying to play off 15 year old bugs against 8 year old bugs as 
if 8 years old bugs were fresh. Yeah, I know, it's not funny even to me 
anymore, I'm weird that way. ;-)

> This specific revision was picked since it's the latest one that this 
> patch can be straightforwardly applied to (there is a (trivial) merge 
> conflict with -stable, though).

Yeah. So in the x86/urgent commit I've tagged the other commit you 
pinpointed in your followup mail:

    Fixes: e8eff5ac294e ("[PATCH] Make swsusp avoid memory holes and reserved memory regions on x86_64")

Just to give backporters *some* chance at fixing this ancient bug
in older kernels, if they really want to.

Thanks,

	Ingo

  parent reply	other threads:[~2025-04-07 17:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-06  4:45 [PATCH v3] x86/e820: Fix handling of subpage regions when calculating nosave ranges Myrrh Periwinkle
2025-04-06 18:23 ` Ingo Molnar
2025-04-06 18:36   ` Ingo Molnar
2025-04-07  0:53     ` Myrrh Periwinkle
2025-04-07  1:12       ` Myrrh Periwinkle
2025-04-07 17:33       ` Ingo Molnar [this message]
2025-04-07 17:29 ` [tip: x86/urgent] x86/e820: Fix handling of subpage regions when calculating nosave ranges in e820__register_nosave_regions() tip-bot2 for Myrrh Periwinkle

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=Z_QMghKBVFz_EDap@gmail.com \
    --to=mingo@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=io@r-ricci.it \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=myrrhperiwinkle@qtmlabs.xyz \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.