Re: [PATCH v11 7/7] coco: guest: arm64: Replace dummy CCA device with sysfs ABI
From: Aneesh Kumar K . V
Date: Wed Sep 16 2026 - 10:10:17 EST
Catalin Marinas <catalin.marinas@xxxxxxx> writes:
> On Mon, Sep 14, 2026 at 11:35:11AM +0530, Aneesh Kumar K.V (Arm) wrote:
>> diff --git a/Documentation/ABI/testing/sysfs-firmware-cca b/Documentation/ABI/testing/sysfs-firmware-cca
>> new file mode 100644
>> index 000000000000..bf177d636b92
>> --- /dev/null
>> +++ b/Documentation/ABI/testing/sysfs-firmware-cca
>> @@ -0,0 +1,10 @@
>> +What: /sys/firmware/cca/realm_guest
>> +Date: May 2026
>> +Contact: Linux ARM Kernel Mailing list <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>
>> +Description: Read-only. Indicates whether the kernel is running as an
>> + Arm Confidential Compute Architecture (CCA) Realm guest.
>> +
>> + The value is one of:
>> +
>> + 0: the kernel is not running as a Realm guest
>> + 1: the kernel is running as a Realm guest
>
> Does this file ever read as 0? It is created only if rsi_present and
> always reads as 1. That's fine by me but we shouldn't document 0 as a
> value. More like if present, it always reads 1 and RSI is present.
>
For now, that is correct. However, the two checks could diverge if Realm
guest support is enabled only after additional checks, such as version
compatibility.
In that case, is_realm_world() and static_branch_unlikely(&rsi_present)
could return different results.
I assume that any error when reading the file, including -ENOENT, can be
treated as indicating that the kernel is not running as a Realm guest.
Do we need to document that?
-aneesh