Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2127987imu; Sat, 22 Dec 2018 12:59:34 -0800 (PST) X-Google-Smtp-Source: ALg8bN6DzM9+bC/nnIXeo6GoHvoNuoZUwPfNVihb3D3YhVe6apgXMEdT2/vASiFwCVnN6CodssLX X-Received: by 2002:a17:902:380c:: with SMTP id l12mr7517871plc.326.1545512374418; Sat, 22 Dec 2018 12:59:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545512374; cv=none; d=google.com; s=arc-20160816; b=CtvtnXZaal78SQ+qmeb+fWiqFeUDfiEr0hDF3SSDCVEmcYbWt+qx0txj91zW49O8sL XKQ9ZpfLpLJhzTi5U7D4wL+9S/xpAKcqB8tbCbprV0BQ5D3sUWan+b+i3nSXo49KvpPN 8fdjA3Iwnchv4XR79brMSIsvMh1fGISqXm67wQncptYaIvr/xxRrMmdSBeU6tvCJQtll Sd4sE2JD8XqPCuNhnKlwYKzSSnukwPwJnPfuAP50pB4MfNaZgm6O2deVt/MO4nfQWoME WWnA4wA7I8+JPt2psMyQB+0tPqAHb0gwyeRXzpcwyVIdHfMnZIY+bT29XMfJGKITRPNU NNcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=IzQBByhyVxr6B7tP3LVzT6f1RBXwylr67AU8NIgZ0/8=; b=QhsZ7e6MjwJOXSiTq+gOg1LbgKlH5nC8UMf4HpaxZB6KBGXCbLsmQmE+jhBdRSKceB f65+S+4m7v7UMTznCaruwe0ecDQvTvZ+HrRNXD0l2XL2027vkCskYdGMUqh2C6Y/yaU0 9j017zmomzU/VwMzi84DNM1VyJ7U5UFEZ+8sKnEGOpx/7GCbICzGLGMPThCP7LtyCGXQ st5MVX44zsnAbxkNc7U5DtHLKinHmIRlxgExe8TEoYY87C5AmYA0rGm78GqEQbjkNxj7 DhZDvOeAT34X6WKz30rGd5VjVUYiCkMDN8wdLxzWu/i4K7gw+21nevJA6XeIdExPTCq3 8LIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ORjvkQQS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t75si23973964pfi.193.2018.12.22.12.58.27; Sat, 22 Dec 2018 12:59:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ORjvkQQS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389808AbeLURCn (ORCPT + 99 others); Fri, 21 Dec 2018 12:02:43 -0500 Received: from mail-io1-f67.google.com ([209.85.166.67]:36947 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389352AbeLURCm (ORCPT ); Fri, 21 Dec 2018 12:02:42 -0500 Received: by mail-io1-f67.google.com with SMTP id r7so146449iog.4 for ; Fri, 21 Dec 2018 09:02:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IzQBByhyVxr6B7tP3LVzT6f1RBXwylr67AU8NIgZ0/8=; b=ORjvkQQSrOElg406Bv0bYKlXEk6/c78VOYwErxnwrulOAlXFj7fOYX/86EgnsgxgEj 1coa+829qlrpqqVr0N2gFknNC/Id4AjZr/UhIJvYHB4fW1ks3XIpylWRa2PfREt2ZOU+ NOLRyP2KdiMOYwacc4O+076jC5VHhO6r7wqq4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IzQBByhyVxr6B7tP3LVzT6f1RBXwylr67AU8NIgZ0/8=; b=brVOInCoBkBeDSZ9+oi2t1xTm93utodIN+UtTxh96KH4ETRlmq7EtYhyz2KnynS8nb tn1etP76d6djBcdyvHej3h8HhN04Kq1NGUaa76E61+KkaomYVJgPkdj3EPqrJMcXfGs0 OdrIM721LzHNR1Rxjt62o3Cozlv1jwOTgUYRmfNLLwT7Lu5CskbcVjTtSc9aNnS+O7hS bziAOgay3BGh2V/GuDt8Gxyxdrpp464+ehEOHwQxsjo0KXgwHje89j8BZad5qJslYBJz VvqbpIaW4nhwrN3fxVBQdrDE5TCRE43eV9qfzS1DX80+hEsHxI+p69E2iNUCPXDaPZFV CP+g== X-Gm-Message-State: AJcUukeOuZjWE175qTcAPJ2OVs0fewVzp/dZupfWwf5FWRFgUHSUmlID k/Lt0rnDyzuMh9lp25HWSWQCHJHlTjvvMnWAQ6FyCq+jae4= X-Received: by 2002:a5d:8417:: with SMTP id i23mr271981ion.173.1545411761597; Fri, 21 Dec 2018 09:02:41 -0800 (PST) MIME-Version: 1.0 References: <20181129171230.18699-6-ard.biesheuvel@linaro.org> In-Reply-To: From: Ard Biesheuvel Date: Fri, 21 Dec 2018 18:02:29 +0100 Message-ID: Subject: Re: [tip:efi/core] x86/efi: Unmap EFI boot services code/data regions from efi_pgd To: "Prakhya, Sai Praneeth" Cc: Ingo Molnar , "tglx@linutronix.de" , "x86@kernel.org" , "bp@alien8.de" , "marc.zyngier@arm.com" , "eric.snowberg@oracle.com" , "hdegoede@redhat.com" , "Hansen, Dave" , "peterz@infradead.org" , "hpa@zytor.com" , "arend.vanspriel@broadcom.com" , "julien.thierry@arm.com" , "bhsharma@redhat.com" , "jonathanh@nvidia.com" , "joe@perches.com" , "matt@codeblueprint.co.uk" , "torvalds@linux-foundation.org" , "natechancellor@gmail.com" , "luto@kernel.org" , "linux-kernel@vger.kernel.org" , "sedat.dilek@gmail.com" , "zhuyifei1999@gmail.com" , "linux-tip-commits@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 17 Dec 2018 at 20:48, Prakhya, Sai Praneeth wrote: > > > > > > Hi Thomas and Ingo, > > > > > > > > > > I recently noticed that the below commits [1] and [2] are broken > > > > > when kernel command line argument "efi=old_map" is passed. Sorry! > > > > > I missed to test this condition prior to sending these patches to mailing list. > > > > > I am working on a fix and will send it to mailing list as soon as it's ready. > > > > > > > > > > > > > Could you elaborate on the problem please? > > > > > > Sure! My bad.. > > > > > > Little bit of history here: > > > Boris with this patch set [1] introduced statically mapping EFI > > > Runtime Services at -4G and also introduced "efi=old_map" to return to > > > previous EFI functionality which used ioremap and __va(pa). > > > > > > [3] and [4] are links to old_map_region() > > > > > > The commit 08cfb38f3ef4 ("x86/efi: Unmap EFI boot services code/data > > > regions from efi_pgd"), unmaps EFI boot services code/data regions > > > *only* from efi_pgd but efi=old_map maps EFI boot services code/data > > > regions into swapper_pgd. Also, efi=old_map uses either > > > ioremap() or __va(md->phys_addr) to map EFI runtime/boot time services and > > doesn't use kernel_map_pages_in_pgd(). > > > > > > So, we need a different unmapping routine to unmap EFI boot services > > > code/data regions from swapper_pgd if they were mapped using efi=old_map. > > > > > > > For the short term, could we simply make your changes dependent on efi != > > old_map? That gives us some time to fix the old_map case properly. > > Yes, I think we could and it should work but I hesitated to propose it because > (as you already noted) it's a short term fix and not the right fix. > What is the status here? > Alternatively, we could also evaluate if we need to support efi=old_map case going further. > I thought dropping it would be a bad idea because it changes kernel user visible interface > (because it's a kernel command line argument) and never brought it up. > Not sure what Thomas, Ingo or Linus might think about dropping a kernel command line > argument. > Dropping a command line argument is not a problem in itself, unless anyone is actively using it :-) As far as I can tell, the SGI x86 UV platforms still rely on this, so we're stuck with it for the foreseeable future. This means we need a fixes that makes your unmapping code conditional on !old_memmap. Do you have an ETA for that?