Age | Commit message (Collapse) | Author | Files | Lines |
|
It's just dead code. (Dependences on headers are auto-generated as
`.d` files.)
|
|
|
|
chaining
This step is to ensure that removing config.h out of headers will not cause regressions.
|
|
|
|
|
|
Set target endianess in constructors
|
|
|
|
Signed-off-by: Jerin Joy <joy@rivosinc.com>
|
|
Suppressing these individually would add too much clutter.
|
|
|
|
|
|
code and emits an error message to help avoid unintentionally loading wrong elf.
|
|
It's nearly free to do so, because it's just virtual address space.
@davidbiancolin recently fell into this pit when using context_t with VCS.
|
|
the default target endian is always little endian:
- mmu::is_target_big_endian() return false
- sim_t::get_target_endianness() return memif_endianness_little
when RISCV_ENABLE_DUAL_ENDIAN macro is undefined
|
|
We don't actually need encoding.h, so don't include it.
|
|
Fixes regression introduced by 1fea2afbf46d2641d77f2db3d6108e0897431a84
Resolves #964
|
|
...which includes program loading.
|
|
They should cause bad behavior in target land rather than crashing the
simulator.
|
|
|
|
This replaces multiple uses of `std::vector::operator[]` where the
parameter is a constant `0` with the use of C++11's `std::vector::data`
method. This fixes the root cause of invalid memory accesses.
`std::vector::operator[]` is an unchecked memory access, and when the
buffers are zero-sized (that is the buffer container is empty) either
due to a 0 padding in the case of elfloader or NULL parameters to
syscalls where permitted, the unchecked access may cause an invalid
memory access. The use of `std::vector::data` is permitted even in such
a case, though the returned memory may not be dereferenced. The general
usage of the returned pointer is to pass to `memif_t`, which is careful
about 0-sized buffer accesses, and so passing the result of
`std::vector::data` is safe. This is theoretically a better access
pattern as it also avoids having the compiler to re-materialize the
pointer from the de-referenced location.
|
|
`std::vector::operator[]` does not perform a bounds check when accessing
the underlying memory. If the length of the padding is 0, this would
access an invalid memory location. Guard against this by ensuring that
we have any padding to apply by constant hoisting the length computation
and checking the value.
|
|
This simply uses clang-format to reflow the text of the macro, which
makes it easier to read and edit.
|
|
Precompiled headers were broken because they weren't compiled with
the same -fPIC setting as the rest of the code. Fix by just making
everything use -fPIC.
|
|
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
|
|
|
|
Was broken by #681.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Bug fix for final byte in signature output.
|
|
* reduce sig_len constraint to 4 bytes
Spike currently asserts that the signature length should always be a multiple of 16-bytes. However, the compliance suite has agreed to upon the signature being a multiple ot 4-bytes. This prevents some of the tests to run on spike since it fails the assertion.
The proposed change fixes this issue and reduces the assertion to 4 bytes.
* Added size argument to htif arguments and zero padding for signature output. Defaultline size-16.
* Modified type of line_size to unsigned.
* Renamed size to granularity.
* Rename granularity to signature-granularity.
Co-authored-by: dracarys99 <spawan1999@gmail.com>
|
|
The new macros IS_ELF_... introduced in 80b5b2f5 were not endian safe.
|
|
* Adding symbol lookup when --enable-commitlog is enabled
* Removed the #ifdef RISCV_ENABLE_COMMITLOG for all get_symbol related function
Only retained the in processor.cc where it is called.
Co-authored-by: Shajid Thiruvathodi <sthiruva@valtrix.in>
|
|
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
|
|
1. add new hypervisor csr
2. add debug module csr
3. add some new high part register for rv32
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
|
|
Resolves #435
|
|
|
|
|
|
|
|
Support loading multiple ELF files via a new payload HTIF option
|
|
Firmware implementations, such as OpenSBI's fw_jump, make use of this
feature on other targets to avoid having to be rebuilt every time the
payload is updated.
|
|
|
|
|
|
Stricter validation of ELF binaries improves usability with informative
assertions. This prevents users from loading ELF relocatable files and
binaries compiled for their (non-RISC-V) workstations, for example.
Without this patch, spike would attempt to load nearly any ELF given,
but it would usually fail with an error about debug module accesses,
since the given ELF causes accesses in the debug module's memory space.
Even if spike successfully loaded the ELF file, it would still misbehave
during simulation, for example in the case of ELF relocatable files.
ELF magic numbers come from official ELF documents:
TIS ELF spec v1.2, via Linux Foundation Referenced Specifications
See: https://refspecs.linuxbase.org/
RISC-V magic number comes from official RISC-V ELF documents:
See: riscv/riscv-elf-psabi-doc@60c25981b62c0b43d16142f8a12c8b1e98e60d4d
|
|
|
|
|