From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753812Ab3J2Jkm (ORCPT ); Tue, 29 Oct 2013 05:40:42 -0400 Received: from mail.skyhub.de ([78.46.96.112]:55121 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751168Ab3J2Jkk (ORCPT ); Tue, 29 Oct 2013 05:40:40 -0400 Date: Tue, 29 Oct 2013 10:40:34 +0100 From: Borislav Petkov To: Dave Young Cc: X86 ML , LKML , Borislav Petkov , Matt Fleming , Matthew Garrett , "H. Peter Anvin" , James Bottomley , Vivek Goyal , linux-efi@vger.kernel.org, fwts-devel@lists.ubuntu.com Subject: Re: [PATCH 12/12] EFI: Runtime services virtual mapping Message-ID: <20131029094033.GA10972@pd.tnic> References: <1379602494-26684-1-git-send-email-bp@alien8.de> <20131008164551.GB16793@pd.tnic> <20131008164831.GD16793@pd.tnic> <20131029064720.GA16009@dhcp-16-126.nay.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20131029064720.GA16009@dhcp-16-126.nay.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 29, 2013 at 02:47:20PM +0800, Dave Young wrote: > Boris, could you update the comment? it says below: update that memory > descriptor with the virtual address obtained from ioremap(). > > Logiclly your patch should update it, then my patch update it again > with the case of mapping to fixed address for kexec. Thanks for catching this, I ended up doing the following: /* * This function will switch the EFI runtime services to virtual mode. * Essentially, we look through the EFI memmap and map every region that * has the runtime attribute bit set in its memory descriptor into the * ->trampoline_pgd page table using a top-down VA allocation scheme. * * The old method which used to update that memory descriptor with the * virtual address obtained from ioremap() is still supported when the * kernel is booted with efi=old_map on its command line. Same old * method enabled the runtime services to be called without having to * thunk back into physical mode for every invocation. * * The new method does a pagetable switch in a preemption-safe manner * so that we're in a different address space when calling a runtime * function. For function arguments passing we do copy the PGDs of the * kernel page table into ->trampoline_pgd prior to each call. */ -- Regards/Gruss, Boris. Sent from a fat crate under my desk. Formatting is fine. --