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 3D13EC25B07 for ; Thu, 4 Aug 2022 23:44:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234779AbiHDXoU (ORCPT ); Thu, 4 Aug 2022 19:44:20 -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-Google-Smtp-Source: AA6agR74kW0u66mRgCpycAF0GIRARSp98NVY/1DMqszGKi68DR/MhsISDtA1DgL/ydMsEfCd8Dan8yoxVMRRIxuMcqk= 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" 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.