Age | Commit message (Collapse) | Author | Files | Lines |
|
Resolves #336
|
|
|
|
|
|
Signed-off-by: Hiroo HAYASHI <24754036+hirooih@users.noreply.github.com>
|
|
cf. https://github.com/riscv-software-src/riscv-isa-sim/issues/1361
Signed-off-by: Hiroo HAYASHI <24754036+hirooih@users.noreply.github.com>
|
|
|
|
|
|
|
|
Signed-off-by: Zixian Cai <2891235+caizixian@users.noreply.github.com>
|
|
|
|
|
|
|
|
See: https://www.kernel.org/doc/html/latest/arch/riscv/hwprobe.html
|
|
|
|
|
|
|
|
* Implement syscall readlinkat
* Implement syscall readv by read syscalls
Since pk lacks kernel-space dynamic memory management, we implement readv with
normal read syscalls rather than forwarding it to spike
|
|
It was originally added as a temporary hack to hide a race condition in
a prototype. It should've been removed long ago.
Resolves #312
|
|
|
|
Signed-off-by: Zixian Cai <2891235+caizixian@users.noreply.github.com>
|
|
|
|
|
|
|
|
See: https://www.kernel.org/doc/html/latest/arch/riscv/hwprobe.html
|
|
|
|
|
|
|
|
* Implement syscall readlinkat
* Implement syscall readv by read syscalls
Since pk lacks kernel-space dynamic memory management, we implement readv with
normal read syscalls rather than forwarding it to spike
|
|
|
|
|
|
|
|
|
|
It was originally added as a temporary hack to hide a race condition in
a prototype. It should've been removed long ago.
Resolves #312
|
|
|
|
This reverts commit 54de960a5e4c91734fcfd454fdc7e593c6ac571d.
See #298 for explanation.
|
|
There are many issues: 260, 285, 287 has to be solved
This workaround helps to add neccessary zicsr and
zifencei for cssr and fence.i accordingly.
|
|
Linux kernel simply return current brk when request brk addr is not
feasible. The pk should probably do the same.
|
|
config (#98)""
This reverts commit 7ae86fb97b792586493255f935f2f12ff068b13f.
This will continue to allow accesses to cycle/time via mcycle/mtime
despite https://github.com/riscv-software-src/riscv-isa-sim/pull/1297.
The hope is this will keep most people happy while doing the right thing
with Spike.
|
|
Regenerated the configure file using autoconf 2.71 to avoid the Syntax
error problem when running on OSX/AArch64.
|
|
Fixes #282
|
|
|
|
|
|
We previously kernel-panicked because that made it more obvious when a
syscall implementation was missing. These days, it's more common that
the C library will do something sensible in response to returning -ENOSYS.
Favor that approach to avoid frustrating users.
|
|
|
|
The UART drivers all return -1 if no character is present, and so that's
what we should do if there's no UART at all.
See discussion on https://github.com/riscv-non-isa/riscv-sbi-doc/issues/82
|
|
See https://gcc.gnu.org/onlinedocs/gcc/Local-Register-Variables.html#Local-Register-Variables
"Other than when invoking the Extended asm, the contents of the
specified register are not guaranteed."
Also revert 90191ad93eac47d61ab9cc89084050ad1541d160.
|
|
|
|
|
|
|
|
The memory manager maintains the first free page as the page after the
`_end` synthetic emitted by the linker. This value is stored in a
translation unit local variable. This value is only ever written to
from `init_early_alloc` which is static and only ever invoked from
`pk_vm_init`. Furthermore, the value that `first_free_page` is ever set
to is computed as a rounding of the _address_ of `_end`. Because the
address of the symbol cannot change during execution of a normal
program, this is effectively a constant, making the computed value a
"constant" which can be re-materialized. Now, with the knowledge that
the value is effectively a constant that can be re-materialized and the
fact that the value is ever written to at a single position, we can
simply re-materialize the value if it was ever changed in
`free_page_addr`. This will allow the 8-byte value to be truncated to
1-byte.
Now, we can inline `__early_pgalloc_align`, and because the combination
of `__early_alloc` and `__early_pgalloc_align` is small, we can inline
that again at the two sites locally. This changes the
`__augment_page_freelist` to re-materialize the constant when needed for
the allocation.
The re-materialization however uses a pc-relative addressing, which now
computes a different value than expected - the address has become a VA
rather than a PA. This results in the address computed by
`free_page_addr` (which is the result of the `__early_pgalloc_align`) to
be a virtual address after the relocation, which then propagates through
`__early_alloc` to the value in `__augment_page_freelist`, which is then
consumed by `__page_alloc`, which will treat the now VA as a PA and
perform an additional translation to a VA.
Mark the value as `volatile` to indicate that the value must be read at
all points to thwart the size optimization of the compiler resulting in
a mis-compilation resulting in the eventual invalid memory access during
the `memset` that follows the allocation.
Thanks to @nzmichaelh for the help in tracking this down!
|