-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify hart_mask_base requirements #197
Conversation
Overall looks good to me but there is spec build failure. Add separate first commit in this PR to fix this build issue. Here's how we fixed it for BRS spec (commit) |
v3 is no longer supported. See [1]. Link: https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/ [1] Signed-off-by: Andrew Jones <[email protected]>
hart_mask_base doesn't need to be valid unless bit0 of hart_mask is set, since the base isn't used independently. Clarify this to ensure implementations don't return SBI_ERR_INVALID_PARAM for invalid hart_mask_base when hart_mask isn't selecting it. Signed-off-by: Andrew Jones <[email protected]>
94e6b1c
to
46fe6e4
Compare
Where does this requirement come from? Why is bit 0 special? If I want to select hart 2, why can't I set This isn't how existing software works, for example: https://github.com/riscv-software-src/opensbi/blob/fe11dee7eaeef71c4e03f8244f1b3d16b8cac460/lib/sbi/sbi_ipi.c#L124. |
This change would break FreeBSD: https://github.com/freebsd/freebsd-src/blob/11db70b6057e41b259dc2245cd893d5b19179fcc/sys/riscv/riscv/sbi.c#L209 |
It's the other way around. The spec should now say that you can, while you couldn't before. SBI now returns an error only if |
Ah, I see now how you're interpreting it. I never thought of With a fresh look, the change looks good to me. |
Maybe we could move the note to the changelog (or just remove it). You're right that no-one should think that the note is needed... it only made sense to people who knew how the spec was before. |
But above the note we have:
We could try to reword hart_mask_base's definition, but I feel like it would get convoluted, and the current "starting hartid" may imply a valid hartid to some readers, simply because references to hartids aren't generally to potentiality invalid hartids. |
I also had the same interpretation as @SiFiveHolland at first read. I think the commit text is bit confusing. The note in the actual commit makes more sense.
|
hart_mask_base doesn't need to be valid unless bit0 of hart_mask is set, since the base isn't used independently. Clarify this to ensure implementations don't return SBI_ERR_INVALID_PARAM for invalid hart_mask_base when hart_mask isn't selecting it.