From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44F42C19F2B for ; Mon, 1 Aug 2022 14:15:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232476AbiHAOPq (ORCPT ); Mon, 1 Aug 2022 10:15:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232431AbiHAOPn (ORCPT ); Mon, 1 Aug 2022 10:15:43 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71976B4B6 for ; Mon, 1 Aug 2022 07:15:42 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id e8-20020a17090a280800b001f2fef7886eso12153969pjd.3 for ; Mon, 01 Aug 2022 07:15:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc; bh=QuT4xFJ+H3I7bIvGWq2+zpolgZWgrD2J6nOy/da36hQ=; b=J7ljgbno6ufX7q9vaz65gRHInT23JXatr7SlSg0wjIY7+da5Wl0z2DnzNfO/LMrCU2 OnOn+ftQQltgOPcWbDmbXaQEZvvrBmvAjRqsGguRPc/BXT2XrO6tTEIh8atVBYS6T1qQ u30q3SnBOEHWqGOoDTapiPbZgGp8KMc5IeoG6o+pc4YbpvufRhcFWcPVp21hl/p2nbT2 n/EEKNfMzTBIHG/hAW3T3WkRJ/xJ8chiuxGYQVxPhHF7ZE1R541Fdbf7ve6MBj1OnJRZ n2qDeZ9DQESWdJJscL3fI+Lm5TrKAomBOrXrTOvrDVo4arqqCGeqi0S5NhHS/QXLaj14 BnCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=QuT4xFJ+H3I7bIvGWq2+zpolgZWgrD2J6nOy/da36hQ=; b=DJ0O4C92HHdRqMtb8rlbLEoYiE83yxEBRQ9SJwByUnnvsiap0UKoQqzRcTAbBnxbhP GkwQyyvjmiWNkV5YwkX16/42uPU7dsQGkesgKi6ymE1zizKZzZjajod0FXHHwHsjESv+ qT9RRlUtnBWRTq9IKOGXYYhCihshmVVQb1TabwOTXaZbGw9NAx2Pye+MnRUW36K6OFTQ H1DnN0vpaM7/wqMeRBl/3TosGllfgQaCtc2Rcen+sKHcwEP+A6Q/7M1g8k+L8tdE4v/a B/wEtczvGhwxsnv74NPrmFAw+OSIxdQDlSHzeydT8EfunfSPmmIxB86U9K3BFDuo+t1c ALwA== X-Gm-Message-State: ACgBeo1KNmae7PwDS7QdVYOuslgybEUD5SKEvk28NYLmTKGNewwRfKQT rCEc0YS2TBCOIzxkdiCJ75vGBA== X-Google-Smtp-Source: AA6agR6GtXPwEy4J/MmFtBHlJsvIqQ+DC3eHBWMo5trq2cTHhnVFxVmRj39RS0cqKWnTAReTZ4C1/Q== X-Received: by 2002:a17:90b:3d8:b0:1f4:d5c4:5d76 with SMTP id go24-20020a17090b03d800b001f4d5c45d76mr12665615pjb.219.1659363341834; Mon, 01 Aug 2022 07:15:41 -0700 (PDT) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id n1-20020a17090a2bc100b001f2b0f8e047sm8946740pje.27.2022.08.01.07.15.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Aug 2022 07:15:41 -0700 (PDT) Date: Mon, 1 Aug 2022 14:15:37 +0000 From: Sean Christopherson To: Kai Huang Cc: Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Roth , Tom Lendacky Subject: Re: [PATCH 2/4] KVM: x86/mmu: Fully re-evaluate MMIO caching when SPTE masks change Message-ID: References: <20220728221759.3492539-1-seanjc@google.com> <20220728221759.3492539-3-seanjc@google.com> <9104e22da628fef86a6e8a02d9d2e81814a9d598.camel@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 Mon, Aug 01, 2022, Kai Huang wrote: > On Fri, 2022-07-29 at 15:07 +0000, Sean Christopherson wrote: > > Lastly, in prepration for TDX, enable_mmio_caching should be changed to key off > > of the _mask_, not the value. E.g. for TDX, the value will be '0', but the mask > > should be SUPPRESS_VE | RWX. > > Agreed. But perhaps in another patch. We need to re-define what does > mask/value mean to enable_mmio_caching. There's no need to redefine what they mean, the only change that needs to be made is handle the scenario where desire value is '0'. Maybe that's all you mean by "redefine"? Another thing to note is that only the value needs to be per-VM, the mask can be KVM-wide, i.e. "mask = SUPPRESS_VE | RWX" will work for TDX and non-TDX VMs when EPT is enabled.