pc: Don't prematurely explode QEMUMachineInitArgs
Don't explode QEMUMachineInitArgs before passing it to pc_init1().
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>...
pc: Don't explode QEMUMachineInitArgs into local variables needlessly
Don't explode when the variable is used just a few times, and neverchanged.
pc: Kill pc_init_pci_1_0()
The pc_init_pci_1_2()/pc_init_pci_1_0() split was made on commit6fd028f64f662c801fd5a54d0e3a1d2baeee93ea, in preparation for commit9953f8822cc316eec9962f0a2858c3439a80adec. The latter was reverted, so there'sno reason to keep two separate functions that do exactly the same, anymore....
pc: cleanup 1.4 compat support
Make 1.4 compat code call the 1.6 one, reducingcode duplication. Add comment explaining why we can'tmake 1.4 call 1.5 as usual.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Reviewed-by: Andreas Färber <afaerber@suse.de>...
loader: store FW CFG ROM files in RAM
ROM files that are put in FW CFG are copied to guest ram, by BIOS, butthey are not backed by RAM so they don't get migrated.
Each time we change two bytes in such a ROM this breaks cross-versionmigration: since we can migrate after BIOS has read the first byte but...
pvpanic: fix bad merge
Context matching caused the 'has_pvpanic = true' to be applied tothe 1.6 machine type instead of the 1.5 machine type.
Reported-by: Markus Armbruster <armbru@redhat.com>Reported-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote-tracking branch 'afaerber/tags/qom-cpu-for-anthony' into staging
QOM CPUState refactorings
Conflicts:...
pc: drop external DSDT loading
This breaks migration and is unneeded with modern SeaBIOS.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1376316104-11269-1-git-send-email-aliguori@us.ibm.com
hw/misc: don't create pvpanic device by default
This patch is based on Hu Tao's:http://lists.nongnu.org/archive/html/qemu-devel/2013-08/msg00124.html
No need to hard-code pvpanic as part of the machine.It can be added with "-device pvpanic" from command line (The next patch)....
pc: Remove PCLMULQDQ from Westmere on pc-*-1.4 and older
Commit 41cb383f42d0cb51d8e3e25e3ecebc954dd4196f made a guest-visiblechange by adding the PCLMULQDQ bit to Westmere without addingcompatibility code to keep the ABI for older machine-types.Fix it by adding the missing compat code....
pc_sysfw: remove the rom_only property
With the new semantics of pc_sysfw (no -pflash implies "old-style" ROM setup,-pflash implies "new-style" ROM setup), there is no need anymore for a compatproperty. Old machines simply will never use -pflash, and thus will always...
pc_sysfw: do not make it a device anymore
Move the code to hw/i386, the sole remaining property is availableas !pci_enabled.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Markus Armbruster <armbru@redhat.com>Message-id: 1376069702-22330-4-git-send-email-aliguori@us.ibm.com...
pc: disable pci-info for 1.6
The BIOS that we ship in 1.6 does not use pci infofrom host (yet). Several issues turned up(e.g. around winXP boot crashes). So it's safest to disable thatinterface for 1.6 machine types for now, leave it on for 1.7as we have enough time to fix issues if any....
target-i386: Fix X86CPU error handling
Error **errp argument is not for emitting warnings, it means an errorhas occurred and the caller should not make any assumptions about thestate of other return values (unless otherwise documented).
Therefore cpu_x86_create() must unref the new X86CPU itself, and...
pc: limit 64 bit hole to 2G by default
It turns out that some 32 bit windows guests crashif 64 bit PCI hole size is >2G.Limit it to 2G for piix and q35 by default.User may override default 64-bit PCI hole size byusing "pci-hole64-size" property.
Examples:...
pc: add Q35 to QOM composition tree under /machine
Signed-off-by: Igor Mammedov <imammedo@redhat.com>Reviewed-by: Andreas Färber <afaerber@suse.de>Reviewed-by: Michael S. Tsirkin <mst@redhat.com>Reviewed-by: Andreas Färber <afaerber@suse.de>Message-id: 1375109277-25561-5-git-send-email-imammedo@redhat.com...
pc: move IO_APIC_DEFAULT_ADDRESS to include/hw/i386/ioapic.h
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Laszlo Ersek <lersek@redhat.com>Signed-off-by: Igor Mammedov <imammedo@redhat.com>Reviewed-by: Andreas Färber <afaerber@suse.de>...
kvmvapic: QOM cast cleanup
Signed-off-by: Andreas Färber <afaerber@suse.de>
kvm/ioapic: QOM cast cleanup
devices: Associate devices to their logical category
The category will be used to sort the devices displayed inthe command line help.
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>Message-id: 1375107465-25767-4-git-send-email-marcel.a@redhat.com...
cpu: Turn cpu_get_phys_page_debug() into a CPUClass hook
Change breakpoint_invalidate() argument to CPUState alongside.
Since all targets now assign a softmmu-only field, we can drop helperscpu_class_set_{do_unassigned_access,vmsd}() and device_class_set_vmsd()....
exec: Change cpu_memory_rw_debug() argument to CPUState
Propagate X86CPU in kvmvapic for simplicity.
kvm/clock: QOM'ify some more
Introduce type constant and avoid FROM_SYSBUS().
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>[AF: Renamed parent field]Signed-off-by: Andreas Färber <afaerber@suse.de>
kvm/clock: Use QOM realize for kvmclock
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
kvmvapic: Use QOM realize
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>[AF: Renamed variable]Signed-off-by: Andreas Färber <afaerber@suse.de>
q35: Use type-safe cast instead of direct access of parent dev
And remove variables if possible.
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>[AF: Converted remaining access and renamed to parent_obj]Signed-off-by: Andreas Färber <afaerber@suse.de>
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
pci,net,pc enhancements
This includes some fixes and enhancements that accumulated in my tree:pci fixes by dkoch, virtio-net enhancements by akong and mst,and a fix for xen pc by mst.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
pc: don't access fw cfg if NULL
commit f8c457b88d72a48989f190bc3d7b79f4f3b7d11c "pc: pass PCI hole ranges to Guests" broke Xen as it has no fw_cfg.Check for this configuration and boil out.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Tested-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
cpu: Make first_cpu and next_cpu CPUState
Move next_cpu from CPU_COMMON to CPUState.Move first_cpu variable to qom/cpu.h.
gdbstub needs to use CPUState::env_ptr for now.cpu_copy() no longer needs to save and restore cpu_next.
Acked-by: Paolo Bonzini <pbonzini@redhat.com>...
cpu: Replace cpu_single_env with CPUState current_cpu
Move it to qom/cpu.h.
pci,misc enhancements
This includes some pci enhancements:
Better support for systems with multiple PCI root busesFW cfg interface for more robust pci programming in BIOSMinor fixes/cleanups for fw cfg and cross-version migration -...
pci: Add root bus parameter to pci_nic_init()
At present, pci_nic_init() and pci_nic_init_nofail() assume that they willonly create a NIC under the primary PCI root. As we add support formultiple PCI roots, that may no longer be the case. This patch adds a root...
pci: Abolish pci_find_root_bus()
pci_find_root_bus() takes a domain parameter. Currently PCI root buseswith domain other than 0 can't be created, so this is more or less a longwinded way of retrieving the main PCI root bus. Numbered domains don'tactually properly cover the (non x86) possibilities for multiple PCI root...
Merge remote-tracking branch 'bonzini/iommu-for-anthony' into staging
hw/i*: pass owner to memory_region_init* functions
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
memory: add ref/unref calls
Add ref/unref calls at the following places:
- places where memory regions are stashed by a listener and used outside the BQL (including in Xen or KVM).
- memory_region_find callsites
- creation of aliases and containers (only the aliased/contained...
memory: add owner argument to initialization functions
pci: store PCI hole ranges in guestinfo structure
Will be used to pass hole ranges to guests.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pc: pass PCI hole ranges to Guests
Guest currently has to jump through lots of hoops to guess the PCI holeranges. It's fragile, and makes us change BIOS each time we add a newchipset. Let's report the window in a ROM file, to make BIOS do exactlywhat QEMU intends....
pc_piix: cleanup init compat handling
Make sure 1.4 calls 1.5, 1.3 calls 1.4 etc.This way it's enough to add enough new compat hookin a single place in piix.
kvmclock: clock should count only if vm is running
kvmclock should not count while vm is paused, because:
1) if the vm is paused for long periods, timekeepingmath can overflow while converting the (large) clocksourcedelta to nanoseconds.
2) Users rely on CLOCK_MONOTONIC to count run time, that is,...
pci-assign: remove the duplicate function name in debug message
While DEBUG already includes the function name.
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>Acked-by: Alex Williamson <alex.williamson@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
KVM: PIC: Only commit irq routing when necessary
The current logic updates KVM's view of our interrupt map every time wechange it. While this is nice and bullet proof, it slows things downbadly for me. QEMU spends about 3 seconds on every start telling KVM what...
multiboot: Calculate upper_mem in the ROM
The upper_mem field of the Multiboot information struct doesn't reallycontain the RAM size - 1 MB like we used to calculate it, but only thememory from 1 MB up to the first (upper) memory hole.
In order to correctly retrieve this information, the multiboot ROM now...
kvm: Change cpu_synchronize_state() argument to CPUState
Change Monitor::mon_cpu to CPUState as well.
Reviewed-by: liguang <lig.fnst@cn.fujitsu.com>Acked-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Change cpu_exit() argument to CPUState
It no longer depends on CPUArchState, so move it to qom/cpu.c.
Prepares for changing GDBState::c_cpu to CPUState.
Move hardcoded initialization of xen-platform device.
Creation of the xen-platform device is currently hardcoded into machinetype pc's initialization code, guarded by a test for the whether the xenaccelerator is enabled. This patch moves the creation of xen-platform into...
Allow use of pc machine type (accel=xen) for Xen HVM domains.
Xen HVM domains normally spawn QEMU with a dedicated xenfv machine type. Theinitialization code for this machine type can easily be pulled into thegeneric pc initialization code and guarded with a test for whether the xen...
Revert "xen: start PCI hole at 0xe0000000 (same as pc_init1 and qemu-xen-traditional)"
This reverts commit 9f24a8030a70ea4954b5b8c48f606012f086f65f.
The start of the PCI hole is actually set to 0xf0000000 by hvmloader.In order to retain ABI compatibility with Xen we leave the start of the...
Merge remote-tracking branch 'kraxel/usb.84' into staging
usb: fix serial number for hid devices
commit 7b074a22dab4bdda9864b933f1bc811a3db42845 changed the serialnumber of hid devices. Add compat properties to keep the old serialnumber for qemu 0.12 and older.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
kvm: Fix potential resource leak (missing fclose)
This leak was detected by cppcheck.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
pc: Make -no-fd-bootchk stick across boot order changes
Option -no-fd-bootchk asks the BIOS to attempt booting from a floppyeven when the boot sector signature isn't there, by setting a bit inRTC CMOS. It was added back in 2006 (commit 52ca8d6a).
Two years later, commit 0ecdffbb added monitor command boot_set....
Merge branch 'realize-isa.v2' of git://github.com/afaerber/qemu-cpu
smbios: Fix -smbios type=0, release=... for big endian hosts
Classic endianness bug due to careless dirty coding: assuming readinga byte from an int variable gets the least significant byte.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Laszlo "ever the optimist" Ersek <lersek@redhat.com>...
smbios: Check R in -smbios type=0, release=R parses okay
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Laszlo "ever the optimist" Ersek <lersek@redhat.com>Message-id: 1370610036-10577-7-git-send-email-armbru@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
smbios: Convert to error_report()
Improves diagnistics from ad hoc messages like
Invalid SMBIOS UUID string
to
qemu-system-x86_64: -smbios type=1,uuid=gaga: Invalid UUID
smbios: Clean up smbios_add_field() parameters
Having size precede the associated pointer is odd. Swap them, and fixup the types.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Laszlo "ever the optimist" Ersek <lersek@redhat.com>Message-id: 1370610036-10577-5-git-send-email-armbru@redhat.com...
pc: Fix crash when attempting to hotplug CPU with negative ID
QMP command "{ 'execute': 'cpu-add', 'arguments': { 'id': 1 }}" may causeQEMU SIGSEGV at: piix4_cpu_hotplug_req () ... g>sts[cpu_id / 8] |= (1 << (cpu_id % 8)); ...
Since for PC in current implementation id should be in range [0...maxcpus)...
pc: Create pc-*-1.6 machine-types
Some CPU model fixes are going to be included and they will requirecompatibility properties in the pc-*-1.5 machine-types.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>Reviewed-by: Igor Mammedov <imammedo@redhat.com>...
target-i386: Update model values on Conroe/Penryn/Nehalem CPU models
The CPUID model values on Conroe, Penryn, and Nehalem are tooconservative and don't reflect the values found on real Conroe, Penryn,and Nehalem CPUs.
This causes at least one known problems: Windows XP disables sysenter...
isa: QOM'ify ISADevice
Rename its parent field and use DEVICE where necessary.
kvm/i8254: QOM'ify some more
Introduce type constant and cast macro to obsolete DO_UPCAST().
Prepares for PIT realizefn.
i8254: Convert PITCommonState to QOM realizefn
Instead of having the parent provide PITCommonClass::init,let the children override DeviceClass::realize themselves.This pushes the responsibility for saving and calling the parent'srealizefn to the children....
kvm/i8259: QOM'ify some more
Introduce type constant.
Prepares for PIC realizefn.
i8259: Convert PICCommonState to use QOM realizefn
Instead of having the parent provide PICCommonClass::init,let the children override DeviceClass::realize themselves.This pushes the responsibility of saving and calling the parent'srealizefn to the children....
isa: Use realizefn for ISADevice
Drop ISADeviceClass::init and the resulting no-op initfn and letchildren implement their own realizefn. Adapt error handling.Split off an instance_init where sensible.
Merge remote-tracking branch 'sstabellini/xen_fixes_20130603' into staging
xen: start PCI hole at 0xe0000000 (same as pc_init1 and qemu-xen-traditional)
We are currently setting the PCI hole to start at HVM_BELOW_4G_RAM_END,that is 0xf0000000.Start the PCI hole at 0xe0000000 instead, that is the same value used bypc_init1 and qemu-xen-traditional....
xen: remove xen_vcpu_init
No need for xen_vcpu_init anymore:
- the RTC emulator doesn't have any periodic timers continuously runningeven in absence of guest interactions anymore;
- qemu_dummy_start_vcpu takes care of disabling TCG for us, so we don't...
xen: use pc_init_pci instead of pc_init_pci_no_kvmclock
Call kvmclock_create only if kvmclock_enabled.Use pc_init_pci on Xen rather than pc_init_pci_no_kvmclock.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
xen_machine_pv: do not create a dummy CPU in machine->init
This fixes a regression introduced by:
commit 62fc403f11523169eb4264de31279745f48e3eccAuthor: Igor Mammedov <imammedo@redhat.com>Date: Mon Apr 29 18:54:13 2013 +0200
target-i386: Attach ICC bus to CPU on its creation...
refer to FWCfgState explicitly
Currently some places use pointer-to-void even though they meanpointer-to-FWCfgState. Clean them up.
Signed-off-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
isapc: Fix non-KVM qemu boot (read/write memory for isapc BIOS)
The isapc machine with seabios currently requires the BIOS regionto be read/write memory rather than read-only memory.
KVM currently cannot support the BIOS as a ROM region, but qemuin non-KVM mode can. Based on this, isapc machine currently only...
pci-assign: Add MSI affinity support
To support guest MSI affinity changes update the MSI message any timethe guest writes to the address or data fields.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>Acked-by: Michael S. Tsirkin <mst@redhat.com>...
Revert "pc: Kill the "use flash device for BIOS unless KVM" misfeature"
This reverts commit 9953f8822cc316eec9962f0a2858c3439a80adec.While Markus's analysis is entirely correct, there are 1.6 patchesthat fix the bug for real and without requiring machine type hacks....
remove double semicolons
Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Merge remote-tracking branch 'afaerber/qom-cpu' into staging
target-i386: n270 can MOVBE
The Atom core (cpu name "n270" in QEMU speak) supports MOVBE. This isneeded when booting 3.8 and later linux kernels built with the MATOMtarget because we require MOVBE in order to boot properly now.
Signed-off-by: Borislav Petkov <bp@suse.de>...
kvmvapic: add ioport read accessor
Necessary since memory region accessor assumes read and writemethods are registered. Otherwise reading I/O port 0x7e segfaults.
https://bugzilla.redhat.com/show_bug.cgi?id=954306
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>...
target-i386: Replace cpuid_*features fields with a feature word array
This replaces the feature-bit fields on both X86CPU and x86_def_tstructs with an array.
With this, we will be able to simplify code that simply does the sameoperation on all feature words (e.g. kvm_check_features_against_host(),...
target-i386: Move APIC to ICC bus
It allows APIC to be hotplugged.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
pc: Implement QEMUMachine::hot_add_cpu hook
Signed-off-by: Igor Mammedov <imammedo@redhat.com>Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
target-i386: Introduce ICC bus/device/bridge
Provides a hotpluggable bus for APIC and CPU.
target-i386: Attach ICC bus to CPU on its creation
X86CPU should have parent bus so it could provide bus for child APIC.
target-i386: Replace MSI_SPACE_SIZE with APIC_SPACE_SIZE
Put APIC_SPACE_SIZE in a public header so that it can bereused elsewhere later.
kvmvapic: Make dependency on sysbus.h explicit
Allows kvmvapic to compile if sysbus.h is removed from apic_internal.h,from which it is indirectly included.sysbus.h will be removed from apic_internal.h after convertingAPICs to ICCDevice.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>...
pc: Update rtc_cmos on CPU hot-plug
It provides updated currently available CPUs count to BIOS on reboot.
target-i386: Introduce apic-id CPU property
The property is used from board level to set APIC ID for CPUs itcreates. Do so in a new pc_new_cpu() helper, to be reused for hot-plug.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>...
pvpanic: create pvpanic by default for machine 1.5
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>Reviewed-by: Markus Armbruster <armbru@redhat.com>Message-id: f840042f0e1205041f8feaf0d39ca639884f3a00.1366945969.git.hutao@cn.fujitsu.com...
pc_piix: remove undesired change in pc_init1
Introduced when applying commit f81222b (audio: look for the ISA andPCI buses, 2013-04-18).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Message-id: 1367330432-14417-1-git-send-email-pbonzini@redhat.com...
audio: enable PCI audio cards for all PCI-enabled targets
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Message-id: 1366303444-24620-9-git-send-email-pbonzini@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
audio: look for the ISA and PCI buses
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Message-id: 1366303444-24620-8-git-send-email-pbonzini@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
pc: QOM'ify port 92
Prepares for ISA realizefn.
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Andreas Färber <afaerber@suse.de>Message-id: 1367093935-29091-12-git-send-email-afaerber@suse.de...
fdc: QOM'ify ISA floppy controller
Introduce type constant and cast macro to obsolete DO_UPCAST().Reuse type constant for PC machine compatibility settings.
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Andreas Färber <afaerber@suse.de>...
i8259: QOM cleanups
Eliminate DO_UPCAST() for PICCommonState. Prepares for ISA realizefn.
Also give the i8259_common type registration functions unique nameswhile at it.
pc: Kill the "use flash device for BIOS unless KVM" misfeature
Use of a flash memory device for the BIOS was added in series "[PATCHv10 0/8] PC system flash support", commit 4732dca..1b89faf, v1.1.
Flash vs. ROM is a guest-visible difference. Thus, flash use had to...
pc: Inline pc_init_pci_1_3() into pc_init_pci_1_2()
Just to make the commit after next easier to review.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Message-id: 1365780303-26398-2-git-send-email-armbru@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
pc: Split pc_init_pci_1_0() off pc_init_pci_1_2()
Just to make the next commit easier to review.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Message-id: 1365780303-26398-3-git-send-email-armbru@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>