Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp780942lql; Mon, 11 Mar 2024 18:33:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXNzDauGEEjGI5QmeF8OjWuREpcSsYnbr3jvb60SQGac68ogF1HtBQALBEW/Lma3caJ/lQLHD3VsuwplYSFqesa1o8LQ1jhr3DJxVjcJA== X-Google-Smtp-Source: AGHT+IGthkzVtit7MTDqEIxEe9lU5QlvgTYWjGUgBHj1F7R6jUWZ0uMLw4MQh2Bjj16wzASdUtos X-Received: by 2002:a17:902:cf0a:b0:1dc:693b:4074 with SMTP id i10-20020a170902cf0a00b001dc693b4074mr7995099plg.7.1710207228559; Mon, 11 Mar 2024 18:33:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710207228; cv=pass; d=google.com; s=arc-20160816; b=G2glE+m4GHTXG6eIOEujbjUuByYibYWOEuhImClpF3Bb1e3hcJGqRnyJfJAEuAaN8O VNDs8PE9/ABU2Xsl62B8rCZjF8v9uXdlOEGzvpIn2rocA56LzWKfQtPFXZeYq+oU9I8B 0GvkO7LuZOeFTmVBZTDEPMOa438+YxRh5pLK8ZGhHS7UBqIHF57CY2G1gc3kwNv3PIfS E6/sVaVdCcGOM4m1cUmSOypwGuwbogMhiLIvcb15UD+8egs3sxxgtF+s2oWukTn4LHnW /Kygud0aY8qNSazYK8/buIDgE69ByZTrH+QeBIxj+/xzRSwL6rIxuwOupl6fBAteMGpq zcMg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=8+0Dd0blsjv86pWf8iDVbZvyABxZAPueGDvu56FLAic=; fh=y7lSnTMWfcKv/hIYxmRnPahkKHALM8f9K5t7DDW+fuE=; b=da4q8CRXx/9RhtwVAK70+w83ESFkw2rsmNePE6tDtNOOA+Hxng9SrFNRnR7R0TmGMS kJc6ycIBMPIbCgB6BXwND+icbb2tbS5yJPXmO4nkr8rEOnuOXbgfRv+J/lYRh2ZAPyJ0 1qhaatTUyGHU8OIc+Q+n7J81V/WGqMtfE62cWryH4hEg7GSpSoIY4rLI9ITx2bnMRKug 0i1sClNnl8p2F3FY1+NGu1MFgS2VwFbgK8mTl4g+/I/4zDe2tB6c63ZI3vQkHR3mH7Mq Dyzw/+kMlQ+LJRlUsFwi46KdosR5/r2YOFoJMHDOHkRKfEv6uBRUwdYCT+nMh7JQn1A7 NxVw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KUoSUydy; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-99733-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99733-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d10-20020a170903208a00b001dd772f0246si5634638plc.169.2024.03.11.18.33.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 18:33:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-99733-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KUoSUydy; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-99733-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99733-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 8F30AB22276 for ; Tue, 12 Mar 2024 01:32:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BB3004C99; Tue, 12 Mar 2024 01:32:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="KUoSUydy" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 E46E217F7; Tue, 12 Mar 2024 01:32:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710207132; cv=none; b=HU1PG+Vo2ZOHDymc795CpaRf1Ur5tAkjhc+yElPiN4MvKkGVYxQ74qBvl183k0biFEnGPODcSAZuWQRZQBaViXiw8qsuqYZyzNVXwpgTo5JLXJKr9ei5/Y6TUCz1EZJo4HUehWESiKnjGO2CBHjdPkBXdgKA4rh+/rEVw2vRONA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710207132; c=relaxed/simple; bh=DQiMo2W6ZgCMZgmVW436D7oZbKZEGL/9fScs0o5heAw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=X2KDLIs69I0rhZahclw8aRZhpWsT3ERGIE0J/8BFI5QQMfo34lcO/hQENhcHKk4V0nndfqMD3B6TWztA3ePn9yOlKDPYmwA8iW1aFinZd7cSsHAIrhbGbfD3NwWx4TZFL/UyKMmXQKqzOLw4WGo3EPJ9seqbUX2Y5BnJELgkykI= 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=KUoSUydy; arc=none smtp.client-ip=198.175.65.9 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=1710207131; x=1741743131; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=DQiMo2W6ZgCMZgmVW436D7oZbKZEGL/9fScs0o5heAw=; b=KUoSUydydbi9m8ykI98fTwYow19ksmbe1mwouXDVpa3tsuMqk+cYdHME GeISQe0Vt9SL6NJTJAVmlj9eOBd8y+3d6Z6vhUzy6rX2vQwZ4pW/H27Mo muL7fKgJOgbkFr7zA/2/rKnOo7I6IBnH487/7PjWAHIxmzejjbOyEz6FV wUFGcDYS798h11OOoRxm0GYrKBD81AHqzwa3KpEq7Lrg4hWg7hgeDMxHJ ORTPi8CdCN3+q+GZ5968g/n9PVLRAJCpzTXUV3kKmlRv4LdxuI29pC70x K6mrligFDlvmksTXwaHxHBf03YwSG0J8Gu+9VGUQv5e1QaF6js7ne00nt A==; X-IronPort-AV: E=McAfee;i="6600,9927,11010"; a="27373543" X-IronPort-AV: E=Sophos;i="6.07,118,1708416000"; d="scan'208";a="27373543" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Mar 2024 18:32:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,118,1708416000"; d="scan'208";a="11278425" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Mar 2024 18:32:08 -0700 Date: Mon, 11 Mar 2024 18:32:08 -0700 From: Isaku Yamahata To: Sean Christopherson Cc: Michael Roth , isaku.yamahata@intel.com, kvm@vger.kernel.org, isaku.yamahata@gmail.com, linux-kernel@vger.kernel.org, Paolo Bonzini , David Matlack , Federico Parola , isaku.yamahata@linux.intel.com Subject: Re: [RFC PATCH 0/8] KVM: Prepopulate guest memory API Message-ID: <20240312013208.GD935089@ls.amr.corp.intel.com> References: <20240311032051.prixfnqgbsohns2e@amd.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: On Mon, Mar 11, 2024 at 04:44:27PM -0700, Sean Christopherson wrote: > On Sun, Mar 10, 2024, Michael Roth wrote: > > On Fri, Mar 01, 2024 at 09:28:42AM -0800, isaku.yamahata@intel.com wrote: > > > struct kvm_sev_launch_update_data { > > > __u64 uaddr; > > > __u32 len; > > > }; > > > > > > - TDX and measurement > > > The TDX correspondence is TDH.MEM.PAGE.ADD and TDH.MR.EXTEND. TDH.MEM.EXTEND > > > extends its measurement by the page contents. > > > Option 1. Add an additional flag like KVM_MEMORY_MAPPING_FLAG_EXTEND to issue > > > TDH.MEM.EXTEND > > > Option 2. Don't handle extend. Let TDX vendor specific API > > > KVM_EMMORY_ENCRYPT_OP to handle it with the subcommand like > > > KVM_TDX_EXTEND_MEMORY. > > > > For SNP this happens unconditionally via SNP_LAUNCH_UPDATE, and with some > > additional measurements via SNP_LAUNCH_FINISH, and down the road when live > > migration support is added that flow will be a bit different. So > > personally I think it's better to leave separate for now. > > +1. The only reason to do EXTEND at the same time as PAGE.ADD would be to > optimize setups that want the measurement to be extended with the contents of a > page immediately after the measurement is extended with the mapping metadata for > said page. And AFAIK, the only reason to prefer that approach is for backwards > compatibility, which is not a concern for KVM. I suppose maaaybe some memory > locality performance benefits, but that seems like a stretch. > >