Re: [PATCH v4 2/2] coco: guest: arm64: Drop dummy RSI platform device stub
From: Greg KH
Date: Wed May 13 2026 - 03:12:08 EST
On Wed, May 13, 2026 at 12:28:12PM +0530, Aneesh Kumar K.V wrote:
> Catalin Marinas <catalin.marinas@xxxxxxx> writes:
>
> > + Suzuki again
> >
> > On Mon, Apr 27, 2026 at 11:46:15AM +0530, Aneesh Kumar K.V (Arm) wrote:
> >> The SMCCC firmware driver now creates the `arm-smccc` platform device
> >> and also creates the CCA auxiliary devices once the RSI ABI is
> >> discovered. This makes the arch-specific arm64_create_dummy_rsi_dev()
> >> helper redundant. Remove the arm-cca-dev platform device registration
> >> and let the SMCCC probe manage the RSI device.
> >>
> >> systemd match on platform:arm-cca-dev for confidential vm detection [1].
> >> Losing the platform device registration can break that. Keeping this
> >> removal in its own change makes it easy to revert if that regression
> >> blocks the rollout.
> >>
> >> [1] https://lore.kernel.org/all/4a7d84b2-2ec4-4773-a2d5-7b63d5c683cf@xxxxxxx
> >
> > I wouldn't merge this now given that systemd checks this file. Could we
> > have a symbolic link instead for some time until systemd eventually gets
> > updated (years?).
> >
>
> I’ll add this in the next revision.
>
> static int create_rsi_compat_link(struct device *target_dev)
> {
> struct kobject *platform_kobj;
> /*
> * target_dev is:
> * /sys/devices/platform/arm-smccc/arm_cca_guest.arm-rsi-dev.0
> * Create compat link /sys/devices/platform/arm-cca-dev
> */
> platform_kobj = target_dev->kobj.parent->parent;
What? That is crazy, you don't know that is always going to be ok.
> return sysfs_create_link(platform_kobj,
> &target_dev->kobj,
> "arm-cca-dev");
No, don't do that, if a driver calls a sysfs* function, something is
almost always wrong. Don't be making random sysfs symlinks please.
If userspace can not find the device anymore, that's fine, that's how
sysfs works, devices move around all the time. Especially platform
devices as those are almost always not supposed to be platform devices :)
thanks,
greg k-h