All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Will Deacon <will@kernel.org>,
	Jeremy Linton <jeremy.linton@arm.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Rob Herring <robh+dt@kernel.org>, Christoph Hellwig <hch@lst.de>,
	Robin Murphy <robin.murphy@arm.com>,
	Hanjun Guo <guohanjun@huawei.com>,
	Sudeep Holla <sudeep.holla@arm.com>,
	Anshuman Khandual <anshuman.khandual@arm.com>
Subject: Re: [PATCH] arm64: mm: set ZONE_DMA size based on early IORT scan
Date: Wed, 14 Oct 2020 14:54:52 +0200	[thread overview]
Message-ID: <1c436e677b948c3242ed60839b72e36868c51334.camel@suse.de> (raw)
In-Reply-To: <CAMj1kXHhcB85Uc4wbv7zWkSKACnd05Hj-JRKm_R5OgDB1bkHNg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3862 bytes --]

On Wed, 2020-10-14 at 14:44 +0200, Ard Biesheuvel wrote:
> On Tue, 13 Oct 2020 at 16:42, Nicolas Saenz Julienne
> <nsaenzjulienne@suse.de> wrote:
> > On Mon, 2020-10-12 at 17:59 +0100, Catalin Marinas wrote:
> > > On Mon, Oct 12, 2020 at 06:35:37PM +0200, Ard Biesheuvel wrote:
> > > > On Mon, 12 Oct 2020 at 18:22, Catalin Marinas <catalin.marinas@arm.com> wrote:
> > > > > On Mon, Oct 12, 2020 at 05:55:45PM +0200, Ard Biesheuvel wrote:
> > > > > > On Mon, 12 Oct 2020 at 17:50, Catalin Marinas <catalin.marinas@arm.com> wrote:
> > > > > > > > > On Mon, Oct 12, 2020 at 12:43:05PM +0200, Ard Biesheuvel wrote:
> > > > > > > > > > Also, could someone give an executive summary of why it matters where
> > > > > > > > > > the crashkernel is loaded? As far as I can tell, reserve_crashkernel()
> > > > > > > > > > only allocates memory for the kernel's executable image itself, which
> > > > > > > > > > can usually be loaded anywhere in memory. I could see how a
> > > > > > > > > > crashkernel might need some DMA'able memory if it needs to use the
> > > > > > > > > > hardware, but I don't think that is what is going on here.
> > > > > [...]
> > > > > > > However, the crashkernel=... range is meant for sufficiently large
> > > > > > > reservation to be able to run the kdump kernel, not just load the image.
> > > > > > 
> > > > > > Sure. But I was referring to the requirement that it is loaded low in
> > > > > > memory. Unless I am misunderstanding something, all we need for the
> > > > > > crashkernel to be able to operate is some ZONE_DMA memory in case it
> > > > > > is needed by the hardware, and beyond that, it could happily live
> > > > > > anywhere in memory.
> > > > > 
> > > > > Yes, the crash kernel doesn't need to be loaded in the low memory. But
> > > > > some low memory needs to end up in its perceived System RAM. That's what
> > > > > Chen is trying to do with this series:
> > > > > 
> > > > > https://lore.kernel.org/linux-arm-kernel/20200907134745.25732-1-chenzhou10@huawei.com/
> > > > > 
> > > > > It reserves the normal crashkernel memory at some high address range
> > > > > with a small block (currently proposed as 256MB similar to x86) in the
> > > > > "low" range.
> > > > > 
> > > > > This "low" range for arm64 currently means below 1GB but it's only RPi4
> > > > > that needs it this low, all other platforms are fine with the full low
> > > > > 32-bit range.
> > > > > 
> > > > > If it's not doable in a nice way, we'll just leave with this permanent
> > > > > 1GB ZONE_DMA and hope we won't get platforms requiring an even smaller
> > > > > one. There's also the option of ignoring kdump on RPi4, make ZONE_DMA
> > > > > depend on !CRASH_DUMP and the "low" reservations can use the full 32-bit
> > > > > range since the kdump kernel won't need <30-bit addresses.
> > > > 
> > > > Are you aware of any reason why we cannot defer the call to
> > > > reserve_crashkernel() to the start of bootmem_init()? That way, we
> > > > have access to the unflattened DT as well as the IORT, and so we can
> > > > tweak the zone limits based on the h/w description, but before
> > > > allocating the crashkernel.
> > > 
> > > Not really, as long as memblock_reserve/alloc() still works.
> > 
> > I had a look at this myself, and IIUC we're free to call reserve_crashkernel()
> > anytime as long as it's before memblock_free_all().
> > 
> > So, should I add a patch in my series taking care of that? or you'd rather take
> > care of it yourselves?
> > 
> 
> Would you mind adopting this patch, and insert it into your series
> where appropriate? (after dropping the Documentation/ change, and
> moving the prototype declaration into linux/acpi_iort.h?) Then, you
> can also include moving the reserve_crashkernel() into bootmem_init().

