Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4020960ybv; Tue, 25 Feb 2020 11:36:21 -0800 (PST) X-Google-Smtp-Source: APXvYqxjSB7YUwu3qIzJt7SfDpgEVT1sLGR+bl+WLkO9Q5WqEGq2LOoiLOJCkueXbsdKKxYOm9g2 X-Received: by 2002:a9d:20c1:: with SMTP id x59mr156570ota.286.1582659380934; Tue, 25 Feb 2020 11:36:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582659380; cv=none; d=google.com; s=arc-20160816; b=rgHYmdCVWKtnUCd6bZY/CfiH/gwNPanhZEaaAsOx8rUjeUsVJ9qUdTVfqZbFd2Uc0u ZPwZTqOFU+O2DY7hoUvmsjB5yoKED1/DujUxrkjbpPf+p3vNYgyiQFMzu2t8HZp+Mybh vCh339tUtY5/wY63B/GFfxrXGUka//h3ogkyqGeAyVKqdpHJKZmgq572wKbfIueKxsek 9NDOnZuRVQDq5dwEFG/Q5wlRNm9sRoRQC9UpDN5y1zVL/OHxTkvUoOagwalSJa5dIyZR 95UcTHYrZw+qwcshcPazcmVL6yfd9rzZ4hI80aZls9K9BZiA72R/BjW7apqmjyNBkh0P k7UA== 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=4IGJNrvaJQ+NCc9i8xo5JmuxFAG9X8cpMgbuOa9uU14=; b=g6ZlYPJaxKnm3FOkroZYbuegOBspAFqn5/irFs+wtvo/VhrIb8B+6WAh84jojd2m6j tDIMGgjR0XWtUnGmX1shmRhNszhH1Zt0PtoOz1c3x2aAmFahOJxPbuNXfgJ0AB/H3RFy kPUaYZtiwP95c0d/3KiUd/GnlwfFPIMQLpA3FqUdc0vJ3039uLB8uRDiKmsog9zp0Kem 0ZthNuEO84UtWFr4QnSuGy6dIZOfZAuoy2E4clkWB561I3REKKoR/cpPcHT8cQt6SwKx gaDEkhetzoQBfWxsHhf3NBH8gfiK2WxA0bPuNAQs3Nd6QSnvyWNcO+2RRgRVG+4fWp4W QLYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AgkksRli; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j18si78866oii.42.2020.02.25.11.36.08; Tue, 25 Feb 2020 11:36:20 -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=@kernel.org header.s=default header.b=AgkksRli; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728200AbgBYT2k (ORCPT + 99 others); Tue, 25 Feb 2020 14:28:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:33562 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731421AbgBYT2k (ORCPT ); Tue, 25 Feb 2020 14:28:40 -0500 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 497F221556 for ; Tue, 25 Feb 2020 19:28:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582658919; bh=No7bnjFMpZoG5H+BKpwiXz76L973BCgC/d2751ecwag=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=AgkksRlijt51Q9tKY9iKGj+8UK0aw/qCD8zKaWMaH1HYuNrKTBq1GMeWJK8Fcylju YZIl8g2rCaS5CGhIdVSMKqYb1U3wwp0C7rwPuV1xiMhrstdqvhmmQAcSWnmIRuZmge ALwW9HV03ej2w12NvYlIi+bF+f/g7snhhaJRr3FI= Received: by mail-wr1-f48.google.com with SMTP id w12so44388wrt.2 for ; Tue, 25 Feb 2020 11:28:39 -0800 (PST) X-Gm-Message-State: APjAAAUyz4AcTcqgorpPp976ASLh49Gw4ccs/lxejYL3Ezs9WN+VL/EH TjmjTgeTYpl04F331iVOKWr21QYO0e7N0ZcJaceboQ== X-Received: by 2002:adf:e742:: with SMTP id c2mr671445wrn.262.1582658917548; Tue, 25 Feb 2020 11:28:37 -0800 (PST) MIME-Version: 1.0 References: <261ea8108c6290e95962be2638bd204f90787c1c.1582652466.git.thomas.lendacky@amd.com> <9e16fed9-4399-5c78-cbfb-6be75c295f31@amd.com> <96417897-8bf0-e60c-6285-7286673ecd01@amd.com> In-Reply-To: From: Ard Biesheuvel Date: Tue, 25 Feb 2020 20:28:26 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] x86/efi: Add additional efi tables for unencrypted mapping checks To: Tom Lendacky Cc: Linux Kernel Mailing List , "the arch/x86 maintainers" , linux-efi , platform-driver-x86@vger.kernel.org, Darren Hart , Andy Shevchenko , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" 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 Tue, 25 Feb 2020 at 20:21, Tom Lendacky wrote: > > On 2/25/20 12:12 PM, Ard Biesheuvel wrote: > > On Tue, 25 Feb 2020 at 19:10, Tom Lendacky wrote: > >> > >> On 2/25/20 11:58 AM, Ard Biesheuvel wrote: > >>> On Tue, 25 Feb 2020 at 18:54, Tom Lendacky wrote: > >>>> > >>>> On 2/25/20 11:45 AM, Ard Biesheuvel wrote: > >>>>> On Tue, 25 Feb 2020 at 18:41, Tom Lendacky wrote: > >>>>>> > >>>>>> When booting with SME active, EFI tables must be mapped unencrypted since > >>>>>> they were built by UEFI in unencrypted memory. Update the list of tables > >>>>>> to be checked during early_memremap() processing to account for new EFI > >>>>>> tables. > >>>>>> > >>>>>> This fixes a bug where an EFI TPM log table has been created by UEFI, but > >>>>>> it lives in memory that has been marked as usable rather than reserved. > >>>>>> > >>>>>> Signed-off-by: Tom Lendacky > >>>>>> > >>>>>> --- > >>>>>> Changes since v1: > >>>>>> - Re-spun against EFI tree > >>>>> > >>>>> Which one? Surely not the one in the link I included? > >>>> > >>>> I did a git clone of > >>>> > >>>> git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git > >>>> > >>>> and checked out branch next. Not sure what I missed... > >>>> > >>> > >>> Weird. Do you see commit 5d288dbd88606d8f215c7138b10649115d79cadd on > >>> that branch? It removes rng_seed from struct efi, hence my request to > >>> rebase your patch. > >> > >> I had just assumed you wanted a cleaner version and didn't realize that > >> rng_seed was removed from struct efi. My bad for not building. > >> > >>> > >>> IMO, best is to simply drop the 'static' from rng_seed, rename it to > >>> efi_rng_seed, and drop an extern declaration in linux/efi.h so it is > >>> accessible from your code. I'm reluctant to put it back in struct efi. > >> > >> Ok, I'll re-work the patch. > >> > > > > OK > > > > Btw if you want the TPM part of the fix to go to -stable, better to > > split them in two (and I'll put a cc:stable on the tpm one) > > I had thought about stable, but the fix gets tricky since the two tables > were added at different times (4.16 and 5.3) and the efi_tables array was > moved from drivers/firmware/efi/efi.c to arch/x86/platform/efi/efi.c in 5.4. > > I could do the two TPM tables each as their own patch and add an > appropriate Cc: stable # v4.16.x-, etc., if you don't think that's > overkill. The array move shouldn't be too hard to adjust for in stable. > Thoughts? > So v5.4/v5.5 seems straight-forward then, no? Once that one is in, we can do one specially for v4.19