summaryrefslogtreecommitdiff
path: root/hw/i386
AgeCommit message (Collapse)Author
2014-05-13pc: port 92 reset requires a low->high transitionPaolo Bonzini
The PIIX datasheet says that "before another INIT pulse can be generated via [port 92h], [bit 0] must be written back to a zero. This bug is masked right now because a full reset will clear the value of port 92h. But once we implement soft reset correctly, the next attempt to enable the A20 line by setting bit 1 (and leaving the others untouched) will cause another reset. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-05-13pci-assign: limit # of msix vectorsMichael S. Tsirkin
KVM only supports MSIX table size up to 256 vectors, but some assigned devices support more vectors, at the moment attempts to assign them fail with EINVAL. Tweak the MSIX capability exposed to guest to limit table size to a supported value. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Gonglei <arei.gonglei@huawei.com> Cc: qemu-stable@nongnu.org Acked-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-05-13pci-assign: Fix a bug when map MSI-X table memory failedGonglei
When mmapping memory for the MSI-X table failsthe dev->msix_table is not set to NULL and assigned_dev_unregister_msix_mmio() will cause a segfault when trying to munmap it. Signed-off-by: Gonglei Arei <arei.gonglei@huawei.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
2014-05-08pci-assign: assigned_initfn(): set monitor error in common error handlerLaszlo Ersek
Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-05-08pci-assign: propagate errors from assign_intx()Laszlo Ersek
Among the callers, only assigned_initfn() should set the monitor's stored error. Other callers may run in contexts where the monitor's stored error makes no sense. For example: assigned_dev_pci_write_config() assigned_dev_update_msix() assign_intx() Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-05-08pci-assign: propagate errors from assign_device()Laszlo Ersek
Also, change the return type to "void"; the function is static (with a sole caller) and the negative errno values are not distinguished from each other. Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-05-08pci-assign: propagate errors from assigned_dev_register_regions()Laszlo Ersek
Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-05-08pci-assign: propagate errors from assigned_dev_register_msix_mmio()Laszlo Ersek
The return type is also changed from "int" to "void", because it was used in a success vs. failure sense only (the caller didn't distinguish error codes from each other, and even assigned_dev_register_msix_mmio() masked mmap()'s errno values with a common -EFAULT). Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-05-08pci-assign: propagate errors from assigned_device_pci_cap_init()Laszlo Ersek
Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-05-08pci-assign: propagate errors from get_real_device()Laszlo Ersek
Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-05-08pci-assign: assignment should fail if we can't read config spaceLaszlo Ersek
assigned_initfn() get_real_device() read() Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-05-08pci-assign: accept Error from pci_add_capability2()Laszlo Ersek
Propagate any errors while adding PCI capabilities to assigned_device_pci_cap_init(). We'll continue the propagation upwards when assigned_device_pci_cap_init() becomes a leaf itself (when none of its callees will report errors internally any longer when detecting and returning them). Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-05-08pci-assign: propagate Error from check_irqchip_in_kernel()Laszlo Ersek
Rename check_irqchip_in_kernel() to verify_irqchip_in_kernel(), so that the name reflects our expectation better. Rather than returning a bool, make it do nothing or set an Error. Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-05-08pci-assign: propagate errors from get_real_id()Laszlo Ersek
get_real_id() has two thin wrappers (and no other callers), get_real_vendor_id() and get_real_device_id(); it's easiest to convert them in one fell swoop. Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-05-08pci-assign: make assign_failed_examine() just format the causeLaszlo Ersek
This allows us to report the entire error with one error_report() call, easing future error propagation. Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-05-08pci-assign: accept Error from monitor_handle_fd_param2()Laszlo Ersek
Propagate any errors in monitor fd handling up to get_real_device(), and report them there. We'll continue the propagation upwards when get_real_device() becomes a leaf itself (when none of its callees will report errors internally any longer when detecting and returning an error). Signed-off-by: Laszlo Ersek <lersek@redhat.com> eviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-05-07Merge remote-tracking branch 'remotes/sstabellini/xen-140507-2' into stagingPeter Maydell
* remotes/sstabellini/xen-140507-2: xen_disk: add discard support pass an inclusive address range to xc_domain_pin_memory_cacheattr xen: factor out common functions xen: move Xen HVM files under hw/i386/xen xen: move Xen PV machine files to hw/xenpv qemu-xen: free all the pirqs for msi/msix when driver unload exec: Limit translation limiting in address_space_translate to xen Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-05-07xen: move Xen HVM files under hw/i386/xenWei Liu
Signed-off-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2014-05-07xen: move Xen PV machine files to hw/xenpvWei Liu
Signed-off-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2014-05-07pc: add compat_props placeholder for 2.0 machine typeGabriel L. Somlo
Add the "boilerplate" necessary for subsequent patches to simply drop in compat_props for pc machines 2.0 and older. This patch contains no functional changes. Signed-off-by: Gabriel Somlo <somlo@cmu.edu> Acked-by: Alexander Graf <agraf@suse.de> Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2014-05-07acpi: fix tables for no-hpet configurationMichael S. Tsirkin
acpi build tried to add offset of hpet table to rsdt even when hpet was disabled. If no tables follow hpet, this could lead to a malformed rsdt. Fix it up. To avoid such errors in the future, rearrange code slightly to make it clear that acpi_add_table stores the offset of the following table - not of the previous one. Reported-by: TeLeMan <geleman@gmail.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Cc: qemu-stable@nongnu.org
2014-05-07acpi-build: properly decrement objects' reference countersKirill Batuzov
Object returned by object_property_get_qobject needs its reference counter to be decremented when it is not needed by caller anymore. Signed-off-by: Kirill Batuzov <batuzovk@ispras.ru> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2014-05-05SMBIOS: Build aggregate smbios tables and entry pointGabriel L. Somlo
Build an aggregate set of smbios tables and an entry point structure. Insert tables and entry point into fw_cfg respectively under "etc/smbios/smbios-tables" and "etc/smbios/smbios-anchor". Machine types <= 2.0 will for now continue using field-by-field overrides to SeaBIOS defaults, but for machine types 2.1 and up we expect the BIOS to look for and use the aggregate tables generated by this patch. Signed-off-by: Gabriel Somlo <somlo@cmu.edu> [ kraxel: fix 32bit build ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-05SMBIOS: Use bitmaps to prevent incompatible comand line optionsGabriel L. Somlo
Replace existing smbios_check_collision() functionality with a pair of bitmaps: have_binfile_bitmap and have_fields_bitmap. Bits corresponding to each smbios type are set by smbios_entry_add(), which also uses the bitmaps to ensure that binary blobs and field values are never accepted for the same type. These bitmaps will also be used in the future to decide whether or not to build a full table for a given smbios type. Signed-off-by: Gabriel Somlo <somlo@cmu.edu> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-05SMBIOS: Use macro to set smbios defaultsGabriel L. Somlo
The function smbios_set_defaults() uses a repeating code pattern for each field. This patch replaces that pattern with a macro. This patch contains no functional changes. Signed-off-by: Gabriel Somlo <somlo@cmu.edu> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-05SMBIOS: Rename symbols to better reflect future useGabriel L. Somlo
Rename the following symbols: - smbios_set_type1_defaults() to the more general smbios_set_defaults(); - bool smbios_type1_defaults to the more general smbios_defaults; - smbios_get_table() to smbios_get_table_legacy(); This patch contains no functional changes. Signed-off-by: Gabriel Somlo <somlo@cmu.edu> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-05E820: Add interface for accessing e820 tableGabriel L. Somlo
Add the following two functions: - e820_get_num_entries() - query the size of the e820 table - e820_get_entry() - grab an entry matching a given set of criteria This interface is currently necessary for creating type 19 (memory array mapped address) structures in smbios. Signed-off-by: Gabriel Somlo <somlo@cmu.edu> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-05pc: add 2.1 machine typeMichael S. Tsirkin
At the moment, 2.1 and 2.0 machines are identical. As several people are working on incompatible changes to the PC machine, collaboration will be made easier by merging this place-holder. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-04-27misc: Use cpu_physical_memory_read and cpu_physical_memory_writeStefan Weil
These functions don't need type casts (as does cpu_physical_memory_rw) and also make the code better readable. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-04-14acpi: fix incorrect encoding for 0x{F-1}FFFFIgor Mammedov
Fix typo in build_append_int() which causes integer truncation when it's in range 0x{F-1}FFFF by packing it as WordConst instead of required DWordConst. In partucular this fixes a regression: hotplug in slots 16,17,18 and 19 didn't work, since SSDT had code like this: If (And (Arg0, 0x0000)) { Notify (S80, Arg1) } Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Stefan Weil <sw@weilnetz.de>
2014-04-10acpi: update generated hex filesMichael S. Tsirkin
commit f2ccc311df55ec026a8f8ea9df998f26314f22b2 dsdt: tweak ACPI ID for hotplug resource device changes the DSDT, update hex files to match Otherwise the fix is only effective if QEMU is built with iasl. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2014-04-08dsdt: tweak ACPI ID for hotplug resource deviceMichael S. Tsirkin
ACPI0004 seems too new: Windows XP complains about an unrecognized device. This is a regression since 1.7. Use PNP0A06 instead - Generic Container Device. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-By: Igor Mammedov <imammedo@redhat.com>
2014-03-28Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell
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>
2014-03-28acpi: fix ACPI generation for pci bridgesMarcel Apfelbaum
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>
2014-03-27hw/i386/acpi_build.c: Avoid shifting left into sign bitPeter Maydell
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>
2014-03-26acpi: make SSDT 1.0 spec compliant when possibleMichael S. Tsirkin
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>
2014-03-24Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell
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>
2014-03-18acpi: fix endian-ness for table idsMichael S. Tsirkin
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>
2014-03-18i386/acpi-build: support hotplug of VCPU with APIC ID 0xFFLaszlo Ersek
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>
2014-03-18i386/acpi-build: allow more than 255 elements in CPONLaszlo Ersek
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>
2014-03-18pc: Refuse max_cpus if it results in too large APIC IDEduardo Habkost
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>
2014-03-18acpi: Don't use MAX_CPUMASK_BITS for APIC ID bitmapEduardo Habkost
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>
2014-03-18pc: Refuse CPU hotplug if the resulting APIC ID is too largeEduardo Habkost
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>
2014-03-13cpu-exec: Change cpu_resume_from_signal() argument to CPUStateAndreas Färber
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13translate-all: Change tb_gen_code() argument to CPUStateAndreas Färber
Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13translate-all: Change cpu_restore_state() argument to CPUStateAndreas Färber
This lets us drop some local variables in tlb_fill() functions. Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13cpu: Move mem_io_{pc,vaddr} fields from CPU_COMMON to CPUStateAndreas Färber
Reset them. Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13target-i386: Enable x2apic by default on KVMEduardo Habkost
When on KVM mode, enable x2apic by default on all CPU models. Normally we try to keep the CPU model definitions as close as the real CPUs as possible, but x2apic can be emulated by KVM without host CPU support for x2apic, and it improves performance by reducing APIC access overhead. x2apic emulation is available on KVM since 2009 (Linux 2.6.32-rc1), there's no reason for not enabling x2apic by default when running KVM. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-13target-i386: Introduce x86_cpu_compat_disable_kvm_features()Eduardo Habkost
Instead of the feature-specific disable_kvm_pv_eoi() function, create a more general function that can be used to disable other feature bits in machine-type compat code. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-12acpi-build: fix misaligned accessMichael S. Tsirkin
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>