Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1188423

Re: [PATCH V5 3/4] arm64: apei: implement arch_apei_get_mem_attributes()

From "Zhang, Jonathan Zhixiong" <zjzhang@codeaurora.org>
Newsgroups linux.kernel
Subject Re: [PATCH V5 3/4] arm64: apei: implement arch_apei_get_mem_attributes()
Date 2015-07-20 20:30 +0200
Message-ID <pOnZ8-Kj-19@gated-at.bofh.it> (permalink)
References <pMiTU-8bL-3@gated-at.bofh.it> <pMiTU-8bL-1@gated-at.bofh.it> <pMUZd-4Ke-23@gated-at.bofh.it> <pN2N3-7wL-5@gated-at.bofh.it> <pNarg-1FW-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH V5 3/4] arm64: apei: implement arch_apei_get_mem_attributes() "Jonathan (Zhixiong) Zhang" <zjzhang@codeaurora.org> - 2015-07-15 02:40 +0200
  Re: [PATCH V5 3/4] arm64: apei: implement  arch_apei_get_mem_attributes() Will Deacon <will.deacon@arm.com> - 2015-07-16 19:20 +0200
    Re: [PATCH V5 3/4] arm64: apei: implement arch_apei_get_mem_attributes() "Zhang, Jonathan Zhixiong" <zjzhang@codeaurora.org> - 2015-07-17 03:40 +0200
      Re: [PATCH V5 3/4] arm64: apei: implement  arch_apei_get_mem_attributes() Will Deacon <will.deacon@arm.com> - 2015-07-17 11:50 +0200
        Re: [PATCH V5 3/4] arm64: apei: implement  arch_apei_get_mem_attributes() "Zhang, Jonathan Zhixiong" <zjzhang@codeaurora.org> - 2015-07-20 20:30 +0200
      Re: [PATCH V5 3/4] arm64: apei: implement arch_apei_get_mem_attributes() Hanjun Guo <hanjun.guo@linaro.org> - 2015-07-17 12:10 +0200
        Re: [PATCH V5 3/4] arm64: apei: implement  arch_apei_get_mem_attributes() "Zhang, Jonathan Zhixiong" <zjzhang@codeaurora.org> - 2015-07-20 20:30 +0200

csiph-web