linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] EFI changes for v4.3
@ 2015-08-06 20:32 Matt Fleming
       [not found] ` <1438936621-5215-7-git-send-email-matt@codeblueprint.co.uk>
       [not found] ` <1438936621-5215-4-git-send-email-matt@codeblueprint.co.uk>
  0 siblings, 2 replies; 6+ messages in thread
From: Matt Fleming @ 2015-08-06 20:32 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin
  Cc: linux-efi, linux-kernel, Will Deacon, Borislav Petkov,
	Catalin Marinas, Rafael J. Wysocki, linux-acpi

Folks, please pull the following changes for v4.3. The biggest changes
are the memory map querying updates in the ACPI GHES driver and the
revert of commit aeffc4928ea2 ("x86/efi: Request desired alignment via
the PE/COFF headers") which was reportedly causing errors when users
attempt to sign their kernels with Signtool.

The GHES driver changes touch a mixture of ACPI, x86 and arm64 code but
all the patches have been ACKed and/or reviewed by relevant people.

The following changes since commit bc0195aad0daa2ad5b0d76cce22b167bc3435590:

  Linux 4.2-rc2 (2015-07-12 15:10:30 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/mfleming/efi.git tags/efi-next

for you to fetch changes up to 8229722e29da369a4e9512a5c18adb4028a7626b:

  acpi, apei: use appropriate pgprot_t to map GHES memory (2015-08-06 15:44:41 +0100)

----------------------------------------------------------------
 * Add support for the new EFI memory map attribute EFI_MEMORY_RO that
   was introduced in the UEFI 2.5 spec - Ard Biesheuvel

 * Lower the severity of the invalid BGRT message from pr_err()
   to pr_debug() since it's legitimate (per the spec) for the firmware
   to pass the kernel a BGRT with the invalid status bit set. The kernel
   just simply needs to ignore it.

 * Revert the optimisation of using CONFIG_PHYSICAL_ALIGN in the
   PE/COFF header SectionAlignment field of the EFI stub, since it
   violates the PE/COFF spec which says SizeOfImage must be a multiple
   of SectionAlignment, and because it was causing Signtool to fail.

 * Update the ACPI Platform Error Interface (APEI) GHES driver to query
   the EFI memory map for the correct cache attributes to use when
   mapping pages accessed by both the kernel and firmware. This prevents
   stale data being read by the kernel - Jonathan (Zhixiong) Zhang

----------------------------------------------------------------
Ard Biesheuvel (1):
      efi: Add support for EFI_MEMORY_RO attribute introduced by UEFIv2.5

Jonathan (Zhixiong) Zhang (5):
      efi: x86: rearrange efi_mem_attributes()
      x86: acpi: implement arch_apei_get_mem_attributes()
      arm64: mm: add PROT_DEVICE_nGnRnE and PROT_NORMAL_WT
      arm64: apei: implement arch_apei_get_mem_attributes()
      acpi, apei: use appropriate pgprot_t to map GHES memory

Matt Fleming (2):
      x86/efi-bgrt: Switch pr_err() to pr_debug() for invalid BGRT
      Revert "x86/efi: Request desired alignment via the PE/COFF headers"

 arch/arm64/include/asm/acpi.h    | 27 +++++++++++++++++++++++++++
 arch/arm64/include/asm/memory.h  |  1 +
 arch/arm64/include/asm/pgtable.h |  2 ++
 arch/arm64/mm/proc.S             |  4 +++-
 arch/x86/boot/header.S           |  2 +-
 arch/x86/include/asm/acpi.h      | 24 ++++++++++++++++++++++++
 arch/x86/platform/efi/efi-bgrt.c |  9 +++++++--
 arch/x86/platform/efi/efi.c      | 18 ------------------
 drivers/acpi/apei/ghes.c         |  6 ++++--
 drivers/firmware/efi/efi.c       | 39 ++++++++++++++++++++++++++++++++++++---
 include/linux/efi.h              |  1 +
 11 files changed, 106 insertions(+), 27 deletions(-)

-- 
Matt Fleming, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 7/8] arm64: apei: implement arch_apei_get_mem_attributes()
       [not found] ` <1438936621-5215-7-git-send-email-matt@codeblueprint.co.uk>
@ 2015-08-07  9:50   ` Matt Fleming
  2015-08-08  8:39     ` Ingo Molnar
  0 siblings, 1 reply; 6+ messages in thread
From: Matt Fleming @ 2015-08-07  9:50 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin
  Cc: Jonathan (Zhixiong) Zhang, Matt Fleming, linux-kernel, linux-efi,
	Ard Biesheuvel

On Fri, 07 Aug, at 09:37:00AM, Matt Fleming wrote:
> From: "Jonathan (Zhixiong) Zhang" <zjzhang@codeaurora.org>
> 
> Table 8 of UEFI 2.5 section 2.3.6.1 defines mappings from EFI
> memory types to MAIR attribute encodings for arm64.
> 
> If the physical address has memory attributes defined by EFI
> memmap as EFI_MEMORY_[UC|WC|WT], return approprate page protection
> type according to the UEFI spec. Otherwise, return PAGE_KERNEL.
> 
> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
> Acked-by: Hanjun Guo <hanjun.guo@linaro.org>
> Signed-off-by: Jonathan (Zhixiong) Zhang <zjzhang@codeaurora.org>
> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
> ---
>  arch/arm64/include/asm/acpi.h | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
> 

Ard Biesheuvel has brought up a concern with this patch and it's
currently under discussion here,

  https://lkml.kernel.org/r/CAKv+Gu8+g3dTaNzXjSD=5GxproaHM+Eu1hLmRWp7cVrQimzbHQ@mail.gmail.com

-- 
Matt Fleming, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 4/8] efi: x86: rearrange efi_mem_attributes()
       [not found] ` <1438936621-5215-4-git-send-email-matt@codeblueprint.co.uk>
@ 2015-08-07 17:43   ` Zhang, Jonathan Zhixiong
  2015-08-07 18:46     ` Matt Fleming
  2015-08-09 10:24   ` [tip:core/efi] efi, x86: Rearrange efi_mem_attributes() tip-bot for Jonathan (Zhixiong) Zhang
  1 sibling, 1 reply; 6+ messages in thread
From: Zhang, Jonathan Zhixiong @ 2015-08-07 17:43 UTC (permalink / raw)
  To: Matt Fleming, Ingo Molnar, Thomas Gleixner, "H. Peter Anvin
  Cc: linux-kernel, linux-efi, Matt Fleming

Thank you Matt for your help. I tried to find the cover letter
and patch 1, 2, 3 of the patch set. But I did not find them.
Probably the subject has typo? I appreciate that you re-post the
patch set to get more feed backs, I just wanted to be sure.

-- 
Jonathan (Zhixiong) Zhang
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 4/8] efi: x86: rearrange efi_mem_attributes()
  2015-08-07 17:43   ` [PATCH 4/8] efi: x86: rearrange efi_mem_attributes() Zhang, Jonathan Zhixiong
@ 2015-08-07 18:46     ` Matt Fleming
  0 siblings, 0 replies; 6+ messages in thread
From: Matt Fleming @ 2015-08-07 18:46 UTC (permalink / raw)
  To: Zhang, Jonathan Zhixiong
  Cc: Ingo Molnar, Thomas Gleixner, linux-kernel, linux-efi,
	Matt Fleming, H. Peter Anvin

On Fri, 07 Aug, at 10:43:46AM, Zhang, Jonathan Zhixiong wrote:
> Thank you Matt for your help. I tried to find the cover letter
> and patch 1, 2, 3 of the patch set. But I did not find them.
> Probably the subject has typo? I appreciate that you re-post the
> patch set to get more feed backs, I just wanted to be sure.

I sent the patches as follow-up to my GIT PULL request here,

  https://lkml.kernel.org/r/20150806203232.GH4332@codeblueprint.co.uk

-- 
Matt Fleming, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 7/8] arm64: apei: implement arch_apei_get_mem_attributes()
  2015-08-07  9:50   ` [PATCH 7/8] arm64: apei: implement arch_apei_get_mem_attributes() Matt Fleming
@ 2015-08-08  8:39     ` Ingo Molnar
  0 siblings, 0 replies; 6+ messages in thread
From: Ingo Molnar @ 2015-08-08  8:39 UTC (permalink / raw)
  To: Matt Fleming
  Cc: Thomas Gleixner, H. Peter Anvin, Jonathan (Zhixiong) Zhang,
	Matt Fleming, linux-kernel, linux-efi, Ard Biesheuvel


* Matt Fleming <matt@codeblueprint.co.uk> wrote:

> On Fri, 07 Aug, at 09:37:00AM, Matt Fleming wrote:
> > From: "Jonathan (Zhixiong) Zhang" <zjzhang@codeaurora.org>
> > 
> > Table 8 of UEFI 2.5 section 2.3.6.1 defines mappings from EFI
> > memory types to MAIR attribute encodings for arm64.
> > 
> > If the physical address has memory attributes defined by EFI
> > memmap as EFI_MEMORY_[UC|WC|WT], return approprate page protection
> > type according to the UEFI spec. Otherwise, return PAGE_KERNEL.
> > 
> > Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
> > Acked-by: Hanjun Guo <hanjun.guo@linaro.org>
> > Signed-off-by: Jonathan (Zhixiong) Zhang <zjzhang@codeaurora.org>
> > Signed-off-by: Matt Fleming <matt.fleming@intel.com>
> > ---
> >  arch/arm64/include/asm/acpi.h | 27 +++++++++++++++++++++++++++
> >  1 file changed, 27 insertions(+)
> > 
> 
> Ard Biesheuvel has brought up a concern with this patch and it's
> currently under discussion here,
> 
>   https://lkml.kernel.org/r/CAKv+Gu8+g3dTaNzXjSD=5GxproaHM+Eu1hLmRWp7cVrQimzbHQ@mail.gmail.com

Ok, I applied the patches up to this point, to tip:core/efi, to get the ball 
rolling - and will push them out after testing:

 8d446c8647c9 arm64/mm: Add PROT_DEVICE_nGnRnE and PROT_NORMAL_WT
 b40227fbfb1f acpi, x86: Implement arch_apei_get_mem_attributes()
 7bf793115dd9 efi, x86: Rearrange efi_mem_attributes()
 fa5c35011a8d Revert "x86/efi: Request desired alignment via the PE/COFF headers"
 248fbcd5aee0 x86/efi-bgrt: Switch pr_err() to pr_debug() for invalid BGRT
 87db73aebf55 efi: Add support for EFI_MEMORY_RO attribute introduced by UEFIv2.5

Let me know when the concerns are resolved or there are other patches to add.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [tip:core/efi] efi, x86: Rearrange efi_mem_attributes()
       [not found] ` <1438936621-5215-4-git-send-email-matt@codeblueprint.co.uk>
  2015-08-07 17:43   ` [PATCH 4/8] efi: x86: rearrange efi_mem_attributes() Zhang, Jonathan Zhixiong
@ 2015-08-09 10:24   ` tip-bot for Jonathan (Zhixiong) Zhang
  1 sibling, 0 replies; 6+ messages in thread
From: tip-bot for Jonathan (Zhixiong) Zhang @ 2015-08-09 10:24 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: zjzhang, hpa, peterz, matt.fleming, tglx, mingo, linux-kernel, torvalds

Commit-ID:  7bf793115dd96ce9bd8ed1665fc187d961a95dba
Gitweb:     http://git.kernel.org/tip/7bf793115dd96ce9bd8ed1665fc187d961a95dba
Author:     Jonathan (Zhixiong) Zhang <zjzhang@codeaurora.org>
AuthorDate: Fri, 7 Aug 2015 09:36:57 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Sat, 8 Aug 2015 10:37:39 +0200

efi, x86: Rearrange efi_mem_attributes()

x86 and ia64 implement efi_mem_attributes() differently. This
function needs to be available for other architectures
(such as arm64) as well, such as for the purpose of ACPI/APEI.

ia64 EFI does not set up a 'memmap' variable and does not set
the EFI_MEMMAP flag, so it needs to have its unique implementation
of efi_mem_attributes().

Move efi_mem_attributes() implementation from x86 to the core
EFI code, and declare it with __weak.

It is recommended that other architectures should not override
the default implementation.

Signed-off-by: Jonathan (Zhixiong) Zhang <zjzhang@codeaurora.org>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Reviewed-by: Matt Fleming <matt.fleming@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1438936621-5215-4-git-send-email-matt@codeblueprint.co.uk
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/platform/efi/efi.c | 18 ------------------
 drivers/firmware/efi/efi.c  | 31 +++++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index e4308fe..2f61fcd 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -952,24 +952,6 @@ u32 efi_mem_type(unsigned long phys_addr)
 	return 0;
 }
 
