Andrew Waterman
abadfdc507
Avoid dependence on asm ssp symbol
Resolves #336
1 year ago
Andrew Waterman
7f3bef0119
Enable CBOs (but upgrade inval to flush for safety)
2 years ago
Andrew Waterman
47a2e87ccd
Support CFI shadow stacks via --zicfiss command-line arg
2 years ago
Ming-Yi Lai
6c62461a1e
Zicfilp: Support enabling userspace Zicfilp mechanism
2 years ago
Andrew Waterman
7e9b671c04
Specify text section in rest_of_boot_loader definition
Fixes #282
4 years ago
Christoph Müllner
12edfed73d
pk: Fix __clear_cache() compilation issue with recent compilers ( #240 )
Using recent compilers we get the following error message:
../pk/pk.c: In function 'run_loaded_program.constprop':
../pk/pk.c:177:3: error: both arguments to '__builtin___clear_cache'
must be pointers
177 | __clear_cache(0, 0);
| ^~~~~~~~~~~~~~~~~~~
Let's use the existing function __riscv_flush_icache(),
give it a header with a prototype and use it to
emits the FENCE.I instruction directly.
See #239
Suggested-by: Andrew Waterman <andrew@sifive.com>
Signed-off-by: Christoph Muellner <cmuellner@linux.com>
5 years ago
Andrew Waterman
168c5cac03
pk: don't init files until VM setup is complete
5 years ago
Andrew Waterman
146391f7eb
pk: refactor vm free list management
5 years ago
Andrew Waterman
b9eba474fb
pk: support >2 GiB of user memory for RV64
Previously, the pk would always run from virtual address MEM_START.
Instead, remap it into the negative virtual addresses, allowing user
processes to expand beyond MEM_START.
5 years ago
Andrew Waterman
817e7d0dfe
pk: only access user memory through explicit accessors
Enforced with sstatus.SUM.
5 years ago
Marcus Comstedt
5752f0a173
pk: Fix pushing of argc to match linux kernel behaviour
The linux kernel pushes argc as an int, not an uintptr_t.
(The offset to the next element is still sizeof(uintptr_t).)
6 years ago
Andrew Waterman
6fa3555cc5
Enable vector unit if present (continuation of 77a5df5694)
6 years ago
Luís Marques
92d3a34a9b
Add --help ( #179 )
7 years ago
Luís Marques
99d6d0a93f
Make performance counters always 64 bits wide ( #178 )
This prevents the counters from easily overflowing for a 32-bit pk.
7 years ago
Andrew Waterman
cb253a3f97
Allow up to 2 KiB of arguments
Closes #161
7 years ago
Andrew Waterman
16476bd821
Properly license all nontrivial files
8 years ago
Andrew Waterman
f2aaee46b9
Enable FPU in PK, regardless of FPU presence
Otherwise, the emulation code will refuse to emulate FP instructions.
8 years ago
Palmer Dabbelt
9204785053
Detect harts that can't boot Linux instead of hard-coding them
This checks to see if a hart can't boot Linux by looking for a
compatible "mmu-type" field. If the hart can't boot Linux, then bbl
masks it off.
9 years ago
Wesley W. Terpstra
96965a8cc6
pk: does not use dtb
9 years ago
Wesley W. Terpstra
23ab37ad78
SBI: a0+a1 hold hartid+dtb pointer between boot loader stages
9 years ago
Andrew Waterman
7d60c5904f
Allow PK access to user memory
9 years ago
Andrew Waterman
926b360655
WIP towards ECALL interface for SBI
9 years ago
Andrew Waterman
e5ed1d115c
Add ability to hard-code an initial environment
10 years ago
Andrew Waterman
4a6b20595a
Add -p flag to pk to disable demand paging
10 years ago
Andrew Waterman
0a7862c79f
when -s is passed, print time, instret, cycle, and CPI
10 years ago
Andrew Waterman
d88671efdf
Remove uarch counters
We'll re-add support for the generic performance counter facility once
it exists.
10 years ago
Andrew Waterman
7389e46cd0
Move DRAM to high addresses
10 years ago
Andrew Waterman
ee00503ebe
Don't assume existence of uarch counters
10 years ago
Andrew Waterman
b94c7a4b07
Refactor pk, bbl, machine into separate libraries
Yuck.
10 years ago
Andrew Waterman
33ed6c6c5e
get rid of struct mainvars
10 years ago
Andrew Waterman
80447e5711
Disentangle PK and BBL a bit
10 years ago
Andrew Waterman
ad7a60abea
WIP on priv spec v1.9
10 years ago
Andrew Waterman
31ad71b8a4
Remove incorrect code supporting ELF32 on RV64 and vice-versa
This is technically possible by running an RV32 supervisor on an
RV64 machine, but the M-mode and S-mode code would need to be
compiled and linked separately.
10 years ago
Andrew Waterman
cffdcee338
Make boot loader/SBI changes to support SMP Linux
11 years ago
Andrew Waterman
87683e74f5
Split pk functionality into pk and bbl
pk is now an AEE only (i.e. it can only execute user programs).
bbl is now an SEE only (i.e. it can only host kernels).
11 years ago
Andrew Waterman
1a8572a47d
Upgrade to privileged architecture 1.7
11 years ago
Andrew Waterman
33e738d643
Add ASCII art boot logo
It's only printed when booting the Linux kernel. Feel free to improve the
quality of the ASCII art. It looks like this when rendered:
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvv
rrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvv
rr vvvvvvvvvvvvvvvvvvvvvv
rr vvvvvvvvvvvvvvvvvvvvvvvv rr
rrrr vvvvvvvvvvvvvvvvvvvvvvvvvv rrrr
rrrrrr vvvvvvvvvvvvvvvvvvvvvv rrrrrr
rrrrrrrr vvvvvvvvvvvvvvvvvv rrrrrrrr
rrrrrrrrrr vvvvvvvvvvvvvv rrrrrrrrrr
rrrrrrrrrrrr vvvvvvvvvv rrrrrrrrrrrr
rrrrrrrrrrrrrr vvvvvv rrrrrrrrrrrrrr
rrrrrrrrrrrrrrrr vv rrrrrrrrrrrrrrrr
rrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrr
rrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrr
rrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrr
INSTRUCTION SETS WANT TO BE FREE
11 years ago
Andrew Waterman
e474878db4
Fix stack discipline for recursive traps
11 years ago
Andrew Waterman
a24e1934dd
Remove errant statement forcing mem size to 64M
h/t Palmer
11 years ago
Andrew Waterman
a79f62f72a
Merge [shm]call into ecall, [shm]ret into eret
11 years ago
Andrew Waterman
6517fe26a2
Update to new privileged spec
11 years ago
Andrew Waterman
5c86450130
work in progress on new supervisor spec
11 years ago
Andrew Waterman
0a81fd3a93
Support linkat, unlinkat, mkdirat syscalls
Also, old-style syscalls e.g. open are now implemented with e.g. openat.
11 years ago
Andrew Waterman
069bdd3f0d
Implement draft of new calling convention
Here is the new syscall ABI:
syscall number in a7
args in a0 - a6
return value in a0
Here is the integer register map:
x0 -> x0
x1 -> ra
x2 -> sp
x3 -> tp
x4 -> gp
x5 -> t0
x6 -> t1
x7 -> t2
x8 -> s0
x9 -> s1
x10 -> a0
x11 -> a1
x12 -> a2
x13 -> a3
x14 -> a4
x15 -> a5
x16 -> a6
x17 -> a7
x18 -> s2
x19 -> s3
x20 -> s4
x21 -> s5
x22 -> s6
x23 -> s7
x24 -> s8
x25 -> s9
x26 -> s10
x27 -> s11
x28 -> t3
x29 -> t4
x30 -> t5
x31 -> t6
12 years ago
Andrew Waterman
1d953bf6fc
Support glibc 2.20 programs
12 years ago
Christopher Celio
5eba64df88
Added "-c" option to track uarch counter info.
12 years ago
Andrew Waterman
e3fa35fb85
Handle options before vm_init is called
This prevents ptbr etc. from being accessed when -p is passed.
12 years ago
Colin Schmidt
e50dc18f5d
Add several syscalls, and move syscall header file from newlib
syscalls added (openat, access, accessat, faccessat, etc.)
12 years ago
Andrew Waterman
f1f8dbbed0
Abandon MIPS convention for indicating syscall errors in register a3
12 years ago
Andrew Waterman
5cd583648d
Speed up glibc init
12 years ago