The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Alexander Graf <graf@amazon.com>,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	Baoquan He <bhe@redhat.com>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	nh-open-source@amazon.com
Subject: Re: [PATCH] kexec: Enable CMA based contiguous allocation
Date: Mon, 12 May 2025 20:14:08 -0700	[thread overview]
Message-ID: <20250512201408.81acaf861581f6fb98e8a3b0@linux-foundation.org> (raw)
In-Reply-To: <35f818e2cf3f15b7dc7028f543e0eea94c799efd.camel@infradead.org>

On Mon, 12 May 2025 19:02:20 -0700 David Woodhouse <dwmw2@infradead.org> wrote:

> > >   2) More robust. Even if by accident some page is still in use for DMA,
> > >      the new kernel image will be safe from that access because it resides
> > >      in a memory region that is considered allocated in the old kernel and
> > >      has a chance to reinitialize that component.
> > 
> > 
>  > https://lore.kernel.org/all/20250512140909.3464-1-dssauerw@amazon.de/>
>
> >Is this known to be a problem in current code?
> 
> Oh $DEITY yes. The Arm Generic Interrupt Controller is, to quote a dear
> friend, "a cautionary tale of how not to approach a hardware design".
> 
> It does a whole bunch of arbitrary DMA all over the place, and doesn't
> even live behind an IOMMU. And doesn't *stop* doing DMA unless you ask
> it *really* nicely; merely shutting down the offending high-level
> components isn't always enough, because they might still to write back
> some caches.
> 
> Here's one of the latest examples (not actually the one which has been
> breaking kexec for us, as far as we know, but an example of the genre):
> https://lore.kernel.org/all/20250512140909.3464-1-dssauerw@amazon.de/
> 
> So putting the new kernel into a physical memory region which was
> considered 'free' by the previous kernel, as Alex explains, is actually
> a very good defence-in-depth mechanism to protect against such issues.

Lol, it sounds like you're having fun over there.

Alexander, can you please repackage David's info to your taste and
include it in the changelog?  Escalating the value of the patch from
"might speed it up, don't know how much" to "addresses grievous
real-world issues" is helpful to the patch's case!


  reply	other threads:[~2025-05-13  3:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-12 22:57 [PATCH] kexec: Enable CMA based contiguous allocation Alexander Graf
2025-05-12 23:59 ` Andrew Morton
2025-05-13  2:02   ` David Woodhouse
2025-05-13  3:14     ` Andrew Morton [this message]
2025-05-13  8:20   ` Alexander Graf
2025-05-24 10:16 ` David Woodhouse

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=20250512201408.81acaf861581f6fb98e8a3b0@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=dwmw2@infradead.org \
    --cc=graf@amazon.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nh-open-source@amazon.com \
    --cc=pasha.tatashin@soleen.com \
    /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