Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3197378imu; Mon, 17 Dec 2018 15:18:05 -0800 (PST) X-Google-Smtp-Source: AFSGD/V80Tgwr8gGDPeEvRPKgLXjALo3n4tRpXfYVvPRoO4zAJ0E6PM2cNjM02rJldk8lxlFNXp2 X-Received: by 2002:a62:6143:: with SMTP id v64mr14490740pfb.142.1545088685023; Mon, 17 Dec 2018 15:18:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545088684; cv=none; d=google.com; s=arc-20160816; b=ILwiU0csB8Hybow2MXgf72AdmXESC2N7rfGIndbVn6LkJFJbqTe9tuz1UdaDGm0aBx kna4g7Ruv7o6jNhjafEC9g3buXnql+xyNoOKyGaYeaD/0f6/NWZ9mGgTjn4atrC1gid9 5ER4oFpEr1PiXwaO0pyQWeeCER5Zhxeo56fcYuKGUHZ/tU/pevvq6w0uNDR3rCaa84CJ BJuHLgy64MgrN9DD/DGOyBrWzGWOnZHr6r15kNffxXikn67Y/EAO3P5wFjCkm4wwrSKO SUHfS6ZAFihsmz0mZ5aV9k/aY08WUt9m+wKKaZfPZi6V4cSFI6EGsyJ2cjrM6girSCAf /t3A== 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=cg/drGNrJvWSVvhwSllUP1bylbyWPMkVlihtmXoDqKE=; b=P+D8HZ8awEMDzWfxR+SExbXLY2MCkvzs1vCoKSGw72vNqRlalBDbiuSs1f23j+EiwR HaCKs1LSRnpAEdSQ2/vWQNt2j+yyTbKWE0LBin06+i03k5qRFNJCbegxWZsd/CoHShYQ BXIZ2Kmo+tYTLBjOiW0QiT72wZ5FfwcsewZ5IJZFd1zF0Iu4RihVbhU08f7/IU2EnXmW APT5iBkERTIihonnG0h1eB2iY4WVX+WJKfhcmnijqpD2Zxgsx2WyxwqvSenuYJPXvDYN 1G7R949tmAHlCcH2dZsJ7cY6XDaZyU5VyXbSLoBiqYEozABFHXdeveKIcadV3lRnFRnE xdHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eGZ3PG4X; 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 u69si12761093pfj.219.2018.12.17.15.17.49; Mon, 17 Dec 2018 15:18:04 -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=eGZ3PG4X; 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 S2388265AbeLQTfu (ORCPT + 99 others); Mon, 17 Dec 2018 14:35:50 -0500 Received: from mail-it1-f196.google.com ([209.85.166.196]:50443 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727641AbeLQTfu (ORCPT ); Mon, 17 Dec 2018 14:35:50 -0500 Received: by mail-it1-f196.google.com with SMTP id z7so659176iti.0 for ; Mon, 17 Dec 2018 11:35:49 -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=cg/drGNrJvWSVvhwSllUP1bylbyWPMkVlihtmXoDqKE=; b=eGZ3PG4XF/xoPxCtYsXDY+LFzEyLNh854EoG3J5j/7o+oPzU8hywE1h0ZpA7jF2tCw qrn6Z1Lrk+Frhg1JbKkjGyAgGWBR8vcITYaCQfT5vcs2O9RbIPIaO3Fj+pl1xBnoDPWS +50UoS2TX9sOL/CQ6G3/GfFOG5/oWUK6zE4is= 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=cg/drGNrJvWSVvhwSllUP1bylbyWPMkVlihtmXoDqKE=; b=UNecDdbKtdrEaS7x9rzxB2H062e0xYluwk6FF9BllytrUSH4Nj4K0giCx331rpeio1 qFX5gvWzWo+9hQ4fAKBYDnwO/0zuy3eRwgHL/RacnPpV8XcY8jBytaW1bp9r+fGk/h26 up2dLfDaMLwE3dlPk3HYJvImGR5796WzFzPZSf4GJZfjgZH5vXrE99mguv5d5YqhEeoc Vb06Ff1S6MVD2aQumOAXha0SXh1QElDwInjlC9m1Da+NksnHPaBRZbPKz83MFtSLDJl6 iJBI5CSjp5qRt+TDxyF1yHxVgRGvsQRdBrc26Ki3kRDYEWS0mxILM1ph7tq7N0lYQnvs n/Ng== X-Gm-Message-State: AA+aEWbcsSXyZK4g1H2V7J//5agq/0emWK4/43BoyQwueCGxQY52k5M0 WuX65TSjzlhWwPhxZEX/eEMdd3y/8JAbVGtb9LYkYHyAr5I= X-Received: by 2002:a24:edc4:: with SMTP id r187mr437561ith.158.1545075348901; Mon, 17 Dec 2018 11:35:48 -0800 (PST) MIME-Version: 1.0 References: <20181129171230.18699-6-ard.biesheuvel@linaro.org> In-Reply-To: From: Ard Biesheuvel Date: Mon, 17 Dec 2018 20:35:37 +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 19:42, 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.