public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH] arm64/efi: use stable virtual mappings for UEFI runtime services
Date: Tue, 14 Oct 2014 11:42:21 +0100	[thread overview]
Message-ID: <20141014104221.GI16598@leverpostej> (raw)
In-Reply-To: <20141014021721.GA4201@darkstar.nay.redhat.com>

On Tue, Oct 14, 2014 at 03:17:21AM +0100, Dave Young wrote:
> Hi, Geoff
> 
> On 10/13/14 at 03:52pm, Geoff Levand wrote:
> > Hi Ard,
> > 
> > On Wed, 2014-10-08 at 19:38 +0200, Ard Biesheuvel wrote:
> > > I haven't tested this code under kexec myself, but I have confirmed that
> > > the runtime services work as expected (rtc-efi and efivars). The comments
> > > that Mark Salter and Will Deacon gave on the id mapping patch here
> > 
> > I applied this patch to my kexec master branch [1] and tested a basic
> > kexec re-boot using the FVP_Base_AEMv8A-AEMv8A_0.8_5602 model and the
> > 14.09 LEG EFI build.
> > 
> > It crashes when the 2nd stage kernel is starting up on the first
> > dereference of the c16 variable in uefi_init():
> > 
> >   c16 = early_memremap(efi.systab->fw_vendor, sizeof(vendor));
> >   if (c16) {
> >     for (i = 0; i < (int) sizeof(vendor) - 1 && *c16; ++i) {
> >                                                 ^^^^ crashes here
> > 
> > early_memremap() returns 0xFFFFFFBFFBCBF618, and the dereference
> > starts the crash.  I did not look into it further.
> 
> This is an expected behaviour as I mentioned before, we need save fw_vendor
> and the other two physical addresses and pass them to 2nd kernel.
> 
> UEFI firmware will convert them to virtual address after entering virtual mode.

So long as we know they are virtual addresses (implied by whatever way
we detect we're in virtual mode), and we know the virt->phys mappings
(which are in the EFI memmap passed via the DTB), we should be able to
figure out those physical addresses without having to pass them
explicitly, regardless of what mapping is used.

Mark.

  parent reply	other threads:[~2014-10-14 10:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-08 17:38 [RFC PATCH] arm64/efi: use stable virtual mappings for UEFI runtime services Ard Biesheuvel
2014-10-13 22:52 ` Geoff Levand
2014-10-14  2:17   ` Dave Young
2014-10-14 10:26     ` Ard Biesheuvel
2014-10-14 12:44       ` Vivek Goyal
2014-10-14 13:55         ` Ard Biesheuvel
2014-10-14 16:53       ` Geoff Levand
2014-10-14 22:26         ` Ard Biesheuvel
2014-10-14 10:42     ` Mark Rutland [this message]
2014-10-15  7:08       ` Dave Young

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=20141014104221.GI16598@leverpostej \
    --to=mark.rutland@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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