- Jan 12, 2022
-
-
Paolo Bonzini authored
This is unnecessary, because the interrupt would be retrieved and queued anyway by KVM_GET_VCPU_EVENTS and KVM_SET_VCPU_EVENTS respectively, and it makes the flow more similar to the one for KVM_GET/SET_SREGS2. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Maxim Levitsky authored
This allows to make PDPTRs part of the migration stream and thus not reload them after migration which is against X86 spec. Signed-off-by:
Maxim Levitsky <mlevitsk@redhat.com> Message-Id: <20211101132300.192584-2-mlevitsk@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Fabiano Rosas authored
We use the endianness of interrupts to determine which endianness to use for the guest kernel memory dump. For machines that support HILE (powernv8 and up) we have been always generating big endian dump files. This patch uses the HILE support recently added to ppc_interrupts_little_endian to fix the endianness of the dumps for powernv machines. Here are two dumps created at different moments: $ file skiboot.dump skiboot.dump: ELF 64-bit MSB core file, 64-bit PowerPC ... $ file kernel.dump kernel.dump: ELF 64-bit LSB core file, 64-bit PowerPC ... Suggested-by:
David Gibson <david@gibson.dropbear.id.au> Signed-off-by:
Fabiano Rosas <farosas@linux.ibm.com> Reviewed-by:
David Gibson <david@gibson.dropbear.id.au> Message-Id: <20220107222601.4101511-9-farosas@linux.ibm.com> Signed-off-by:
Cédric Le Goater <clg@kaod.org>
-
Fabiano Rosas authored
Next patches will split powerpc_excp in multiple family specific handlers. This patch adds a wrapper to make the transition clearer. Signed-off-by:
Fabiano Rosas <farosas@linux.ibm.com> Reviewed-by:
David Gibson <david@gibson.dropbear.id.au> Message-Id: <20220107222601.4101511-8-farosas@linux.ibm.com> Signed-off-by:
Cédric Le Goater <clg@kaod.org>
-
Fabiano Rosas authored
The ppc_interrupts_little_endian function is now suitable for determining the endianness of interrupts for all CPUs. Signed-off-by:
Fabiano Rosas <farosas@linux.ibm.com> Reviewed-by:
David Gibson <david@gibson.dropbear.id.au> Message-Id: <20220107222601.4101511-7-farosas@linux.ibm.com> Signed-off-by:
Cédric Le Goater <clg@kaod.org>
-
Fabiano Rosas authored
Some CPUs set ILE via an MSR bit. We can make ppc_interrupts_little_endian handle that case as well. Now we have a centralized way of determining the endianness of interrupts. This change has no functional impact. Signed-off-by:
Fabiano Rosas <farosas@linux.ibm.com> Reviewed-by:
David Gibson <david@gibson.dropbear.id.au> Message-Id: <20220107222601.4101511-6-farosas@linux.ibm.com> Signed-off-by:
Cédric Le Goater <clg@kaod.org>
-
Fabiano Rosas authored
The ppc_interrupts_little_endian function could be used for interrupts delivered in Hypervisor mode, so add support for powernv8 and powernv9 to it. Also drop the comment because it is inaccurate, all CPUs that can run little endian can have interrupts in little endian. The point is whether they can take interrupts in an endianness different from MSR_LE. This change has no functional impact. Signed-off-by:
Fabiano Rosas <farosas@linux.ibm.com> Reviewed-by:
David Gibson <david@gibson.dropbear.id.au> Message-Id: <20220107222601.4101511-5-farosas@linux.ibm.com> Signed-off-by:
Cédric Le Goater <clg@kaod.org>
-
Fabiano Rosas authored
Signed-off-by:
Fabiano Rosas <farosas@linux.ibm.com> Reviewed-by:
Cédric Le Goater <clg@kaod.org> Reviewed-by:
David Gibson <david@gibson.dropbear.id.au> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220107222601.4101511-4-farosas@linux.ibm.com> Signed-off-by:
Cédric Le Goater <clg@kaod.org>
-
Fabiano Rosas authored
Remove the compile time definition and make the logging be controlled by the `-d mmu` option in the cmdline. Signed-off-by:
Fabiano Rosas <farosas@linux.ibm.com> Reviewed-by:
Cédric Le Goater <clg@kaod.org> Reviewed-by:
David Gibson <david@gibson.dropbear.id.au> Message-Id: <20220107222601.4101511-3-farosas@linux.ibm.com> Signed-off-by:
Cédric Le Goater <clg@kaod.org>
-
Fabiano Rosas authored
Signed-off-by:
Fabiano Rosas <farosas@linux.ibm.com> Reviewed-by:
David Gibson <david@gibson.dropbear.id.au> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220107222601.4101511-2-farosas@linux.ibm.com> Signed-off-by:
Cédric Le Goater <clg@kaod.org>
-
Cédric Le Goater authored
ISA v2.03 introduced Floating Round to Integer instructions : frin, friz, frip, and frim. Add them to POWER5+. The PPC_FLOAT_EXT flag also includes the fre (Floating Reciprocal Estimate) instruction which was introduced in ISA v2.0x. The architecture document says its optional and that might be the reason why it has been kept under the PPC_FLOAT_EXT flag. This means 970 CPUs can not use it under QEMU, which doesn't seem to be a problem. Signed-off-by:
Cédric Le Goater <clg@kaod.org>
-
Cédric Le Goater authored
popcntb instruction was added in ISA v2.02. Add support for POWER5+ processors since they implement ISA v2.03. PPC970 CPUs implement v2.01 and do not support popcntb. Signed-off-by:
Cédric Le Goater <clg@kaod.org> Reviewed-by:
Fabiano Rosas <farosas@linux.ibm.com> Message-Id: <20220105095142.3990430-2-clg@kaod.org> Signed-off-by:
Cédric Le Goater <clg@kaod.org>
-
- Jan 11, 2022
-
-
Richard Henderson authored
Simplify cpu_loop by doing all of the decode in translate. Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220107213243.212806-18-richard.henderson@linaro.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
Richard Henderson authored
Simplify cpu_loop by doing all of the decode in translate. This fixes a bug in that cpu_loop was not handling the different layout of the R6 version of break16. This fixes a bug in that cpu_loop extracted the wrong bits for the mips16e break16 instruction. Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220107213243.212806-17-richard.henderson@linaro.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
- Jan 09, 2022
-
-
Mark Cave-Ayland authored
Commit a9431a03 ("target/m68k: add M68K_FEATURE_UNALIGNED_DATA feature") added a new feature for processors from the 68020 onwards which do not require data accesses to be word aligned. Unfortunately the original commit missed an additional case whereby the SP is still word aligned when setting up an additional format 1 stack frame so add the necessary M68K_FEATURE_UNALIGNED_DATA feature guard. Signed-off-by:
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Fixes: a9431a03 ("target/m68k: add M68K_FEATURE_UNALIGNED_DATA feature") Reviewed-by:
Laurent Vivier <laurent@vivier.eu> Message-Id: <20220108180453.18680-1-mark.cave-ayland@ilande.co.uk> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
- Jan 08, 2022
-
-
Alistair Francis authored
The stval and mtval registers can optionally contain the faulting instruction on an illegal instruction exception. This patch adds support for setting the stval and mtval registers. The RISC-V spec states that "The stval register can optionally also be used to return the faulting instruction bits on an illegal instruction exception...". In this case we are always writing the value on an illegal instruction. This doesn't match all CPUs (some CPUs won't write the data), but in QEMU let's just populate the value on illegal instructions. This won't break any guest software, but will provide more information to guests. Signed-off-by:
Alistair Francis <alistair.francis@wdc.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Message-id: 20211220064916.107241-4-alistair.francis@opensource.wdc.com
-
Alistair Francis authored
In preparation for adding support for the illegal instruction address let's fixup the Hypervisor extension setting GVA logic and improve the variable names. Signed-off-by:
Alistair Francis <alistair.francis@wdc.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Message-id: 20211220064916.107241-3-alistair.francis@opensource.wdc.com
-
Alistair Francis authored
Signed-off-by:
Alistair Francis <alistair.francis@wdc.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Message-id: 20211220064916.107241-2-alistair.francis@opensource.wdc.com
-
Frédéric Pétrot authored
The csrs are accessed through function pointers: we add 128-bit read operations in the table for three csrs (writes fallback to the 64-bit version as the upper 64-bit information is handled elsewhere): - misa, as mxl is needed for proper operation, - mstatus and sstatus, to return sd In addition, we also add read and write accesses to the machine and supervisor scratch registers. Signed-off-by:
Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr> Co-authored-by:
Fabien Portas <fabien.portas@grenoble-inp.org> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com> Message-id: 20220106210108.138226-19-frederic.petrot@univ-grenoble-alpes.fr Signed-off-by:
Alistair Francis <alistair.francis@wdc.com>
-
Frédéric Pétrot authored
As opposed to the gen_arith and gen_shift generation helpers, the csr insns do not have a common prototype, so the choice to generate 32/64 or 128-bit helper calls is done in the trans_csrxx functions. Signed-off-by:
Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr> Co-authored-by:
Fabien Portas <fabien.portas@grenoble-inp.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com> Message-id: 20220106210108.138226-18-frederic.petrot@univ-grenoble-alpes.fr Signed-off-by:
Alistair Francis <alistair.francis@wdc.com>
-
Frédéric Pétrot authored
Given the side effects they have, the csr instructions are realized as helpers. We extend this existing infrastructure for 128-bit sized csr. We return 128-bit values using the same approach as for div/rem. Theses helpers all call a unique function that is currently a fallback on the 64-bit version. The trans_csrxx functions supporting 128-bit are yet to be implemented. Signed-off-by:
Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr> Co-authored-by:
Fabien Portas <fabien.portas@grenoble-inp.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com> Message-id: 20220106210108.138226-17-frederic.petrot@univ-grenoble-alpes.fr Signed-off-by:
Alistair Francis <alistair.francis@wdc.com>
-
Frédéric Pétrot authored
Adding the high part of a very minimal set of csr. Signed-off-by:
Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr> Co-authored-by:
Fabien Portas <fabien.portas@grenoble-inp.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com> Message-id: 20220106210108.138226-16-frederic.petrot@univ-grenoble-alpes.fr Signed-off-by:
Alistair Francis <alistair.francis@wdc.com>
-
Frédéric Pétrot authored
Mult are generated inline (using a cool trick pointed out by Richard), but for div and rem, given the complexity of the implementation of these instructions, we call helpers to produce their behavior. From an implementation standpoint, the helpers return the low part of the results, while the high part is temporarily stored in a dedicated field of cpu_env that is used to update the architectural register in the generation wrapper. Signed-off-by:
Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr> Co-authored-by:
Fabien Portas <fabien.portas@grenoble-inp.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com> Message-id: 20220106210108.138226-15-frederic.petrot@univ-grenoble-alpes.fr Signed-off-by:
Alistair Francis <alistair.francis@wdc.com>
-
Frédéric Pétrot authored
Addition of 128-bit adds and subs in their various sizes, "set if less than"s and branches. Refactored the code to have a comparison function used for both stls and branches. Signed-off-by:
Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr> Co-authored-by:
Fabien Portas <fabien.portas@grenoble-inp.org> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com> Message-id: 20220106210108.138226-14-frederic.petrot@univ-grenoble-alpes.fr Signed-off-by:
Alistair Francis <alistair.francis@wdc.com>
-
Frédéric Pétrot authored
Handling shifts for 32, 64 and 128 operation length for RV128, following the general framework for handling various olens proposed by Richard. Signed-off-by:
Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr> Co-authored-by:
Fabien Portas <fabien.portas@grenoble-inp.org> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com> Message-id: 20220106210108.138226-13-frederic.petrot@univ-grenoble-alpes.fr Signed-off-by:
Alistair Francis <alistair.francis@wdc.com>
-
Frédéric Pétrot authored
Adding the 128-bit version of lui and auipc, and introducing to that end a "set register with immediat" function to handle extension on 128 bits. Signed-off-by:
Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr> Co-authored-by:
Fabien Portas <fabien.portas@grenoble-inp.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com> Message-id: 20220106210108.138226-12-frederic.petrot@univ-grenoble-alpes.fr Signed-off-by:
Alistair Francis <alistair.francis@wdc.com>
-
Frédéric Pétrot authored
The 128-bit bitwise instructions do not need any function prototype change as the functions can be applied independently on the lower and upper part of the registers. Signed-off-by:
Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr> Co-authored-by:
Fabien Portas <fabien.portas@grenoble-inp.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com> Message-id: 20220106210108.138226-11-frederic.petrot@univ-grenoble-alpes.fr Signed-off-by:
Alistair Francis <alistair.francis@wdc.com>
-
Frédéric Pétrot authored
Get function to retrieve the 64 top bits of a register, stored in the gprh field of the cpu state. Set function that writes the 128-bit value at once. The access to the gprh field can not be protected at compile time to make sure it is accessed only in the 128-bit version of the processor because we have no way to indicate that the misa_mxl_max field is const. The 128-bit ISA adds ldu, lq and sq. We provide support for these instructions. Note that (a) we compute only 64-bit addresses to actually access memory, cowardly utilizing the existing address translation mechanism of QEMU, and (b) we assume for now little-endian memory accesses. Signed-off-by:
Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr> Co-authored-by:
Fabien Portas <fabien.portas@grenoble-inp.org> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com> Message-id: 20220106210108.138226-10-frederic.petrot@univ-grenoble-alpes.fr Signed-off-by:
Alistair Francis <alistair.francis@wdc.com>
-
Frédéric Pétrot authored
lwu and ld are functionally close to the other loads, but were after the stores in the source file. Similarly, xor was away from or and and by two arithmetic functions, while the immediate versions were nicely put together. This patch moves the aforementioned loads after lhu, and xor above or, where they more logically belong. Signed-off-by:
Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr> Co-authored-by:
Fabien Portas <fabien.portas@grenoble-inp.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com> Message-id: 20220106210108.138226-9-frederic.petrot@univ-grenoble-alpes.fr Signed-off-by:
Alistair Francis <alistair.francis@wdc.com>
-
Frédéric Pétrot authored
This patch adds the support of the '-cpu rv128' option to qemu-system-riscv64 so that we can indicate that we want to run rv128 executables. Still, there is no support for 128-bit insns at that stage so qemu fails miserably (as expected) if launched with this option. Signed-off-by:
Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr> Co-authored-by:
Fabien Portas <fabien.portas@grenoble-inp.org> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com> Message-id: 20220106210108.138226-8-frederic.petrot@univ-grenoble-alpes.fr [ Changed by AF - Rename CPU to "x-rv128" ] Signed-off-by:
Alistair Francis <alistair.francis@wdc.com>
-
Frédéric Pétrot authored
The upper 64-bit of the 128-bit registers have now a place inside the cpu state structure, and are created as globals for future use. Signed-off-by:
Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr> Co-authored-by:
Fabien Portas <fabien.portas@grenoble-inp.org> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com> Message-id: 20220106210108.138226-7-frederic.petrot@univ-grenoble-alpes.fr Signed-off-by:
Alistair Francis <alistair.francis@wdc.com>
-
Frédéric Pétrot authored
Introduction of a gen_logic function for bitwise logic to implement instructions in which no propagation of information occurs between bits and use of this function on the bitwise instructions. Signed-off-by:
Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr> Co-authored-by:
Fabien Portas <fabien.portas@grenoble-inp.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com> Message-id: 20220106210108.138226-6-frederic.petrot@univ-grenoble-alpes.fr Signed-off-by:
Alistair Francis <alistair.francis@wdc.com>
-
Frédéric Pétrot authored
Given that the 128-bit version of the riscv spec adds new instructions, and that some instructions that were previously only available in 64-bit mode are now available for both 64-bit and 128-bit, we added new macros to check for the processor mode during translation. Although RV128 is a superset of RV64, we keep for now the RV64 only tests for extensions other than RVI and RVM. Signed-off-by:
Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr> Co-authored-by:
Fabien Portas <fabien.portas@grenoble-inp.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com> Message-id: 20220106210108.138226-5-frederic.petrot@univ-grenoble-alpes.fr Signed-off-by:
Alistair Francis <alistair.francis@wdc.com>
-
Frédéric Pétrot authored
Renaming defines for quad in their various forms so that their signedness is now explicit. Done using git grep as suggested by Philippe, with a bit of hand edition to keep assignments aligned. Signed-off-by:
Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com> Message-id: 20220106210108.138226-2-frederic.petrot@univ-grenoble-alpes.fr Signed-off-by:
Alistair Francis <alistair.francis@wdc.com>
-
Philipp Tomsich authored
When commit 0643c12e dropped the 'x-' prefix for Zb[abcs] and set them to be enabled by default, the comment about experimental extensions was kept in place above them. This moves it down a few lines to only cover experimental extensions. References: 0643c12e ("target/riscv: Enable bitmanip Zb[abcs] instructions") Signed-off-by:
Philipp Tomsich <philipp.tomsich@vrull.eu> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com> Message-id: 20220106134020.1628889-1-philipp.tomsich@vrull.eu Signed-off-by:
Alistair Francis <alistair.francis@wdc.com>
-
Frank Chang authored
target/riscv: rvv-1.0: Call the correct RVF/RVD check function for narrowing fp/int type-convert insns vfncvt.f.xu.w, vfncvt.f.x.w convert double-width integer to single-width floating-point. Therefore, should use require_rvf() to check whether RVF/RVD is enabled. vfncvt.f.f.w, vfncvt.rod.f.f.w convert double-width floating-point to single-width integer. Therefore, should use require_scale_rvf() to check whether RVF/RVD is enabled. Signed-off-by:
Frank Chang <frank.chang@sifive.com> Acked-by:
Alistair Francis <alistair.francis@wdc.com> Message-Id: <20220105022247.21131-4-frank.chang@sifive.com> Signed-off-by:
Alistair Francis <alistair.francis@wdc.com>
-
Frank Chang authored
target/riscv: rvv-1.0: Call the correct RVF/RVD check function for widening fp/int type-convert insns vfwcvt.xu.f.v, vfwcvt.x.f.v, vfwcvt.rtz.xu.f.v and vfwcvt.rtz.x.f.v convert single-width floating-point to double-width integer. Therefore, should use require_rvf() to check whether RVF/RVD is enabled. vfwcvt.f.xu.v, vfwcvt.f.x.v convert single-width integer to double-width floating-point, and vfwcvt.f.f.v convert double-width floating-point to single-width floating-point. Therefore, should use require_scale_rvf() to check whether RVF/RVD is enabled. Signed-off-by:
Frank Chang <frank.chang@sifive.com> Acked-by:
Alistair Francis <alistair.francis@wdc.com> Message-Id: <20220105022247.21131-3-frank.chang@sifive.com> Signed-off-by:
Alistair Francis <alistair.francis@wdc.com>
-
Frank Chang authored
Vector widening floating-point instructions should use require_scale_rvf() instead of require_rvf() to check whether RVF/RVD is enabled. Signed-off-by:
Frank Chang <frank.chang@sifive.com> Acked-by:
Alistair Francis <alistair.francis@wdc.com> Message-Id: <20220105022247.21131-2-frank.chang@sifive.com> Signed-off-by:
Alistair Francis <alistair.francis@wdc.com>
-
Alistair Francis authored
Let's enable the Hypervisor extension by default. This doesn't affect named CPUs (such as lowrisc-ibex or sifive-u54) but does enable the Hypervisor extensions by default for the virt machine. Signed-off-by:
Alistair Francis <alistair.francis@wdc.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Message-Id: <20220105213937.1113508-7-alistair.francis@opensource.wdc.com>
-
Alistair Francis authored
The Hypervisor spec is now frozen, so remove the experimental tag. Signed-off-by:
Alistair Francis <alistair.francis@wdc.com> Reviewed-by:
Anup Patel <anup.patel@wdc.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Message-Id: <20220105213937.1113508-6-alistair.francis@opensource.wdc.com>
-