All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Fleming <matt@codeblueprint.co.uk>
To: Borislav Petkov <bp@alien8.de>
Cc: "Zhang, Jonathan Zhixiong" <zjzhang@codeaurora.org>,
	Matt Fleming <matt.fleming@intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	fu.wei@linaro.org, al.stone@linaro.org, tony.luck@gmail.com,
	rjw@rjwysocki.net, lenb@kernel.org, ying.huang@intel.com,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V3 4/4] acpi, apei: use EFI memmap to map GHES memory
Date: Mon, 22 Jun 2015 06:11:31 +0100	[thread overview]
Message-ID: <20150622051131.GA2815@codeblueprint.co.uk> (raw)
In-Reply-To: <20150615145908.GK4255@pd.tnic>

On Mon, 15 Jun, at 04:59:08PM, Borislav Petkov wrote:
> On Mon, Jun 15, 2015 at 03:15:33PM +0100, Matt Fleming wrote:
> > On Sat, 13 Jun, at 10:27:51AM, Borislav Petkov wrote:
> > > On Fri, Jun 12, 2015 at 04:44:25PM -0700, Zhang, Jonathan Zhixiong wrote:
> > > > Since such function is only needed for APEI functionality, at least as
> > > > of today, I will name it arch_apei_get_mem_attribute().
> > > 
> > > Why?
> > > 
> > > It can be extended to be used generically too, no? Come to think of it,
> > > the different arches should already have a way to tell you with what mem
> > > attributes a physical address is mapped, no?
> > > 
> > > IOW, such functionality should be already present, you'd only have to
> > > find it and use it.
> > 
> > I did think about this, but I don't think we have a generic way to ask
> > the firmware for its memory map.
> 
> Not the firmware but the OS. Like on x86, for example, we have MTRRs
> and PAT and they cover the whole range. Basically what lookup_memtype()
> does. We already have that info, why not query it instead of growing
> more stuff ontop.
> 
> I mean, we do ioremap* which does reserve_memtype() and sticks the range
> in the rbtree which we query after. Can't be better than that...

Right, but see my previous comment about x86 discarding a bunch of
attributes for memory regions because the kernel "knows better".

And in most places, yes, the kernel really does know better. But this
APEI case is special because irrespective of what the kernel says we
want to be compatible with the firmware's memory map.

And we don't have an API for that.

-- 
Matt Fleming, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in

WARNING: multiple messages have this Message-ID (diff)
From: Matt Fleming <matt@codeblueprint.co.uk>
To: Borislav Petkov <bp@alien8.de>
Cc: "Zhang, Jonathan Zhixiong" <zjzhang@codeaurora.org>,
	Matt Fleming <matt.fleming@intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	fu.wei@linaro.org, al.stone@linaro.org, tony.luck@gmail.com,
	rjw@rjwysocki.net, lenb@kernel.org, ying.huang@intel.com,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V3 4/4] acpi, apei: use EFI memmap to map GHES memory
Date: Mon, 22 Jun 2015 06:11:31 +0100	[thread overview]
Message-ID: <20150622051131.GA2815@codeblueprint.co.uk> (raw)
In-Reply-To: <20150615145908.GK4255@pd.tnic>

On Mon, 15 Jun, at 04:59:08PM, Borislav Petkov wrote:
> On Mon, Jun 15, 2015 at 03:15:33PM +0100, Matt Fleming wrote:
> > On Sat, 13 Jun, at 10:27:51AM, Borislav Petkov wrote:
> > > On Fri, Jun 12, 2015 at 04:44:25PM -0700, Zhang, Jonathan Zhixiong wrote:
> > > > Since such function is only needed for APEI functionality, at least as
> > > > of today, I will name it arch_apei_get_mem_attribute().
> > > 
> > > Why?
> > > 
> > > It can be extended to be used generically too, no? Come to think of it,
> > > the different arches should already have a way to tell you with what mem
> > > attributes a physical address is mapped, no?
> > > 
> > > IOW, such functionality should be already present, you'd only have to
> > > find it and use it.
> > 
> > I did think about this, but I don't think we have a generic way to ask
> > the firmware for its memory map.
> 
> Not the firmware but the OS. Like on x86, for example, we have MTRRs
> and PAT and they cover the whole range. Basically what lookup_memtype()
> does. We already have that info, why not query it instead of growing
> more stuff ontop.
> 
> I mean, we do ioremap* which does reserve_memtype() and sticks the range
> in the rbtree which we query after. Can't be better than that...

Right, but see my previous comment about x86 discarding a bunch of
attributes for memory regions because the kernel "knows better".

And in most places, yes, the kernel really does know better. But this
APEI case is special because irrespective of what the kernel says we
want to be compatible with the firmware's memory map.

And we don't have an API for that.

-- 
Matt Fleming, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

  reply	other threads:[~2015-06-22  5:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-11 18:25 [PATCH V3 0/4] map GHES memory region with EFI memory map Jonathan (Zhixiong) Zhang
2015-06-11 18:25 ` [PATCH V3 1/4] x86: acpi: define uncached page flag Jonathan (Zhixiong) Zhang
2015-06-12  7:52   ` Ingo Molnar
2015-06-12 23:49     ` Zhang, Jonathan Zhixiong
2015-06-11 18:25 ` [PATCH V3 2/4] arm64: " Jonathan (Zhixiong) Zhang
2015-06-11 18:25 ` [PATCH V3 3/4] efi: x86: rearrange efi_mem_attributes() Jonathan (Zhixiong) Zhang
2015-06-11 18:26 ` [PATCH V3 4/4] acpi, apei: use EFI memmap to map GHES memory Jonathan (Zhixiong) Zhang
2015-06-12 16:29   ` Borislav Petkov
2015-06-12 23:44     ` Zhang, Jonathan Zhixiong
2015-06-13  8:27       ` Borislav Petkov
2015-06-15 14:15         ` Matt Fleming
2015-06-15 14:59           ` Borislav Petkov
2015-06-22  5:11             ` Matt Fleming [this message]
2015-06-22  5:11               ` Matt Fleming
2015-06-23  9:50               ` Matt Fleming
     [not found] <E1ZG8Pn-0002uB-2C@feisty.vs19.net>
2015-07-21  0:22 ` Zhang, Jonathan Zhixiong

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=20150622051131.GA2815@codeblueprint.co.uk \
    --to=matt@codeblueprint.co.uk \
    --cc=al.stone@linaro.org \
    --cc=bp@alien8.de \
    --cc=fu.wei@linaro.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt.fleming@intel.com \
    --cc=rjw@rjwysocki.net \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@gmail.com \
    --cc=ying.huang@intel.com \
    --cc=zjzhang@codeaurora.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.