mbox series

[GIT,PULL,00/12] first batch of EFI changes for v4.17

Message ID 20180308080020.22828-1-ard.biesheuvel@linaro.org
Headers show
Series first batch of EFI changes for v4.17 | expand

Message

Ard Biesheuvel March 8, 2018, 8 a.m. UTC
The following changes since commit 7928b2cbe55b2a410a0f5c1f154610059c57b1b2:

  Linux 4.16-rc1 (2018-02-11 15:04:29 -0800)

are available in the Git repository at:

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

for you to fetch changes up to 67a2152c7362bd9ee3ba6d218e435a04c27c32aa:

  efi: make const array 'apple' static (2018-03-08 07:54:10 +0000)

----------------------------------------------------------------
First batch of EFI changes for v4.17:
- use efi_switch_mm() on x86 instead of manipulating %cr3 directly (Sai)
- some fixes for the apple-properties code (Andy)
- add WARN() on arm64 if UEFI Runtime Services corrupt the reserved x18
  register (Ard)
- other minor cleanups and bugfixes

----------------------------------------------------------------
Andy Shevchenko (2):
      efi/apple-properties: Device core takes care of empty properties
      efi/apple-properties: Use memremap() instead of ioremap()

Ard Biesheuvel (3):
      efi/arm*: Stop printing addresses of virtual mappings
      efi: arm64: Check whether x18 is preserved by runtime services calls
      efi: reorder pr_notice() with add_device_randomness() call

Colin Ian King (1):
      efi: make const array 'apple' static

Jia-Ju Bai (1):
      x86: efi: Replace GFP_ATOMIC with GFP_KERNEL in efi_query_variable_store

Luis de Bethencourt (1):
      efi/x86: Fix trailing semicolons

Mark Rutland (1):
      efi/arm*: Only register page tables when they exist

Sai Praneeth (3):
      efi: Use efi_mm in x86 as well as ARM
      x86/efi: Replace efi_pgd with efi_mm.pgd
      x86/efi: Use efi_switch_mm() rather than manually twiddling with %cr3

 arch/arm64/include/asm/efi.h            |  4 ++-
 arch/arm64/kernel/Makefile              |  3 +-
 arch/arm64/kernel/efi-rt-wrapper.S      | 41 +++++++++++++++++++++++
 arch/arm64/kernel/efi.c                 |  6 ++++
 arch/x86/boot/compressed/eboot.c        |  6 ++--
 arch/x86/include/asm/efi.h              | 29 ++++++++---------
 arch/x86/platform/efi/efi_64.c          | 58 ++++++++++++++++++---------------
 arch/x86/platform/efi/efi_thunk_64.S    |  2 +-
 arch/x86/platform/efi/quirks.c          |  2 +-
 drivers/firmware/efi/apple-properties.c | 20 ++++--------
 drivers/firmware/efi/arm-runtime.c      | 17 +++-------
 drivers/firmware/efi/efi.c              | 11 ++++++-
 include/linux/efi.h                     |  2 ++
 13 files changed, 125 insertions(+), 76 deletions(-)
 create mode 100644 arch/arm64/kernel/efi-rt-wrapper.S
--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Ingo Molnar March 9, 2018, 7:40 a.m. UTC | #1
* Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:

> From: Sai Praneeth <sai.praneeth.prakhya@intel.com>

> 

> Presently, only ARM uses mm_struct to manage efi page tables and efi

> runtime region mappings. As this is the preferred approach, let's make

> this data structure common across architectures. Specially, for x86,

> using this data structure improves code maintainability and readability.


> diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h

> index 85f6ccb80b91..00f977ddd718 100644

> --- a/arch/x86/include/asm/efi.h

> +++ b/arch/x86/include/asm/efi.h

> @@ -2,10 +2,14 @@

>  #ifndef _ASM_X86_EFI_H

>  #define _ASM_X86_EFI_H

>  

> +#include <linux/sched/mm.h>

> +#include <linux/sched/task.h>

> +

>  #include <asm/fpu/api.h>

>  #include <asm/pgtable.h>

>  #include <asm/processor-flags.h>

>  #include <asm/tlb.h>

> +#include <asm/mmu_context.h>

>  

>  /*

>   * We map the EFI regions needed for runtime services non-contiguously,


> diff --git a/include/linux/efi.h b/include/linux/efi.h

> index f5083aa72eae..f1b7d68ac460 100644

> --- a/include/linux/efi.h

> +++ b/include/linux/efi.h

> @@ -966,6 +966,8 @@ extern struct efi {

>  	unsigned long flags;

>  } efi;

>  

> +extern struct mm_struct efi_mm;

> +

>  static inline int

>  efi_guidcmp (efi_guid_t left, efi_guid_t right)

>  {


Ugh, I can see three problems with this patch:

1)

Why is the low level asm/efi.h header polluted with two of the biggest header 
files in existence, to add a type to _another_ header (efi.h)?

2)

Why is <linux/sched/task.h> included if what is being relied on is mm_struct?

3)

But even <linux/sched/mm.h> looks unnecessary in efi.h, a simple forward 
declaration of mm_struct would do ...

The high level MM and sched headers should be added to the actual .c files that 
make use of them.

Thanks,

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html