Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1314810lqt; Tue, 19 Mar 2024 22:41:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXOIjDVQ2LDb80H+m6y2bZF0e0FL/tBs85anx3K3legJMA8+L4epqhhxP50T9OdEOmmoltxbkzIqTCr+4LZdCgCiITULpt1ZsJxHoTIWQ== X-Google-Smtp-Source: AGHT+IEUcl94zJRq1X2TTwrioGCJQLizM5J+9U11LdWKBkpVfgN/ahKNwoyLId+zGRmwLg/huWhX X-Received: by 2002:a05:620a:5587:b0:789:e917:ac8d with SMTP id vq7-20020a05620a558700b00789e917ac8dmr13591094qkn.71.1710913284863; Tue, 19 Mar 2024 22:41:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710913284; cv=pass; d=google.com; s=arc-20160816; b=oFkukBlfovkc6yAf1jarQt4rMoWeB7sw79E8MSpqiN1b8GlkfNMcLU3pQ+4xJ0i53K yCrvvGFnpvbXKdlNUBMwHga5G29uErHBnbKhpl6qw1g7DmsDVH4T+KQQGWufUhmwY0Db I0DJAfKm31OLXORWT0vz4zPsS680lHsF+7IETDH/D101V5kHoAcq1UBJCFbDEz0mBw52 sEdcbe2t+z1MWZNkJWRj0jgunSySG4PWP4iqsKehlmXR+EfTLmebHJ6Q+1lzfvp+hdIB GKdlV7kkr14uvH8D03fT/c5PhoFvgKrq0fYR5PFJp0NgvaefJT4MmdxJSNfsUmPUN2/S WPzg== 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=zlEs7BxsN3u3+EFVDrWzone1R6D3eXgPjjFjJPmt4qs=; fh=8LkwZNJlRIPdU0Yrrteug9btHk5j6S09vjaHixZuodI=; b=iPSxhBpkIJSiBvYdPA5I/myxys4EVifb+1VsGwNzWU7p7gD/g4mK5OIFrbIpsOmo0c H9ifrO3Mrom74xstlnCiq7gGo1qCmYUKuD58/vK68JrRD8f4kv1UGbTTqJQn8BjbDNzR brdrh2OVahu0Zf6iTKLqsj3rsFxdH7f68jk78Itn+TEpm1TEWcmQPiuIiTrHTVsCEe3V wNKBWEuhBVtyPDlchmAEQjX09KpsuCj6P51u4VnUqzcux7DNxySjHLlphU+mzSc9fTfI hk37gfuzjVHqsHbXm3X4xyZTb2obB6UB3wfwyobSk+I7mxj84TDYR8mSPf2e7wYUsfQ5 OHiA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="m1mTt/Lu"; 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-108455-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108455-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id g20-20020a05620a40d400b00789e8f2219csi10619254qko.318.2024.03.19.22.41.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 22:41:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-108455-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="m1mTt/Lu"; 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-108455-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108455-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 0A5581C2067B for ; Wed, 20 Mar 2024 05:41:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 427EF1947B; Wed, 20 Mar 2024 05:41:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="m1mTt/Lu" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 AA548182A1; Wed, 20 Mar 2024 05:41:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710913274; cv=none; b=ll0+761D3IU4/K1hyIY4WJLRJ1vpzymoRVKDkluhNZDPhXEBQwrO7AN3jXmfih893MdEltc62gFLgHFanH3+bMtm1l5JzOXm7h6EEPKK2mf7G2chuOjQaVPpDsBUK1TZXnMdiJfRwsKg54jtPaOBgA5SrZFktXcejneEvpsOdPU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710913274; c=relaxed/simple; bh=3GMZnY+JN53UzdMSGC6C8EOQ504dGXkGJ8WKcwuVtyA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YHxZgGn6uN0Ovuz7qZ4bmbJBM39xOOFlH8PEJAUkLlDGbKSfDwNF1UjRdxxRuJstycPkPZ6usutr7pTzhAau4WPK3fecmtjEhrokxUUK5NK+UE+C0YJ839/A8qC5AL+Y3q6CpQ1GTV/SdUccp1e9tH95G1jb1jIv7hhnJSwYJBo= 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=m1mTt/Lu; arc=none smtp.client-ip=192.198.163.8 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=1710913272; x=1742449272; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=3GMZnY+JN53UzdMSGC6C8EOQ504dGXkGJ8WKcwuVtyA=; b=m1mTt/Lu49v/M/LGblJTh25VuxN9o8LQjKDzMCt5CRxTz9rUORa0nQYK FrJVypfVLDymbMvRLy9qE8H2ghKklslrtsMnheVPFDv/8Wj1RoBk6CGHA HZirEK6eVQQF8rqCHNyV+/XNKOq/mXQm5t8HDNpFlfuCuf2N5CigJ62qV 4+ABWX/74esN8m5QuKdMppL5y/r4/LgEk9FyIk+y0IrAJLWMiN/xWRBjC LRoEFKyp5bPp7ZA+C5ex5U6dkNvDOpaLs12LbFNm6XDavQCQpuekjG3po BPnJj30XMdrgyp95chcRMxsR+NF009jnJloPO4Th8fxBKJPXmMrtYDQNh g==; X-IronPort-AV: E=McAfee;i="6600,9927,11018"; a="23320806" X-IronPort-AV: E=Sophos;i="6.07,139,1708416000"; d="scan'208";a="23320806" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Mar 2024 22:41:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,139,1708416000"; d="scan'208";a="14067896" 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; 19 Mar 2024 22:41:10 -0700 Date: Tue, 19 Mar 2024 22:41:09 -0700 From: Isaku Yamahata To: "Edgecombe, Rick P" Cc: "Yamahata, Isaku" , "Zhang, Tina" , "isaku.yamahata@linux.intel.com" , "seanjc@google.com" , "Huang, Kai" , "sean.j.christopherson@intel.com" , "Chen, Bo2" , "sagis@google.com" , "linux-kernel@vger.kernel.org" , "Yuan, Hang" , "Aktas, Erdem" , "kvm@vger.kernel.org" , "pbonzini@redhat.com" , "Yao, Yuan" , "isaku.yamahata@gmail.com" , "binbin.wu@linux.intel.com" Subject: Re: [PATCH v19 029/130] KVM: TDX: Add C wrapper functions for SEAMCALLs to the TDX module Message-ID: <20240320054109.GE1994522@ls.amr.corp.intel.com> References: <7cfd33d896fce7b49bcf4b7179d0ded22c06b8c2.1708933498.git.isaku.yamahata@intel.com> <3370738d1f6d0335e82adf81ebd2d1b2868e517d.camel@intel.com> <20240320000920.GD1994522@ls.amr.corp.intel.com> <97f8b63bd3a8e9a610c15ef3331b23375f4aeecf.camel@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: <97f8b63bd3a8e9a610c15ef3331b23375f4aeecf.camel@intel.com> On Wed, Mar 20, 2024 at 12:11:17AM +0000, "Edgecombe, Rick P" wrote: > On Tue, 2024-03-19 at 17:09 -0700, Isaku Yamahata wrote: > > > The helper abstracts setting the arguments into the proper > > > registers > > > fields passed in, but doesn't abstract pulling the result out from > > > the > > > register fields. Then the caller has to manually extract them in > > > this > > > verbose way. Why not have the helper do both? > > > > Yes. Let me update those arguments. > > What were you thinking exactly, like? > > tdh_mem_sept_add(kvm_tdx, gpa, tdx_level, hpa, &entry, &level_state); > > And for the other helpers? I have the following four helpers. Other helpers will have no out argument. tdh_mem_sept_add(kvm_tdx, gpa, tdx_level, hpa, &entry, &level_state); tdh_mem_page_aug(kvm_tdx, gpa, hpa, &entry, &level_state); tdh_mem_page_remove(kvm_tdx, gpa, tdx_level, &entry, &level_state); tdh_mem_range_block(kvm_tdx, gpa, tdx_level, &entry, &level_state); -- Isaku Yamahata