Re: [PATCH v9 1/7] firmware: smccc: Add an Arm SMCCC bus
flat view
From: Aneesh Kumar K.V <aneesh.kumar@kernel.org>
Date: 2026-09-04 05:50:32
Also in:
linux-coco, lkml
Jason Gunthorpe [off-list ref] writes:
On Thu, Sep 03, 2026 at 05:18:16PM +0100, Sudeep Holla wrote:quoted
Oh yes, we need this whatever you term as "duplication". I would argue against terming it as duplications as if you look at the various SMCCC based specification, we have zero consistency in how the VERSION command is expected to work.Okay, then that pretty much settles it. Nothing to doquoted
quoted
Missing a check means FW upgrades might become Linux breaking.Are you referring to the SMCCC bus code or RSI in particular above. I don't see any issue with SMCCC bus code check as that is the least we can do and must not change with future versions of the firmware as well.Just in general, SMCCC drivers have to do something smart with the version. Like, is this OK: #define ARM_SMCCC_TRNG_MIN_VERSION 0x10000UL static inline bool smccc_probe_trng(void) { struct arm_smccc_res res; arm_smccc_1_1_invoke(ARM_SMCCC_TRNG_VERSION, &res); if ((s32)res.a0 < 0) return false; return res.a0 >= ARM_SMCCC_TRNG_MIN_VERSION; } ? It means you can never publish a version 2 that is ABI breaking because linux doesn't check for that. Was that ARM's intention with the version API? It's basically a completely pointless check that doesn't effectively do anything. My broader, more general point is that if SMCC is being made into a discoverable bus, that's great, but it would be even better if ARM could find a way to progmatically enumerate all the ABIs present on the SMCC interface to populate the bus. That would necessarily include some consistent treatment of versioning for consistent interoperability.quoted
If lower is also set at v3.0, then I would argue it is firmware upgrade issue expecting old kernel with old RSI version supported to work. If that returns v2.0, the driver must work IIUC. Aneesh, hopefully I got this right ?There was many long conversations about this and I think the conclusion was RSI will broadly not use versions for any kind of ABI control. It is too coarse to really work in the real world and we must have strong forward/backwards interoperability inside VMs forever.
Even if we take RMI as an example, SMC_RMI_ABI_VERSION returns the lowest and highest supported interface versions. After a firmware upgrade, either value can change. Unless the existing kernel supports an interface version within the advertised range, the upgrade will break compatibility. Including the major version in the modalias does not help with this. Even with separate kernel drivers for versions 1 and 2, we still face the same issue. If the firmware initially supports version 1 and an upgrade raises the lowest supported version to 2, the version 2 driver can handle it. However, that is functionally equivalent to a single driver supporting both interface versions. If the current kernel does not support version 2, either through a single driver or a separate driver, the firmware upgrade will break compatibility. -aneesh