The check on hyp pointer is done later than just before
using it for the first time. Move the MPASS check just
before using the pointer for the first time.
Signed-off-by: Doongar Singh <doonbsd@gmail.com>
Differential D54856
riscv: Do MPASS check on hyp pointer before using it Authored by doonbsd_gmail.com on Sat, Jan 24, 6:04 AM. Tags None Referenced Files
Details
Diff Detail
Event TimelineComment Actions Better would just be to remove the assertion IMO. It's a bit silly to assert that malloc(M_WAITOK) returns a non-NULL pointer. Comment Actions Well it is where it is because (a) asserting in vmmops_init is pointless with M_WAITOK as you say (b) vm_init is in a separate translation unit so in some world views should treat vmmops_init as a black box, and is therefore asserting that it never fails. And this pattern is copied from arm64, so we should keep the two consistent, whichever way it goes. Comment Actions "vm_init" is implementation specific. I understand point (a) but as per (b) it's unnecessary that two architectures have the exact same implementation line by line. As of now for both architectures don't need this check. Comment Actions I agree that we should keep arm64 consistent at the very least. I tend to think that asserting that a pointer is non-NULL is silly, but on second thought a patch that just removes assertions is also a bit silly. So I'd rather just leave these alone. |