Linux-Next discussions
 help / color / mirror / Atom feed
From: "Xing, Cedric" <cedric.xing@intel.com>
To: Greg KH <greg@kroah.com>, Dan Williams <dan.j.williams@intel.com>
Cc: "Stephen Rothwell" <sfr@canb.auug.org.au>,
	sathyanarayanan.kuppuswamy@linux.intel.com, yilun.xu@intel.com,
	sameo@rivosinc.com, aik@amd.com, suzuki.poulose@arm.com,
	steven.price@arm.com, lukas@wunner.de,
	"Thomas Weißschuh" <linux@weissschuh.net>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Linux Next Mailing List" <linux-next@vger.kernel.org>
Subject: Re: linux-next: build failure after merge of the devsec-tsm tree
Date: Mon, 12 May 2025 12:40:43 -0500	[thread overview]
Message-ID: <36988bb6-af90-4f1a-94ce-353fb5cba2ca@intel.com> (raw)
In-Reply-To: <2025050909-muscular-lanky-48ac@gregkh>

On 5/9/2025 2:12 AM, Greg KH wrote:
[...]
> But what are these binary files for?  I looked in the documentation and
> found this entry:
> 	/sys/devices/virtual/misc/tdx_guest/measurements/rtmr[0123]:sha384
> is that these binary files?
> 
All files (including rtmr[0123]:sha384) under 
/sys/devices/virtual/misc/tdx_guest/measurements/ are TDX measurement 
registers, one file (sysfs binary attribute) per each register.

> Why is sysfs being used to expose binary "registers" and not done
> through the ioctl api instead?
Sysfs is preferred over ioctl for exposing TD measurement registers for 
several reasons:

- Global Register Values: The register values are global and not tied to 
specific file descriptors of the tdx_guest device.
- Intuitive Operations: The operations supported by these registers can 
be intuitively mapped to file read/write operations.
- Ease of Access: Sysfs attributes allow easy enumeration and access 
from all programming languages, including shell commands and scripts. 
This ease of access is beneficial for application debugging, enabling, 
and platform diagnosis/maintenance, as these measurements are relevant 
to all SW running inside the same TD.

> That's an internal kernel-computed
> structure, not coming from the hardware, or am I mistaken?
> 
These are measurement registers of the current TD on Intel platforms. 
They are read together via the TDG.MR.REPORT TDCALL then broken down 
into individual register values. They are NOT computed by the kernel but 
come directly from the TDX ISA.


  reply	other threads:[~2025-05-12 17:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-08  8:10 linux-next: build failure after merge of the devsec-tsm tree Stephen Rothwell
2025-05-09  0:37 ` Dan Williams
2025-05-09  7:12   ` Greg KH
2025-05-12 17:40     ` Xing, Cedric [this message]
2025-05-12 18:45     ` Dan Williams
2025-05-10  7:05   ` Thomas Weißschuh
2025-05-13  4:56     ` Dan Williams

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=36988bb6-af90-4f1a-94ce-353fb5cba2ca@intel.com \
    --to=cedric.xing@intel.com \
    --cc=aik@amd.com \
    --cc=dan.j.williams@intel.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=lukas@wunner.de \
    --cc=sameo@rivosinc.com \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=sfr@canb.auug.org.au \
    --cc=steven.price@arm.com \
    --cc=suzuki.poulose@arm.com \
    --cc=yilun.xu@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