[PATCH] riscv: Move user-visible sbi ext ids to uapi
Andrew Jones
ajones at ventanamicro.com
Thu Oct 9 08:07:20 PDT 2025
On Thu, Oct 09, 2025 at 03:27:18PM +0800, BillXiang wrote:
> On 10/9/2025 4:37 AM, Paul Walmsley wrote:
> > Hi Drew,
> >
> > On Wed, 8 Oct 2025, Andrew Jones wrote:
> >
> >> On Wed, Oct 08, 2025 at 12:17:01PM -0600, Paul Walmsley wrote:
> >> ...
> >>> I do have some broader questions: is this patch really needed? Is it
> >>> fixing anything that's broken? These SBI constants aren't defined by the
> >>> kernel; they come from RISC-V standards.
>
> Hi All,
>
> Thanks for the review, and sorry for the noise my earlier mistake caused.
> Just to clarify the intent of this patch: these SBI constants are
> defined by the RISC-V spec, but they are implemented by kernel.
> IMO, for a userspace developer working on linux it's better to include
> this constants from kernel instead of define them again.
> If you don't like the patch, feel free to ignore it, nothing breaks
> either way.
> Additionally, the goodness of UAPI was described in[1].
>
> [1] https://lwn.net/Articles/507794/
No one is arguing with the benefits of separate UAPI headers, but these
constants are not Linux UAPI. These constants are SBI. If anything,
there should be a header generator developed that takes the SBI spec as
input and creates headers which can be included into any project that
needs them, such as SBI firmwares, Linux, Xen, KVM VMMs, etc.. That
generator could also create Rust constants directly and prepare the
information for any other languages as well.
Thanks,
drew
>
> >>
> >> Hi Paul,
> >>
> >> You're right that we don't want this patch. I hadn't noticed that the same
> >> patch was posted more than once or I would have nacked it here too. I
> >> replied to the other posting[1] a couple weeks ago.
> >>
> >> [1] https://lore.kernel.org/all/20250924-7e9764acec6722b5ef29ce7d@orel/
> >
> > Thanks for the heads up and for the early review. Patchwork didn't pick
> > up the thread for whatever reason beyond the initial patch, and I didn't
> > bother to check the mail archive...
> >
> >
> > - Paul
More information about the linux-riscv
mailing list