Re: [PATCH] x86/sev: Make SEV_STATUS available via SYSFS

Juergen Gross
2025-03-10T12:28:41Z

[-- Attachment #1.1.1: Type: text/plain, Size: 1536 bytes --]

On 10.03.25 12:24, Alexey Gladkov wrote:
> On Mon, Mar 10, 2025 at 11:28:46AM +0100, Joerg Roedel wrote:
>> On Thu, Mar 06, 2025 at 11:37:28AM +0100, Alexey Gladkov (Intel) wrote:
>>> I was thinking to suggest something like that
>>>
>>> /sys/firmware/coco/tdx/...
>>> /sys/firmware/coco/sev/...
>>
>> So on a second thought I'd like to vote for the /sys/hypervisor/
>> hierarchy. The `firmware` term is a bit amibious here, the TDX module
>> can be seen as a kind of firmware for the guest OS, but realistically it
>> is more like another hypervisor sitting between KVM and the guest.
>>
>> Also the settings on the SEV side that need to be exposed (VMPL and
>> SEV_STATUS) are CPU properties, but on the other side also set by some
>> form of hypervisor (either KVM/QEMU, the SVSM, or some other paravisor
>> in-between).
>>
>> Overall /sys/hypervisor/ seems to be the best-fitting location for all
>> this data. To avoid ambiguation I propose:
>>
>> /sys/hypervisor/common/[coco/]tdx/
>> /sys/hypervisor/common/[coco/]sev/
>
> The /sys/hypervisor requires CONFIG_SYS_HYPERVISOR=y. Now, this parameter
> is not required for the minimum TDX guest configuration.
>
> As I can see right now [1] this directory is used exclusively by xen team.
> It's part of their ABI stable. I'm not sure we can go in there.

We can (saying that with my Xen maintainer hat on).

There is /sys/hypervisor/type which should return the used virtualization
environment ("xen" when running as a Xen guest).

Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]