User:Demindiro/SBI: Difference between revisions

no edit summary
(Important note about QEMU being buggy)
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1:
{{stub|nocat=1}}
 
{{In Progress|nocat=1}}
 
 
Line 41:
 
{{NoteBox
| <p>QEMU as of 6.1.0-rc3 [https://gitlab.com/qemu-project/qemu/-/issues/493 does not handle <code>UINT64_MAX</code> properly]. To fix this, apply the following patch:</p>
<pre style="text-align:left">
diff --git a/hw/intc/sifive_clint.c b/hw/intc/sifive_clint.c
Line 52:
muldiv64(diff, NANOSECONDS_PER_SECOND, timebase_freq);
+ /* ensure next does not overflow, as timer_mod takes a signed value */
+ next = MAXMIN(next, INT64_MAX);
timer_mod(cpu->env.timer, next);
}
Line 66:
 
 
[[:Category:RISC-V]]
[[Category:User drafts]]