From: Oliver Upton <oliver.upton@linux.dev>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: Jianyong Wu <jianyong.wu@arm.com>,
maz@kernel.org, james.morse@arm.com, will@kernel.org,
salil.mehta@huawei.com, suzuki.poulose@arm.com,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
linux-kernel@vger.kernel.org, justin.he@arm.com
Subject: Re: [PATCH] arm64/kvm: Introduce feature extension for SMCCC filter
Date: Thu, 16 Nov 2023 15:22:10 -0800 [thread overview]
Message-ID: <ZVakIv5mw6YUlHms@thinky-boi> (raw)
In-Reply-To: <ZVZoKlWrjV1L3CBo@shell.armlinux.org.uk>
On Thu, Nov 16, 2023 at 07:06:18PM +0000, Russell King (Oracle) wrote:
> 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 would also work, as we return ENXIO for the unsupported ioctl.
> 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.
I generally agree, but KVM has gone in the other direction of providing
auxiliary interfaces for discovering new UAPI. ENXIO has been slightly
overloaded to imply that a given ioctl is non-existent or otherwise
unsupported due to some dynamic configuration.
Is it ideal? Of course not. With that said userspace may as well use the
preferred / documented discoverability mechanism. And in Jianyong's case
the KVM documentation is rather unambiguous (for once) about how you
discover device attributes.
https://docs.kernel.org/virt/kvm/api.html#kvm-has-device-attr
--
Thanks,
Oliver
WARNING: multiple messages have this Message-ID (diff)
From: Oliver Upton <oliver.upton@linux.dev>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: Jianyong Wu <jianyong.wu@arm.com>,
maz@kernel.org, james.morse@arm.com, will@kernel.org,
salil.mehta@huawei.com, suzuki.poulose@arm.com,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
linux-kernel@vger.kernel.org, justin.he@arm.com
Subject: Re: [PATCH] arm64/kvm: Introduce feature extension for SMCCC filter
Date: Thu, 16 Nov 2023 15:22:10 -0800 [thread overview]
Message-ID: <ZVakIv5mw6YUlHms@thinky-boi> (raw)
In-Reply-To: <ZVZoKlWrjV1L3CBo@shell.armlinux.org.uk>
On Thu, Nov 16, 2023 at 07:06:18PM +0000, Russell King (Oracle) wrote:
> 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 would also work, as we return ENXIO for the unsupported ioctl.
> 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.
I generally agree, but KVM has gone in the other direction of providing
auxiliary interfaces for discovering new UAPI. ENXIO has been slightly
overloaded to imply that a given ioctl is non-existent or otherwise
unsupported due to some dynamic configuration.
Is it ideal? Of course not. With that said userspace may as well use the
preferred / documented discoverability mechanism. And in Jianyong's case
the KVM documentation is rather unambiguous (for once) about how you
discover device attributes.
https://docs.kernel.org/virt/kvm/api.html#kvm-has-device-attr
--
Thanks,
Oliver
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-11-16 23:22 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-16 11:41 [PATCH] arm64/kvm: Introduce feature extension for SMCCC filter Jianyong Wu
2023-11-16 11:41 ` Jianyong Wu
2023-11-16 13:08 ` Cornelia Huck
2023-11-16 13:08 ` Cornelia Huck
2023-11-16 14:06 ` Salil Mehta
2023-11-16 14:06 ` Salil Mehta
2023-11-21 1:58 ` Jianyong Wu
2023-11-21 1:58 ` Jianyong Wu
2023-11-16 14:21 ` Marc Zyngier
2023-11-16 14:21 ` Marc Zyngier
2023-11-21 2:01 ` Jianyong Wu
2023-11-21 2:01 ` Jianyong Wu
2023-11-16 19:06 ` Russell King (Oracle)
2023-11-16 19:06 ` Russell King (Oracle)
2023-11-16 23:22 ` Oliver Upton [this message]
2023-11-16 23:22 ` Oliver Upton
2023-11-21 10:57 ` Salil Mehta
2023-11-21 10:57 ` Salil Mehta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZVakIv5mw6YUlHms@thinky-boi \
--to=oliver.upton@linux.dev \
--cc=james.morse@arm.com \
--cc=jianyong.wu@arm.com \
--cc=justin.he@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=maz@kernel.org \
--cc=salil.mehta@huawei.com \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.