Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp848425iog; Wed, 15 Jun 2022 13:49:58 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vdQVCDn3eVmKcV5MUzjRos/IrzGFk2HS1FcLJ0UIIiwA5dq4BsqMHjYMzWf8llJuvenh6F X-Received: by 2002:a17:902:f302:b0:168:d1fd:3013 with SMTP id c2-20020a170902f30200b00168d1fd3013mr1141367ple.29.1655326197816; Wed, 15 Jun 2022 13:49:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655326197; cv=none; d=google.com; s=arc-20160816; b=GSYngPHBIdmgtQbdXKplgmWbFtKf3x6HXdOXH7HBtP8y4z2kpKOG62Cg7fFH6zW+nL qTdQhPncOHPvqda61QcTEXXTKM/dOB8domJHZxAKcOU0sVn8YPhTdXTPquXfa/3K15K4 83KdB1S551Ch7mDyuVWY0x/mUpgfVA+s7w7rSORk4uf0u2M/5GRizQrZXC/z4Km7Ho0X lAycvcF5XQjkgtRgGs17FNyLmgM8/m4YFyH7zb3MAmnNBloYSDMczglhUu8Qw8v6OKl3 8xCBz96GAFoNiM3QpqAsNIm/RWbvoUTyu02lPNQXt2ap9wmuUrxsIMdu7pA4N4cEpgzT SSig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature; bh=qa3tsYK2bljXrt3Mkxfz0grFVBOVa6KK4MmffPa/HZs=; b=H4kaW4Bfm+cZR/fEgFVSGcxuMrwRmXywd8wew6s+NviXT+1kjBmytNHgk6x5YElZ9m 9BwXLiqXbSUl17O7D5kCri5eFhvM4Sn/GRF6QCYUZ1rMdpVoRhby9vwiSriFbpqyPKjw pZXddB6Q/Tx9dUaYF4tSlsQeoS2dxCMDx+CXMj8MD1vYS3XhkxXNaLNk4iCfe0SshdQd HotuWFrrVu38md2Ul92r+UXQy0Em7z5ziktyyrEVhuNikHcESZPsDH9ik1cYtuyG15h/ WRZThNcR3KiYnjVYEsZP6Q3SndAHgO8aKtcAGwskbvaK6ssjepswUaS4jJInXGEiutb2 iJvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@eclypsium.com header.s=google header.b=RX18Xnnf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=eclypsium.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u186-20020a6279c3000000b0050d2da2e380si253868pfc.47.2022.06.15.13.49.45; Wed, 15 Jun 2022 13:49:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@eclypsium.com header.s=google header.b=RX18Xnnf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=eclypsium.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346385AbiFOUsu (ORCPT + 99 others); Wed, 15 Jun 2022 16:48:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346329AbiFOUsk (ORCPT ); Wed, 15 Jun 2022 16:48:40 -0400 Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54E5D54F80 for ; Wed, 15 Jun 2022 13:48:36 -0700 (PDT) Received: by mail-yb1-xb2a.google.com with SMTP id l204so22537729ybf.10 for ; Wed, 15 Jun 2022 13:48:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eclypsium.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=qa3tsYK2bljXrt3Mkxfz0grFVBOVa6KK4MmffPa/HZs=; b=RX18XnnfqjfkM7VzGEEtNwFnp9OLKHeAAzouCcexVXysP2zke5k1vt4V+P62kKD1nx TGGY6CwUOsIqQu7kYnQlucj4iszPS9+Q1PuHOCOFXWzBW4s6s521IumeVVkFLllSeaAJ /Vsac2wvJ6G4zIQenT3j2ZhDPDn/Tpp+gd2no3DpbR6U6U6/+BgWYTo054K0966aKwvj WcIr0GcR1pngLv0/yeHnjj48jx14ft+D/bQLBdOUGwu1HnynsZLXRg+uoYnnyAPTL7P8 krZcbM7mpBudQ3y8HAz5Z7P3zDEV6MFKqaLCnc45hfD2KLIJSZzeKA919PcsYRYJJi5e 8uTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=qa3tsYK2bljXrt3Mkxfz0grFVBOVa6KK4MmffPa/HZs=; b=5Uxr09TiFLfEZdXAztqN8llcBgRimevgIuwrTGOzhNF2qCshIoUs3T+B/APGNs/XkZ HbgK+YpeGFBuPdSbjHbVo9eBb1xOdj0H56oRDokl6w6KmwwBHrU//OvUaYpRlDvSK5v3 YWEWtoQt38rVTxKHn0TLXoTo8XQNcAKcn1vcH0Bl6krlpz77l+xQrRn6qXCC/N1hZlkd djjHVGgsOvpC86QLAAtmzlpe7nVDJTzPQ85WVNyxr/T35Zm25kZBxi3TKnM5nJhj70mI fPuRryeZ1oVfGBVDS9ItkGDG/JbuoZ/AVyTzFeDCvzRoUdRsXuu50Jqx+CLMZn1E1eBn +Bjg== X-Gm-Message-State: AJIora+31ulr9zvvfuox8ie+gFAuCHSs5DqMHnwV1I1F8RdUSmxjKAYa rO0bkKdEG0w1UDJKAY7ruvkrfbNiXzA6bTlFCkpHDg== X-Received: by 2002:a5b:884:0:b0:65d:1c7c:4f33 with SMTP id e4-20020a5b0884000000b0065d1c7c4f33mr1836464ybq.601.1655326115552; Wed, 15 Jun 2022 13:48:35 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a81:af52:0:0:0:0:0 with HTTP; Wed, 15 Jun 2022 13:48:34 -0700 (PDT) In-Reply-To: References: <20220614210217.1940563-1-martin.fernandez@eclypsium.com> <20220615190519.GA1524500@alison-desk> <20220615195425.GA1524649@alison-desk> From: Martin Fernandez Date: Wed, 15 Jun 2022 17:48:34 -0300 Message-ID: Subject: Re: [PATCH] x86/cpuinfo: Clear X86_FEATURE_TME if TME/MKTME is disabled by BIOS To: Daniel Gutson Cc: Alison Schofield , Richard Hughes , linux-kernel , Borislav Petkov , Dave Hansen , x86@kernel.org, Ingo Molnar , Thomas Gleixner , Alex Bazhaniuk Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URI_DOTEDU autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/15/22, Daniel Gutson wrote: > On Wed, Jun 15, 2022 at 4:54 PM Alison Schofield > wrote: >> >> On Wed, Jun 15, 2022 at 08:34:58PM +0100, Richard Hughes wrote: >> > On Wed, 15 Jun 2022 at 20:06, Alison Schofield >> > wrote: >> > > My first reaction is lying about the cpuinfo is not a soln, since >> > > it creates a problem for a users currently relying on cpuinfo to be >> > > the source of truth for TME. >> > >> > I think you have to qualify "source of truth". At the moment the CPU >> > reports "Yes! I support TME!" and then for one reason or another the >> > platform turns it off and actually there's no memory encryption of >> > your secrets at all. There's seemingly no userspace way of telling if >> > TME is actually active. We were told that we shouldn't export the >> > "platform has disabled a CPU feature" in sysfs and just to clear the >> > cpuid flag that gets exported (like AMD is currently doing) which is >> > what Martin proposed here. Programs want to know the true CPU >> > capability can do __get_cpuid_count() like they can for the SME/SEV >> > capabilities. >> > >> Disagree on sending folks to use __get_cpuid_count() when they already >> have cpuinfo. >> >> Why is a sysfs entry TME-enabled 0/1 a bad thing? > > :))) > This was my very first patch, and I got half of the community complaining > It was so long ago that I don't recall everything, maybe Mart=C3=ADn does= ? > or Richard? The discussion triggered the fact that checking that TME is active is not enough to tell if memory is being encrypted or not (which we thought it was true by that time), and that triggered a series of patches t= o address the other checks required, which is currently going nowhere [1]. The sysfs _wasn't_ discarded perse, but since Boris suggested the change in cpuinfo (several times now that I recalled that Daniel patch [2]) I think that is cleaner, besides the backwards compatibility. [1] https://lore.kernel.org/linux-efi/20220429201717.1946178-1-martin.ferna= ndez@eclypsium.com/ [2] https://lkml.iu.edu/hypermail/linux/kernel/2006.2/05231.html >> It can be documented >> to have the same meaning as the log message. >> >> You keep referring to AMD. How is their exception documented? >> >> Alison >> >> > > Are we to tell them to go look in the >> > > log now, because fwupd folks didn't want to ;) >> > >> > We're not telling anyone to use the log; grepping megabytes of >> > unformatted kernel logs is a terrible (and slow) way to get one >> > boolean value. >> > >> > Richard. >