Yes, I'll take care of it.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Anshuman Khandual <anshuman.khandual@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Sudeep Holla <sudeep.holla@arm.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Jeremy Linton <jeremy.linton@arm.com>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Hanjun Guo <guohanjun@huawei.com>, Will Deacon <will@kernel.org>,
	Christoph Hellwig <hch@lst.de>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] arm64: mm: set ZONE_DMA size based on early IORT scan
Date: Wed, 14 Oct 2020 14:54:52 +0200	[thread overview]
Message-ID: <1c436e677b948c3242ed60839b72e36868c51334.camel@suse.de> (raw)
In-Reply-To: <CAMj1kXHhcB85Uc4wbv7zWkSKACnd05Hj-JRKm_R5OgDB1bkHNg@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 3862 bytes --]

On Wed, 2020-10-14 at 14:44 +0200, Ard Biesheuvel wrote:
> On Tue, 13 Oct 2020 at 16:42, Nicolas Saenz Julienne
> <nsaenzjulienne@suse.de> wrote:
> > On Mon, 2020-10-12 at 17:59 +0100, Catalin Marinas wrote:
> > > On Mon, Oct 12, 2020 at 06:35:37PM +0200, Ard Biesheuvel wrote:
> > > > On Mon, 12 Oct 2020 at 18:22, Catalin Marinas <catalin.marinas@arm.com> wrote:
> > > > > On Mon, Oct 12, 2020 at 05:55:45PM +0200, Ard Biesheuvel wrote:
> > > > > > On Mon, 12 Oct 2020 at 17:50, Catalin Marinas <catalin.marinas@arm.com> wrote:
> > > > > > > > > On Mon, Oct 12, 2020 at 12:43:05PM +0200, Ard Biesheuvel wrote:
> > > > > > > > > > Also, could someone give an executive summary of why it matters where
> > > > > > > > > > the crashkernel is loaded? As far as I can tell, reserve_crashkernel()
> > > > > > > > > > only allocates memory for the kernel's executable image itself, which
> > > > > > > > > > can usually be loaded anywhere in memory. I could see how a
> > > > > > > > > > crashkernel might need some DMA'able memory if it needs to use the
> > > > > > > > > > hardware, but I don't think that is what is going on here.
> > > > > [...]
> > > > > > > However, the crashkernel=... range is meant for sufficiently large
> > > > > > > reservation to be able to run the kdump kernel, not just load the image.
> > > > > > 
> > > > > > Sure. But I was referring to the requirement that it is loaded low in
> > > > > > memory. Unless I am misunderstanding something, all we need for the
> > > > > > crashkernel to be able to operate is some ZONE_DMA memory in case it
> > > > > > is needed by the hardware, and beyond that, it could happily live
> > > > > > anywhere in memory.
> > > > > 
> > > > > Yes, the crash kernel doesn't need to be loaded in the low memory. But
> > > > > some low memory needs to end up in its perceived System RAM. That's what
> > > > > Chen is trying to do with this series:
> > > > > 
> > > > > https://lore.kernel.org/linux-arm-kernel/20200907134745.25732-1-chenzhou10@huawei.com/
> > > > > 
> > > > > It reserves the normal crashkernel memory at some high address range
> > > > > with a small block (currently proposed as 256MB similar to x86) in the
> > > > > "low" range.
> > > > > 
> > > > > This "low" range for arm64 currently means below 1GB but it's only RPi4
> > > > > that needs it this low, all other platforms are fine with the full low
> > > > > 32-bit range.
> > > > > 
> > > > > If it's not doable in a nice way, we'll just leave with this permanent
> > > > > 1GB ZONE_DMA and hope we won't get platforms requiring an even smaller
> > > > > one. There's also the option of ignoring kdump on RPi4, make ZONE_DMA
> > > > > depend on !CRASH_DUMP and the "low" reservations can use the full 32-bit
> > > > > range since the kdump kernel won't need <30-bit addresses.
> > > > 
> > > > Are you aware of any reason why we cannot defer the call to
> > > > reserve_crashkernel() to the start of bootmem_init()? That way, we
> > > > have access to the unflattened DT as well as the IORT, and so we can
> > > > tweak the zone limits based on the h/w description, but before
> > > > allocating the crashkernel.
> > > 
> > > Not really, as long as memblock_reserve/alloc() still works.
> > 
> > I had a look at this myself, and IIUC we're free to call reserve_crashkernel()
> > anytime as long as it's before memblock_free_all().
> > 
> > So, should I add a patch in my series taking care of that? or you'd rather take
> > care of it yourselves?
> > 
> 
> Would you mind adopting this patch, and insert it into your series
> where appropriate? (after dropping the Documentation/ change, and
> moving the prototype declaration into linux/acpi_iort.h?) Then, you
> can also include moving the reserve_crashkernel() into bootmem_init().

