linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Alex Thorlton <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: matt@codeblueprint.co.uk, peterz@infradead.org,
	roy.franz@linaro.org, mingo@kernel.org, catalin.marinas@arm.com,
	sivanich@sgi.com, athorlton@sgi.com, rja@sgi.com,
	tglx@linutronix.de, torvalds@linux-foundation.org,
	linux@armlinux.org.uk, mark.rutland@arm.com,
	ard.biesheuvel@linaro.org, hpa@zytor.com,
	linux-kernel@vger.kernel.org, will.deacon@arm.com
Subject: [tip:efi/core] x86/uv: Update uv_bios_call() to use efi_call_virt_pointer()
Date: Mon, 27 Jun 2016 06:02:33 -0700	[thread overview]
Message-ID: <tip-d1be84a232e359ca9456c63e72cb0082d68311b6@git.kernel.org> (raw)
In-Reply-To: <1466839230-12781-6-git-send-email-matt@codeblueprint.co.uk>

Commit-ID:  d1be84a232e359ca9456c63e72cb0082d68311b6
Gitweb:     http://git.kernel.org/tip/d1be84a232e359ca9456c63e72cb0082d68311b6
Author:     Alex Thorlton <athorlton@sgi.com>
AuthorDate: Sat, 25 Jun 2016 08:20:28 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 27 Jun 2016 13:06:56 +0200

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

Now that the efi_call_virt() macro has been generalized to be able to
use EFI system tables besides efi.systab, we are able to convert our
uv_bios_call() wrapper to use this standard EFI callback mechanism.

This simple change is part of a much larger effort to recover from some
issues with the way we were mapping in some of our MMRs, and the way
that we were doing our BIOS callbacks, which were uncovered by commit
67a9108ed431 ("x86/efi: Build our own page table structures").

The first issue that this uncovered was that we were relying on the EFI
memory mapping mechanism to map in our MMR space for us, which, while
reliable, was technically a bug, as it relied on "undefined" behavior in
the mapping code.

The reason we were able to piggyback on the EFI memory mapping code to
map in our MMRs was because, previously, EFI code used the
trampoline_pgd, which shares a few entries with the main kernel pgd.  It
just so happened, that the memory range containing our MMRs was inside
one of those shared regions, which kept our code working without issue
for quite a while.

Anyways, once we discovered this problem, we brought back our original
code to map in the MMRs with commit:

  08914f436bdd ("x86/platform/UV: Bring back the call to map_low_mmrs in uv_system_init")

This got our systems a little further along, but we were still running
into trouble with our EFI callbacks, which prevented us from booting
all the way up.

Our first step towards fixing the BIOS callbacks was to get our
uv_bios_call() wrapper updated to use efi_call_virt() instead of the plain
efi_call().  The previous patch took care of the effort needed to make
that possible.  Along the way, we hit a major issue with some confusion
about how to properly pull arguments higher than number 6 off the stack
in the efi_call() code, which resulted in the following commit from Linus:

  683ad8092cd2 ("x86/efi: Fix 7-parameter efi_call()s")

Now that all of those issues are out of the way, we're able to make this
simple change to use the new efi_call_virt_pointer() in uv_bios_call()
which gets our machines booting, running properly, and able to execute our
callbacks with 6+ arguments.

Note that, since we are now using the EFI page table when we make our
function call, we are no longer able to make the call using the __va()
of our function pointer, since the memory range containing that address
isn't mapped into the EFI page table.  For now, we will use the physical
address of the function directly, since that is mapped into the EFI page
table.  In the near future, we're going to get some code added in to
properly update our function pointer to its virtual address during
SetVirtualAddressMap.

Signed-off-by: Alex Thorlton <athorlton@sgi.com>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Dimitri Sivanich <sivanich@sgi.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Roy Franz <roy.franz@linaro.org>
Cc: Russ Anderson <rja@sgi.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/1466839230-12781-6-git-send-email-matt@codeblueprint.co.uk
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/platform/uv/bios_uv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/platform/uv/bios_uv.c b/arch/x86/platform/uv/bios_uv.c
index 815fec6..66b2166 100644
--- a/arch/x86/platform/uv/bios_uv.c
+++ b/arch/x86/platform/uv/bios_uv.c
@@ -40,8 +40,7 @@ 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((void *)__va(tab->function), (u64)which,
-			a1, a2, a3, a4, a5);
+	ret = efi_call_virt_pointer(tab, function, (u64)which, a1, a2, a3, a4, a5);
 	return ret;
 }
 EXPORT_SYMBOL_GPL(uv_bios_call);

  reply	other threads:[~2016-06-27 13:04 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-25  7:20 [GIT PULL 0/7] EFI changes for v4.8 Matt Fleming
2016-06-25  7:20 ` [PATCH 1/7] efibc: Report more information in the error messages Matt Fleming
2016-06-27 13:00   ` [tip:efi/core] " tip-bot for Compostella, Jeremy
2016-06-25  7:20 ` [PATCH 2/7] efi: Document #define FOO_PROTOCOL_GUID layout Matt Fleming
2016-06-27 10:49   ` Ingo Molnar
2016-06-27 11:14     ` Joe Perches
2016-07-04 13:17     ` Matt Fleming
2016-07-08 13:27     ` [tip:efi/core] efi: Reorganize the GUID table to make it easier to read tip-bot for Ingo Molnar
2016-06-27 13:01   ` [tip:efi/core] efi: Document #define FOO_PROTOCOL_GUID layout tip-bot for Peter Jones
2016-06-25  7:20 ` [PATCH 3/7] x86/efi: Remove unused variable efi Matt Fleming
2016-06-27 13:01   ` [tip:efi/core] x86/efi: Remove unused variable 'efi' tip-bot for Colin Ian King
2016-06-25  7:20 ` [PATCH 4/7] efi: Convert efi_call_virt to efi_call_virt_pointer Matt Fleming
2016-06-27 11:00   ` Ingo Molnar
2016-06-27 11:22     ` Mark Rutland
2016-07-04 13:18     ` Matt Fleming
2016-06-27 13:02   ` [tip:efi/core] efi: Convert efi_call_virt() to efi_call_virt_pointer() tip-bot for Alex Thorlton
2016-06-25  7:20 ` [PATCH 5/7] x86/uv: Update uv_bios_call to use efi_call_virt_pointer Matt Fleming
2016-06-27 13:02   ` tip-bot for Alex Thorlton [this message]
2016-06-25  7:20 ` [PATCH 6/7] x86/efi: Update efi_thunk to use the the arch_efi_call_virt* macros Matt Fleming
2016-06-27 13:02   ` [tip:efi/core] x86/efi: Update efi_thunk() to use the the arch_efi_call_virt*() macros tip-bot for Alex Thorlton
2016-06-25  7:20 ` [PATCH 7/7] x86/efi: Remove unused efi_get_time function Matt Fleming
2016-06-27 13:03   ` [tip:efi/core] x86/efi: Remove the unused efi_get_time() function tip-bot for Arnd Bergmann

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=tip-d1be84a232e359ca9456c63e72cb0082d68311b6@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=athorlton@sgi.com \
    --cc=catalin.marinas@arm.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=matt@codeblueprint.co.uk \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rja@sgi.com \
    --cc=roy.franz@linaro.org \
    --cc=sivanich@sgi.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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).