From: "Sun, Yi" <Yi.Sun@intel.com>
To: "Huang, Kai" <kai.huang@intel.com>
Cc: "tglx@linutronix.de" <tglx@linutronix.de>,
"mingo@redhat.com" <mingo@redhat.com>,
"peterz@infradead.org" <peterz@infradead.org>,
"x86@kernel.org" <x86@kernel.org>, "bp@alien8.de" <bp@alien8.de>,
"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
"kirill.shutemov@linux.intel.com"
<kirill.shutemov@linux.intel.com>,
"sathyanarayanan.kuppuswamy@linux.intel.com"
<sathyanarayanan.kuppuswamy@linux.intel.com>,
"Su, Heng" <heng.su@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Yan, Dongcheng" <dongcheng.yan@intel.com>,
"yi.sun@linux.intel.com" <yi.sun@linux.intel.com>
Subject: Re: [PATCH v4] x86/tdx: Dump TDX version During the TD Bootup
Date: Fri, 6 Oct 2023 19:09:49 +0800 [thread overview]
Message-ID: <ZR/q/VaR8gF1CdOg@ysun46-mobl.ccr.corp.intel.com> (raw)
In-Reply-To: <9db9a874e5b7ff62e9cb419f51279047438c30ec.camel@intel.com>
On 06.10.2023 17:48, Huang, Kai wrote:
>On Fri, 2023-10-06 at 14:28 +0800, Yi Sun wrote:
>
>
>It's better if you can maintain the code change history among different versions
>so that people can see what changes have been done:
>
> <your SoB>
> ---
> code change history
> ---
> ...
>
>The "code change history" will be thrown away when the patch is applied.
>
I'll refine commit log and the change history.
...
>> + td_sys->vendor_id = (u32)args.r8;
>> +
>> + args.rdx = TDX_SYS_MAJOR_FID;
>> + __tdcall_ret(TDX_SYS_RD, &args);
>> +
>> + td_sys->major_version = (u16)args.r8;
>> +
>> + args.rdx = TDX_SYS_MINOR_FID;
>> + __tdcall_ret(TDX_SYS_RD, &args);
>> +
>> + td_sys->minor_version = (u16)args.r8;
>> +
>> + return;
>> +
>> + /* TDX 1.0 does not have the TDCALL TDG.SYS.RD */
>> +version_1_0:
>> + td_sys->vendor_id = TDX_VENDOR_INTEL;
>> + td_sys->major_version = 1;
>> + td_sys->minor_version = 0;
>
>So the main reason that I think you can just print module version in this
>function instead of tdx_early_init() is because IIUC you are setting up some
>random value for TDX module 1.0. Probably it's better to just print it's module
>1.0 w/o mentioning major/minor.
Actually, it is not a random value here; it is the fixed value for TDX 1.0
becasue there is not such version info in TDX 1.0.
I assume we can state major=1 and minor=0 when TDX 1.0 is detected.
This will prevent confusion for the users.
>As replied above, I think you can print module info in tdg_get_sysinfo().
>
>If you do so, perhaps to rename the function to something like
>detect_tdx_version().
>
>You can either still keep
>
> pr_info("Guest detected\n");
>
>here, or remove it but embed it to the message when you print module version.
Get it. I'll do that.
>
>
>> diff --git a/arch/x86/include/asm/shared/tdx.h b/arch/x86/include/asm/shared/tdx.h
>> index f74695dea217..d326509832e6 100644
>> --- a/arch/x86/include/asm/shared/tdx.h
>> +++ b/arch/x86/include/asm/shared/tdx.h
>> @@ -17,6 +17,7 @@
>> #define TDG_MR_REPORT 4
>> #define TDG_MEM_PAGE_ACCEPT 6
>> #define TDG_VM_WR 8
>> +#define TDX_SYS_RD 11
>
>TDG_SYS_RD, please.
Appreciate Kai's detailed comments.
Thanks
--Sun, Yi
next prev parent reply other threads:[~2023-10-06 14:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-06 6:28 Yi Sun
2023-10-06 8:11 ` Nikolay Borisov
2023-10-06 10:20 ` Yi Sun
2023-10-06 9:48 ` Huang, Kai
2023-10-06 11:09 ` Sun, Yi [this message]
2023-10-06 20:40 ` Huang, Kai
2023-10-09 1:23 ` Kuppuswamy Sathyanarayanan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZR/q/VaR8gF1CdOg@ysun46-mobl.ccr.corp.intel.com \
--to=yi.sun@intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=dongcheng.yan@intel.com \
--cc=heng.su@intel.com \
--cc=kai.huang@intel.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=sathyanarayanan.kuppuswamy@linux.intel.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=yi.sun@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®