From: "Zhang, Jonathan Zhixiong" <zjzhang@codeaurora.org>
To: Will Deacon <will.deacon@arm.com>
Cc: Catalin Marinas <Catalin.Marinas@arm.com>,
"fu.wei@linaro.org" <fu.wei@linaro.org>,
"al.stone@linaro.org" <al.stone@linaro.org>,
"bp @ alien8 . de Matt Fleming" <matt.fleming@intel.com>,
"rjw@rjwysocki.net" <rjw@rjwysocki.net>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linaro-acpi@lists.linaro.org" <linaro-acpi@lists.linaro.org>
Subject: Re: [PATCH V5 3/4] arm64: apei: implement arch_apei_get_mem_attributes()
Date: Mon, 20 Jul 2015 11:22:52 -0700 [thread overview]
Message-ID: <55AD3C7C.2010906@codeaurora.org> (raw)
In-Reply-To: <20150717094314.GE18994@arm.com>
Thanks for the clarification, Will.
On 7/17/2015 2:43 AM, Will Deacon wrote:
> On Fri, Jul 17, 2015 at 02:37:00AM +0100, Zhang, Jonathan Zhixiong wrote:
>> On 7/16/2015 10:18 AM, Will Deacon wrote:
>>> On Wed, Jul 15, 2015 at 01:31:55AM +0100, Jonathan (Zhixiong) Zhang wrote:
>>>> +pgprot_t arch_apei_get_mem_attribute(phys_addr_t addr)
>>>> +{
>>>> + if (efi_mem_attributes(addr) & EFI_MEMORY_UC)
>>>> + return PROT_DEVICE_nGnRE;
>>>> + else
>>>> + return PAGE_KERNEL;
>>>> +}
>>>
>>> Do we really need a new file and out-of-line call for this?
>> We have a choice of either adding this function to
>> arch/arm64/kernel/acpi.c, or creating
>> arch/arm64/kernel/apei.c. As we continue to work on firmware first
>> HW error handling for arm64, more arm64 specific APEI related functions
>> may need to be implemented, thus I think it would be good to create
>> arch/arm64/kernel/apei.c. That being said, to date we have found
>> the needs to have only two arm64 specific APEI related functions.
>> The other one can be found in LEG kernel, through this commit:
>> aa2d69c88b27 ACPI, APEI, ARM64: APEI initial support for aarch64
>> My understanding is that Linaro will work on to upstream that commit. I
>> do not strongly prefer either choice.
>>
>> When APEI ghes driver maps the memory region that has error record
>> updated by firmware, it executes in IRQ, timer or SEA handler. Since
>> ioremap() can not be used in atomic context, so APEI implements a
>> special version of atomic ioremap function calling ioremap_page_range().
>> On the other hand, x86 and ARM64 have different ways to define pgprot_t
>> for page that needs to be accessed with uncached property. x86 defines
>> PAGE_KERNEL_NOCACHE, while arm64 defines PROT_DEVICE_nGnRE. Therefore
>> arch specific implementation is needed.
>> There are other ways to achieve such needs. V3 of this
>> patch set tried another way [1]. I think the current way makes the most
>> sense, since it made generic APEI code to stay generic (no knowledge
>> about EFI, no arch dependent ifdefs).
>
> I understand what you're doing and my concern was much simpler than you
> seem to imagine. Put another way: why can't arch_apei_get_mem_attribute
> be a static inline in a header file (like acpi_os_ioremap in asm/acpi.h)?
Great. Will do.
>
> Will
>
--
Jonathan (Zhixiong) Zhang
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2015-07-20 18:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-15 0:31 [PATCH V5 0/4] map GHES memory region according to EFI memory map Jonathan (Zhixiong) Zhang
2015-07-15 0:31 ` [PATCH V5 1/4] efi: x86: rearrange efi_mem_attributes() Jonathan (Zhixiong) Zhang
2015-07-15 0:31 ` [PATCH V5 2/4] x86: acpi: implement arch_apei_get_mem_attributes() Jonathan (Zhixiong) Zhang
2015-07-15 0:31 ` [PATCH V5 3/4] arm64: apei: " Jonathan (Zhixiong) Zhang
2015-07-16 17:18 ` Will Deacon
2015-07-17 1:37 ` Zhang, Jonathan Zhixiong
2015-07-17 9:43 ` Will Deacon
2015-07-20 18:22 ` Zhang, Jonathan Zhixiong [this message]
2015-07-17 10:06 ` Hanjun Guo
2015-07-20 18:22 ` Zhang, Jonathan Zhixiong
2015-07-15 0:31 ` [PATCH V5 4/4] acpi, apei: use appropriate pgprot_t to map GHES memory Jonathan (Zhixiong) Zhang
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=55AD3C7C.2010906@codeaurora.org \
--to=zjzhang@codeaurora.org \
--cc=Catalin.Marinas@arm.com \
--cc=al.stone@linaro.org \
--cc=fu.wei@linaro.org \
--cc=linaro-acpi@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matt.fleming@intel.com \
--cc=rjw@rjwysocki.net \
--cc=will.deacon@arm.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;
as well as URLs for NNTP newsgroup(s).