public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] x86/platform/UV: Fix support for EFI_OLD_MEMMAP after BIOS callback updates
@ 2016-10-20  1:48 Alex Thorlton
  2016-10-20 12:26 ` Matt Fleming
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Alex Thorlton @ 2016-10-20  1:48 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alex Thorlton, Mike Travis, Russ Anderson, Dimitri Sivanich,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Matt Fleming,
	Masahiro Yamada, x86

Some time ago, we brought our UV BIOS callback code up to speed with the
new EFI memory mapping scheme, in commit:

    d1be84a232e3 ("x86/uv: Update uv_bios_call() to use efi_call_virt_pointer()")

By leveraging some changes that I made to a few of the EFI runtime
callback mechanisms, in commit:

    80e75596079f ("efi: Convert efi_call_virt() to efi_call_virt_pointer()")

This got everything running smoothly on UV, with the new EFI mapping
code.  However, this left one, small loose end, in that EFI_OLD_MEMMAP
(a.k.a. efi=old_map) will no longer work on UV, on kernels that include
the aforementioned changes.

At the time this was not a major issue (in fact, it still really isn't),
but there's no reason that EFI_OLD_MEMMAP *shouldn't* work on our
systems.  This commit adds a check into uv_bios_call, to see if we have
the EFI_OLD_MEMMAP bit set in efi.flags.  If it is set, we fall back to
using our old callback method, which uses efi_call directly on the __va
of our function pointer.

v2: Invert if-statement and add unlikely() hint.

Signed-off-by: Alex Thorlton <athorlton@sgi.com>
Cc: Mike Travis <travis@sgi.com>
Cc: Russ Anderson <rja@sgi.com>
Cc: Dimitri Sivanich <sivanich@sgi.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: x86@kernel.org
---
 arch/x86/platform/uv/bios_uv.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/x86/platform/uv/bios_uv.c b/arch/x86/platform/uv/bios_uv.c
index b4d5e95..d1f7422 100644
--- a/arch/x86/platform/uv/bios_uv.c
+++ b/arch/x86/platform/uv/bios_uv.c
@@ -40,7 +40,15 @@ s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5)
 		 */
 		return BIOS_STATUS_UNIMPLEMENTED;
 
-	ret = efi_call_virt_pointer(tab, function, (u64)which, a1, a2, a3, a4, a5);
+	/*
+	 * If EFI_OLD_MEMMAP is set, we need to fall back to using our old EFI
+	 * callback method, which uses efi_call directly, with the kernel page tables.
+	 */
+	if (unlikely(test_bit(EFI_OLD_MEMMAP, &efi.flags)))
+		ret = efi_call((void *)__va(tab->function), (u64)which, a1, a2, a3, a4, a5);
+	else
+		ret = efi_call_virt_pointer(tab, function, (u64)which, a1, a2, a3, a4, a5);
+
 	return ret;
 }
 EXPORT_SYMBOL_GPL(uv_bios_call);
-- 
1.8.5.6

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

end of thread, other threads:[~2016-10-31 18:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-20  1:48 [PATCH v2] x86/platform/UV: Fix support for EFI_OLD_MEMMAP after BIOS callback updates Alex Thorlton
2016-10-20 12:26 ` Matt Fleming
2016-10-21  5:48 ` [tip:x86/urgent] " tip-bot for Alex Thorlton
2016-10-25  6:46 ` [lkp] [x86/platform/UV] 71854cb812: will-it-scale.per_thread_ops -2.3% regression kernel test robot
2016-10-25 10:57   ` Thomas Gleixner
2016-10-27  1:55     ` Ye Xiaolong
2016-10-27 22:37       ` Thomas Gleixner
2016-10-31  5:41         ` [LKP] " Fengguang Wu
2016-10-31 18:19           ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox