- Aug 12, 2014
-
-
Lluís Vilanova authored
Signed-off-by:
Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
- Aug 07, 2014
-
-
James Hogan authored
MIPS registers an unassigned access handler which raises a guest bus error exception. However this causes QEMU to crash when KVM is enabled as it isn't called from the main execution loop so longjmp() gets called without a corresponding setjmp(). Until the KVM API can be updated to trigger a guest exception in response to an MMIO exit, prevent the bus error exception being raised from mips_cpu_unassigned_access() if KVM is enabled. The check is at run time since the do_unassigned_access callback is initialised before it is known whether KVM will be enabled. The problem can be triggered with Malta emulation by making the guest write to the reset region at physical address 0x1bf00000, since it is marked read-only which is treated as unassigned for writes. Signed-off-by:
James Hogan <james.hogan@imgtec.com> Reviewed-by:
Aurelien Jarno <aurelien@aurel32.net> Cc: Peter Maydell <peter.maydell@linaro.org> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Gleb Natapov <gleb@redhat.com> Cc: Christoffer Dall <christoffer.dall@linaro.org> Cc: Sanjay Lal <sanjayl@kymasys.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jul 28, 2014
-
-
Dongxue Zhang authored
Free t0 and t1 in opcode OPC_DINSV. Signed-off-by:
Dongxue Zhang <elta.era@gmail.com> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
- Jul 09, 2014
-
-
James Hogan authored
KVM doesn't yet support the MIPS FPU, or writing to the guest's Config1 register which contains the FPU implemented bit. Clear QEMU's version of that bit on reset and display a warning that the FPU has been disabled. The previous incorrect Config1 CP0 register value wasn't being passed to KVM yet, however we should ensure it is set correctly now to reduce the risk of breaking migration/loadvm to a future version of QEMU/Linux that does support it. Signed-off-by:
James Hogan <james.hogan@imgtec.com> Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jul 05, 2014
-
-
James Hogan authored
The EBase CP0 register is initialised to 0x80000000, however with KVM the guest's KSEG0 is at 0x40000000. The incorrect value doesn't get passed to KVM yet as KVM doesn't implement the EBase register, however we should set it correctly now so as not to break migration/loadvm to a future version of QEMU that does support EBase. Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
James Hogan <james.hogan@imgtec.com> Reviewed-by:
Aurelien Jarno <aurelien@aurel32.net> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jun 20, 2014
-
-
Aurelien Jarno authored
In order to avoid access to the CPUMIPSState structure in the translator, keep a copy of CP0_Config1 into DisasContext. The whole register is read-only so it can be copied as a single value. Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
- Jun 18, 2014
-
-
Petar Jovanovic authored
From MIPS documentation (Volume III): UserLocal Register (CP0 Register 4, Select 2) Compliance Level: Recommended. The UserLocal register is a read-write register that is not interpreted by the hardware and conditionally readable via the RDHWR instruction. This register only exists if the Config3-ULRI register field is set. Privileged software may write this register with arbitrary information and make it accessible to unprivileged software via register 29 (ULR) of the RDHWR instruction. To do so, bit 29 of the HWREna register must be set to a 1 to enable unprivileged access to the register. Signed-off-by:
Petar Jovanovic <petar.jovanovic@imgtec.com> Reviewed-by:
Andreas Färber <afaerber@suse.de> Reviewed-by:
Aurelien Jarno <aurelien@aurel32.net> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
Sanjay Lal authored
Enable KVM support for MIPS in the build system. Signed-off-by:
Sanjay Lal <sanjayl@kymasys.com> Signed-off-by:
James Hogan <james.hogan@imgtec.com> Reviewed-by:
Aurelien Jarno <aurelien@aurel32.net> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
James Hogan authored
When KVM is enabled call kvm_mips_reset_vcpu() from mips_cpu_reset() as done for other targets since commit 50a2c6e5 (kvm: reset state from the CPU's reset method). Signed-off-by:
James Hogan <james.hogan@imgtec.com> Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Gleb Natapov <gleb@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Sanjay Lal authored
Implement the main KVM arch API for MIPS. Signed-off-by:
Sanjay Lal <sanjayl@kymasys.com> Signed-off-by:
James Hogan <james.hogan@imgtec.com> Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: Gleb Natapov <gleb@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Andreas Färber <afaerber@suse.de> Cc: Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
James Hogan authored
MIPS KVM trap & emulate mode (which is currently the only supported mode) has to add an extra kseg0/kseg1 at 0x40000000 and an extra kseg2/kseg3 at 0x60000000. Take this into account in get_physical_address() so that debug memory access works. This is done by translating the address to a standard kseg0 or kseg2 address before doing the normal address translation. The real virtual address is still used for TLB lookups. Signed-off-by:
James Hogan <james.hogan@imgtec.com> Cc: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
James Hogan authored
Add preprocessor definitions for 32bit segment bases for use in get_physical_address(). These will also be taken advantage of in the next patch which adds KVM awareness. Signed-off-by:
James Hogan <james.hogan@imgtec.com> Reviewed-by:
Aurelien Jarno <aurelien@aurel32.net> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
James Hogan authored
The MIPS CPU timer (CP0 Count/Compare registers & QEMU timer) is reset at machine initialisation, including starting the timeout. Both registers however are placed before mvp in CPUMIPSState so they will both be zeroed on reset by the memset in mips_cpu_reset() including soon after init. This doesn't take into account that the timer may be running, in which case env->CP0_Count will represent the delta against the VM clock and the timeout will need updating. At init time (cpu_mips_clock_init()), lets only create the timer. Setting Count = 1 and starting the timer (cpu_mips_store_count()) can be done at reset time from cpu_state_reset(), which is after the memset. There is also no need to set CP0_Compare = 0 as that is already handled by the memset. Note that a reset occurs from mips_cpu_realizefn() which is before the machine init callback has had a chance to set up the CPU interrupts and the CPU timer, so env->timer will be NULL. This case is handled explicitly in cpu_mips_store_count(), treating the timer as disabled (which will also be the right thing to do when KVM support is added). Reported-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
James Hogan <james.hogan@imgtec.com> Cc: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jun 05, 2014
-
-
Paolo Bonzini authored
This will collect all load and store helpers soon. For now it is just a replacement for softmmu_exec.h, which this patch stops including directly, but we also include it where this will be necessary in order to simplify the next patch. Reviewed-by:
Richard Henderson <rth@twiddle.net> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
They do not need to be in op_helper.c. Because cputlb.c now includes softmmu_template.h twice for each size, io_readX must be elided the second time through. Reviewed-by:
Richard Henderson <rth@twiddle.net> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Prepare for moving softmmu_header.h inclusion out of .c files Reviewed-by:
Richard Henderson <rth@twiddle.net> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
We will reference it from more files in the next patch. To avoid ruining the small steps we're making towards multi-target, make it a method of CPU rather than just a global. Reviewed-by:
Andreas Färber <afaerber@suse.de> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- May 28, 2014
-
-
Richard Henderson authored
Rather than include helper.h with N values of GEN_HELPER, include a secondary file that sets up the macros to include helper.h. This minimizes the files that must be rebuilt when changing the macros for file N. Reviewed-by:
Alex Bennée <alex.bennee@linaro.org> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
- Mar 27, 2014
-
-
Peter Maydell authored
Add U suffix to various places where we shift a 1 left by 31, to avoid undefined behaviour. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru>
-
- Mar 25, 2014
-
-
Petar Jovanovic authored
Previous implementation presumed that FPU registers are 64-bit and are working in 64-bit mode. This change first checks MIPS_HFLAG_F64 and if not set, it does load/store from the odd numbered register pair. Patch by Matthew Fortune. Signed-off-by:
Matthew Fortune <matthew.fortune@imgtec.com> Signed-off-by:
Petar Jovanovic <petar.jovanovic@imgtec.com> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
- Mar 13, 2014
-
-
Andreas Färber authored
Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Andreas Färber authored
Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Andreas Färber authored
Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Andreas Färber authored
Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Andreas Färber authored
This lets us drop some local variables in tlb_fill() functions. Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Andreas Färber authored
Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Andreas Färber authored
Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Andreas Färber authored
Most targets were using offsetof(CPUFooState, breakpoints) to determine how much of CPUFooState to clear on reset. Use the next field after CPU_COMMON instead, if any, or sizeof(CPUFooState) otherwise. Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Andreas Färber authored
Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Andreas Färber authored
Note that while such functions may exist both for *-user and softmmu, only *-user uses the CPUState hook, while softmmu reuses the prototype for calling it directly. Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Andreas Färber authored
Default to false. Tidy variable naming and inline cast uses while at it. Tested-by: Jia Liu <proljc@gmail.com> (or32) Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
- Feb 10, 2014
-
-
Petar Jovanovic authored
Description of UFR feature: Required in MIPS32r5 if floating point is implemented and user-mode FR switching is supported. The UFR register allows user-mode to clear StatusFR by executing a CTC1 to UFR with GPR[0] as input, and read StatusFR by executing a CFC1 to UFR. helper_ctc1 has been extended with an additional parameter rt to check requirements for UFR feature. Definition of mips32r5-generic has been modified to include support for UFR. Signed-off-by:
Petar Jovanovic <petar.jovanovic@imgtec.com> Reviewed-by:
Eric Johnson <eric.johnson@imgtec.com>
-
Petar Jovanovic authored
Add CP0_Config5, define rw_bitmask and enable modifications. Signed-off-by:
Petar Jovanovic <petar.jovanovic@imgtec.com> Reviewed-by:
Eric Johnson <eric.johnson@imgtec.com>
-
Petar Jovanovic authored
Add CP0_Config4, define rw_bitmask. Signed-off-by:
Petar Jovanovic <petar.jovanovic@imgtec.com> Reviewed-by:
Eric Johnson <eric.johnson@imgtec.com>
-
Petar Jovanovic authored
Add mips32r5-generic among CPU definitions for MIPS. Define ISA_MIPS32R3 and ISA_MIPS32R5. Signed-off-by:
Petar Jovanovic <petar.jovanovic@imgtec.com> Reviewed-by:
Eric Johnson <eric.johnson@imgtec.com>
-
- Dec 21, 2013
-
-
Aurelien Jarno authored
Reviewed-by:
Richard Henderson <rth@twiddle.net> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
- Dec 09, 2013
-
-
Stefan Weil authored
This improves readability and simplifies the code. Cc: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by:
Stefan Weil <sw@weilnetz.de> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
Petar Jovanovic authored
FR bit should be initialized to 1 for MIPS64, under condition that this bit is writable and that CPU has an FPU unit. It should be initialized to zero for MIPS32. This fixes different MIPS32 issues with FPU instructions whose behaviour defaulted to 64-bit FPU mode. Signed-off-by:
Petar Jovanovic <petar.jovanovic@imgtec.com> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
- Dec 02, 2013
-
-
Stefan Weil authored
Most code already used QEMUTimer without the redundant 'struct' keyword. Signed-off-by:
Stefan Weil <sw@weilnetz.de> Reviewed-by:
Andreas Färber <afaerber@suse.de> Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru>
-
- Oct 10, 2013
-
-
Richard Henderson authored
During GEN_HELPER=1, these are actually stray top-level semi-colons which are technically invalid ISO C, but GCC accepts as an extension. If we added enough __extension__ markers that we could dare use -Wpedantic, we'd see warning: ISO C does not allow extra ‘;’ outside of a function This will become a hard error in the next patch, wherein those ; will appear in the middle of a data structure. Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-