linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] EFI urgent fix
@ 2015-11-04 10:47 Matt Fleming
  2015-11-04 10:47 ` [PATCH] x86/setup: Fix recent boot crash on 32-bit SMP machines Matt Fleming
       [not found] ` <1446634037-10251-1-git-send-email-matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
  0 siblings, 2 replies; 3+ messages in thread
From: Matt Fleming @ 2015-11-04 10:47 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H . Peter Anvin
  Cc: Matt Fleming, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-efi-u79uwXL29TY76Z2rM5mHXA, Andy Lutomirski,
	Borislav Petkov, Huang, Ying, Laszlo Ersek, Paolo Bonzini,
	stable-u79uwXL29TY76Z2rM5mHXA

Folks, the LKP robot reported an issue with Paolo's recent bug fix
that syncs the identity mapping in 'initial_page_table'. Turns out
that KERNEL_PGD_PTRS is not the correct constant to use when copying
to the lower region because that's every PGD from PAGE_OFFSET to the
end of the addressable memory.

Crucially, KERNEL_PGD_PTRS > KERNEL_PGD_BOUNDARY and so the patch ends
up trashing some of the kernel mappings in 'initial_page'table,
leading to boot crashes on 32-bit SMP when bringing APs online.

The following changes since commit 9ee870feaa9e0c6abef95a3b1fc518d88adfa2d3:

  Merge branch 'x86/cpufeature' into x86/urgent, to pick up pending Intel MID change (2015-11-03 12:00:40 +0100)

are available in the git repository at:

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

for you to fetch changes up to 5965d1bbeba70fe3626e4537f4729283cb0e75f7:

  x86/setup: Fix recent boot crash on 32-bit SMP machines (2015-11-04 09:26:24 +0000)

----------------------------------------------------------------
 * Avoid trashing the kernel mappings in 'initial_page_table' when
   copying the identity mapping from 'swapper_pg_dir'. This bug was
   introduced by a bug fix in v4.3 which erroneously copies too many
   entries from 'swapper_pg_dir'.

----------------------------------------------------------------
Matt Fleming (1):
      x86/setup: Fix recent boot crash on 32-bit SMP machines

 arch/x86/kernel/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

* [PATCH] x86/setup: Fix recent boot crash on 32-bit SMP machines
  2015-11-04 10:47 [GIT PULL] EFI urgent fix Matt Fleming
@ 2015-11-04 10:47 ` Matt Fleming
       [not found] ` <1446634037-10251-1-git-send-email-matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
  1 sibling, 0 replies; 3+ messages in thread
From: Matt Fleming @ 2015-11-04 10:47 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H . Peter Anvin
  Cc: Matt Fleming, linux-kernel, linux-efi, Paolo Bonzini,
	Laszlo Ersek, stable, Borislav Petkov, Andy Lutomirski,
	Huang, Ying

The LKP test robot reported that the bug fix in commit f5f3497cad8c
("x86/setup: Extend low identity map to cover whole kernel range")
causes CONFIG_X86_32 SMP machines to crash on boot when trying to
bring AP cpus online.

The above commit erroneously copies too many of the PGD entries to the
low memory region of 'identity_page_table', resulting in some of the
kernel mappings for PAGE_OFFSET being trashed because,

  KERNEL_PGD_PTRS > KERNEL_PGD_BOUNDARY

The maximum number of PGD entries we can copy without corrupting the
kernel mapping is KERNEL_PGD_BOUNDARY or pgd_index(PAGE_OFFSET).

Reported-by: Huang, Ying <ying.huang@intel.com>
Tested-by: Huang, Ying <ying.huang@intel.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: <stable@vger.kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
---
 arch/x86/kernel/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index a3cccbfc5f77..2b8cbd693da8 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -1180,7 +1180,7 @@ void __init setup_arch(char **cmdline_p)
 	 */
 	clone_pgd_range(initial_page_table,
 			swapper_pg_dir     + KERNEL_PGD_BOUNDARY,
-			KERNEL_PGD_PTRS);
+			KERNEL_PGD_BOUNDARY);
 #endif
 
 	tboot_probe();
-- 
2.6.2

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

* Re: [GIT PULL] EFI urgent fix
       [not found] ` <1446634037-10251-1-git-send-email-matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
@ 2015-11-04 10:50   ` Thomas Gleixner
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Gleixner @ 2015-11-04 10:50 UTC (permalink / raw)
  To: Matt Fleming
  Cc: Ingo Molnar, H . Peter Anvin, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-efi-u79uwXL29TY76Z2rM5mHXA, Andy Lutomirski,
	Borislav Petkov, Huang, Ying, Laszlo Ersek, Paolo Bonzini,
	stable-u79uwXL29TY76Z2rM5mHXA

On Wed, 4 Nov 2015, Matt Fleming wrote:
> for you to fetch changes up to 5965d1bbeba70fe3626e4537f4729283cb0e75f7:
> 
>   x86/setup: Fix recent boot crash on 32-bit SMP machines (2015-11-04 09:26:24 +0000)

I just picked that up manually :)

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

end of thread, other threads:[~2015-11-04 10:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-04 10:47 [GIT PULL] EFI urgent fix Matt Fleming
2015-11-04 10:47 ` [PATCH] x86/setup: Fix recent boot crash on 32-bit SMP machines Matt Fleming
     [not found] ` <1446634037-10251-1-git-send-email-matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2015-11-04 10:50   ` [GIT PULL] EFI urgent fix Thomas Gleixner

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