From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (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 E5B4533065D for ; Wed, 28 Jan 2026 06:50:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769583057; cv=none; b=dEIH82NLgdYy310SUCX5nRB8qsvOOytpVtWzZT/UQ1vnXVGkobJb9AN5ykIvbBUhzHDlaku8tJECUhuKm88ZrBWs/xauaOFzXS7JrksxyY67WI8OCjNh52KrexwKjoCaOuUWwUYTJkm0YN1JrxAZ/Refm6wSohhtIIOc5+5nDZk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769583057; c=relaxed/simple; bh=gzN16H435P71a1hFvbzPcNWJPMvuFh1t8O7DMR3D2vQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=E7RlKnahGZb61QAx6sEoEc7uo61oFYQkS+I0bqt6/cX6L/3jwYuxrCirZuCtBb9uBgZC/2vJUYOs6Z9RBWbOjxFIit9J4Vum3vn9cwc5PXuxiQlYlieCtNZAVAkGj+qP/oaOekb2jn5dVp3XYDKhwrx9pbfGlYyuCwhy0hcNiQo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=LjGyRfdW; arc=none smtp.client-ip=192.198.163.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="LjGyRfdW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1769583056; x=1801119056; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=gzN16H435P71a1hFvbzPcNWJPMvuFh1t8O7DMR3D2vQ=; b=LjGyRfdWnczUFXs/i5qL6FnzxebgMUvqfFWtyHayrTKzFyfhyy9Wfllt LTBPgOgNcUb5ncTb2rA96m+62aG5i42or+nHGSEbuTrcnrHTQpDxgSE+o uzLWAdSTrTA+AyakLzIlvPlUNFXyu/MGMAs0Uum6U2P+vgDpKxXWu+ezT MSAuMZf1/kV8otIFOv48KuoetZk2tJSzfqPLU2ll9JvHI5GgfWpN2a48e szFGLy8lMtJioizxm2dsAzSdjKrVkQd/tZoNNH8jK70580a9gFRzWQWov vqIHS40Zvi7urE4HV/I5qVWpz38bnFPAHj6PEe9Jnl9wL02TyRLtWG0in Q==; X-CSE-ConnectionGUID: ap6r3tzzRr+cUHuQVKLDuw== X-CSE-MsgGUID: M3rDtaMCQuyCMh4nDY7tRQ== X-IronPort-AV: E=McAfee;i="6800,10657,11684"; a="70876635" X-IronPort-AV: E=Sophos;i="6.21,258,1763452800"; d="scan'208";a="70876635" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2026 22:50:55 -0800 X-CSE-ConnectionGUID: bM+WCizAQIa5E73sYAQT/g== X-CSE-MsgGUID: PPfEoJHAQO6KhehHhtx8Ig== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,258,1763452800"; d="scan'208";a="208543927" Received: from unknown (HELO [10.238.1.231]) ([10.238.1.231]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2026 22:50:50 -0800 Message-ID: Date: Wed, 28 Jan 2026 14:50:47 +0800 Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 08/26] x86/virt/seamldr: Retrieve P-SEAMLDR information To: Chao Gao Cc: linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, x86@kernel.org, reinette.chatre@intel.com, ira.weiny@intel.com, kai.huang@intel.com, dan.j.williams@intel.com, yilun.xu@linux.intel.com, sagis@google.com, vannapurve@google.com, paulmck@kernel.org, nik.borisov@suse.com, zhenzhong.duan@intel.com, seanjc@google.com, rick.p.edgecombe@intel.com, kas@kernel.org, dave.hansen@linux.intel.com, vishal.l.verma@intel.com, Farrah Chen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" References: <20260123145645.90444-1-chao.gao@intel.com> <20260123145645.90444-9-chao.gao@intel.com> Content-Language: en-US From: Binbin Wu In-Reply-To: <20260123145645.90444-9-chao.gao@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 1/23/2026 10:55 PM, Chao Gao wrote: > P-SEAMLDR returns its information e.g., version and supported features, in > response to the SEAMLDR.INFO SEAMCALL. > > This information is useful for userspace. For example, the admin can decide > which TDX module versions are compatible with the P-SEAMLDR according to > the P-SEAMLDR version. > > Add and export seamldr_get_info() which retrieves P-SEAMLDR information by > invoking SEAMLDR.INFO SEAMCALL in preparation for exposing P-SEAMLDR > version and other necessary information to userspace. > > Signed-off-by: Chao Gao > Tested-by: Farrah Chen Reviewed-by: Binbin Wu One nit below. [...] > diff --git a/arch/x86/virt/vmx/tdx/seamldr.c b/arch/x86/virt/vmx/tdx/seamldr.c > index b99d73f7bb08..6a83ae405fac 100644 > --- a/arch/x86/virt/vmx/tdx/seamldr.c > +++ b/arch/x86/virt/vmx/tdx/seamldr.c > @@ -9,9 +9,16 @@ > #include > #include > > +#include > + > #include "seamcall.h" > > -static __maybe_unused int seamldr_call(u64 fn, struct tdx_module_args *args) > +/* P-SEAMLDR SEAMCALL leaf function */ > +#define P_SEAMLDR_INFO 0x8000000000000000 > + > +static struct seamldr_info seamldr_info __aligned(256); > + > +static inline int seamldr_call(u64 fn, struct tdx_module_args *args) No need to tag the local function with inline. > { > unsigned long flags; > u64 vmcs; > @@ -54,3 +61,11 @@ static __maybe_unused int seamldr_call(u64 fn, struct tdx_module_args *args) > WARN_ONCE(1, "Failed to save/restore the current VMCS"); > return -EIO; > }