Skip to content

Commit

Permalink
Add some entropy to the icount timer.
Browse files Browse the repository at this point in the history
So that CheriBSD doesn't hang collecting entropy we add 4 bits of
the host clock to the lower bits of the counter this is used for
the timer.
  • Loading branch information
staceyson committed May 11, 2017
1 parent 65cc9fc commit 578c23d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qemu-timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ int64_t qemu_clock_get_ns(QEMUClockType type)
default:
case QEMU_CLOCK_VIRTUAL:
if (use_icount) {
return cpu_get_icount();
return (cpu_get_icount() << 4) | (cpu_get_clock() & 0xful);
} else {
return cpu_get_clock();
}
Expand Down

0 comments on commit 578c23d

Please sign in to comment.