summaryrefslogtreecommitdiffstats
path: root/hw
Commit message (Collapse)AuthorAgeFilesLines
* pci: Fix clearing IRQs on resetCole Robinson2014-03-311-2/+2
| | | | | | | | | | | | | | | | | | | | irq_state is cleared before calling pci_device_deassert_intx, but the latter misbehaves if the former isn't accurate. In this case, any raised IRQs are not cleared, which hits an assertion in pcibus_reset: qemu-system-x86_64: hw/pci/pci.c:250: pcibus_reset: Assertion `bus->irq_count[i] == 0' failed. pci_device_deassert_intx should clear irq_state anyways, so add an assert. This fixes migration with usb2 + usb-tablet. Signed-off-by: Cole Robinson <crobinso@redhat.com> Message-id: 7da1ad94ce027183b4049c2de370cb191b0073c1.1396290569.git.crobinso@redhat.com Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell2014-03-282-3/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | acpi,pc,build bug fixes Here are some bugfixes for 2.0. A bugfix for acpi for pci bridges, and a build fix for old systems without pthread_setname_np: both fix regressions so we definitely want to include them. HPET fix is not for a regression but looks very safe, fixes a nasty bug and has been on list for a while. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Fri 28 Mar 2014 12:00:12 GMT using RSA key ID D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" * remotes/mst/tags/for_upstream: acpi: fix ACPI generation for pci bridges Don't enable a HPET timer if HPET is disabled Detect pthread_setname_np at configure time Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * acpi: fix ACPI generation for pci bridgesMarcel Apfelbaum2014-03-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 8dcf525abc5dff785251a881f9764dd961065c0d acpi-build: append description for non-hotplug appended description for all occupied non hotpluggable PCI slots. However the bridge devices are already added to SSDT, adding them again will create an incorrect SSDT table. Fixed by skipping the pci bridge devices, marking them as 'system'. Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * Don't enable a HPET timer if HPET is disabledMatt Lupfer2014-03-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A HPET timer can be started when HPET is not yet enabled. This will not generate an interrupt to the guest, but causes problems when HPET is later enabled. A timer that is created and expires at least once before HPET is enabled will have an initialized comparator based on a hpet_offset of 0 (uninitialized). When HPET is enabled, hpet_set_timer() is called a second time, which modifies the timer expiry to a time based on the difference between current ticks (measured with the newly initialized hpet_offset) and the timer's comparator (which was generated before hpet_offset was initialized). This results in a long period of no HPET timer ticks. When this occurs with a CentOS 5.x guest, the guest may not receive timer interrupts during its narrow timer check window and panic on boot. Signed-off-by: Matt Lupfer <mlupfer@ddn.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
* | Merge remote-tracking branch 'remotes/afaerber/tags/ppc-for-2.0' into stagingPeter Maydell2014-03-271-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PowerPC queue for 2.0 * OpenPIC fix * MSR fixes for POWER7 upwards * TCG instruction set support fix for POWER8 # gpg: Signature made Thu 27 Mar 2014 16:12:12 GMT using RSA key ID 3E7E013F # gpg: Good signature from "Andreas Färber <afaerber@suse.de>" # gpg: aka "Andreas Färber <afaerber@suse.com>" * remotes/afaerber/tags/ppc-for-2.0: target-ppc: MSR_POW not supported on POWER7/7+/8 target-ppc: POWER7+ supports the MSR_VSX bit target-ppc: POWER8 supports isel target-ppc: POWER8 supports the MSR_LE bit intc/openpic_kvm: Fix MemListener delete region callback function Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | intc/openpic_kvm: Fix MemListener delete region callback functionPrasad Joshi2014-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | Fixes d85937e683f6ff4d68293cb24c780fb1f6820d2c. Signed-off-by: Prasad Joshi <prasadjoshi.linux@gmail.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* | | Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-2014-03-27' ↵Peter Maydell2014-03-2715-55/+56
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into staging trivial patches for 2014-03-27 # gpg: Signature made Thu 27 Mar 2014 15:23:53 GMT using RSA key ID 74F0C838 # gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>" # gpg: aka "Michael Tokarev <mjt@corpit.ru>" # gpg: aka "Michael Tokarev <mjt@debian.org>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D 4324 457C E0A0 8044 65C5 # Subkey fingerprint: E190 8639 3B10 B51B AC2C 8B73 5253 C5AD 74F0 C838 * remotes/mjt/tags/trivial-patches-2014-03-27: (23 commits) linux-user: remove duplicate statement hw/timer/grlib_gptimer: remove unnecessary assignment hw/pci-host/apb.c: Avoid shifting left into sign bit hw/intc/xilinx_intc: Avoid shifting left into sign bit hw/intc/slavio_intctl: Avoid shifting left into sign bit tests/libqos/pci-pc: Avoid shifting left into sign bit hw/ppc: Avoid shifting left into sign bit hw/intc/openpic: Avoid shifting left into sign bit hw/usb/hcd-ohci.c: Avoid shifting left into sign bit target-mips: Avoid shifting left into sign bit hw/i386/acpi_build.c: Avoid shifting left into sign bit hw/pci/pci_host.c: Avoid shifting left into sign bit hw/intc/apic.c: Use uint32_t for mask word in foreach_apic target-i386: Avoid shifting left into sign bit CODING_STYLE: Section about mixed declarations doc: update default PowerPC framebuffer settings doc: update sun4m documentation fix return check for KVM_GET_DIRTY_LOG ioctl target-i386: Add missing 'static' and 'const' attributes util: Add 'static' attribute to function implementation ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | | hw/timer/grlib_gptimer: remove unnecessary assignmentPrasad Joshi2014-03-271-1/+0
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Prasad Joshi <prasadjoshi.linux@gmail.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
| * | | hw/pci-host/apb.c: Avoid shifting left into sign bitPeter Maydell2014-03-271-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add U suffix to avoid undefined behaviour. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
| * | | hw/intc/xilinx_intc: Avoid shifting left into sign bitPeter Maydell2014-03-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid undefined behaviour shifting left into the sign bit. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
| * | | hw/intc/slavio_intctl: Avoid shifting left into sign bitPeter Maydell2014-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add 'U' suffix to avoid undefined behaviour. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
| * | | hw/ppc: Avoid shifting left into sign bitPeter Maydell2014-03-275-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add U suffix to various places where we were doing "1 << 31", which is undefined behaviour, and also to other constant definitions in the same groups, for consistency. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
| * | | hw/intc/openpic: Avoid shifting left into sign bitPeter Maydell2014-03-271-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add U suffix to avoid undefined behaviour. This is only strictly necessary for the 1 << 31 cases; for consistency we extend it to other constants in the same group. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
| * | | hw/usb/hcd-ohci.c: Avoid shifting left into sign bitPeter Maydell2014-03-271-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add U suffix to avoid undefined behaviour. This is only strictly necessary for the 1<<31 cases, but we add it for the other constants in these groups for consistency. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
| * | | hw/i386/acpi_build.c: Avoid shifting left into sign bitPeter Maydell2014-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add U suffix to avoid undefined behaviour. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
| * | | hw/pci/pci_host.c: Avoid shifting left into sign bitPeter Maydell2014-03-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add U suffix to avoid undefined behaviour. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
| * | | hw/intc/apic.c: Use uint32_t for mask word in foreach_apicPeter Maydell2014-03-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use unsigned arithmetic for operations on the mask word in the foreach_apic() macro, to avoid relying on undefined behaviour when shifting into the sign bit. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
| * | | hw/ide: Add missing 'static' attributesStefan Weil2014-03-271-1/+1
| |/ / | | | | | | | | | | | | | | | | | | This fixes a warning from the static code analysis (smatch). Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* | | hw/arm: Stop specifying integratorcp as the default boardPeter Maydell2014-03-271-1/+0
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently for both qemu-system-arm and qemu-system-aarch64 the default board model if the user doesn't specify one is the 'integratorcp'. This is a totally arbitrary historical accident since it was the first board to be modelled. That board is now just one target among many for us, and is a very poor choice of default: * it's an ancient board that is now only found in the junkpiles of longtime ARM/Linux hackers, if at all * it's an ARMv5 CPU, when most distros are now assuming ARMv7 * it's pretty much unmaintained in QEMU * it doesn't even have versatilepb's advantage of supporting PCI Making it or any other board the default serves only to confuse people new to ARM who expect something more like the x86 monoculture. Remove the is_default marker from integratorcp, and don't set it for any other board, to give users a nudge that they need to think about which board they want a QEMU model of. (QEMU will produce the admittedly slightly cryptic error "No machine found.") Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
* | Merge remote-tracking branch 'remotes/bonzini/scsi-next' into stagingPeter Maydell2014-03-262-2/+3
|\ \ | |/ |/| | | | | | | | | | | * remotes/bonzini/scsi-next: spapr_vscsi: remove duplicate condition check scsi: check req pointer before dereferencing it Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * spapr_vscsi: remove duplicate condition checkPrasad Joshi2014-03-261-1/+1
| | | | | | | | | | Signed-off-by: Prasad Joshi <prasadjoshi.linux@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * scsi: check req pointer before dereferencing itPrasad Joshi2014-03-261-1/+2
| | | | | | | | | | Signed-off-by: Prasad Joshi <prasadjoshi.linux@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* | virtio-net: add vlan receive state to RxFilterInfoAmos Kong2014-03-261-13/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stefan Fritsch just fixed a virtio-net driver bug [1], virtio-net won't filter out VLAN-tagged packets if VIRTIO_NET_F_CTRL_VLAN isn't negotiated. This patch added a new field to @RxFilterInfo to indicate vlan receive state ('normal', 'none', 'all'). If VIRTIO_NET_F_CTRL_VLAN isn't negotiated, vlan receive state will be 'all', then all VLAN-tagged packets will be received by guest. This patch also fixed a boundary issue in visiting vlan table. [1] http://lists.nongnu.org/archive/html/qemu-devel/2014-02/msg02604.html Signed-off-by: Amos Kong <akong@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
* | virtio-net: Do not filter VLANs without F_CTRL_VLANStefan Fritsch2014-03-261-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | If VIRTIO_NET_F_CTRL_VLAN is not negotiated, do not filter out all VLAN-tagged packets but send them to the guest. This fixes VLANs with OpenBSD guests (and probably NetBSD, too, because the OpenBSD driver started as a port from NetBSD). Signed-off-by: Stefan Fritsch <sf@sfritsch.de> Signed-off-by: Amos Kong <akong@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* | acpi: make SSDT 1.0 spec compliant when possibleMichael S. Tsirkin2014-03-261-2/+14
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ACPI specification says: The ASL compiler can emit two different AML opcodes for a Package declaration, either PackageOp or VarPackageOp. For small, fixed-length packages, the PackageOp is used and this opcode is compatible with ACPI 1.0. A VarPackageOp will be emitted if any of the following conditions are true: . The NumElements argument is a TermArg that can only be resolved at runtime. . At compile time, NumElements resolves to a constant that is larger than 255. . The PackageList contains more than 255 initializer elements. Note: The ability to create variable-sized packages was first introduced in ACPI 2.0. ACPI 1.0 only allowed fixed-size packages with up to 255 elements. So the spec seems to say a fixed value up to 255 must always be used with PackageOp and not VarPackageOp, and some guests (windows up to win2k8) seem to interpret it like this. Let's do just this, choosing the encoding depending on the number of elements. Fixes 9bcc80cd71892df42605e0c097d85c0237ff45d1 (i386/acpi-build: allow more than 255 elements in CPON). https://bugs.launchpad.net/bugs/1297651 Reported-by: Robert Hu <robert.hu@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* vfio: Cosmetic error reporting fixesAlex Williamson2014-03-251-14/+14
| | | | | | | * Remove terminating newlines from hw_error() and error_report() calls * Fix cut-n-paste error in text (s/to/from/) Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
* vfio: Correction in vfio_rom_read when attempting rom loadingBandan Das2014-03-251-4/+1
| | | | | | | | | | commit e638073c569e801ce9de added a flag to track whether a previous rom read had failed. Accidentally, the code ended up adding vfio_load_option_rom twice. (Thanks to Alex for spotting it) Signed-off-by: Bandan Das <bsd@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
* Merge remote-tracking branch ↵Peter Maydell2014-03-241-1/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'remotes/pmaydell/tags/pull-target-arm-20140324' into staging target-arm queue for 2.0: * Fix wrong-results bug in A64 Neon MLS instruction * Fix loading of ELF images for 32 bit boards in qemu-system-aarch64 # gpg: Signature made Mon 24 Mar 2014 17:14:07 GMT using RSA key ID 14360CDE # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" * remotes/pmaydell/tags/pull-target-arm-20140324: target-arm: Load ELF images with the correct machine type for CPU target-arm: Fix A64 Neon MLS Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * target-arm: Load ELF images with the correct machine type for CPUPeter Maydell2014-03-241-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When trying to load an ELF file specified via -kernel, we need to pass load_elf() the ELF machine type corresponding to the CPU we're booting with, not the one corresponding to the softmmu binary we happen to be running. (The two are different in the case of loading a 32-bit ARM ELF file into a 32 bit CPU being emulated by qemu-system aarch64.) This was causing us to incorrectly fail to load ELF images in this situation. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de> Message-id: 1395427476-25546-1-git-send-email-peter.maydell@linaro.org
* | Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell2014-03-244-36/+45
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | acpi,pc,test bug fixes More small fixes all over the place. Notably fixes for big-endian hosts by Marcel. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Mon 24 Mar 2014 10:41:07 GMT using RSA key ID D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17 0970 C350 3912 AFBE 8E67 # Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA 8A0D 281F 0DB8 D28D 5469 * remotes/mst/tags/for_upstream: tests/acpi-test: do not fail if iasl is broken vl.c: Use MAX_CPUMASK_BITS macro instead of hardcoded constant sysemu.h: Document what MAX_CPUMASK_BITS really limits acpi: fix endian-ness for table ids acpi-test: signature endian-ness fixes i386/acpi-build: support hotplug of VCPU with APIC ID 0xFF acpi-test: rebuild SSDT i386/acpi-build: allow more than 255 elements in CPON pc: Refuse max_cpus if it results in too large APIC ID acpi: Don't use MAX_CPUMASK_BITS for APIC ID bitmap acpi: Assert sts array limit on AcpiCpuHotplug_add() pc: Refuse CPU hotplug if the resulting APIC ID is too large acpi: Add ACPI_CPU_HOTPLUG_ID_LIMIT macro acpi-test: update expected SSDT files acpi-build: fix misaligned access Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * acpi: fix endian-ness for table idsMichael S. Tsirkin2014-03-182-29/+16
| | | | | | | | | | | | | | | | when using signature for table ID, we forgot to byte-swap it. signatures are really ASCII strings, let's treat them as such. While at it, get rid of most of _SIGNATURE macros. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * i386/acpi-build: support hotplug of VCPU with APIC ID 0xFFLaszlo Ersek2014-03-181-1/+6
| | | | | | | | | | | | | | | | | | | | Building on the previous patch, raise the maximal count of processor objects / NTFY branches / CPON elements from 255 to 256. This allows the VCPU with APIC ID 0xFF to be hotplugged. Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * i386/acpi-build: allow more than 255 elements in CPONLaszlo Ersek2014-03-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The build_ssdt() function builds a number of AML objects that are related to CPU hotplug, and whose IDs form a contiguous sequence of APIC IDs. (APIC IDs are in fact discontiguous, but this is the traditional interface: build a contiguous sequence from zero up that covers all possible APIC IDs.) These objects are: - a Processor() object for each VCPU, - a NTFY method, with one branch for each VCPU, - a CPON package with one element (hotplug status byte) for each VCPU. The build_ssdt() function currently limits the *count* of processor objects, and NTFY branches, and CPON elements, in 0xFF (see the assignment to "acpi_cpus"). This allows for an inclusive APIC ID range of [0..254]. This is incorrect, because the highest APIC ID that we otherwise allow a VCPU to take is 255. In order to extend the maximum count to 256, and the traversed APIC ID range correspondingly to [0..255]: - the Processor() objects need no change, - the NTFY method also needs no change, - the CPON package must be updated, because it is defined with a DefPackage, and the number of elements in such a package can be at most 255. We pick a DefVarPackage instead. We replace the Op byte, and the encoding of the number of elements. Compare: DefPackage := PackageOp PkgLength NumElements PackageElementList DefVarPackage := VarPackageOp PkgLength VarNumElements PackageElementList PackageOp := 0x12 VarPackageOp := 0x13 NumElements := ByteData VarNumElements := TermArg => Integer The build_append_int() function implements precisely the following TermArg encodings (a subset of what the ACPI spec describes): TermArg := DataObject DataObject := ComputationalData ComputationalData := ConstObj | ByteConst | WordConst | DWordConst directly encoded in the function, with build_append_byte(): ConstObj := ZeroOp | OneOp ZeroOp := 0x00 OneOp := 0x01 call to build_append_value(..., 1): ByteConst := BytePrefix ByteData BytePrefix := 0x0A ByteData := 0x00 - 0xFF call to build_append_value(..., 2): WordConst := WordPrefix WordData WordPrefix := 0x0B WordData := ByteData[0:7] ByteData[8:15] call to build_append_value(..., 4): DWordConst := DWordPrefix DWordData DWordPrefix := 0x0C DWordData := WordData[0:15] WordData[16:31] Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pc: Refuse max_cpus if it results in too large APIC IDEduardo Habkost2014-03-181-0/+8
| | | | | | | | | | | | | | | | | | | | | | This changes the PC initialization code to reject max_cpus if it results in an APIC ID that's too large, instead of aborting or erroring out when it is already too late. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * acpi: Don't use MAX_CPUMASK_BITS for APIC ID bitmapEduardo Habkost2014-03-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MAX_CPUMASK_BITS is a limit for max_cpus and CPU indexes, not for APIC IDs. ACPI_CPU_HOTPLUG_ID_LIMIT is the right macro for the limit on APIC IDs on the ACPI and CPU hotplug code. There are no functional changes introduced by this patch, as MAX_CPUMASK_BITS + 1 == 255 + 1 == 256 == ACPI_CPU_HOTPLUG_ID_LIMIT. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * acpi: Assert sts array limit on AcpiCpuHotplug_add()Eduardo Habkost2014-03-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | AcpiCpuHotplug_add() can't handle vCPU arch IDs larger than ACPI_CPU_HOTPLUG_ID_LIMIT. Instead of corrupting memory in case the vCPU ID is too large, use g_assert() to ensure we are not over the limit. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pc: Refuse CPU hotplug if the resulting APIC ID is too largeEduardo Habkost2014-03-181-0/+8
| | | | | | | | | | | | | | | | | | | | | | The ACPI CPU hotplug code requires APIC IDs to be smaller than ACPI_CPU_HOTPLUG_ID_LIMIT, so enforce the limit before trying to hotplug a new vCPU, returning an error instead of crashing. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * acpi-build: fix misaligned accessMichael S. Tsirkin2014-03-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | clang build reported a misaligned access: runtime error: store to misaligned address 0x2b5aa47dfb19 for type 'uint16_t' (aka 'unsigned short'), which requires 2 byte alignment 0x2b5aa47dfb19: note: pointer points here 45 53 54 0b ff ff 5b 80 50 45 4f 52 01 50 45 53 54 01 5b 81 0b 50 45 4f 52 01 50 45 50 54 08 14 fix this up Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* | Merge remote-tracking branch 'remotes/afaerber/tags/ppc-for-2.0' into stagingPeter Maydell2014-03-208-20/+217
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PowerPC queue for 2.0 * sPAPR loop fix * SPR reset fix * Reduce allocation size of indirect opcode tables * Restrict number of CPU threads * sPAPR H_SET_MODE fixes * sPAPR firmware path fixes * Static and constness cleanups # gpg: Signature made Thu 20 Mar 2014 01:46:14 GMT using RSA key ID 3E7E013F # gpg: Good signature from "Andreas Färber <afaerber@suse.de>" # gpg: aka "Andreas Färber <afaerber@suse.com>" * remotes/afaerber/tags/ppc-for-2.0: spapr: Implement interface to fix device pathname spapr: QOM'ify pseries machine spapr_vio: Fix firmware names spapr_llan: Add to boot device list qdev: Introduce FWPathProvider interface vl.c: Extend get_boot_devices_list() to ignore suffixes spapr_hcall: Fix little-endian resource handling in H_SET_MODE target-ppc: Introduce powerisa-207-server flag target-ppc: Force CPU threads count to be a power of 2 target-ppc: Fix overallocation of opcode tables target-ppc: Reset SPRs on CPU reset spapr_hcall: Fix h_enter to loop correctly target-ppc: Add missing 'static' and 'const' attributes Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | spapr: Implement interface to fix device pathnameAlexey Kardashevskiy2014-03-201-1/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This extends the pseries machine type with the interface to fix firmware pathnames for devices which have @bootindex property. This fixes SCSI disks' device node names (which are wildcard nodes in the device-tree), for spapr-vscsi, virtio-scsi and usb-storage. This fixes PHB name from "pci" to "pci@XXXX" where XXXX is a BUID as there is no bus on top of sPAPRPHBState where PHB firmware name could be fixed using the BusClass::get_fw_dev_path() mechanism. This stores the boot list in the /chosen/qemu,boot-list property of the device tree. "\n" are replaced by spaces to support OF1275. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * | spapr: QOM'ify pseries machineAlexey Kardashevskiy2014-03-201-3/+19
| | | | | | | | | | | | | | | Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * | spapr_vio: Fix firmware namesAlexey Kardashevskiy2014-03-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This changes VIO bridge fw name from spapr-vio-bridge to vdevice and vscsi/veth node names from QEMU object names to VIO specific device tree names. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * | spapr_llan: Add to boot device listAlexey Kardashevskiy2014-03-201-0/+3
| | | | | | | | | | | | | | | Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * | qdev: Introduce FWPathProvider interfacePaolo Bonzini2014-03-203-1/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QEMU supports firmware names for all devices in the QEMU tree but some architectures expect some parts of firmware path names in different format. This introduces a firmware-pathname-change interface definition. If some machines needs to redefine the firmware path format, it has to add the TYPE_FW_PATH_PROVIDER interface to an object that is above the device on the QOM tree (typically /machine). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * | vl.c: Extend get_boot_devices_list() to ignore suffixesAlexey Kardashevskiy2014-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As suffixes do not make sense for sPAPR's device tree and there is no way to filter them out on the BusState::get_fw_dev_path() level, let's add an ability for the external caller to specify whether to apply suffixes or not. We could handle suffixes in SLOF (ignored for now) but this would require serious rework in the node opening code in SLOF, which has no obvious benefit for the currently emulated sPAPR machine. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * | spapr_hcall: Fix little-endian resource handling in H_SET_MODEAlexey Kardashevskiy2014-03-201-8/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes resource code definitions to ones used in the host kernel. This fixes H_SET_MODE_RESOURCE_LE (switch between big endian and little endian) to sync registers from KVM before changing LPCR value. This adds a set_spr() helper to update an SPR in a CPU's context to avoid possible races and makes use of it to change LPCR. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * | spapr_hcall: Fix h_enter to loop correctlyAneesh Kumar K.V2014-03-201-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We wanted to loop till index is 8. On 8 we return with H_PTEG_FULL. If we are successful in loading hpte with any other index, we continue with that index value. Reported-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* | | raven: Use raven_ for all function prefixesHervé Poussineau2014-03-201-19/+21
| | | | | | | | | | | | | | | Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Andreas Färber <andreas.faerber@web.de>
* | | raven: Fix PCI bus accesses with size > 1Hervé Poussineau2014-03-201-4/+4
| | | | | | | | | | | | | | | | | | Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Reviewed-by: Artyom Tarasenko <atar4qemu@gmail.com> Signed-off-by: Andreas Färber <andreas.faerber@web.de>
* | | raven: Add PCI bus mastering address spaceHervé Poussineau2014-03-201-0/+24
| | | | | | | | | | | | | | | | | | | | | This has been tested on Linux 2.4/PPC with the lsi53c895a SCSI adapter. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Andreas Färber <andreas.faerber@web.de>
OpenPOWER on IntegriCloud