Received: by 2002:ab2:7a09:0:b0:1f8:46dc:890e with SMTP id k9csp168867lqo; Wed, 15 May 2024 10:35:52 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXMZHp8ot+1pFW9CUTelKxZiC+TcGKAnBIxOGoNkY//EIM+MfwR2osfATRv7sT93iLRq9Z6+c4O0AVliAAJ+wEdlwhFQxnopGvonm/i4A== X-Google-Smtp-Source: AGHT+IHjS9sB3FL4TOdYr35B+0Vlj7LBrTBt844Wn4JR9eHDUpdaG3fuoqgn5rW5UfveSb/xhFYu X-Received: by 2002:a19:9119:0:b0:51b:afe0:3f4c with SMTP id 2adb3069b0e04-5220ff70bafmr10510255e87.48.1715794552160; Wed, 15 May 2024 10:35:52 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-574f7ee817fsi1142912a12.134.2024.05.15.10.35.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 10:35:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180219-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=SxVWhf0d; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-180219-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180219-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D78BA1F21D46 for ; Wed, 15 May 2024 17:35:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 59CE54879B; Wed, 15 May 2024 17:35:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=intel.com header.i=@intel.com header.b="SxVWhf0d" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9527D28680; Wed, 15 May 2024 17:35:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715794539; cv=none; b=WrFM+UaMIFMXzaRDA5qu373kcShkVRgfXaN2rM9vWhjob7IGJKC5ZXqe9ZBDTcXlVYNrYI6q7b/kDoAEklj3EWE/Y3S6xTP9Amuy4FxwfYLuUqp3BpKkTq0eH1cMoPMaa1cMvae01xcKQTZraFs6kJdUTww9SDTw46LXCnc65rI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715794539; c=relaxed/simple; bh=bMXMTNE3OZS4/T3Ia9cod0oRbe/kxZEwCK4cz+pCvPE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KOInMzX42h/ixD6+8waVkHBCBk1f+JsQPBkhR55mlF3YqqUxFTJTvEYgY8leNx8jw4QpQsCarzNq3lD5K/ktqQVBo85zsxK9T+ubhyAXXzXUyNaq8e+hxgIFkWG58DTqZ6bl/dB7RG5cjC6tAqsQiHY8IeeE+/yvbSMGVbyVzRM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=SxVWhf0d; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715794537; x=1747330537; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=bMXMTNE3OZS4/T3Ia9cod0oRbe/kxZEwCK4cz+pCvPE=; b=SxVWhf0dOQ9u3zYiOlxY8I9KjC2xO4s8iMlBs6WPaeyBKVVDPvIiRor+ bgH4f9yaUbaAXIYtnZquD5vejUYKnXLEK3eCykxleWccIerygPFcrF6wy C4n2OFMTNtb8CriIvgRPsZzpX19VGlGjDEiyliAjv4sc9oR1pVeMGp50n O1z2zrZ2BB7XHLZ7p8TQ/PH0ePc2szFRdKbpOcbtLsXlxNXuqsKK5I8aI iPKW0nZGvlwTm0U8HIMdQi7bEv19FCQrdDcIEsHfKP1wyPnvK4vfsljeU EIRtQmItTy4+lMX6+GY1nchMXm7G1GIvZoO+betIIRMWdPE7VePzStpXn g==; X-CSE-ConnectionGUID: 7Knlw3k5TsOQ80L0Mx6cTQ== X-CSE-MsgGUID: 2DJn9QUWTgmtZk1r708OCA== X-IronPort-AV: E=McAfee;i="6600,9927,11074"; a="22465741" X-IronPort-AV: E=Sophos;i="6.08,162,1712646000"; d="scan'208";a="22465741" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2024 10:35:36 -0700 X-CSE-ConnectionGUID: ChK8VZQxRjCKrNmXGhQmDg== X-CSE-MsgGUID: 8/AIo60qTcq2zS8LstgONg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,162,1712646000"; d="scan'208";a="31263346" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by orviesa009-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2024 10:35:36 -0700 Date: Wed, 15 May 2024 10:35:36 -0700 From: Isaku Yamahata To: Rick Edgecombe Cc: pbonzini@redhat.com, seanjc@google.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, isaku.yamahata@gmail.com, erdemaktas@google.com, sagis@google.com, yan.y.zhao@intel.com, dmatlack@google.com Subject: Re: [PATCH 10/16] KVM: x86/tdp_mmu: Support TDX private mapping for TDP MMU Message-ID: <20240515173536.GE168153@ls.amr.corp.intel.com> References: <20240515005952.3410568-1-rick.p.edgecombe@intel.com> <20240515005952.3410568-11-rick.p.edgecombe@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240515005952.3410568-11-rick.p.edgecombe@intel.com> On Tue, May 14, 2024 at 05:59:46PM -0700, Rick Edgecombe wrote: ..snip... > @@ -619,6 +776,8 @@ static inline int tdp_mmu_zap_spte_atomic(struct kvm *kvm, > */ > __kvm_tdp_mmu_write_spte(iter->sptep, SHADOW_NONPRESENT_VALUE); > > + > + role = sptep_to_sp(iter->sptep)->role; > /* > * Process the zapped SPTE after flushing TLBs, and after replacing > * REMOVED_SPTE with 0. This minimizes the amount of time vCPUs are > @@ -626,7 +785,7 @@ static inline int tdp_mmu_zap_spte_atomic(struct kvm *kvm, > * SPTEs. > */ > handle_changed_spte(kvm, iter->as_id, iter->gfn, iter->old_spte, > - 0, iter->level, true); > + SHADOW_NONPRESENT_VALUE, role, true); > > return 0; > } This SHADOW_NONPRESENT_VALUE change should go to another patch at [1] I replied to [1]. [1] https://lore.kernel.org/kvm/20240507154459.3950778-3-pbonzini@redhat.com/ -- Isaku Yamahata