summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-06-19w32: Fix regression caused by new g_poll implementationStefan Weil1-78/+174
Commit 5a007547df76446ab891df93ebc55749716609bf tried to fix a performance degradation caused by bad handling of small timeouts in the original implementation of g_poll. Since that commit, hard disk I/O no longer works. Instead of rewriting the g_poll implementation, this patch simply copies the original code (released under LGPL) from latest glib and only modifies it where needed (see comments in the code). URL of the original code: https://git.gnome.org/browse/glib/tree/glib/gpoll.c Signed-off-by: Stefan Weil <sw@weilnetz.de> Message-id: 1401291744-14314-1-git-send-email-sw@weilnetz.de Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-18target-mips: implement UserLocal RegisterPetar Jovanovic6-15/+85
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>
2014-06-18bitops: provide an inline implementation of find_first_bitAurelien Jarno1-1/+11
find_first_bit has started to be used heavily in TCG code. The current implementation based on find_next_bit is not optimal and can't be optimized be the compiler if the bit array has a fixed size, which is the case most of the time. This new implementation does not use find_next_bit and is yet small enough to be inlined. Cc: Corentin Chary <corentin.chary@gmail.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2014-06-18Merge remote-tracking branch 'remotes/bonzini/memory' into stagingPeter Maydell7-66/+119
* remotes/bonzini/memory: memory: Don't call memory_region_update_coalesced_range if nothing changed memory: MemoryRegion: rename parent to container memory: MemoryRegion: factor out memory region re-adder memory: MemoryRegion: factor out subregion add functionality qtest: fix qtest_clock_warp() for no deadline case exec: dummy_section: Pass address space through. memory: Simplify mr_add_subregion() if-else memory: Don't update all memory region when ioeventfd changed unset RAMBlock idstr when unregister MemoryRegion exec: introduce qemu_ram_unset_idstr() to unset RAMBlock idstr MAINTAINERS: Add myself as Memory API maintainer Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-18memory: Don't call memory_region_update_coalesced_range if nothing changedFam Zheng1-1/+6
With huge number of PCI devices in the system (for example, 200 virtio-blk-pci), this unconditional call can slow down emulation of irrelevant PCI operations drastically, such as a BAR update on a device that has no coalescing region. So avoid it. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-06-18memory: MemoryRegion: rename parent to containerPaolo Bonzini2-30/+30
Avoid confusion with the QOM parent. Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-06-17memory: MemoryRegion: factor out memory region re-adderPeter Crosthwaite1-10/+16
memory_region_set_address is mostly just a function that deletes and re-adds a memory region. Factor this generic functionality out into a re-usable function. This prepares support for further QOMification of MemoryRegion. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-06-17memory: MemoryRegion: factor out subregion add functionalityPeter Crosthwaite1-6/+12
Split off the core looping code that actually adds subregions into it's own fn. This prepares support for Memory Region qomification where setting the MR address or parent via QOM will back onto this more minimal function. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> [Rename new function. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-06-17Merge remote-tracking branch 'remotes/riku/linux-user-for-upstream' into stagingPeter Maydell5-736/+526
* remotes/riku/linux-user-for-upstream: User mode support for Linux ELF files with no section header linux-user: Return correct errno for unsupported netlink socket linux-user: Don't overrun guest buffer in sched_getaffinity linux-user/uname: Return correct uname string for x86_64 linux-user: fix gcc-4.9 compiler error on __{get,put]}_user signal/ppc/do_setcontext remove __get_user return check signal/sparc64_set_context: remove __get_user checks signal/ppc/{save,restore}_user_regs remove __put/get error checks signal/all/setup_frame remove __put_user checks signal/all/do_sigreturn - remove __get_user checks signal/all/do_sigaltstack remove __get_user value check signal/sparc/restore_fpu_state: remove signal/all: remove return value from restore_sigcontext signal/all: remove return value from setup_sigcontext signal/all: remove return value from copy_siginfo_to_user signal/x86/setup_frame: __put_user cleanup signal/all: remove __get/__put_user return value reading Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-17qtest: fix qtest_clock_warp() for no deadline caseSergey Fedorov1-1/+1
Use dedicated qemu_soonest_timeout() instead of MIN(). Signed-off-by: Sergey Fedorov <serge.fdrv@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-06-17exec: dummy_section: Pass address space through.Peter Crosthwaite1-6/+8
Rather than use the global singleton. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-06-17memory: Simplify mr_add_subregion() if-elsePeter Crosthwaite1-7/+1
This if else is not needed. The previous call to memory_region_add (whether _overlap or not) will always set priority and may_overlap to desired values. And its not possible to get here without having called memory_region_add_subregion due to the null guard on parent. So we can just directly call memory_region_add_subregion_common. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-06-17memory: Don't update all memory region when ioeventfd changedGonglei1-10/+23
memory mappings don't rely on ioeventfds, there is no need to destroy and rebuild them when manipulating ioeventfds, otherwise it scarifies performance. according to testing result, each ioeventfd deleing needs about 5ms, within which memory mapping rebuilding needs about 4ms. With many Nics and vmchannel in a VM doing migrating, there can be many ioeventfds deleting which increasing downtime remarkably. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Herongguang <herongguang.he@huawei.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-06-17unset RAMBlock idstr when unregister MemoryRegionHu Tao1-1/+1
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-06-17exec: introduce qemu_ram_unset_idstr() to unset RAMBlock idstrHu Tao2-5/+22
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-06-17MAINTAINERS: Add myself as Memory API maintainerPaolo Bonzini1-0/+10
I'm not including Avi since he has already removed himself from the KVM entry. I'm not going to commit my patches without review. Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-06-17User mode support for Linux ELF files with no section headerCraig Heffner1-1/+0
In user mode Linux, Qemu currently refuses to load ELF files that do not contain section headers (ehdr->e_shentsize == 0). Since section headers are not required in order to load an ELF file, simply removing the e_shentsize check in elf_check_ehdr() allows ELF binaries with no section headers to be run properly in user mode: Signed-off-by: Craig Heffner <cheffner@tacnetsol.com> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-06-17linux-user: Return correct errno for unsupported netlink socketEd Swierk1-1/+1
This fixes "Cannot open audit interface - aborting." when the EAFNOSUPPORT errno differs between the target and host architectures (e.g. mips target and x86_64 host). Signed-off-by: Ed Swierk <eswierk@skyportsystems.com> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-06-17linux-user: Don't overrun guest buffer in sched_getaffinityPeter Maydell1-0/+16
If the guest's "long" type is smaller than the host's, then our sched_getaffinity wrapper needs to round the buffer size up to a multiple of the host sizeof(long). This means that when we copy the data back from the host buffer to the guest's buffer there might be more than we can fit. Rather than overflowing the guest's buffer, handle this case by returning EINVAL or ignoring the unused extra space, as appropriate. Note that only guests using the syscall interface directly might run into this bug -- the glibc wrappers around it will always use a buffer whose size is a multiple of 8 regardless of guest architecture. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-06-17linux-user/uname: Return correct uname string for x86_64Peter Maydell1-3/+1
We were returning the incorrect uname string (with a hyphen, not an underscore) for x86_64. Fix this by removing the x86_64 special case, since the default "just use UNAME_MACHINE" behaviour suffices. This leaves cpu_to_uname_machine() special cases for only those architectures which need to vary the string based on runtime CPU features. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2014-06-17linux-user: fix gcc-4.9 compiler error on __{get,put]}_userRiku Voipio1-6/+6
gcc-4.9 finds unused operand: linux-user/syscall.c: In function ‘host_to_target_stat64’: linux-user/qemu.h:301:19: error: right-hand operand of comma expression has no effect [-Werror=unused-value] ((hptr), (x)), 0) Just removing the rh operand is no good, it will error in later: linux-user/main.c: In function ‘arm_kernel_cmpxchg64_helper’: linux-user/qemu.h:330:15: error: void value not ignored as it ought to be __ret = __put_user((x), __hptr); \ Thus, remove setting __ret from __get_user and __put_user, as and set the right hand operand to (void)0 to make it clear that these return never nothing. This commit depends on the signal.c cleanup, to ensure bisectable version history. Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Cc: Richard Henderson <rth@twiddle.net>
2014-06-17signal/ppc/do_setcontext remove __get_user return checkRiku Voipio1-2/+1
The last remaining check for return value of __get_user. Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Cc: Alexander Graf <agraf@suse.de>
2014-06-17signal/sparc64_set_context: remove __get_user checksRiku Voipio1-9/+3
Remove checks of __get_user and the err variable used to control flow with it. Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-17signal/ppc/{save,restore}_user_regs remove __put/get error checksRiku Voipio1-85/+41
As __get_user and __put_user do not return errors, remove the if checks from around them. This allows making the save/restore functions void. Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Cc: Alexander Graf <agraf@suse.de>
2014-06-17signal/all/setup_frame remove __put_user checksRiku Voipio1-72/+25
Remove "if(__put_user" checks and their related error paths for all architecture's setup_frame, setup_rt_frame and similar. Remove the unlock_user_struct when the only way to end up there is from failed lock_user_struct. Remove err variable if there are no users for it in the function anymore. Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-17signal/all/do_sigreturn - remove __get_user checksRiku Voipio1-41/+18
Remove "if(__get_user" checks and their related error paths for all architecture's do_sigreturn. Remove the unlock_user_struct when the only way to end up there is from failed lock_user_struct. v3: remove unneccesary sigsegv label as suggested by Peter Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-17signal/all/do_sigaltstack remove __get_user value checkRiku Voipio1-4/+5
Access is already checked in the lock_user_struct call before. Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-17signal/sparc/restore_fpu_state: removeRiku Voipio1-37/+0
A function never called from anywhere, obviously half-complete. Remove function and if someone wants to complete this, please check the old version out of git history. Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-17signal/all: remove return value from restore_sigcontextRiku Voipio1-31/+12
make most implementations of restore_sigcontext void and remove checking it's return value from functions calling restore_sigcontext. The exception is the X86 version of the function that is too different from others to deal in this way, and arm version, to keep possibility of erroring out from failed valid_user_regs. v3: keep arm valid_user_regs for filling in near future. Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-17signal/all: remove return value from setup_sigcontextRiku Voipio1-44/+21
Make all implementations of setup_sigcontext void and remove checking it's return value from functions calling setup_sigcontext. Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-17signal/all: remove return value from copy_siginfo_to_userRiku Voipio1-19/+9
Since copy_siginfo_to_user always returns 0, make it void and remove any checks for return value from calling functions. Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-17signal/x86/setup_frame: __put_user cleanupRiku Voipio1-12/+4
Remove the remaining check for __put_user return value, and all the checks for err variable which isn't set anywhere anymore. No we can only end up in give_sigsegv due to failed lock_user_struct - thus we remove the unlock_user_struct to avoid unlocking a region never locked. Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-17signal/all: remove __get/__put_user return value readingRiku Voipio1-370/+364
Remove all the simple cases of reading the return value of __get_user and __put_user. We set err = 0 in sparc versions of do_sigreturn and sparc64_set_context to avoid compile error, but else this patch is just general removal of err |= __get_user ... idiom. v2: remove err variable from target_rt_restore_ucontext Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-16Merge remote-tracking branch 'remotes/agraf/tags/signed-ppc-for-upstream' ↵Peter Maydell94-2034/+19278
into staging 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>
2014-06-16rules.mak: remove $(sort) from extract-libsPaolo Bonzini1-1/+1
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>
2014-06-16Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into ↵Peter Maydell43-1203/+1096
staging 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>
2014-06-16spapr_pci: Advertise MSI quotaBadari Pulavarty3-1/+3
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>
2014-06-16PPC: KVM: Make pv hcall endian agnosticAlexander Graf1-8/+8
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>
2014-06-16powerpc: use float64 for frsqrteTristan Gingold1-3/+0
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>
2014-06-16spapr: Add kvm-type propertyEduardo Habkost1-0/+25
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>
2014-06-16spapr: Create SPAPRMachine structEduardo Habkost1-0/+14
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>
2014-06-16linux-user: Tell guest about big host page sizesAlexander Graf1-1/+1
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>
2014-06-16spapr_hcall: Add address-translation-mode-on-interrupt resource in H_SET_MODEAlexey Kardashevskiy4-3/+60
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>
2014-06-16spapr_hcall: Split h_set_mode()Alexey Kardashevskiy1-31/+34
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>
2014-06-16target-ppc: Enable DABRX SPR and limit it to <=POWER7Alexey Kardashevskiy1-1/+14
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>
2014-06-16target-ppc: Enable PPR and VRSAVE SPRs migrationAlexey Kardashevskiy1-8/+8
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>
2014-06-16target-ppc: Add POWER8's Event Based Branch (EBB) control SPRsAlexey Kardashevskiy2-0/+64
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>
2014-06-16KVM: target-ppc: Enable TM state migrationAlexey Kardashevskiy3-0/+87
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>
2014-06-16target-ppc: Add POWER8's TM SPRsAlexey Kardashevskiy4-0/+111
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>
2014-06-16target-ppc: Add POWER8's MMCR2/MMCRS SPRsAlexey Kardashevskiy2-0/+25
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>