- Jun 18, 2014
-
-
James Hogan authored
Add MAINTAINERS entry for MIPS KVM. Signed-off-by:
James Hogan <james.hogan@imgtec.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
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
In KVM mode the bootrom is loaded and executed from the last 1MB of DRAM. Based on "[PATCH 12/12] KVM/MIPS: General KVM support and support for SMP Guests" by Sanjay Lal <sanjayl@kymasys.com>. Signed-off-by:
James Hogan <james.hogan@imgtec.com> Reviewed-by:
Aurelien Jarno <aurelien@aurel32.net> Cc: Peter Maydell <peter.maydell@linaro.org> Cc: Sanjay Lal <sanjayl@kymasys.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Sanjay Lal authored
COP0 emulation is in-kernel for KVM, so inject IRQ2 (I/O) interrupts via ioctls. Signed-off-by:
Sanjay Lal <sanjayl@kymasys.com> Signed-off-by:
James Hogan <james.hogan@imgtec.com> Reviewed-by:
Aurelien Jarno <aurelien@aurel32.net> Reviewed-by:
Andreas Färber <afaerber@suse.de> 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/Linux is unusual in having 128 signals rather than just 64 like most other architectures. This means its sigmask is 16 bytes instead of 8, so allow arches to override the sigmask->len value passed to the KVM_SET_SIGNAL_MASK ioctl in kvm_set_signal_mask() by calling kvm_set_sigmask_len() from kvm_arch_init(). Otherwise default to 8 bytes. Signed-off-by:
James Hogan <james.hogan@imgtec.com> Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: Sanjay Lal <sanjayl@kymasys.com> Cc: Gleb Natapov <gleb@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> 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>
-
Sanjay Lal authored
Add API for converting physical addresses to KVM guest KSEG0 addresses, and fix the existing API for converting KSEG0 addresses to physical addresses to work in the KVM case. Both have the same sized KSEG0, so it's just a case of fixing the mask. In KVM trap and emulate mode both the guest kernel and guest userspace execute in useg: Guest User address space: 0x00000000..0x3fffffff Guest Kernel Unmapped: 0x40000000..0x5fffffff Guest Kernel Mapped: 0x60000000..0x7fffffff Signed-off-by:
Sanjay Lal <sanjayl@kymasys.com> Signed-off-by:
James Hogan <james.hogan@imgtec.com> Cc: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Sanjay Lal authored
Compare/Count timer interrupts are handled in-kernel for KVM. Therefore don't bother creating the timer at init time if KVM is enabled. This will conveniently avoid attempts to set the timeout when cpu_mips_store_count() is called at reset with KVM enabled, treating the timer as stopped so that CP0_Count is modified directly. Signed-off-by:
Sanjay Lal <sanjayl@kymasys.com> [james.hogan@imgtec.com: Update after "target-mips: Reset CPU timer consistently" which moves timer start to reset time] 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>
-
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>
-
Alexander Graf authored
KVM tells us the number of GSIs it can handle inside the kernel. That value is basically KVM_MAX_IRQ_ROUTES. However when we try to set the GSI mapping table, it checks for r = -EINVAL; if (routing.nr >= KVM_MAX_IRQ_ROUTES) goto out; erroring out even when we're only using all of the GSIs. To make sure we never hit that limit, let's reduce the number of GSIs we get from KVM by one. Cc: qemu-stable@nongnu.org Signed-off-by:
Alexander Graf <agraf@suse.de> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jun 16, 2014
-
-
Peter Maydell authored
Patch queue for ppc - 2014-06-16 This pull request brings a lot of fun things. Among others we have - e500: u-boot firmware support - sPAPR: magic page enablement - sPAPR: add "compat" CPU option to support older guests - sPAPR: refactorings in preparation for VFIO - POWER8 live migration - mac99: expose bus frequency - little endian core dump, gdb and disas support - new ppc64le-linux-user target - DFP emulation - bug fixes # gpg: Signature made Mon 16 Jun 2014 12:28:32 BST using RSA key ID 03FEDC60 # gpg: Can't check signature: public key not found * remotes/agraf/tags/signed-ppc-for-upstream: (156 commits) spapr_pci: Advertise MSI quota PPC: KVM: Make pv hcall endian agnostic powerpc: use float64 for frsqrte spapr: Add kvm-type property spapr: Create SPAPRMachine struct linux-user: Tell guest about big host page sizes spapr_hcall: Add address-translation-mode-on-interrupt resource in H_SET_MODE spapr_hcall: Split h_set_mode() target-ppc: Enable DABRX SPR and limit it to <=POWER7 target-ppc: Enable PPR and VRSAVE SPRs migration target-ppc: Add POWER8's Event Based Branch (EBB) control SPRs KVM: target-ppc: Enable TM state migration target-ppc: Add POWER8's TM SPRs target-ppc: Add POWER8's MMCR2/MMCRS SPRs target-ppc: Enable FSCR facility check for TAR target-ppc: Add POWER8's FSCR SPR target-ppc: Add POWER8's TIR SPR target-ppc: Refactor class init for POWER7/8 target-ppc: Switch POWER7/8 classes to use correct PMU SPRs target-ppc: Make use of gen_spr_power5p_lpar() for POWER7/8 ... Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Paolo Bonzini authored
Duplicate removal was added to extract-libs in order to avoid including the same library multiple times into the linking command line; this could potentially happen when using "foo.mo-libs" (which adds the library to all components, causing it to appear N times if the module is composed of N objects). However, sorting and removing duplicates causes problems with static linking, and also with space-separated linker options as found in some Mac OS X packaging systems. Furthermore, the "optimization" is really a non-problem since we do not expect .mo modules to be composed of many files. Reported-by:
Sean Bruno <sbruno@ignoranthack.me> Tested-by:
Sean Bruno <sbruno@ignoranthack.me> Reviewed-by:
Fam Zheng <famz@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Message-id: 1402929805-16836-1-git-send-email-pbonzini@redhat.com Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Peter Maydell authored
Block pull request # gpg: Signature made Mon 16 Jun 2014 12:22:22 BST using RSA key ID 81AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" * remotes/stefanha/tags/block-pull-request: (39 commits) QemuOpts: cleanup tmp 'allocated' member from QemuOptsList cleanup QEMUOptionParameter vpc.c: replace QEMUOptionParameter with QemuOpts vmdk.c: replace QEMUOptionParameter with QemuOpts vhdx.c: replace QEMUOptionParameter with QemuOpts vdi.c: replace QEMUOptionParameter with QemuOpts ssh.c: replace QEMUOptionParameter with QemuOpts sheepdog.c: replace QEMUOptionParameter with QemuOpts rbd.c: replace QEMUOptionParameter with QemuOpts raw_bsd.c: replace QEMUOptionParameter with QemuOpts raw-win32.c: replace QEMUOptionParameter with QemuOpts raw-posix.c: replace QEMUOptionParameter with QemuOpts qed.c: replace QEMUOptionParameter with QemuOpts qcow2.c: replace QEMUOptionParameter with QemuOpts QemuOpts: export qemu_opt_find qcow.c: replace QEMUOptionParameter with QemuOpts nfs.c: replace QEMUOptionParameter with QemuOpts iscsi.c: replace QEMUOptionParameter with QemuOpts gluster.c: replace QEMUOptionParameter with QemuOpts cow.c: replace QEMUOptionParameter with QemuOpts ... Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Badari Pulavarty authored
Hotplug of multiple disks fails due to MSI vector quota check. Number of MSI vectors default to 8 allowing only 4 devices. This happens on RHEL6.5 guest. RHEL7 and SLES11 guests fallback to INTX. One way to workaround the issue is to increase total MSIs, so that MSI quota check allows us to hotplug multiple disks. This sets the quota to the maximum number of interupts XICS has which is 1024 now (XICS_IRQS). This moves XICS_IRQS from spapr.c to xics.h for wider visibility. Signed-off-by:
Badari Pulavarty <pbadari@us.ibm.com> [aik: put XICS_IRQS=1024 instead of 64i, fixed endianness and size] Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Alexander Graf authored
There were a few revisions of the Linux kernel that incorrectly swapped the hcall instructions when they saw ePAPR compliant hypercalls. We already have fixups for those in place when running with PR KVM, but HV KVM and systems that don't implement hypercalls at all are still broken because they fall back to the QEMU implementation of fallback hypercalls. So let's make the fallback hypercall instruction path endian agnostic. This only really works well for 64bit guests, but I don't think there are any 32bit systems left that don't implement real pv hcall support, so we'll never get into this code path. Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Tristan Gingold authored
Remove the code that reduce the result to float32 as the frsqrte instruction is defined to return a double-precision estimate of the reciprocal square root. Although reducing the fractional part is harmless (as the estimation must have at least 12 bits of precision according to the old PEM), reducing the exponent range is not correct. Signed-off-by:
Tristan Gingold <gingold@adacore.com> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Eduardo Habkost authored
The kvm-type machine option was left out when MachineState was introduced, preventing the kvm-type option from being used. Add the missing property to the sPAPR machine class, so it can be used. Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Tested-by:
Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Eduardo Habkost authored
Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Tested-by:
Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Alexander Graf authored
We tell the guest its page size via AUX vectors. The guest process then uses this page size as information on which boundaries it can mmap() things. However, if the host has a bigger page size granularity than the guest, it can not fulfill these mmap() requests - which falls apart when MAP_FIXED is passed to mmap. So in that case, let the guest know that we're running on a bigger page size granularity than the target would require. This fixes running qemu-ppc (TARGET_PAGE_SIZE=4k) on a 64k page size ppc64 host for me. Signed-off-by:
Alexander Graf <agraf@suse.de> Reviewed-by:
Richard Henderson <rth@twiddle.net>
-
Alexey Kardashevskiy authored
This adds handling of the RESOURCE_ADDR_TRANS_MODE resource from the H_SET_MODE, for POWER8 (PowerISA 2.07) only. This defines AIL flags for LPCR special register. This changes @excp_prefix according to the mode, takes effect in TCG. This turns support of a new capability PPC2_ISA207S flag for TCG. Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by:
Tom Musta <tommusta@gmail.com> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Alexey Kardashevskiy authored
This moves H_SET_MODE_RESOURCE_LE handler to a separate function as there are other "resources" coming and this is going to become ugly. Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by:
Tom Musta <tommusta@gmail.com> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Alexey Kardashevskiy authored
This adds DABRX SPR. As DABR(X) are present in POWER CPUs till POWER7 only and POWER8 does not have them (as it implements more powerful facility instead), this limits DABR/DABRX registration by POWER7 (inclusive). Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Alexey Kardashevskiy authored
This hooks SPR with their "KVM set_one_reg" counterparts which enables their migration. Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by:
Tom Musta <tommusta@gmail.com> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Alexey Kardashevskiy authored
POWER8 supports Event-Based Branch Facility (EBB). It is controlled via set of SPRs access to which should generate an "Facility Unavailable" interrupt if the facilities are not enabled in FSCR for problem state. This adds EBB SPRs. Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by:
Tom Musta <tommusta@gmail.com> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Alexey Kardashevskiy authored
This adds migration support for registers saved before Transactional Memory (TM) transaction started. Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by:
Tom Musta <tommusta@gmail.com> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Alexey Kardashevskiy authored
This adds TM (Transactional Memory) SPRs. This adds generic spr_read_prev_upper32()/spr_write_prev_upper32() to handle upper half SPRs such as TEXASRU which is upper half of TEXASR. Since this is not the only register like that and their numbers go consequently, it makes sense to generalize the helpers. This adds a gen_msr_facility_check() helper which purpose is to generate the Facility Unavailable exception if the facility is disabled. It is a copy of gen_fscr_facility_check() but it checks for enabled facility in MSR rather than FSCR/HFSCR. It still sets the interrupt cause in FSCR/HFSCR (whichever is passed to the helper). This adds spr_read_tm/spr_write_tm/spr_read_tm_upper32/spr_write_tm_upper32 which are used for TM SPRs. This adds TM-relates MSR bits definitions. This enables TM in POWER8 CPU class' msr_mask. Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by:
Tom Musta <tommusta@gmail.com> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Alexey Kardashevskiy authored
This adds POWER8 specific PMU MMCR2/MMCRS SPRs. Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by:
Tom Musta <tommusta@gmail.com> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Alexey Kardashevskiy authored
This makes user-privileged read/write fail if TAR facility is not enabled in FSCR. Since this is the very first check for enabled in FSCR facility, this also adds gen_fscr_facility_check() for using in spr_write_tar()/ spr_read_tar(). This enables TAR in FSCR for user mode unconditionally. Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by:
Tom Musta <tommusta@gmail.com> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Alexey Kardashevskiy authored
This adds an FSCR (Facility Status and Control Register) SPR. This defines names for FSCR bits. This defines new exception type - POWERPC_EXCP_FU - "facility unavailable" (FU). This registers an interrupt vector for it at 0xF60 as PowerISA defines. This adds a TCG helper_fscr_facility_check() helper to raise an exception if the facility is not enabled. It updates the interrupt cause field in FSCR. This adds a TCG translation block generation code. The helper may be used for HFSCR too as it has the same format. The helper raising FU exceptions is not used by this patch but will be in the next ones. This adds gen_update_current_nip() to update NIP in DisasContext. This helper is not used now and will be called before checking for a condition for throwing an FU exception. Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by:
Tom Musta <tommusta@gmail.com> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Alexey Kardashevskiy authored
This adds TIR (Thread Identification Register) SPR first defined for server CPUs in PowerISA 2.07. Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by:
Tom Musta <tommusta@gmail.com> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Alexey Kardashevskiy authored
This extends init_proc_book3s_64 to support POWER7 and POWER8. Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by:
Tom Musta <tommusta@gmail.com> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Alexey Kardashevskiy authored
This replaces gen_spr_7xx() call (which registers 32bit SPRs) with gen_spr_book3s_pmu() call. This removes SPR_7XX_PMC5/6 as they are for 32bit and gen_spr_book3s_pmu() already registers correct PMC5/6 SPRs. This removes explicit MMCRA registration as gen_spr_book3s_pmu() does it anyway. Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by:
Tom Musta <tommusta@gmail.com> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Alexey Kardashevskiy authored
This makes use of generic gen_spr_power5p_lpar() which registers LPCR SPR. Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by:
Tom Musta <tommusta@gmail.com> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Alexey Kardashevskiy authored
This replaces VRSAVE registration and vscr_init() call with gen_spr_book3s_altivec() which is generic and does the same thing if insns_flags has PPC_ALTIVEC bit set (which POWER7/8 have set). Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by:
Tom Musta <tommusta@gmail.com> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Alexey Kardashevskiy authored
This moves SCFAR/DSCR/CTRL/PPR/PCR PRs to helpers. Later these helpers will be called from generalized init_proc_book3s_64(). This switches init_proc_POWER7() to use generalized gen_spr_book3s_common() which registers CRTL SPR under slightly different names. No change in behaviour or non-debug output is expected. Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by:
Tom Musta <tommusta@gmail.com> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Alexey Kardashevskiy authored
This moves TAR SPR to a helper. Later this helper will be called from generalized init_proc_book3s_64(). Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by:
Tom Musta <tommusta@gmail.com> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Alexey Kardashevskiy authored
This moves PIR/PURR/SPURR SPRs to helpers. Later these helpers will be called from generalized init_proc_book3s_64(). Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by:
Tom Musta <tommusta@gmail.com> Signed-off-by:
Alexander Graf <agraf@suse.de>
-