Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp15774817rwb; Mon, 28 Nov 2022 16:08:39 -0800 (PST) X-Google-Smtp-Source: AA0mqf4mUpVcmgETuSGW/bdgy7iLLlx3ayQ4dU5XYpFslMPLUaDbzSOIqX+YP8xi/oVgl5AHsqW6 X-Received: by 2002:a17:902:9a8a:b0:189:58a9:14a4 with SMTP id w10-20020a1709029a8a00b0018958a914a4mr23964563plp.18.1669680519408; Mon, 28 Nov 2022 16:08:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669680519; cv=none; d=google.com; s=arc-20160816; b=G9Y+MJW+M44VwZqlSzPV6hCslqRHHTwEiT3zSq3+wPTRt5y16nSox+yBCBUFojMDbh JG3tBa5P/MoBjRpzm6JgbI5LeG1FMURZi30WeOAI04SsJQk/HIErGkkLAHXTT3NI3akZ nuE2WEspjvCXZHC8C/rRVXXXFMeeYJJHkRx965aM2zRsBPHdqYSc3eqMorjAcfcEycxr CwTy56wPrwR6FFhG1nPobz6p3wBaKRWB8I61vN0VydXsMgHJaEUqVtkkxahBTvYkfWeo XMpd91bPhfv356M29CtPcZioDAGYfz0k8tuLWrHDzQSf6YHUntzvL8Vhm1nPt4M8SDT0 rwRg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=oVgoeAVnfsk2iXYG0JTdu0THjStYeYpgj9cQZUW7cks=; b=rmTh3JR2et1OoPWXOS7nv65FvVXawaMsvlOO9xCyIZos9Xe/9HKB4CFID2C35JuIlU D0+qAhtf4RBBA3uxPylhTn7SrqxFI6SC6XpytbSi2AiMRtYDfDPcb1Yn452p5IG7fX/n O35u5dFMpZ/Uxeyua83xjf5E4oiS7E2goN3Vk7DJ1UQQmAUcoCZ+PUXQVqpyIko3X2F/ AWf9vrfBYWOBFNH9YaM/jqa6Hb6u0GVnTJuMxqPDOMMGo8SFSqtKlcJ+o7HQmK4a/2Wj /8rGKBjfWbRSQHq6fyyQq2hmLJncJGnov/+ZhdMwQqZbQaqT2UU64Aqv5Aej3S7eKhpC mslA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ZWgV6HJI; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k62-20020a638441000000b0047704a39c8fsi14146703pgd.636.2022.11.28.16.08.25; Mon, 28 Nov 2022 16:08:39 -0800 (PST) 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=@google.com header.s=20210112 header.b=ZWgV6HJI; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234804AbiK1XvQ (ORCPT + 83 others); Mon, 28 Nov 2022 18:51:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234790AbiK1XvP (ORCPT ); Mon, 28 Nov 2022 18:51:15 -0500 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55B5028E36 for ; Mon, 28 Nov 2022 15:51:14 -0800 (PST) Received: by mail-pl1-x62a.google.com with SMTP id d18so967297pls.4 for ; Mon, 28 Nov 2022 15:51:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=oVgoeAVnfsk2iXYG0JTdu0THjStYeYpgj9cQZUW7cks=; b=ZWgV6HJIMapNybCv4vR6zXDsW6Z7GIO+i/wZEeRsIK8vPOSFXAioyWuCwuOKWrl5yD Nni6kSMkTP5RwO4ue+RjMY/l20JLoL+rB8a92x1ucdJjD+orCMDfUTWPyfhAJ9KfOmbK BxW2kgEhqa+jUNkXQoPBqUjp4hjnhUjT6Pxq9J+3TAdFvSqxKnsnF83lek83CJTdfGoH 6+mljQF+SC5lQ+cNDQ13IXoDXg3ExOEVH/sUG2CIfrYPoi1cMTzbWraOOI0pbFb3fAVy cFzEpEmy7dGhKyQhZRampL5tVSD+egmW/f9LgGTnIWfRKZzxas6kkiv6RMa77MYEZhKn l/hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oVgoeAVnfsk2iXYG0JTdu0THjStYeYpgj9cQZUW7cks=; b=nExUju5+ulvtdpxmcj0R2cE1kySdS8QumXArz8VuAXpVP9alyPpEAuDH4eRNJj2Buu puhpe4ExYaofggwiet4uM0n7VGd8YGWFMkMe9kQKcYLubinl9wcvfF4FN18EBcYCn3rv 9wlN0Hio55XXTn2IbX2RXuKsYSpWtq76RPWhDrDBqRQmmrM3/v4IwP3xi1dLXs3fuwYz WxzhJZRLx1bnCkCsAahjnJUbjUDaH1M+8vIETXG/PtaW/QJqbpNnrSh73eQYEtM8kAtm XqBkaUr/p3D1UmdHwPsGaGnNRpMaHu91Jy7I6grSApJSF7STuBSxTgClI7atIpalPbaJ Duow== X-Gm-Message-State: ANoB5pnIfMTGR3rmMuwQ6saJotYkTvVQTgUwKUNN0Vg0k7eFJCFiVm6E Pc8ciqbuAolV/D90/RCNdEoXCw== X-Received: by 2002:a17:902:7688:b0:186:971b:b7e5 with SMTP id m8-20020a170902768800b00186971bb7e5mr49187518pll.54.1669679473706; Mon, 28 Nov 2022 15:51:13 -0800 (PST) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id 123-20020a630781000000b00470275c8d6dsm7159081pgh.10.2022.11.28.15.51.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 15:51:13 -0800 (PST) Date: Mon, 28 Nov 2022 23:51:09 +0000 From: Sean Christopherson To: Isaku Yamahata Cc: "Huang, Kai" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Yamahata, Isaku" , "pbonzini@redhat.com" , "Shahar, Sagi" , "Aktas, Erdem" , "dmatlack@google.com" Subject: Re: [PATCH v10 034/108] KVM: x86/mmu: Add Suppress VE bit to shadow_mmio_{value, mask} Message-ID: References: <1c480a48c2697054b1cfe068fa073f4035648f9a.1667110240.git.isaku.yamahata@intel.com> <20221117180220.GJ2350331@ls.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221117180220.GJ2350331@ls.amr.corp.intel.com> X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham 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 Thu, Nov 17, 2022, Isaku Yamahata wrote: > On Wed, Nov 09, 2022 at 11:48:30AM +0000, > "Huang, Kai" wrote: > > > On Sat, 2022-10-29 at 23:22 -0700, isaku.yamahata@intel.com wrote: > > > From: Isaku Yamahata > > > > > > Because TDX will need shadow_mmio_mask to be VMX_SUPPRESS_VE | RWX > > > shadow_mmio_value to be 0, make VMX EPT case use same value for TDX > > > shadow_mmio_mask. ? > > > > > > > TDX need to use different mmio_mask/value doesn't mean they need to be changed > > for VMX guest. I think the true purpose here is to still be able to use a > > global shadow_mmio_mask for both TDX and VMX guests. So please explicitly call > > out. > > That's right. With this change, per-VM shadow_mmio_{value, mask} can be avoided. > The common value can be used for both VMX and TDX. No, the mask can be global, but the value needs to be per-VM. VMX needs to generate an EPT misconfig, but TDX needs to generate an EPT violation to get the automagic #VE reflection.