summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch ↵Peter Maydell2015-07-085-31/+642
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'remotes/mdroth/tags/qga-pull-2015-07-06-v3-tag' into staging tag for qga-pull-2015-07-06-v3 v3: - fix missing <windows.h> in configure test program. v2: - added configure check for guest-get-fs-info to avoid breakage on older MinGWs - removed extraneous include of ws2ipdef.h in w32 guest-network-get-interfaces. ws2tcpip.h already provides those definitions, and older MinGWs don't have it. - rebased on latest master # gpg: Signature made Wed Jul 8 03:01:18 2015 BST using RSA key ID F108B584 # gpg: Good signature from "Michael Roth <flukshun@gmail.com>" # gpg: aka "Michael Roth <mdroth@utexas.edu>" # gpg: aka "Michael Roth <mdroth@linux.vnet.ibm.com>" # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: CEAC C9E1 5534 EBAB B82D 3FA0 3353 C9CE F108 B584 * remotes/mdroth/tags/qga-pull-2015-07-06-v3-tag: qga: added GuestPCIAddress information qga: added bus type and disk location path configure: add configure check for ntdddisk.h qga: added mountpoint and filesystem type for single volume qga: added empty qmp_quest_get_fsinfo functionality. qga: fail early for invalid time qga: win32 qmp_guest_network_get_interfaces implementation qga: add win32 library iphlpapi Revert "guest agent: remove g_strcmp0 usage" qga/qmp_guest_fstrim: Return per path fstrim result qga/commands-posix: Fix bug in guest-fstrim Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * qga: added GuestPCIAddress informationMichael Roth2015-07-072-1/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PCIAddress inforfation is obtained via SetupApi, which provides the information about address, bus, etc. We look throught entire device tree in the system and try to find device object for given volume. For this PDO SetupDiGetDeviceRegistryProperty is called, which reads PCI configuration for a given devicei if it is possible. This is the most convinient way for a userspace service. The lookup is performed for every volume available. However, this information is not mandatory for vss-provider. In order to use SetupApi we need to notify linker about it. We do not need to install additional libs, so we do not make separate configuration option to use libsetupapi.su SetupApi gives as the same information as kernel driver with IRP_MN_QUERY_INTERFACE. https://support.microsoft.com/en-us/kb/253232 Signed-off-by: Olga Krishtal <okrishtal@virtuozzo.com> Signed-off-by: Denis V. Lunev <den@openvz.org> CC: Eric Blake <eblake@redhat.com> CC: Michael Roth <mdroth@linux.vnet.ibm.com> * stub out get_pci_info if !CONFIG_QGA_NTDDSCSI Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
| * qga: added bus type and disk location pathOlga Krishtal2015-07-072-2/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to Microsoft disk location path can be obtained via IOCTL_SCSI_GET_ADDRESS. Unfortunately this ioctl can not be used for all devices. There are certain bus types which could be obtained with this API. Please, refer to the following link for more details https://technet.microsoft.com/en-us/library/ee851589(v=ws.10).aspx Bus type could be obtained using IOCTL_STORAGE_QUERY_PROPERTY. Enum STORAGE_BUS_TYPE describes all buses supported by OS. Windows defines more bus types than Linux. Thus some values have been added to GuestDiskBusType. Signed-off-by: Olga Krishtal <okrishtal@virtuozzo.com> Signed-off-by: Denis V. Lunev <den@openvz.org> CC: Eric Blake <eblake@redhat.com> CC: Michael Roth <mdroth@linux.vnet.ibm.com> * fixed warning in CreateFile due to use of NULL instead of 0 * only provide disk info when CONFIG_QGA_NTDDSCSI=y Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
| * configure: add configure check for ntdddisk.hMichael Roth2015-07-071-0/+24
| | | | | | | | | | | | | | | | | | | | | | This header file provides w32 ioctl definitions for working with disk devices. Older versions of mingw do not expose this in a useable way, so add a configure check and report it via CONFIG_QGA_NTDDSCSI. Subsequent patches will use this macro to stub out functionality that relies on this in cases where it's not available. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
| * qga: added mountpoint and filesystem type for single volumeOlga Krishtal2015-07-071-1/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should use GetVolumeXXX api to work with volumes. This will help us to resolve the situation with volumes without drive letter, i.e. when the volume is mounted as a folder. Such volume is called mounted folder. This volume is a regular mounted volume from all other points of view. The information about non mounted volume is reported as System Reserved. This volume is not mounted and thus it is not writable. GuestDiskAddressList API is not used because operations are performed with volumes but no with disks. This means that spanned disk will be counted and handled as a single volume. It is worth mentioning that the information about every disk in the volume can be queried via IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS. Signed-off-by: Olga Krishtal <okrishtal@virtuozzo.com> Signed-off-by: Denis V. Lunev <den@openvz.org> CC: Eric Blake <eblake@redhat.com> CC: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
| * qga: added empty qmp_quest_get_fsinfo functionality.Olga Krishtal2015-07-071-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | We need qmp_quest_get_fsinfo togather with vss-provider, which works with volumes. The call to this function is implemented via FindFirst/NextVolumes. Moreover, volumes in Windows OS are filesystem unit, so it will be more effective to work with them rather with devices. Signed-off-by: Olga Krishtal <okrishtal@virtuozzo.com> Signed-off-by: Denis V. Lunev <den@openvz.org> CC: Eric Blake <eblake@redhat.com> CC: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
| * qga: fail early for invalid timeMarc-André Lureau2015-07-071-0/+7
| | | | | | | | | | | | | | | | | | | | It's possible to set system time with dates after 2070, however, it's not possible to set the RTC. It has limitation to up to year 2070 (1970+100). In order to keep both clock in sync and before the kernel complains on invalid values, bail out early. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
| * qga: win32 qmp_guest_network_get_interfaces implementationKirk Allan2015-07-071-3/+216
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, IPv4 prefixes will be derived by matching the address to those returned by GetAdaptersInfo. IPv6 prefixes can not be matched this way due to the unpredictable order of entries. In Windows Vista/2008 guests and newer, both IPv4 and IPv6 prefixes can be retrieved from OnLinkPrefixLength. Setting --extra-cflags in the build configuration to "-D_WIN32_WINNT=0x600" or greater makes OnLinkPrefixLength available. Setting --extra-cflags is not required and if not set, the default approach to get the prefix will be taken. Signed-off-by: Kirk Allan <kallan@suse.com> * drop ws2ipdef.h, it's missing on old mingw, and ws2tcpip.h already includes it automatically on new builds Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
| * qga: add win32 library iphlpapiKirk Allan2015-07-071-1/+1
| | | | | | | | | | | | | | | | Add the iphlpapi library to use APIs such as GetAdaptersInfo and GetAdaptersAddresses. Signed-off-by: Kirk Allan <kallan@suse.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
| * Revert "guest agent: remove g_strcmp0 usage"Markus Armbruster2015-07-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we now require GLib 2.22+ (commit f40685c), we don't have to work around lack of g_strcmp0() anymore. This reverts commit 8f4774789947bc4bc4c8d026a289fe980d3d2ee1. Conflicts: qemu-ga.c Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
| * qga/qmp_guest_fstrim: Return per path fstrim resultJustin Ossevoort2015-07-073-17/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current guest-fstrim support only returns an error if some mountpoint was unable to be trimmed, skipping any possible additional mountpoints. The result of the TRIM operation itself is also discarded. This change returns a per mountpoint result of the TRIM operation. If an error occurs on some mountpoints that error is returned and the guest-fstrim continue with any additional mountpoints. The returned values for errors, minimum and trimmed are dependant on the filesystem, storage stacks and kernel version. Signed-off-by: Justin Ossevoort <justin@quarantainenet.nl> * s/type/struct/ in schema type definitions * moved version annotation for new guest-fstrim return field to the field itself rather than applying to the entire command Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
| * qga/commands-posix: Fix bug in guest-fstrimJustin Ossevoort2015-07-071-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The FITRIM ioctl updates the fstrim_range structure it receives. This way the caller can determine how many bytes were trimmed. The guest-fstrim logic reuses the same fstrim_range for each filesystem, effectively limiting each filesystem to trim at most as much as the previous was able to trim. If a previous filesystem would have trimmed 0 bytes, than the next filesystem would report an error 'Invalid argument' because a FITRIM request with length 0 is not valid. This change resets the fstrim_range structure for each filesystem. Signed-off-by: Justin Ossevoort <justin@quarantainenet.nl> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
* | Merge remote-tracking branch 'remotes/agraf/tags/signed-s390-for-upstream' ↵Peter Maydell2015-07-073-10/+14
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into staging Patch queue for s390 - 2015-07-07 A few last minute fixes for 2.4. All of them are s390 TCG bug fixes. # gpg: Signature made Tue Jul 7 16:52:22 2015 BST using RSA key ID 03FEDC60 # gpg: Good signature from "Alexander Graf <agraf@suse.de>" # gpg: aka "Alexander Graf <alex@csgraf.de>" * remotes/agraf/tags/signed-s390-for-upstream: tcg/s390: fix branch target change during code retranslation target-s390x: fix CONVERT TO BINARY (CVD, CVDY) target-s390x: fix EXECUTE instruction executing TRT target-s390x: fix MOVE LONG instruction Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * tcg/s390: fix branch target change during code retranslationAurelien Jarno2015-07-071-4/+8
| | | | | | | | | | | | | | | | | | | | Make sure to not modify the branch target. This ensure that the branch target is not corrupted during partial retranslation. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Tested-by: Alexander Graf <agraf@suse.de> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Alexander Graf <agraf@suse.de>
| * target-s390x: fix CONVERT TO BINARY (CVD, CVDY)Aurelien Jarno2015-07-071-5/+4
| | | | | | | | | | | | | | | | | | | | | | current_number being shift left by more than 32 bits, we can't use a simple int. Similarly use an int64_t type for the input binary value, to not get the -2^31 case wrong. Finally don't initialize shift to 4, it's already done in the for loop. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Alexander Graf <agraf@suse.de>
| * target-s390x: fix EXECUTE instruction executing TRTAurelien Jarno2015-07-071-0/+1
| | | | | | | | | | | | | | | | | | | | A break is missing in the EXECUTE instruction, when executing the TRANSLATE AND TEST instruction. Reported-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Reviewed-By: Richard Henderson <rth@twiddle.net> Signed-off-by: Alexander Graf <agraf@suse.de>
| * target-s390x: fix MOVE LONG instructionAurelien Jarno2015-07-071-1/+1
| | | | | | | | | | | | | | | | | | | | The MOVE LONG instruction should pad the destination operand with the byte from bit positions 32-39 of the source length (r2 + 1), not with the same byte in the source address. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Alexander Graf <agraf@suse.de>
* | Merge remote-tracking branch 'remotes/agraf/tags/signed-ppc-for-upstream' ↵Peter Maydell2015-07-0731-410/+835
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into staging Patch queue for ppc - 2015-07-07 A few last minute PPC changes for 2.4: - spapr: Update SLOF - spapr: Fix a few bugs - spapr: Preparation for hotplug - spapr: Minor code cleanups - linux-user: Add mftb handling - kvm: Enable hugepage support with memory-backend-file - mac99: Remove nonexistent interrupt pin (Mac OS 9 fix) # gpg: Signature made Tue Jul 7 16:48:41 2015 BST using RSA key ID 03FEDC60 # gpg: Good signature from "Alexander Graf <agraf@suse.de>" # gpg: aka "Alexander Graf <alex@csgraf.de>" * remotes/agraf/tags/signed-ppc-for-upstream: (30 commits) sPAPR: Clear stale MSIx table during EEH reset sPAPR: Reenable EEH functionality on reboot sPAPR: Don't enable EEH on emulated PCI devices spapr-vty: Use TYPE_ definition instead of hardcoding spapr_vty: lookup should only return valid VTY objects spapr_pci: drop redundant args in spapr_[populate, create]_pci_child_dt spapr_pci: populate ibm,loc-code spapr_pci: enumerate and add PCI device tree xics_kvm: Don't enable KVM_CAP_IRQ_XICS if already enabled ppc: Update cpu_model in MachineState spapr: Consolidate cpu init code into a routine spapr: Reorganize CPU dt generation code cpus: Add a macro to walk CPUs in reverse spapr: Support ibm, lrdr-capacity device tree property spapr: Consider max_cpus during xics initialization Revert "hw/ppc/spapr_pci.c: Avoid functions not in glib 2.12 (g_hash_table_iter_*)" spapr_iommu: translate sPAPRTCEAccess to IOMMUAccessFlags spapr_iommu: drop erroneous check in h_put_tce_indirect() spapr_pci: set device node unit address as hex spapr_pci: encode class code including Prog IF register ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | sPAPR: Clear stale MSIx table during EEH resetGavin Shan2015-07-071-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The PCI device MSIx table is cleaned out in hardware after EEH PE reset. However, we still hold the stale MSIx entries in QEMU, which should be cleared accordingly. Otherwise, we will run into another (recursive) EEH error and the PCI devices contained in the PE have to be offlined exceptionally. The patch introduces function spapr_phb_vfio_eeh_pre_reset(), which is called by sPAPR when asserting hot or fundamental reset, to clear stale MSIx table for VFIO PCI devices before EEH PE reset so that MSIx table could be restored properly after EEH PE reset. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | sPAPR: Reenable EEH functionality on rebootGavin Shan2015-07-071-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When rebooting the guest, some PEs might be in frozen state. The contained PCI devices won't work properly if their frozen states aren't cleared in time. One case running into this situation would be maximal EEH error times encountered in the guest. The patch reenables the EEH functinality on PEs on PHB's reset callback, which will clear their frozen states if needed. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | sPAPR: Don't enable EEH on emulated PCI devicesGavin Shan2015-07-071-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There might have emulated PCI devices, together with VFIO PCI devices under one PHB. The EEH capability shouldn't enabled on emulated PCI devices. The patch returns error when enabling EEH capability on emulated PCI devices by RTAS call "ibm,set-eeh-option". Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | spapr-vty: Use TYPE_ definition instead of hardcodingDavid Gibson2015-07-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | There's a call to object_dynamic_cast() in spapr_vty which uses the type name "spapr-vty" directly, instead of the usual idiom of using the #defined TYPE_VIO_SPAPR_VTY_DEVICE. Fix it. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | spapr_vty: lookup should only return valid VTY objectsDavid Gibson2015-07-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a guest passes the reg property of a valid VIO object that is not a VTY to either H_GET_TERM_CHAR or H_PUT_TERM_CHAR, QEMU hits a dynamic cast assertion and aborts. PAPR+ says "Hypervisor checks the termno parameter for validity against the Vterm IOA unit addresses assigned to the partition, else return H_Parameter." This patch adds a type check to ensure vty_lookup() either returns a pointer to a valid VTY object or NULL. H_GET_TERM_CHAR and H_PUT_TERM_CHAR will now return H_PARAMETER to the guest instead of crashing. The patch has no effect on the reg == 0 hack used to implement the RTAS call display-character. Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | spapr_pci: drop redundant args in spapr_[populate, create]_pci_child_dtNikunj A Dadhania2015-07-071-16/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * phb_index is not being used and if required can be obtained from sphb * use helper to get drc_index in spapr_populate_pci_child_dt() * Check if drc_index is zero Suggested-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | spapr_pci: populate ibm,loc-codeNikunj A Dadhania2015-07-071-6/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each hardware instance has a platform unique location code. The OF device tree that describes a part of a hardware entity must include the “ibm,loc-code” property with a value that represents the location code for that hardware entity. Populate ibm,loc-code. 1) PCI passthru devices need to identify with its own ibm,loc-code available on the host. In failure cases use: vfio_<name>:<phb-index>:<bus>:<slot>.<fn> 2) Emulated devices encode as following: qemu_<name>:<phb-index>:<bus>:<slot>.<fn> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | spapr_pci: enumerate and add PCI device treeNikunj A Dadhania2015-07-071-17/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All the PCI enumeration and device node creation was off-loaded to SLOF. With PCI hotplug support, code needed to be added to add device node. This creates multiple copy of the code one in SLOF and other in hotplug code. To unify this, the patch adds the pci device node creation in Qemu. For backward compatibility, a flag "qemu,phb-enumerated" is added to the phb, suggesting to SLOF to not do device node creation. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> [ Squashed Michael's drc_index changes ] Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | xics_kvm: Don't enable KVM_CAP_IRQ_XICS if already enabledBharata B Rao2015-07-072-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When supporting CPU hot removal by parking the vCPU fd and reusing it during hotplug again, there can be cases where we try to reenable KVM_CAP_IRQ_XICS CAP for the vCPU for which it was already enabled. Introduce a boolean member in ICPState to track this and don't reenable the CAP if it was already enabled earlier. Re-enabling this CAP should ideally work, but currently it results in kernel trying to create and associate ICP with this vCPU and that fails since there is already an ICP associated with it. Hence this patch is needed to work around this problem in the kernel. This change allows CPU hot removal to work for sPAPR. Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | ppc: Update cpu_model in MachineStateBharata B Rao2015-07-076-25/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Keep cpu_model field in MachineState uptodate so that it can be used from the CPU hotplug path. Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | spapr: Consolidate cpu init code into a routineBharata B Rao2015-07-071-25/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Factor out bits of sPAPR specific CPU initialization code into a separate routine so that it can be called from CPU hotplug path too. Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | spapr: Reorganize CPU dt generation codeBharata B Rao2015-07-071-125/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reorganize CPU device tree generation code so that it be reused from hotplug path. CPU dt entries are now generated from spapr_finalize_fdt() instead of spapr_create_fdt_skel(). Note: This is how the split-up looks like now: Boot path --------- spapr_finalize_fdt spapr_populate_cpus_dt_node spapr_populate_cpu_dt spapr_fixup_cpu_numa_dt spapr_fixup_cpu_smt_dt ibm,cas path ------------ spapr_h_cas_compose_response spapr_fixup_cpu_dt spapr_fixup_cpu_numa_dt spapr_fixup_cpu_smt_dt Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | cpus: Add a macro to walk CPUs in reverseBharata B Rao2015-07-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add CPU_FOREACH_REVERSE that walks CPUs in reverse. Needed for PowerPC CPU device tree reorganization. Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | spapr: Support ibm, lrdr-capacity device tree propertyBharata B Rao2015-07-073-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for ibm,lrdr-capacity since this is needed by the guest kernel to know about the possible hot-pluggable CPUs and Memory. With this, pseries kernels will start reporting correct maxcpus in /sys/devices/system/cpu/possible. Also define the minimum hotpluggable memory size as 256MB. Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> [agraf: Fix compile error on 32bit hosts] Signed-off-by: Alexander Graf <agraf@suse.de>
| * | spapr: Consider max_cpus during xics initializationBharata B Rao2015-07-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use max_cpus instead of smp_cpus when intializating xics system. Also report max_cpus in ibm,interrupt-server-ranges device tree property of interrupt controller node. Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | Revert "hw/ppc/spapr_pci.c: Avoid functions not in glib 2.12 ↵Markus Armbruster2015-07-071-17/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (g_hash_table_iter_*)" Since we now require GLib 2.22+ (commit f40685c), we don't have to work around lack of g_hash_table_iter_init() & friends anymore. This reverts commit f8833a37c0c6b22ddd57b45e48cfb0f97dbd5af4. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | spapr_iommu: translate sPAPRTCEAccess to IOMMUAccessFlagsGreg Kurz2015-07-071-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fact that these enums have matching values is pure coincidence. We actually need to translate from the PAPR definition to the QEMU one. This patch doesn't fix any bug, it is only code cleanup. Suggested-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | spapr_iommu: drop erroneous check in h_put_tce_indirect()Greg Kurz2015-07-071-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tce_list variable is not a TCE but the address to a TCE: we shouldn't clear permission bits as we do now. And this is dead code anyway since we check tce_list is 4K aligned a few lines above. This patch doesn't fix any bug, it is only code cleanup. Suggested-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | spapr_pci: set device node unit address as hexNikunj A Dadhania2015-07-071-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Device node names should encode the unit address as hex, while the code was encodind it as integers. Also, use FDT_NAME_MAX macro for allocating and composing the name. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | spapr_pci: encode class code including Prog IF registerNikunj A Dadhania2015-07-071-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current code missed the Prog IF register. All Class Code, Subclass, and Prog IF registers are needed to identify the accurate device type. For example: USB controllers use the PROG IF for denoting: USB FullSpeed, HighSpeed or SuperSpeed. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | spapr_pci: encode missing 64-bit memory address spaceNikunj A Dadhania2015-07-071-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The properties reg/assigned-resources need to encode 64-bit memory address space as part of phys.hi dword. 00 if configuration space 01 if IO region, 10 if 32-bit MEM region 11 if 64-bit MEM region Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | spapr: Add sPAPRMachineClassDavid Gibson2015-07-072-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently although we have an sPAPRMachineState descended from MachineState we don't have an sPAPRMAchineClass descended from MachineClass. So far it hasn't been needed, but several upcoming features are going to want it, so this patch creates a stub implementation. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | spapr: Remove obsolete entry_point field from sPAPRMachineStateDavid Gibson2015-07-072-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sPAPRMachineState structure includes an entry_point field containing the initial PC value for starting the machine, even though this always has the value 0x100. I think this is a hangover from very early versions which bypassed the firmware when using -kernel. In any case it has no function now, so remove it. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | spapr: Remove obsolete ram_limit field from sPAPRMachineStateDavid Gibson2015-07-073-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ram_limit field was imported from sPAPREnvironment where it predates the machine's ram size being available generically from machine->ram_size. Worse, the existing code was inconsistent about where it got the ram size from. Sometimes it used spapr->ram_limit, sometimes the global 'ram_size' and sometimes a local 'ram_size' masking the global. This cleans up the code to consistently use machine->ram_size, eliminating spapr->ram_limit in the process. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | spapr: Merge sPAPREnvironment into sPAPRMachineStateDavid Gibson2015-07-0716-148/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code for -machine pseries maintains a global sPAPREnvironment structure which keeps track of general state information about the guest platform. This predates the existence of the MachineState structure, but performs basically the same function. Now that we have the generic MachineState, fold sPAPREnvironment into sPAPRMachineState, the pseries specific subclass of MachineState. This is mostly a matter of search and replace, although a few places which relied on the global spapr variable are changed to find the structure via qdev_get_machine(). Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | pseries: Update SLOF firmware image to qemu-slof-20150429Alexey Kardashevskiy2015-07-073-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The changelog is: > version: update to 20150429 > pci: Use QEMU created PCI device nodes > usb: support 64-bit pci bars > pci: Support 64-bit address translation > pci: program correct bridge limit registers during probe > scsi: handle report-luns failure > Fix "key?" Forth word when using USB keyboards > Remove bulk.fs package > Include make.rules in the library Makefiles Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | spapr: ensure we have at least one XICS serverGreg Kurz2015-07-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | XICS needs to know the upper value for cpu_index as it is used to compute the number of servers: smp_cpus * kvmppc_smt_threads() / smp_threads When passing -smp cpus=1,threads=9 on a POWER8 host, we end up with: 1 * 8 / 9 = 0 ... which leads to an assertion in both emulated: Number of servers needs to be greater 0 Aborted (core dumped) ... and in-kernel XICS: xics_kvm_realize: Assertion `icp->nr_servers' failed. Aborted (core dumped) With this patch, we are sure that nr_servers > 0. Passing the same bogus -smp option then leads to: qemu-system-ppc64: Cannot support more than 8 threads on PPC with KVM ... which is a lot more explicit than the XICS errors. Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | target-ppc: fix hugepage support when using memory-backend-fileMichael Roth2015-07-071-6/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current PPC code relies on -mem-path being used in order for hugepage support to be detected. With the introduction of MemoryBackendFile we can now handle this via: -object memory-file-backend,mem-path=...,id=hugemem0 \ -numa node,id=mem0,memdev=hugemem0 Management tools like libvirt treat the 2 approaches as interchangeable in some cases, which can lead to user-visible regressions even for previously supported guest configurations. Fix these by also iterating through any configured memory backends that may be backed by hugepages. Since the old code assumed hugepages always backed the entirety of guest memory, play it safe an pick the minimum across the max pages sizes for all backends, even ones that aren't backed by hugepages. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | macio: remove nonexistent interrupt on pin 1Cormac O'Brien2015-07-071-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current macio implementation declares an interrupt that doesn't appear to exist in the hardware or any other emulator implementation. OpenBIOS detects this interrupt and generates an 'interrupts' property in the macio device tree entry. Mac OS 9 halts boot when it detects this interrupt, so it has been removed to permit further progress in the boot process. Signed-off-by: Cormac O'Brien <i.am.cormac.obrien@gmail.com> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Alexander Graf <agraf@suse.de>
| * | linux-user, ppc: mftbl can be used by user applicationLaurent Vivier2015-07-071-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In qemu-linux-user, when calling gethostbyname2(), it was hanging in .__res_nmkquery. (gdb) bt 0 in .__res_nmkquery () from /lib64/libresolv.so.2 1 in .__libc_res_nquery () from /lib64/libresolv.so.2 2 in .__libc_res_nsearch () from /lib64/libresolv.so.2 3 in ._nss_dns_gethostbyname3_r () from /lib64/libnss_dns.so.2 4 in ._nss_dns_gethostbyname2_r () from /lib64/libnss_dns.so.2 5 in .gethostbyname2_r () from /lib64/libc.so.6 6 in .gethostbyname2 () from /lib64/libc.so.6 .__res_nmkquery() is: ... do { RANDOM_BITS (randombits); } while ((randombits & 0xffff) == 0); ... <.__res_nmkquery+112>: mftbl r11 <.__res_nmkquery+116>: clrlwi r10,r11,16 <.__res_nmkquery+120>: cmpwi cr7,r10,0 <.__res_nmkquery+124>: beq cr7,<.__res_nmkquery+112> but as mftbl (Move From Time Base Lower) is not implemented, r11 is always 0, so we have an infinite loop. This patch fills the Time Base register with cpu_get_real_ticks(). Signed-off-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Alexander Graf <agraf@suse.de>
* | | Merge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into ↵Peter Maydell2015-07-074-3/+44
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | staging X86 queue, 2015-07-07 Patch "target-i386: emulate CPUID level of real hardware" was removed after the 2015-07-03 pull request. # gpg: Signature made Tue Jul 7 15:46:23 2015 BST using RSA key ID 984DC5A6 # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/x86-pull-request: target-i386: avoid overflow in the tsc-frequency property i386: Introduce ARAT CPU feature Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | | target-i386: avoid overflow in the tsc-frequency propertyPaolo Bonzini2015-07-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The TSC frequency fits comfortably in an int when expressed in kHz, but it may overflow when converted to Hz. In this case, tsc-frequency returns a negative value because x86_cpuid_get_tsc_freq does a 32-bit multiplication before assigning to int64_t. For simplicity just make tsc_khz a 64-bit value. Spotted by Coverity. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
OpenPOWER on IntegriCloud