linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: Will Deacon <will.deacon@arm.com>
Cc: catalin.marinas@arm.com, ard.biesheuvel@linaro.org,
	tbaicar@codeaurora.org, bhsharma@redhat.com, dyoung@redhat.com,
	james.morse@arm.com, mark.rutland@arm.com, al.stone@linaro.org,
	graeme.gregory@linaro.org, hanjun.guo@linaro.org,
	lorenzo.pieralisi@arm.com, sudeep.holla@arm.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, kexec@lists.infradead.org
Subject: Re: [PATCH v3.1 0/4] arm64: kexec,kdump: fix boot failures on acpi-only system
Date: Fri, 13 Jul 2018 09:34:36 +0900	[thread overview]
Message-ID: <20180713003434.GZ28220@linaro.org> (raw)
In-Reply-To: <20180712164918.GA26935@arm.com>

On Thu, Jul 12, 2018 at 05:49:19PM +0100, Will Deacon wrote:
> Hi Akashi,
> 
> On Tue, Jul 10, 2018 at 08:42:25AM +0900, AKASHI Takahiro wrote:
> > This patch series is a set of bug fixes to address kexec/kdump
> > failures which are sometimes observed on ACPI-only system and reported
> > in LAK-ML before.
> 
> I tried picking this up, along with Ard's fixup, but I'm seeing a build
> failure for allmodconfig:
> 
> arch/arm64/kernel/acpi.o: In function `__acpi_get_mem_attribute':
> acpi.c:(.text+0x60): undefined reference to `efi_mem_attributes'
> 
> I didn't investigate further. Please can you fix this?

Because CONFIG_ACPI is on and CONFIG_EFI is off.

This can happen in allmodconfig as CONFIG_EFI depends on
!CONFIG_CPU_BIG_ENDIAN, which is actually on in this case.

Looking at __acpi_get_mem_attributes(), since there is no information
available on memory attributes, what we can do at best is
  * return PAGE_KERNEL (= cacheable) for mapped memory,
  * return DEVICE_nGnRnE (= non-cacheable) otherwise
(See a hunk to be applied on top of my patch#4.)

I think that, after applying, acpi_os_ioremap() would work almost
in the same way as the original before my patchset given that
MAP memblock attribute is used only under CONFIG_EFI for now.

Make sense?

-Takahiro AKASHI

> Will
---8<---
diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
index ed46dc188b22..cad3ed2666ef 100644
--- a/arch/arm64/kernel/acpi.c
+++ b/arch/arm64/kernel/acpi.c
@@ -238,6 +238,7 @@ void __init acpi_boot_table_init(void)
 
 pgprot_t __acpi_get_mem_attribute(phys_addr_t addr)
 {
+#ifdef CONFIG_EFI
 	/*
 	 * According to "Table 8 Map: EFI memory types to AArch64 memory
 	 * types" of UEFI 2.5 section 2.3.6.1, each EFI memory type is
@@ -255,5 +256,9 @@ pgprot_t __acpi_get_mem_attribute(phys_addr_t addr)
 		return __pgprot(PROT_NORMAL_WT);
 	if (attr & EFI_MEMORY_WC)
 		return __pgprot(PROT_NORMAL_NC);
+#else
+	if (memblock_is_map_memory(addr))
+		return PAGE_KERNEL;
+#endif
 	return __pgprot(PROT_DEVICE_nGnRnE);
 }

  reply	other threads:[~2018-07-13  0:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-09 23:42 [PATCH v3.1 0/4] arm64: kexec,kdump: fix boot failures on acpi-only system AKASHI Takahiro
2018-07-09 23:42 ` [PATCH v3.1 1/4] arm64: export memblock_reserve()d regions via /proc/iomem AKASHI Takahiro
2018-07-09 23:42 ` [PATCH v3.1 2/4] efi/arm: preserve early mapping of UEFI memory map longer for BGRT AKASHI Takahiro
2018-07-10 17:57   ` James Morse
2018-07-10 18:39     ` Ard Biesheuvel
2018-07-12 13:32       ` Will Deacon
2018-07-12 14:14         ` Ard Biesheuvel
2018-07-09 23:42 ` [PATCH v3.1 3/4] efi/arm: map UEFI memory map even w/o runtime services enabled AKASHI Takahiro
2018-07-09 23:42 ` [PATCH v3.1 4/4] arm64: acpi: fix alignment fault in accessing ACPI AKASHI Takahiro
2018-07-12 16:49 ` [PATCH v3.1 0/4] arm64: kexec,kdump: fix boot failures on acpi-only system Will Deacon
2018-07-13  0:34   ` AKASHI Takahiro [this message]
2018-07-13  5:49     ` Ard Biesheuvel
2018-07-17  5:12       ` AKASHI Takahiro
2018-07-23 13:35         ` Will Deacon
2018-07-24  5:19           ` Bhupesh Sharma

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=20180713003434.GZ28220@linaro.org \
    --to=takahiro.akashi@linaro.org \
    --cc=al.stone@linaro.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=bhsharma@redhat.com \
    --cc=catalin.marinas@arm.com \
    --cc=dyoung@redhat.com \
    --cc=graeme.gregory@linaro.org \
    --cc=hanjun.guo@linaro.org \
    --cc=james.morse@arm.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=sudeep.holla@arm.com \
    --cc=tbaicar@codeaurora.org \
    --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).