Re: [PATCH] arm64/kvm: Introduce feature extension for SMCCC filter

From: Russell King (Oracle)
Date: Thu Nov 16 2023 - 14:06:46 EST


On Thu, Nov 16, 2023 at 11:41:52AM +0000, Jianyong Wu wrote:
> 821d935c87b introduces support for userspace SMCCC filtering, but lack
> of a way to tell userspace if we have this feature. Add a corresponding
> feature extension can resolve this issue.
>
> For example, the incoming feature Vcpu Hotplug needs the SMCCC filter.
> As there is no way to check this feature, VMM will run into error when
> it calls this feature on an old kernel. It's bad for backward compatible.

Can't you just attempt to use the SMCCC filtering, and if it errors out
with the appropriate error code, decide that SMCCC filtering is not
available?

That's how most things like kernel syscalls work - if they're not
implemented they return -ENOSYS. glibc can detect that and use a
fallback.

Imagine what it would be like if the kernel provided userspace with
a large bitmap of what syscalls were implemented...

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!