-u64 efi_mem_attributes(unsigned long phys_addr)
-{
-	efi_memory_desc_t *md;
-	void *p;
-
-	if (!efi_enabled(EFI_MEMMAP))
-		return 0;
-
-	for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
-		md = p;
-		if ((md->phys_addr <= phys_addr) &&
-		    (phys_addr < (md->phys_addr +
-				  (md->num_pages << EFI_PAGE_SHIFT))))
-			return md->attribute;
-	}
-	return 0;
-}
-
 static int __init arch_parse_efi_cmdline(char *str)
 {
 	if (!str) {
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
index d7a9160..afee2880 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -607,3 +607,34 @@ char * __init efi_md_typeattr_format(char *buf, size_t size,
 			 attr & EFI_MEMORY_UC      ? "UC"  : "");
 	return buf;
 }
+
+/*
+ * efi_mem_attributes - lookup memmap attributes for physical address
+ * @phys_addr: the physical address to lookup
+ *
+ * Search in the EFI memory map for the region covering
+ * @phys_addr. Returns the EFI memory attributes if the region
+ * was found in the memory map, 0 otherwise.
+ *
+ * Despite being marked __weak, most architectures should *not*
+ * override this function. It is __weak solely for the benefit
+ * of ia64 which has a funky EFI memory map that doesn't work
+ * the same way as other architectures.
+ */
+u64 __weak efi_mem_attributes(unsigned long phys_addr)
+{
+	efi_memory_desc_t *md;
+	void *p;
+
+	if (!efi_enabled(EFI_MEMMAP))
+		return 0;
+
+	for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
+		md = p;
+		if ((md->phys_addr <= phys_addr) &&
+		    (phys_addr < (md->phys_addr +
+		    (md->num_pages << EFI_PAGE_SHIFT))))
+			return md->attribute;
+	}
+	return 0;
+}

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-08-09 10:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-06 20:32 [GIT PULL] EFI changes for v4.3 Matt Fleming
     [not found] ` <1438936621-5215-7-git-send-email-matt@codeblueprint.co.uk>
2015-08-07  9:50   ` [PATCH 7/8] arm64: apei: implement arch_apei_get_mem_attributes() Matt Fleming
2015-08-08  8:39     ` Ingo Molnar
     [not found] ` <1438936621-5215-4-git-send-email-matt@codeblueprint.co.uk>
2015-08-07 17:43   ` [PATCH 4/8] efi: x86: rearrange efi_mem_attributes() Zhang, Jonathan Zhixiong
2015-08-07 18:46     ` Matt Fleming
2015-08-09 10:24   ` [tip:core/efi] efi, x86: Rearrange efi_mem_attributes() tip-bot for Jonathan (Zhixiong) Zhang

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).