aboutsummaryrefslogtreecommitdiff
path: root/risu.h
AgeCommit message (Collapse)Author
2023-09-18Pass siginfo_t->si_addr to the reginfo_init() functionThomas Huth
On s390x, we need the si_addr from the siginfo_t to get to the address of the illegal instruction (the PSW address in the ucontext_t is already pointing to the next instruction there). So let's prepare for that situation and pass the si_addr to the reginfo_init() function everywhere. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-id: 20230914113311.379537-2-thuth@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-07-18aarch64: Use arch_init to configure sveRichard Henderson
Adjust some of the aarch64 code to look at the reginfo struct instead of looking at test_sve, so that we do not need to pass the --test-sve option in order to dump sve trace files. Diagnose EINVAL as either cpu or kernel does not support SVE. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20220708154700.18682-22-richard.henderson@linaro.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-07-18Compute reginfo_size based on the reginfoRichard Henderson
This will allow dumping of SVE frames without having to know the SVE vector length beforehand. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20220708154700.18682-19-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-07-18Add magic and size to the trace headerRichard Henderson
Sanity check that we're not getting out of sync with the trace stream. This will be especially bad with the change in size of the sve save data. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20220708154700.18682-18-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-07-18Merge reginfo.c into risu.cRichard Henderson
The distinction between the two is artificial. Following patches will rearrange the functions involved to make it easier for dumping of the trace file. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20220708154700.18682-15-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-07-18Split RES_MISMATCH for registers and memoryRichard Henderson
By remembering the specific comparison that failed, we do not have to try again when it comes time to report. This makes the mem_used flag redundant. Also, packet_mismatch is now redundant with RES_BAD_IO. This means that the only thing that report_match_status does is to report on register status, so rename to report_mismatch_reg. Also, we know there is a failure, so don't return a status from the report. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20220708154700.18682-14-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-07-18Always write for --masterRichard Henderson
For trace, master of course must write to the file we create. For sockets, we can report mismatches from either end. At present, we are reporting mismatches from master. Reverse that so that we report mismatches from the apprentice, just as we do for trace. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20220708154700.18682-12-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-07-18Unify i/o functions and use RisuResultRichard Henderson
Push the trace check down from the function calling the reginfo function down into the i/o function. This means we don't have to pass a function pointer. Return a RisuResult from the i/o functions. This fixes a minor bug in send_register_info (even before the conversion to RisuResult), which returned the write_fn result directly. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20220708154700.18682-10-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-07-18Add enum RisuResultRichard Henderson
Formalize the random set of numbers into an enum. Doing this makes it easy to see that one of the responses in recv_and_compare_register_info was inconsistent. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20220708154700.18682-9-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-07-18Add enum RisuOpRichard Henderson
Formalize the set of defines, plus -1, into an enum. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20220708154700.18682-8-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-07-18Use bool for tracing variablesRichard Henderson
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20220708154700.18682-2-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-07-02risu_reginfo: introduce reginfo_size()Alex Bennée
In preparation for conditionally supporting SVE we need to be able to have different sized reginfos. This introduces reginfo_size() to abstract the size away to the code the actually knows. For aarch64 we also use this while initialising the block. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20180622141205.16306-18-alex.bennee@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-07-02risu: add process_arch_optRichard Henderson
Allows the backend to do more that just set a flag when it comes to processing options. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-id: 20180622141205.16306-15-alex.bennee@linaro.org [AJB: tweaked order, added stdlib includes] Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-07-02risu: move optional args to each architectureAlex Bennée
The key variables here are: *arch_long_opts and *arch_extra_help. If they are not NULL then we concatenate the extra options to appropriate structure to enable the support. Adding architecture short options is not supported. This also includes moving the ARM specific test_fp_exc/test-fp-exc into ARM specific code. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20180622141205.16306-14-alex.bennee@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-07-10risu: make match status take tracing into accountAlex Bennée
Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-id: 20170704144859.17644-2-alex.bennee@linaro.org [PMM: fix spacing around : operator] Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-06-29risu: add header to trace streamAlex Bennée
I've also added a header packet with pc/risu op in it so we can keep better track of how things are going. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> [PMM: flipped header check to early-bailout so diff is easier to read] Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20170621154244.28309-6-alex.bennee@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-06-29risu: parameterise send/receive functionsAlex Bennée
This is a precursor to record/playback support. Instead of passing the socket fd we now pass helper functions for reading/writing and responding. This will allow us to do the rest of the record/playback cleanly outside of the main worker function. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-id: 20170621154244.28309-5-alex.bennee@linaro.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> [PMM: fixed checkpatch nits] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-06-26risu_reginfo_arm.c: Move orphan comment to risu.h.Peter Maydell
Move an orphan comment that describes the reginfo structure into risu.h, and expand it a little. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-id: 1497969886-17773-3-git-send-email-peter.maydell@linaro.org
2017-06-20all: fix up code consistencyAlex Bennée
This is pretty much a mechanical change where I ran: indent -kr Across all the files and then fixed up all but a few violations of: ../../qemu.git/scripts/checkpatch.pl -f *.c *.h > checkpatch.out Along with heavy use of M-x untabify to make everything consistent. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-id: 20170619104655.31104-4-alex.bennee@linaro.org [PMM: some bits of indent in risu_reginfo_arm.c were not right: fixed] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-02-24Tidy up #include linesPeter Maydell
Tidy up unnecessary #includes that risu.h provides. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-02-24Move recv_and_compare_register_info() and report_match_status() to reginfo.cPeter Maydell
Move recv_and_compare_register_info() and report_match_status() to reginfo.c -- they are essentially the same for all targets so can be common code. The shared variables they use come with them. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-02-24Move send_register_info() to reginfo.cPeter Maydell
send_register_info() is now essentially the same code for all target CPUs, so move it into reginfo.c rather than having duplicated code. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-02-24Make reginfo_{init,is_eq,dump,dump_mismatch} official per-CPU APIPeter Maydell
All CPUs now implement reginfo_{init,is_eq,dump,dump_mismatch} with the same API and semantics. Make this official by moving the prototypes into risu.h. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-02-24Make get_risuop() a formal part of the CPU interfacePeter Maydell
Make get_risuop() a formal part of the CPU interface rather than just a de-facto common routine. Signed-off-by: Peter Maydell <pmaydell@chiark.greenend.org.uk>
2017-02-24Abstract out getting and setting parameter registerPeter Maydell
The SETMEMBLOCK operation takes a parameter in a register, and GETMEMBLOCK returns a result in a register. Abstract these out into functions provided by the backend, so we can use common code for send_register_info() and recv_and_compare_register_info(). Signed-off-by: Peter Maydell <pmaydell@chiark.greenend.org.uk>
2014-04-25Remove unnecessary config.hPeter Maydell
All Linux systems should have the socklen_t and uintptr_t types -- these are POSIX mandated and longstanding. There is no need to autodetect these at compile time, so we can remove all the machinery for generating config.h. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-04-25configure: add a configuration step, prepare for 64bit compilationClaudio Fontana
adjust some types to be able to compile successfully on 64 bit. To make it cleanly, add a configure step to check for the appropriate types to use. Signed-off-by: Claudio Fontana <claudio.fontana@linaro.org>
2011-04-12risu: add --test-fp-exc to test FP exception status flagsPeter Maydell
Add a command line option --test-fp-exc which enables testing of the cumulative FP exception status flags. This is disabled by default because qemu gets them wrong a lot and they really aren't actually that important.
2011-04-01Improve diagnostics if master and slave disagree on packet sizePeter Maydell
Improve risu's diagnostics if the master and slave disagree about the size of the packets they are transmitting. This usually means that the two sides disagreed about whether a load/store insn should undef, so one side has reached a 'compare memory' request and the other is doing 'compare registers'.
2011-03-10risu: Implement new memory block opsPeter Maydell
Implement the new risu memory block ops: set, get, reget and compare.
2010-12-07Add licensing/copyright boilerplate to license under EPLPeter Maydell
Add the COPYING file and per-source-file boilerplate text to place risu ender the Eclipse Public License.
2010-09-21Implement image loading and enough of x86 to work with a simple static test ↵Peter Maydell
image.
2010-09-20Add the initial structure of SIGILL handling and CPU-specific interface.Peter Maydell