Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp50533lqp; Wed, 20 Mar 2024 13:21:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW76zzHlYYF0PxAuVT/nA/ZKnvvw3sBbXJCm4Oyy4k17ZZsWEyVZQdlpcaifsPIeY3zu5T2gjVSzuy9jQ+PduDhb4diRKT3W35PdU9VGw== X-Google-Smtp-Source: AGHT+IH+2RzUJk5DgDogmQ3Rc7Af5WJZ0VO1MnD6M0p0Y6GU+GbxQqK2jOxa1fEuDHzX1cw6tgFZ X-Received: by 2002:a17:906:b0b:b0:a46:c139:bc30 with SMTP id u11-20020a1709060b0b00b00a46c139bc30mr6412468ejg.43.1710966065258; Wed, 20 Mar 2024 13:21:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710966065; cv=pass; d=google.com; s=arc-20160816; b=m/yTuwmsK8tCEdK2dwkzDEUakZQBhvXNl41tjH6ccjIaJJmEtJjaj8/h9OwbEXy24p gJ6NlC+Z+NqO6h5qTXgAL9J1YZL1VwpKsdraMkFfgYgHAqcORu54Qpei+voJZfLXKguq hVnMypaShzOQJYQghq5fJ95ECBHLYiFrnEnhAxJbDeSsyDuu+I4+st1NncqFnGkoL3FJ 8KPeUpSlLo6DRowPEP2OUiApMTujodu3HAlzcno2LrG2UEmq38I68acKQPC9rBl5Mdus EKoRWy6wr13z0GATrzXhLe/DI4Tf54eVd+J2mdz4IBFGobxlynJMgKHtpziEgYyM7Myv byEQ== 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=W80zyLuUaj+bLk6Jpu6+4LSRTtXMXYd3txLHHX1YGTI=; fh=8LkwZNJlRIPdU0Yrrteug9btHk5j6S09vjaHixZuodI=; b=o2p+jCq2hWsf1y7PEjYbeyBSh8qaxYSbQP+L/+JXqO5RlLrJiAWMFInlzYcBmRUIAo vjGtwDT6Gamof/HDo2QGo00mgPCULNBS0URAxHpjC9kAtyNsh2IJDbk50jD4nP7dyFMg ZXu6hz8yTQ39s+mJOvBdtEso0kppraGHsjJK2P0o+v3yGyCEbX1hd4+G5WflW+m72l2t PlKx7Vnn6tFUuOaDQ8J27sfFv5vrKNkWZDrYqkLF9RsAnkrIXrDAufSkfi8od+fuYzGZ OPygQLrJFdI26RYBu3sdLd1cl8YaepgSMI/HCyQagop4ntujcVvbirYGRt+Ug1HNh5Xm 1Khw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UMNUcAHv; 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-109392-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109392-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id hs14-20020a1709073e8e00b00a46b9caeaa7si3786983ejc.219.2024.03.20.13.21.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 13:21:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-109392-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UMNUcAHv; 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-109392-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109392-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 02F9B1F235F4 for ; Wed, 20 Mar 2024 20:21:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 91D4B85943; Wed, 20 Mar 2024 20:20:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="UMNUcAHv" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (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 7759029CE8; Wed, 20 Mar 2024 20:20:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710966055; cv=none; b=c24GmtpdsxsucYNBzkJAFmDpWcGHgSBZET2L0hneM578mMeIw9E0Zy/Q6CWap2mBgE9/DPWrfC8XAjalP+A7UBK+sZxtndPHZD1A9GY9z3TVDODO0n7U/TZpy6LmB2MtVbPtU5/mNRv4Bt1v9NhMRls+1CTawWmwk9DqeGc17iQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710966055; c=relaxed/simple; bh=6KLApuHLnnboa7nGw7DTgDv4GVeg3my1JXPtaub9h/w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ni6TxU9NrhF+y2AnulspKBfrBhGd+cZosgg//AiULX9irbqrdLF8juClYALIY2IgkNvhKWmRH/J6WoLg+HNrRK+wGzAxaDp6qG6NRt9InaiKUNDsk5rBXW5wfmSo7hRSi2lQvmBC1E5Kl8zOSQIdqonnRxh6l8da/x16HynYKpc= 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=UMNUcAHv; arc=none smtp.client-ip=198.175.65.16 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=1710966054; x=1742502054; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=6KLApuHLnnboa7nGw7DTgDv4GVeg3my1JXPtaub9h/w=; b=UMNUcAHvAYbJNgH3hVlSvJRZ4Sx+JDrAuBhQxS45QU1xATXPPPipTM5j N/9Uy3LgIvv9WCIhSFj5UZYZyVTxBEMqcP5EindvHkmrxLo6mEoWl+VqP 90fTVrKcGBtS+GahobvyxA3WpHKry0xBxDJRQc4x44v8HUttHECk7Yeqz xhzhO0ICBQ7gCHDIPMbITfkLzCRXsJRFO72SIE7N2kjs4RahL/JBVteZO q8yVUQTsedQ8SO7PiGv9VpYVNy+YBgzJ6ofdGOgQSXKjPKLr3/bRVbA+X PWfCvbEnfSuhNSEX1Embd2M2oYzwFeFCef2oYsLAfSR+vJCtea5aeZMG6 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,11019"; a="6037911" X-IronPort-AV: E=Sophos;i="6.07,141,1708416000"; d="scan'208";a="6037911" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2024 13:20:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,141,1708416000"; d="scan'208";a="18998840" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by ORVIESA003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2024 13:20:41 -0700 Date: Wed, 20 Mar 2024 13:20:40 -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: <20240320202040.GH1994522@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> <20240320054109.GE1994522@ls.amr.corp.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: <20240320054109.GE1994522@ls.amr.corp.intel.com> On Tue, Mar 19, 2024 at 10:41:09PM -0700, Isaku Yamahata wrote: > 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); By updating the code, I found that tdh_mem_range_block() doesn't need out variables. and tdh_vp_rd() needs output. tdh_mem_range_block() doesn't need the out. u64 tdh_vp_rd(struct vcpu_tdx *tdx, u64 field, u64 *value) -- Isaku Yamahata