mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Joerg Roedel <jroedel@suse.de>
Cc: Joerg Roedel <joro@8bytes.org>,
	x86@kernel.org, hpa@zytor.com,
	Tom Lendacky <thomas.lendacky@amd.com>,
	Nikunj A Dadhania <nikunj@amd.com>,
	Larry.Dewey@amd.com, linux-kernel@vger.kernel.org,
	linux-coco@lists.linux.dev, Juergen Gross <jgross@suse.com>,
	kirill.shutemov@linux.intel.com, alexey.gladkov@intel.com
Subject: Re: [PATCH 2/2] x86/sev: Make SEV_STATUS available via SYSFS
Date: Wed, 12 Mar 2025 09:04:14 -0700	[thread overview]
Message-ID: <862e626a-3d4b-40c0-b1b1-6a51b30dcd22@intel.com> (raw)
In-Reply-To: <Z9GjTBHBqXenCWYx@suse.de>

On 3/12/25 08:07, Joerg Roedel wrote:
> Hi Dave,
> 
> On Wed, Mar 12, 2025 at 07:57:31AM -0700, Dave Hansen wrote:
>> Do we really want to just plumb the raw MSR out to userspace? Users
>> would still need to parse the thing, so it's not _really_ human readable.
> 
> I agree that this is not really human readable. On the other side SYSFS
> is more an interface targeted for tools than optimized for human
> readability (see the one-datum-per-file rule).

Right, but I think it's also intended to be independent and not
*require* tools to make sense of the output. A raw MSR requires tooling
or someone sitting there with the hardware docs to make sense of it.

That's why we have things like:

	/sys/kernel/mm/transparent_hugepage/enabled

that tell you:

	[always] madvise never

as opposed to the old style in:

	/proc/sys/vm/zone_reclaim_mode

which require you to go read the docs and figure out what 0/1/2 mean.

> The actual use-case (and the reason for these patches) of the sev_status
> file is to provide a better and more secure interface than /dev/msr to a
> tool named snpguest.

Let's draw this out to its natural conclusion. There are also a bunch of
TDX attributes that tell you about the capabilities of the VM and the
TDX module.

Should we have:

	/sys/devices/system/cpu/tdx/tdx_attributes

which just dumps out the raw register values that come back from the
TDCALL? Then we'll go write a tdxguest tool to parse those values.

  reply	other threads:[~2025-03-12 16:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-12 14:41 [PATCH 0/2 v2] Move SEV sysfs information and expose MSR_SEV_STATUS Joerg Roedel
2025-03-12 14:41 ` [PATCH 1/2] x86/coco/sev: Move SEV SYSFS group to /sys/hypervisor/ Joerg Roedel
2025-03-12 15:11   ` Tom Lendacky
2025-03-12 15:13     ` Joerg Roedel
2025-03-12 15:32   ` Liam Merwick
2025-03-12 15:43     ` Joerg Roedel
2025-03-12 14:41 ` [PATCH 2/2] x86/sev: Make SEV_STATUS available via SYSFS Joerg Roedel
2025-03-12 14:46   ` Tom Lendacky
2025-03-12 14:56     ` Joerg Roedel
2025-03-12 14:57   ` Dave Hansen
2025-03-12 15:07     ` Joerg Roedel
2025-03-12 16:04       ` Dave Hansen [this message]
2025-03-12 16:19         ` Joerg Roedel

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=862e626a-3d4b-40c0-b1b1-6a51b30dcd22@intel.com \
    --to=dave.hansen@intel.com \
    --cc=Larry.Dewey@amd.com \
    --cc=alexey.gladkov@intel.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=joro@8bytes.org \
    --cc=jroedel@suse.de \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nikunj@amd.com \
    --cc=thomas.lendacky@amd.com \
    --cc=x86@kernel.org \
    /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®