Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp28017pxf; Wed, 31 Mar 2021 15:34:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXhR8PQZRazeevoC+gCeQQEfiHjdfZKBuBaTfAAJDvmWkmBbZ4ypP7GObeqA83LQt3noiE X-Received: by 2002:a05:6402:520b:: with SMTP id s11mr6641897edd.212.1617230078995; Wed, 31 Mar 2021 15:34:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617230078; cv=none; d=google.com; s=arc-20160816; b=mwQQE1C6CKm/QKGXm5Qv3YsiFl5O/6m5hjC2KaK+RuM2qnoYm59gVM+MHQtMejzXOX +71Qpp4XFBDXq+0NcqwOi0YN1BkV3e4OXvBNIMhgWHWar/KGErb5ate74XSL0nKfLuwR 5pRva4fQzHxuTH9vlN/HR3zt/CZz/4x1sDiaeV3EC/vrMgWggm2SOImILpkgPSCkBrES rw/jOArntX1Z7wplikg34BaO7dbr+yY8XL/EyWZaOUsfo7GIQGy8p8UDzGfaHu1PAZ1+ 31E3DvyNEQlaDpWZQu9Uj/99AsRLYqH4EVcNB8BiN5rjMvJ28gH6cd/To0qKVpyP5BoJ DjOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Aop3qUolUDRtTavGsx945TafURy+GfTOKX2vL8Fgjt4=; b=bNyX55hjRvgY3wzONfjno0rA51S5ebX74mwJAcX96ECqgYxe56gmGaHp6dAE9tDBOU 8uZDDLjSyXWFLvMq7k+Ii+qVk38ludWrWVUShtBIj4PRGcm0wgqHKS/JuK2MxfbKo82m ahu+/hcTJpFftck3n3oIi63Cr2tDkOtGHxFBWBT7J88uaju1VBHxoDRxi+un/0nF0SXR ZIPwVXs8bL8ldKPFoMyXGmVf6hOyGvhC4m2FdCkrmkrXTIokbdrkQKqPdVG7pXJjobD3 wq2o4yRzrpI/q3BP6XxGq5thK5B7GlrXpWGWLJkdD62oSZyED+3bIlyZAyZZF3iBGvXV BoLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="Qroi6UI/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jy27si2578797ejc.748.2021.03.31.15.34.15; Wed, 31 Mar 2021 15:34:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="Qroi6UI/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231544AbhCaWci (ORCPT + 99 others); Wed, 31 Mar 2021 18:32:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230248AbhCaWc0 (ORCPT ); Wed, 31 Mar 2021 18:32:26 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AFB4C061574 for ; Wed, 31 Mar 2021 15:32:26 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id x7-20020a17090a2b07b02900c0ea793940so1965998pjc.2 for ; Wed, 31 Mar 2021 15:32:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Aop3qUolUDRtTavGsx945TafURy+GfTOKX2vL8Fgjt4=; b=Qroi6UI/g7NZ14dcFdZJ6B3OQOPJpPjRI7Brdh5J9c7opgdTIwhdhUu+OxMRLZK45w eRqHMZwU5fXEzH8y9JTZ6dc+QujEsMGPzidTA+xvP/AsufOdpFYiw8doJAnPi2+i3DF6 qjiHtqPerOPKLKaAJPhxtnIVX5vhX1YuSr/aKBVYHOxUvTJXaRoHvmg7jMetw38zUFzc uBMuHi7SQ29sysPmszEO4yEJsHrLhix6Q1beM6tgtJ7lXtM85EoGBQxHcDKW6ebJeZ75 6G9DopQDpXEjNdGMkQR+zhCP1qdTv2soC42YtKzY0El9RfdzvVYVrBt4V2REGZOxIG/K 119Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Aop3qUolUDRtTavGsx945TafURy+GfTOKX2vL8Fgjt4=; b=dIlX1ApbWywepp4xSkWFmfIiDSFPSOh06pFf5MH9hG2b8QIODv7iQQuID3cxLw6d8m CJw8D2Vf8BJEiR1cval4lITdbp/DVTyfi/Le1Y4xRH2Nw/PVb0NndwN191cXjgI1IqYl n5ioCTg7Rt/83jnWtzKTN8s5Xv+7MiVVsnawtpRPo7tpzQvQgDA3VCKuU+a3uIjt5gL2 DWfcW36kQJZeSp4nrRV4xOoewlvE0BTAuOXDCGRulPFkQxk67fPiyLYfuMXJ8I3vg+BE ocgB8vWq8dPp7gnuyWj4fpZk98b/zIZUGoKGDY3Yd2JxemCtUyoDRusLrM+KyqoszUgB rhzQ== X-Gm-Message-State: AOAM531mtylJy+R8qx5VnNGve9wt+/u3BgfFU6HuXWqu0JaECVzQ5aOP G5Pxsyxnd3+ZClVftH10UJ4JyQ== X-Received: by 2002:a17:90a:a88d:: with SMTP id h13mr5417366pjq.61.1617229945575; Wed, 31 Mar 2021 15:32:25 -0700 (PDT) Received: from google.com (240.111.247.35.bc.googleusercontent.com. [35.247.111.240]) by smtp.gmail.com with ESMTPSA id j30sm3541022pgm.59.2021.03.31.15.32.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Mar 2021 15:32:24 -0700 (PDT) Date: Wed, 31 Mar 2021 22:32:21 +0000 From: Sean Christopherson To: "Kuppuswamy, Sathyanarayanan" Cc: Dave Hansen , Peter Zijlstra , Andy Lutomirski , Andi Kleen , Kirill Shutemov , Kuppuswamy Sathyanarayanan , Dan Williams , Raj Ashok , linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 1/1] x86/tdx: Handle MWAIT, MONITOR and WBINVD Message-ID: References: <2FE32855-EA5D-44E4-AACC-25E9B1476547@amacapital.net> <5d961c25-3dee-4a5d-4bba-a97d157a5a49@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 31, 2021, Kuppuswamy, Sathyanarayanan wrote: > > On 3/31/21 3:11 PM, Dave Hansen wrote: > > On 3/31/21 3:06 PM, Sean Christopherson wrote: > > > I've no objection to a nice message in the #VE handler. What I'm objecting to > > > is sanity checking the CPUID model provided by the TDX module. If we don't > > > trust the TDX module to honor the spec, then there are a huge pile of things > > > that are far higher priority than MONITOR/MWAIT. > > > > In other words: Don't muck with CPUID or the X86_FEATURE at all. Don't > > check it to comply with the spec. If something doesn't comply, we'll > > get a #VE at *SOME* point. We don't need to do belt-and-suspenders > > programming here. > > > > That sounds sane to me. > But I think there are cases (like MCE) where SEAM does not disable them because > there will be future support for it. We should at-least suppress such features > in kernel. MCE is a terrible example, because the TDX behavior for MCE is terrible. Enumerating MCE as supported but injecting a #GP if the guest attempts to set CR4.MCE=1 is awful. I'm all for treating that as a one-off case, with a very derogatory comment :-)