aboutsummaryrefslogtreecommitdiff
path: root/fesvr
AgeCommit message (Collapse)AuthorFilesLines
2022-10-04Fixed -Wnon-virtual-dtor warningsJerin Joy1-0/+2
Signed-off-by: Jerin Joy <joy@rivosinc.com>
2022-10-04Silence remaining unused-parameter warningsAndrew Waterman1-0/+4
Suppressing these individually would add too much clutter.
2022-10-04Delete unused parameter in rfb_t::fb_updateAndrew Waterman2-3/+3
2022-10-04Suppress several unused-parameter warnings in fesvrAndrew Waterman4-4/+5
2022-09-20detects the loading of isa-incompatible (i.e. 32 bit code to 64bit HART) ↵Iman Hosseini5-6/+24
code and emits an error message to help avoid unintentionally loading wrong elf.
2022-09-01Substantially increase context_t stack sizeAndrew Waterman1-1/+1
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.
2022-07-17remove unnecessary ifdef for RISCV_ENABLE_DUAL_ENDIANWeiwei Li1-8/+0
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
2022-04-07Fix build of dtm.cc on RISC-V targetsAndrew Waterman1-1/+0
We don't actually need encoding.h, so don't include it.
2022-04-06Tick devices even when tohost != 0Andrew Waterman1-9/+10
Fixes regression introduced by 1fea2afbf46d2641d77f2db3d6108e0897431a84 Resolves #964
2022-03-17Improve error message when HTIF accesses invalid memoryAndrew Waterman1-10/+41
...which includes program loading.
2022-03-17Don't respond to invalid HTIF operations with assertion failuresAndrew Waterman1-1/+0
They should cause bad behavior in target land rather than crashing the simulator.
2021-09-23Fix torture signature (#808)John Fang1-0/+2
2021-08-26fesvr: replace use of `std::vector::operator[0]`Saleem Abdulrasool4-41/+41
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.
2021-08-26fesvr: avoid an invalid memory accessSaleem Abdulrasool1-3/+5
`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.
2021-08-26fesvr: format `LOAD_ELF` macro (NFC)Saleem Abdulrasool1-43/+50
This simply uses clang-format to reflow the text of the macro, which makes it easier to read and edit.
2021-07-28Significantly speed up compilation with GCCAndrew Waterman1-2/+0
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.
2021-06-04encoding: udpate and move platform-related define outChih-Min Chao1-1/+1
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
2021-03-25Fix statx configure checkAndrew Waterman1-1/+1
2021-03-25Fix Ubuntu 16.04 buildAndrew Waterman2-0/+11
Was broken by #681.
2021-03-25Add `statx` syscallhuaixv3-0/+100
2020-12-29Install config.h into include/fesvrAndrew Waterman1-0/+2
2020-12-28Install fesvr/byteorder.h to fix #622Andrew Waterman2-0/+95
2020-11-26Include stdexcept in ELF loader (#603)Daniel Bates1-0/+1
2020-11-16Fix byteorder issues with struct riscv_stat (#596)Marcus Comstedt1-32/+39
2020-11-07Tag target endian values to help guide conversion codeMarcus Comstedt5-52/+53
2020-11-07Implement support for big-endian targetsMarcus Comstedt5-12/+70
2020-10-21Update htif.cc (#577)S.Pawan Kumar1-1/+1
Bug fix for final byte in signature output.
2020-10-15reduce sig_len constraint to 4 bytes (#569)Neel Gala2-6/+20
* 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>
2020-10-10Fix new ELF checks on big endian hosts (#567)Marcus Comstedt1-4/+6
The new macros IS_ELF_... introduced in 80b5b2f5 were not endian safe.
2020-09-29Adding symbol lookup when --enable-commitlog is enabled (#558)sthiruva2-0/+24
* 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>
2020-05-06Add missing stdexcept importsSchuyler Eldridge1-0/+1
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2020-04-09op: update CSRChih-Min Chao1-2/+2
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>
2020-03-29When enabling the debug module, poll til it's really enabledAndrew Waterman1-0/+2
Resolves #435
2020-03-16fixed htif exception typo (#423)Dai chou1-1/+1
2020-02-11FESVR: ensure dmactive is 1 before reading debug module registersMegan Wachs1-3/+3
2020-02-10FESVR: Can't read a DM register when DMACTIVE=0Megan Wachs1-1/+1
2020-01-31Merge pull request #390 from jrtc27/payloadAndrew Waterman2-8/+37
Support loading multiple ELF files via a new payload HTIF option
2020-01-31Support loading multiple ELF files via a new payload HTIF optionJames Clarke2-7/+31
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.
2020-01-31Support plusarg +h/+help option for HTIFJames Clarke2-1/+6
2020-01-25Allow EM_NONE ELFs, tooAndrew Waterman2-1/+3
2020-01-25Refuse to load non-EXEC/non-RISC-V/non-V1 ELFs (#388)Alexander Lent2-0/+10
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
2019-10-28Whithhold BE ELF loading until BE target support is availableMarcus Comstedt1-9/+3
2019-10-28Implement support for big-endian hostsMarcus Comstedt4-40/+52
2019-07-05Add override modifier to fix clang warningsAndrew Waterman1-2/+2
2019-06-14rvv: add the v-spec-0.7.1 encodingChih-Min Chao1-1471/+0
also remove duplicated one in fesvr Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
2019-03-31Build fesvr as -fPIC to improve compatibility with old usesAndrew Waterman1-0/+2
2019-03-31Add fesvr; only globally install fesvr headers/libsstatic-linkAndrew Waterman34-0/+6394