Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp1089228rwb; Thu, 4 Aug 2022 17:12:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR4KntLT/K1t+iPUcelMgGiyGEcLEnFqG9YsE+CiTJxDsEFTNIMLExXXSGLGzabAAhPTtMBr X-Received: by 2002:a17:90b:38c8:b0:1f5:1311:5bd3 with SMTP id nn8-20020a17090b38c800b001f513115bd3mr4644957pjb.161.1659658358894; Thu, 04 Aug 2022 17:12:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659658358; cv=none; d=google.com; s=arc-20160816; b=k/T+leKANwL78fIXgZVEewdr/GBmylJRyu1VTfhPGqomqncmWdO6cDx/esWiULPL31 hMzx/35iE/7l1BKmINrTPou6jy50llhAncxWZU34GAer1rh5jUy6I8s92yN2DNxiUzVC FGTuaQD2+9PPyA+Fn2ROBTHhRRI62+i8u3edtkjy0PFKfsnT+duJsimyIC+QUja232Mb h+8IlMWiLQXPOzcjuKbsBHDATp9gYaaY6ENsfjOPlTEPEQqm8eMHvThS3t2dyrHGNgy9 dWLLYyT9NEwxUmVwqmFyn0ST4IfyR1iMLaSdZ79GmmLDe1DZ+htsefIizF03DSkhQdxR ENTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=MYpPnNYYRuA37g2a2Va2k82yWFk09zlElGc9XDuWnSs=; b=brium2kS1vrYhyWK/zH/5hVsI44qPA/qiHlMpYReNWHkakGjh9ezEizGY7kvkxBxtP U6srksJz161VlgeKG9NIYd11DOSFz1CGHiQFeFR4Vwg/bu5IGAdpzDgwO2UdfBLSqPlM bOgp1bVoeamrlek6zpxLjiG8oiYPHXjhZoMgosyYr3fUh8Q6CSlL5cqLYAsf84eQrMBB HwebNunaYnfIUgQZjzLnu0CSpS8I63ia/2NWFBkE7GKBmRcljFyVEVyatQv/2dZLGFRu CFdyAKNJR2EFTLhIemz2gO8K5HiBuk47/yqnGkd74Cc4+16WP0MCT+kEn4n6APDCuwZT 0Dng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="FTwjcIb/"; 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 w12-20020a63160c000000b00401a213a5f7si1316349pgl.231.2022.08.04.17.12.25; Thu, 04 Aug 2022 17:12:38 -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=@google.com header.s=20210112 header.b="FTwjcIb/"; 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 S240198AbiHDXoT (ORCPT + 99 others); Thu, 4 Aug 2022 19:44:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233937AbiHDXoR (ORCPT ); Thu, 4 Aug 2022 19:44:17 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B825F71719 for ; Thu, 4 Aug 2022 16:44:16 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id z20so1461015ljq.3 for ; Thu, 04 Aug 2022 16:44:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=MYpPnNYYRuA37g2a2Va2k82yWFk09zlElGc9XDuWnSs=; b=FTwjcIb/srKxRRbBqvpJ06fYmJjau68uzGbLTesB1oFsOO7lNJlXHYUYFpW1KvmJoy FPTk7i6awCzVR27iwbftj3AG49Ug6bEew2r3qD8FOuC+3jnrppS5taw5X7x4w3EJTi2m nu2ORpB3Uz0El1sgr58Plv/TYZ0pJQz6jAO7WCJflrru6p+FGZSwML3dwZSofIzF4AJ6 XMH+u+md3KYC+BLxBtnKb4bj5rpYXn825k+cvAX1qWhe7zzXcV4BpqIYluQW7aNGT+YK H8OxwRdhNe6PN8dN2XQN8Nblcbw1115JP5YVPh4BwGKk1+a+XW74/LMo0yjATvn5Mjun 432Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=MYpPnNYYRuA37g2a2Va2k82yWFk09zlElGc9XDuWnSs=; b=43ZP0v4uaIrLEZRoZbciTdo595FI2sqGLYnU2R30s+GAQDIghRveMcigRmzG+xtdYE MSAFUaAWZ2JW0xlvmIU9cIDlQtrAHs+o9pnq2uc8C6w5Q1XMIN2XOnPY1T2V83QFiRNs vsYfn6j+nZzfPUg2ZQX+UOB4GHmiKilGbj/Jo5euS7waB+2PICav1hrWhnmJvmvcIOjs Cla27YzPLdlPvAxOCdpBR/53/wSisuPXSkCkYediy8IpWBhzPUMMP9oHdNuzA5Kot8Z6 02FDTbE4e71ewntFi2UgdTTKQF3F4xTOdIfsQsN9RKfK6KDuAulwjNUOzoT91ZQvU6Um CaJQ== X-Gm-Message-State: ACgBeo2jskkkP8UdwyMvqlPkllcOJYvdCYqE0qX0ZiHY3kyasOTO9SPJ Bc7i1XQ8M0OP5GqNtwHfWnVzD51xgWHahUpMss+Neg== X-Received: by 2002:a2e:81c1:0:b0:24b:f44:3970 with SMTP id s1-20020a2e81c1000000b0024b0f443970mr1198098ljg.97.1659656655026; Thu, 04 Aug 2022 16:44:15 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: David Matlack Date: Thu, 4 Aug 2022 16:43:48 -0700 Message-ID: Subject: Re: [RFC PATCH v6 037/104] KVM: x86/mmu: Allow non-zero value for non-present SPTE To: Sean Christopherson Cc: Isaku Yamahata , kvm list , LKML , Isaku Yamahata , Paolo Bonzini , Erdem Aktas , Sagi Shahar Content-Type: text/plain; charset="UTF-8" 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, Aug 4, 2022 at 4:23 PM Sean Christopherson wrote: > On Thu, Aug 04, 2022, David Matlack wrote: > > On Thu, May 05, 2022 at 11:14:31AM -0700, isaku.yamahata@intel.com wrote: > > > +#ifdef CONFIG_X86_64 > > > +#define SHADOW_NONPRESENT_VALUE BIT_ULL(63) > > > +static_assert(!(SHADOW_NONPRESENT_VALUE & SPTE_MMU_PRESENT_MASK)); > > > +#else > > > +#define SHADOW_NONPRESENT_VALUE 0ULL > > > +#endif > > > > The terminology "shadow_nonpresent" implies it would be the opposite of > > e.g. is_shadow_present_pte(), when in fact they are completely > > different concepts. > > You can fight Paolo over that one :-) I agree it looks a bit odd when juxtaposed > with is_shadow_present_pte(), but at the same time I agree with Paolo that > SHADOW_INIT_VALUE is also funky. > > https://lore.kernel.org/all/9dfc44d6-6b20-e864-8d4f-09ab7d489b97@redhat.com Ah ok, thanks for the context. > > > Also, this is a good opportunity to follow the same naming terminology > > as REMOVED_SPTE in the TDP MMU. > > > > How about EMPTY_SPTE? > > No, because "empty" implies there's nothing there, and it very much matters that > the SUPPRESS_VE bit is set for TDX. Fair point. My other idea was INITIAL_SPTE but that's already covered by Paolo's objection above :) I'll change my vote to NONPRESENT_SPTE.