All of lore.kernel.org
 help / color / mirror / Atom feed
From: msalter@redhat.com (Mark Salter)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: support ACPI tables outside of kernel RAM
Date: Fri, 22 May 2015 09:13:24 -0400	[thread overview]
Message-ID: <1432300404.9933.69.camel@deneb.redhat.com> (raw)
In-Reply-To: <20150522125346.GX29424@e104818-lin.cambridge.arm.com>

On Fri, 2015-05-22 at 13:53 +0100, Catalin Marinas wrote:
> On Fri, May 22, 2015 at 08:46:02AM -0400, Mark Salter wrote:
> > On Fri, 2015-05-22 at 11:34 +0100, Catalin Marinas wrote:
> > > OK, so my preferred options, in this order:
> > > 
> > > 1. Change the core ACPI kernel code to distinguish between mapping I/O
> > >    or RAM (could be as simple as acpi_map not using acpi_os_ioremap but
> > >    another API). I guess the code knows when it plans to map tables or
> > >    I/O registers
> > > 
> > > 2. If the above is not possible, add the extra checks as per Mark's
> > >    patch but I would rather call this resource "UEFI RAM" than "ACPI",
> > >    it's not really ACPI specific.
> > 
> > Actually, it is ACPI specific. The patch only registers resources for
> > EfiACPIReclaimMemory and EfiACPIMemoryNVS regions which are also
> > marked as cacheable. On x86 these show up in /proc/iomem as
> > "ACPI Tables" and "ACPI Non-volatile Storage". I used "ACPI RAM" to
> > avoid having to search for two strings.
> 
> My point is more about UEFI describing the entire RAM while the kernel
> command line restricts it via "mem=". In this case, the "System RAM"
> resources is reduced as well but it does not necessarily mean that the
> rest of the RAM is only used by ACPI.
> 

Ah okay. But I'm not sure we want the kernel to access other areas
cut off by mem=. The case I'm dealing with which led to this patch
was a kdump dump-collection kernel. For that kernel, we really don't
want it accessing any general purpose memory outside of its system
ram. For the dump collection, it already uses ioremap_cache to get
to crash-kernel memory. The reason for the iomem resources added
for the UEFI ACPI regions was so the dump-collection kernel could
boot using ACPI.

That being said, I could rework the patch to add all "UEFI RAM" and
that would let us just check that one string for acpi_os_ioremap()
purposes rather than checking "System RAM" and "ACPI RAM".

WARNING: multiple messages have this Message-ID (diff)
From: Mark Salter <msalter@redhat.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Matt Fleming <matt.fleming@intel.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Will Deacon <will.deacon@arm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Hanjun Guo <hanjun.guo@linaro.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] arm64: support ACPI tables outside of kernel RAM
Date: Fri, 22 May 2015 09:13:24 -0400	[thread overview]
Message-ID: <1432300404.9933.69.camel@deneb.redhat.com> (raw)
In-Reply-To: <20150522125346.GX29424@e104818-lin.cambridge.arm.com>

On Fri, 2015-05-22 at 13:53 +0100, Catalin Marinas wrote:
> On Fri, May 22, 2015 at 08:46:02AM -0400, Mark Salter wrote:
> > On Fri, 2015-05-22 at 11:34 +0100, Catalin Marinas wrote:
> > > OK, so my preferred options, in this order:
> > > 
> > > 1. Change the core ACPI kernel code to distinguish between mapping I/O
> > >    or RAM (could be as simple as acpi_map not using acpi_os_ioremap but
> > >    another API). I guess the code knows when it plans to map tables or
> > >    I/O registers
> > > 
> > > 2. If the above is not possible, add the extra checks as per Mark's
> > >    patch but I would rather call this resource "UEFI RAM" than "ACPI",
> > >    it's not really ACPI specific.
> > 
> > Actually, it is ACPI specific. The patch only registers resources for
> > EfiACPIReclaimMemory and EfiACPIMemoryNVS regions which are also
> > marked as cacheable. On x86 these show up in /proc/iomem as
> > "ACPI Tables" and "ACPI Non-volatile Storage". I used "ACPI RAM" to
> > avoid having to search for two strings.
> 
> My point is more about UEFI describing the entire RAM while the kernel
> command line restricts it via "mem=". In this case, the "System RAM"
> resources is reduced as well but it does not necessarily mean that the
> rest of the RAM is only used by ACPI.
> 

Ah okay. But I'm not sure we want the kernel to access other areas
cut off by mem=. The case I'm dealing with which led to this patch
was a kdump dump-collection kernel. For that kernel, we really don't
want it accessing any general purpose memory outside of its system
ram. For the dump collection, it already uses ioremap_cache to get
to crash-kernel memory. The reason for the iomem resources added
for the UEFI ACPI regions was so the dump-collection kernel could
boot using ACPI.

That being said, I could rework the patch to add all "UEFI RAM" and
that would let us just check that one string for acpi_os_ioremap()
purposes rather than checking "System RAM" and "ACPI RAM".



  reply	other threads:[~2015-05-22 13:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14 14:22 [PATCH] arm64: support ACPI tables outside of kernel RAM Mark Salter
2015-05-14 14:22 ` Mark Salter
2015-05-14 14:50 ` Ard Biesheuvel
2015-05-14 14:50   ` Ard Biesheuvel
2015-05-15 13:58   ` Mark Salter
2015-05-15 13:58     ` Mark Salter
2015-05-18 11:11 ` Catalin Marinas
2015-05-18 11:11   ` Catalin Marinas
2015-05-18 13:58   ` Mark Salter
2015-05-18 13:58     ` Mark Salter
2015-05-18 16:41     ` Catalin Marinas
2015-05-18 16:41       ` Catalin Marinas
2015-05-18 16:49       ` Ard Biesheuvel
2015-05-18 16:49         ` Ard Biesheuvel
2015-05-22 10:34         ` Catalin Marinas
2015-05-22 10:34           ` Catalin Marinas
2015-05-22 12:46           ` Mark Salter
2015-05-22 12:46             ` Mark Salter
2015-05-22 12:53             ` Catalin Marinas
2015-05-22 12:53               ` Catalin Marinas
2015-05-22 13:13               ` Mark Salter [this message]
2015-05-22 13:13                 ` Mark Salter
2015-05-22 13:49           ` Mark Salter
2015-05-22 13:49             ` Mark Salter

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=1432300404.9933.69.camel@deneb.redhat.com \
    --to=msalter@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.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.