Skip to content

Commit b142c7c

Browse files
committed
builders: fix xs RTL running nanosleep
1 parent 09d422f commit b142c7c

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

builders/cptBuilder/qemu/default.nix

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ stdenv.mkDerivation {
6060
'' /* fix bug that not taking 0th checkpoint */ + ''
6161
sed -i '/if (first_insns_item->data == 0) {/,/^ }$/d' target/riscv/multicore.c
6262
sed -i 's/limit_instructions==0/\&ns->sync_info.online_cpus==0/' target/riscv/serializer.c
63+
'' /* fix: sstc is disabled in nemu machine if not provide_rdtime*/ + ''
64+
sed -i 's/RISCV_ACLINT_DEFAULT_TIMEBASE_FREQ, false/RISCV_ACLINT_DEFAULT_TIMEBASE_FREQ, true/' hw/riscv/nemu.c
6365
'';
6466

6567
buildInputs = [

builders/default.nix

+1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ cores ? "1"
125125
, linuxKernelPatches ? [
126126
(import ./imgBuilder/linux/patches/enable-clint.nix)
127127
(import ./imgBuilder/linux/patches/panic_shutdown.nix)
128+
(import ./imgBuilder/linux/patches/relaxing_random_entropy.nix)
128129
]
129130

130131
, ...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
rec {
2+
name = "relaxing-random-entropy";
3+
patch = builtins.toFile name ''
4+
--- a/drivers/char/random.c
5+
+++ b/drivers/char/random.c
6+
@@ -1280,8 +1280,6 @@
7+
last = stack->entropy;
8+
}
9+
stack->samples_per_bit = DIV_ROUND_UP(NUM_TRIAL_SAMPLES, num_different + 1);
10+
- if (stack->samples_per_bit > MAX_SAMPLES_PER_BIT)
11+
- return;
12+
13+
atomic_set(&stack->samples, 0);
14+
timer_setup_on_stack(&stack->timer, entropy_timer, 0);
15+
'';
16+
}

0 commit comments

Comments
 (0)