Yes, I'll take care of it.


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-10-14 12:54 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-10  9:31 [PATCH] arm64: mm: set ZONE_DMA size based on early IORT scan Ard Biesheuvel
2020-10-10  9:31 ` Ard Biesheuvel
2020-10-12  9:28 ` Catalin Marinas
2020-10-12  9:28   ` Catalin Marinas
2020-10-12  9:30   ` Ard Biesheuvel
2020-10-12  9:30     ` Ard Biesheuvel
2020-10-12 10:43     ` Ard Biesheuvel
2020-10-12 10:43       ` Ard Biesheuvel
2020-10-12 11:24       ` Catalin Marinas
2020-10-12 11:24         ` Catalin Marinas
2020-10-12 14:19         ` Ard Biesheuvel
2020-10-12 14:19           ` Ard Biesheuvel
2020-10-12 15:49           ` Catalin Marinas
2020-10-12 15:49             ` Catalin Marinas
2020-10-12 15:55             ` Ard Biesheuvel
2020-10-12 15:55               ` Ard Biesheuvel
2020-10-12 16:22               ` Catalin Marinas
2020-10-12 16:22                 ` Catalin Marinas
2020-10-12 16:35                 ` Ard Biesheuvel
2020-10-12 16:35                   ` Ard Biesheuvel
2020-10-12 16:59                   ` Catalin Marinas
2020-10-12 16:59                     ` Catalin Marinas
2020-10-13 14:42                     ` Nicolas Saenz Julienne
2020-10-13 14:42                       ` Nicolas Saenz Julienne
2020-10-13 15:45                       ` Catalin Marinas
2020-10-13 15:45                         ` Catalin Marinas
2020-10-14 12:44                       ` Ard Biesheuvel
2020-10-14 12:44                         ` Ard Biesheuvel
2020-10-14 12:54                         ` Nicolas Saenz Julienne [this message]
2020-10-14 12:54                           ` Nicolas Saenz Julienne
2020-10-12 12:16 ` kernel test robot
2020-10-12 12:16   ` kernel test robot
2020-10-12 12:16   ` kernel test robot
2020-10-13 11:09 ` Lorenzo Pieralisi
2020-10-13 11:09   ` Lorenzo Pieralisi
2020-10-13 11:22   ` Ard Biesheuvel
2020-10-13 11:22     ` Ard Biesheuvel
2020-10-13 11:38     ` Ard Biesheuvel
2020-10-13 11:38       ` Ard Biesheuvel
2020-10-13 11:43       ` Ard Biesheuvel
2020-10-13 11:43         ` Ard Biesheuvel
2020-10-13 13:13     ` Lorenzo Pieralisi
2020-10-13 13:13       ` Lorenzo Pieralisi
2020-10-13 13:42       ` Ard Biesheuvel
2020-10-13 13:42         ` Ard Biesheuvel
2020-10-13 15:11         ` Robin Murphy
2020-10-13 15:11           ` Robin Murphy
2020-10-13 15:41         ` Lorenzo Pieralisi
2020-10-13 15:41           ` Lorenzo Pieralisi
2020-10-14 16:18           ` Catalin Marinas
2020-10-14 16:18             ` Catalin Marinas
2020-10-14 17:23             ` Lorenzo Pieralisi
2020-10-14 17:23               ` Lorenzo Pieralisi

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=1c436e677b948c3242ed60839b72e36868c51334.camel@suse.de \
    --to=nsaenzjulienne@suse.de \
    --cc=anshuman.khandual@arm.com \
    --cc=ardb@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=guohanjun@huawei.com \
    --cc=hch@lst.de \
    --cc=jeremy.linton@arm.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=sudeep.holla@arm.com \
    --cc=will@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.