Page MenuHomeFreeBSD

riscv vmm: clean up SBI return code
ClosedPublic

Authored by br on Tue, Jan 21, 3:14 PM.
Tags
None
Referenced Files
F109466808: D48575.diff
Wed, Feb 5, 10:55 AM
Unknown Object (File)
Tue, Feb 4, 2:18 AM
Unknown Object (File)
Fri, Jan 31, 6:06 AM
Unknown Object (File)
Wed, Jan 29, 8:03 AM
Unknown Object (File)
Tue, Jan 28, 9:10 PM
Unknown Object (File)
Tue, Jan 28, 4:18 AM
Unknown Object (File)
Mon, Jan 27, 10:19 PM
Subscribers

Details

Summary

Use C return in SBI handlers and clean up a bit

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

br requested review of this revision.Tue, Jan 21, 3:14 PM

style: end of function return SUCCESS unless switch statement hit FAILURE

This doesn't seem to conform to the spec.

An ECALL with an unsupported SBI extension ID (EID) or an unsupported SBI function ID (FID) must return the error code SBI_ERR_NOT_SUPPORTED.

SBI_ERR_INVALID_PARAM Either hart_mask_base, or at least one hartid from hart_mask, is not valid, i.e. either the hartid is not enabled by the platform or is not available to the supervisor.

(this one's a "may return", but I think best to do so)

(but note hart_mask_base of -1 means all harts, and hart_mask is ignored)

sys/riscv/vmm/vmm_sbi.c
160–161

Not for *this* change, but can you please implement this properly? It should not have landed with this TODO...

Address @jrtc27 comments

  • riscv_send_ipi() now takes cpuset* as an argument
  • SBI error codes fixed with respect to the spec
This revision was not accepted when it landed; it landed in state Needs Review.Wed, Feb 5, 9:35 AM
This revision was automatically updated to reflect the committed changes.