History | View | Annotate | Download (32.2 kB)
target-i386: Split command line parsing out of cpu_x86_register()
In order to instantiate a CPU subtype we will need to know which type,so move the cpu_model splitting into cpu_x86_init().
Parameters need to be set on the X86CPU instance, so movecpu_x86_parse_featurestr() into cpu_x86_init() as well....
target-i386: Pass X86CPU to cpu_x86_set_a20()
Prepares for cpu_interrupt() changing argument to CPUState.
While touching it, rename to x86_cpu_...() now that it takes an X86CPU.
Signed-off-by: Andreas Färber <afaerber@suse.de>Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
fw_cfg: Remove FW_CFG_MAX_CPUS from fw_cfg_init()
PC will not use max_cpus for that field, so move it outside the commoncode so it can use a different value on PC.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
pc: Set fw_cfg data based on APIC ID calculation
This changes FW_CFG_MAX_CPUS and FW_CFG_NUMA to use apic_id_for_cpu(),so the NUMA table can be based on the APIC IDs, instead of CPU index(SeaBIOS knows nothing about CPU indexes, just APIC IDs).
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>...
sysbus: Drop sysbus_from_qdev() cast macro
Replace by SYS_BUS_DEVICE() QOM cast macro using a scripted conversion.Avoids the old macro creeping into new code.
Resolve a Coding Style warning in openpic code.
Signed-off-by: Andreas Färber <afaerber@suse.de>...
fw_cfg: Use void *, size_t instead of uint8_t *, uint32_t for blobs
Many callers pass size_t, which gets silently truncated to uint32_t.Harmless, because all practical sizes are well below 4GiB. Clean itup anyway. Size overflow now fails assertions....
pc: Clean up bochs_bios_init()'s (non-)use of sizeof
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
pc: Fix unchecked strdup() by switching to fw_cfg_add_string()
hw/pc.c: add ULL suffix in ioport80_read and ioportF0_read return value
The commit c02e1eac887b1b0aee7361b1fcf889e7d47fed9d broke the compilationfor i386. ULL need to be specify for uint64_t value.
Signed-off-by: Julien Grall <julien.grall@citrix.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
hw/pc.c: Fix converting of ioport_register* to MemoryRegion
The commit 258711 introduced MemoryRegion to replace ioport_region*for ioport 80h and F0h.A MemoryRegion needs to have both read and write callback otherwise a segfaultwill occur when an access is made....
Make all static TypeInfos const
Since 39bffca2030950ef6efe57c2fac8327a45ae1015 (qdev: register alltypes natively through QEMU Object Model), TypeInfo as used inthe common, non-iterative pattern is no longer amended with informationand should therefore be const....
Merge remote-tracking branch 'kraxel/testdev.1' into staging
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pc: remove bochs bios debug ports
Prehistoric leftover, zap it. We poweroff via acpi these days.
And having a port (0x501,0x502) where any random guest write will makeqemu exit -- with no way to turn it off -- is a bad joke anyway.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
acpi: autoload dsdt
softmmu: move include files to include/sysemu/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
misc: move include files to include/qemu/
monitor: move include files to include/monitor/
exec: move include files to include/exec/
pci: update all users to look in pci/
update all users so we can remove the makefile hack.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pc.c: Replace register_ioport_*
Replace all register_ioport_*() with portio_*() or a MemoryRegion.This permits to use the new Memory stuff like listeners.
Signed-off-by: Julien Grall <julien.grall@citrix.com>Acked-by: Avi Kivity <avi@redhat.com>[AF: Rebased onto hwaddr]...
pc, pc_piix: split out pc nic initialization
Factor out pc nic initialization.This simplifies the pc initialization and will reduce the codeduplication of q35 pc initialization.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
pc: Move ioapic_init() from pc_piix.c to pc.c
Move ioapic_init() from pc_piix.c to pc.c, to make it a common function.Rename ioapic_init() -> ioapic_init_gsi().Move to pc.h so q35 can use them as well.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Jason Baron <jbaron@redhat.com>...
target-i386: Initialize APIC at CPU level
(L)APIC is a part of cpu [1] so move APIC initialization inside ofx86_cpu object. Since cpu_model and override flags currently specifywhether APIC should be created or not, APIC creation&initialization ismoved into x86_cpu_apic_init() which is called from x86_cpu_realize()....
pc port92: convert PIO to new memory api read/write
Signed-off-by: Alexander Graf <agraf@suse.de>
Rename target_phys_addr_t to hwaddr
target_phys_addr_t is unwieldly, violates the C standard (_t suffixes arereserved) and its purpose doesn't match the name (most target_phys_addr_taddresses are not target specific). Replace it with a finger-friendly,...
serial: split serial.c
Split serial.c into serial.c, serial.h and serial-isa.c. While being atcreating a serial.h header file move the serial prototypes from pc.h tothe new serial.h. The latter leads to s/pc.h/serial.h/ in tons ofboards which just want the serial bits from pc.h...
pc: use the new pci_vga_init() and isa_vga_init() functions
The CONFIG_SPICE is now tested in vl.c and thus not needed anymore.
Cc: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
vga: rename pci_vga_init() into pci_std_vga_init()
This better explains what is this function about. Adjust all callers.
Cc: Alexander Graf <agraf@suse.de>Cc: Andreas Färber <andreas.faerber@web.de>Cc: David Gibson <david@gibson.dropbear.id.au>Cc: Anthony Liguori <aliguori@us.ibm.com>...
vga: rename isa_vga_init() to isa_std_vga_init()
pc: Drop practically unused BOCHS BIOS debug ports
We have debugcon these days to listen on those ports that receive debugmessages. Also drop the others that have no effect anymore.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pc: Fix RTC CMOS info on RAM for ram_size < 1MiB
pc_cmos_init() always claims 640KiB base memory, and ram_size - 1MiBextended memory. The latter can underflow to "lots of extendedmemory". Fix both, and clean up some.
Note: SeaBIOS currently requires 1MiB of RAM, and doesn't check...
Add one new file vga-pci.h and cleanup on all platforms
Functions pci_vga_init() and pci_cirrus_vga_init() are declaredin pc.h. That prevents other platforms (e.g. sPAPR) to use them.
This patch is to create one new file vga-pci.h and move thedeclarations to vga-pci.h, so that they can be shared by...
kvm: Move kvm_allows_irq0_override() to target-i386, fix return type
kvm_allows_irq0_override() is a totally x86 specific concept:move it to the target-specific source file where it belongs.This means we need a new header file for the prototype:kvm_i386.h, in line with the existing kvm_ppc.h....
Fixes related to processing of qemu's -numa option
The -numa option to qemu is used to create [fake] numa nodesand expose them to the guest OS instance.
There are a couple of issues with the -numa option:
a) Max VCPU's that can be specified for a guest while using...
target-i386: move cpu halted decision into x86_cpu_reset
MP initialization protocol differs between cpu families, and for P6 andonward models it is up to CPU to decide if it will be BSP using thisprotocol, so try to model this. However there is no point in implementing...
target-i386: move cpu_reset and reset callback to cpu.c
Moving reset callback into cpu object from board level andresetting cpu at the end of x86_cpu_realize() will allow properlycreate cpu object during run-time (hotplug) without calling reset externaly....
hd-geometry: Compute BIOS CHS translation in one place
Currently, it is split between hd_geometry_guess() andpc_cmos_init_late(). Confusing. info qtree shows the result of theformer. Also confusing.
Fold the part done in pc_cmos_init_late() into hd_geometry_guess()....
block: Geometry and translation hints are now useless, purge them
There are two producers of these hints: drive_init() on behalf of-drive, and hd_geometry_guess().
The only consumer of the hint is hd_geometry_guess().
The callers of hd_geometry_guess() call it only when drive_init()...
ide pc: Cut out the block layer geometry middleman
PC BIOS setup needs IDE geometry information. Get it directly fromthe device model rather than through the block layer. In preparationof purging geometry from the block layer, which will happen later in...
fdc: Move floppy geometry guessing back from block.c
Commit 5bbdbb46 moved it to block.c because "other geometry guessingfunctions already reside in block.c". Device-specific functionalityshould be kept in device code, not the block layer. Move it back....
Add PIIX4 properties to control PM system states.
This patch adds two things. First it allows QEMU to distinguish betweenregular powerdown and S4 powerdown. Later separate QMP notification willbe added for S4 powerdown. Second it allows S3/S4 states to be disabled...
pc: Use cpu_x86_init() to obtain X86CPU
Needed for pc_cpu_reset().
Also change return type to X86CPU.
Signed-off-by: Andreas Färber <afaerber@suse.de>Reviewed-by: Igor Mammedov <imammedo@redhat.com>
pc: Pass X86CPU to pc_cpu_reset()
Allows us to use cpu_reset() in place of cpu_state_reset().
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
Merge remote-tracking branch 'sstabellini/for_1.1_rc3' into staging
fdc: floppy drive should be visible after start without media
If you start guest with floppy drive but without media inserted, gueststill should see floppy drive pressent.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
xen: do not initialize the interval timer and PCSPK emulator
PIT and PCSPK are emulated by the hypervisor so we don't need to emulatethem in Qemu: this patch prevents Qemu from waking up needlessly atPIT_FREQ on Xen.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
pc: Enable MSI support at APIC level
Push msi_supported enabling to the APIC implementations where we canencapsulate the decision more cleanly, hiding the details from thegeneric code.
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
xen: add a dummy xc_hvm_inject_msi for Xen < 4.2
xc_hvm_inject_msi is only available on Xen >= 4.2: add a dummycompatibility function for Xen < 4.2.
Also enable msi support only on Xen >= 4.2.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>...
Xen: Add xen-apic support and hook it up.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Replace Qemu by QEMU in comments
The official spelling is QEMU.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Reviewed-by: Andreas Färber <afaerber@suse.de>[blauwirbel@gmail.com: fixed comment style in hw/sun4m.c]Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
i386 hw/: Don't use CPUState
Scripted conversion: for file in hw/apic.h hw/kvm/apic.c hw/kvmvapic.c hw/pc.c hw/vmport.c hw/xen_machine_pv.c; do sed -i "s/CPUState/CPUX86State/g" $file done
Signed-off-by: Andreas Färber <afaerber@suse.de>Acked-by: Anthony Liguori <aliguori@us.ibm.com>
Rename cpu_reset() to cpu_state_reset()
Frees the identifier cpu_reset for QOM CPUs (manual rename).
Don't hide the parameter type behind explicit casts, use staticfunctions with strongly typed argument to indirect.
kvm: x86: Add user space part for in-kernel i8254
This provides the required user space stubs to enable the in-kerneli8254 emulation of KVM.
The in-kernel model supports lost tick compensation according to the"delay" policy. This is enabled by default and can be switched off via a...
block: add a transfer rate for floppy types
Floppies must be read at a specific transfer rate, depending of its own format.Update floppy description table to include required transfer rate.
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
suspend: switch acpi s3 to new infrastructure.
This patch switches pc s3 suspend over to the new infrastructure.The cmos_s3 qemu_irq is killed, the new notifier is used instead.The xen hack goes away with that too, the hypercall can simply bedone in a notifier function now....
hw/pc: move rom init to pc_sysfw.c
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
i8254: Factor out interface header
Move the public interface of the PIT into its own header file and updateall users.
i8254: Pass alternative IRQ output object on initialization
HPET legacy emulation will require control over the PIT IRQ output. Toenable this, add support for an alternative IRQ output object to the PITfactory function. If the isa_irq number is < 0, this object will be...
i8254: Rework & fix interaction with HPET in legacy mode
When the HPET enters legacy mode, the IRQ output of the PIT issuppressed and replaced by the HPET timer 0. But the current code toemulate this was broken in many ways. It reset the PIT state after...
pcspk: Convert to qdev
Convert the PC speaker device to a qdev ISA model. Move the publicinterface to a dedicated header file at this chance.
CC: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qom: Unify type registration
Replace device_init() with generalized type_init().
While at it, unify naming convention: type_init([$prefix_]register_types)Also, type_init() is a function, so add preceding blank line wherenecessary and don't put a semicolon after the closing brace....
kvm: Implement kvm_irqchip_in_kernel like kvm_enabled
To both avoid that kvm_irqchip_in_kernel always has to be paired withkvm_enabled and that the former ends up in a function call, implement itlike the latter. This means keeping the state in a global variable and...
qdev: register all types natively through QEMU Object Model
This was done in a mostly automated fashion. I did it in three steps and thenrebased it into a single step which avoids repeatedly touching every file inthe tree.
The first step was a sed-based addition of the parent type to the subclass...
isa: pic: convert to QEMU Object Model
This converts two devices at once because PIC subclasses ISA and convertingsubclasses independently is extremely hard.
vga: make Cirrus ISA device optional
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
vga: improve VGA logic
Improve VGA selection logic, push check for device availabilty to vl.c.Create the devices at board level unconditionally.
Remove now unused pci_try_create*() functions.
Make PCI VGA devices optional.
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>...
kvm: x86: Establish IRQ0 override control
KVM is forced to disable the IRQ0 override when we run with in-kernelirqchip but without IRQ routing support of the kernel. Set the fwcfgvalue correspondingly. This aligns us with qemu-kvm.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
kvm: x86: Add user space part for in-kernel APIC
This introduces the alternative APIC device which makes use of KVM'sin-kernel device model. External NMI injection via LINT1 is emulated bychecking the current state of the in-kernel APIC, only injecting a NMI...
msi: Generalize msix_supported to msi_supported
Rename msix_supported to msi_supported and control MSI and MSI-Xactivation this way. That was likely to original intention for thisflag, but MSI support came after MSI-X.
vmstate, memory: decouple vmstate from memory API
Currently creating a memory region automatically registers it forlive migration. This differs from other state (which is enumeratedin a VMStateDescription structure) and ties the live migration codeinto the memory core....
Set numa topology for max_cpus
qemu-kvm passes numa/SRAT topology information for smp_cpus to SeaBIOS. HoweverSeaBIOS always expects to setup max_cpus number of SRAT cpu entries(MaxCountCPUs variable in build_srat function of Seabios). When qemu-kvm runs...
isa: give ISABus/ISADevice to isa_create(), isa_bus_irqs() and isa_get_irq() functions
NULL is a valid bus/device, so there is no change in behaviour.
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qom: add vga node to the pc composition tree
fix spelling in hw sub directory
Correct obvious spelling errors in qemu/hw directory.
Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
hw/pc.c: Fix use-while-uninitialized of fd_type[]
Fix a use-while-uninitialized of the fd_type[] array (introducedin commit 34d4260e1, noticed by Coverity). This is more theoreticalthan practical, since it's quite hard to get here with floppy==NULL(the qdev_try_create() of the isa-fdc device has to fail)....
disable automatic loading of sgabios when -nographic
sgabios hasn't gotten a lot of coverage since it was not shipped. For 1.0,let's disable the automatic loading of the option ROM in -nographicmode. We can put it back for 1.1.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
Fix X86 CPU topology in KVM mode
apic id returned to guest kernel in ebx for cpuid(function=1) depends onCPUX86State->cpuid_apic_id which gets populated after the cpuid informationis cached in the host kernel. This results in broken CPU topology in guest....
pc: Fix floppy drives with if=none
Commit 63ffb564 broke floppy devices specified on the command line like-drive file=...,if=none,id=floppy -global isa-fdc.driveA=floppy because itrelies on drive_get() which works only with -fda/-drive if=floppy.
This patch resembles what we're already doing for IDE, i.e. remember the floppy...
pc: Fix and clean up PIC-to-APIC IRQ path
The master PIC is connected to the LINTIN0 of the APICs. As the APICcurrently does not track the state of that line, we have to ask the PICto reinject its IRQ after the CPU picked up an event from the APIC.
This introduces pic_get_output to read the master PIC IRQ line state...
pc: Generalize ISA IRQs to GSIs
The ISA bus IRQ range is 0..15. What isa_irq_handler and IsaIrqState areactually dealing with are the Global System Interrupts. Refactor thecode to clarify this.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
pc: Drop useless test from isa_irq_handler
IsaIrqState::ioapic is always non-NULL. Probably, the concreteqemu_irq was supposed to be tested, but that's already done byqemu_set_irq.
pc: Convert port92 to isa_register_ioport
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Avi Kivity <avi@redhat.com>
pc: Unbreak ROM mapping for ISA machine
This is based on the original fix by Hervé Poussineau: pc_memory_initactually takes a memory region for mapping BIOS and extension ROMs. Thatequals the PCI memory region if PCI is available, but must be systemmemory in the ISA case....
Use new macro QEMU_PACKED for packed structures
Most changes were made using these commands:
git grep -la '__attribute__((packed))'|xargs perl -pi -e 's/__attribute__\(\(packed\)\)/QEMU_PACKED/'git grep -la '__attribute__ ((packed))'|xargs perl -pi -e 's/__attribute__ \(\(packed\)\)/QEMU_PACKED/'...
vga: drop get_system_memory() from vga devices and derivatives
Instead, use the bus accessors, or get the address space directlyfrom the board constructor.
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
440fx: fix PAM, PCI holes
The current implementation of PAM and the PCI holes is broken in severalways:
- PCI BARs are not restricted to the PCI hole (a BAR may hide memory) - PCI devices do not respect PAM (if a PCI device maps a region while PAM maps the region to RAM, the request will be honored)...
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
pc: make vgabios exit port more useful
We've always listened on port 501 for vgabios panic messages. In the entiretime I've worked on QEMU, I've never actually seen a vgabios panic message :-)
If we change the semantics of this port a little bit, it makes it possible to...
pc: grab system_memory
While eventually this should come from the machine initialization function,take a short cut to avoid converting all machines now.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pc: convert pc_memory_init() to memory API
Add an isa device for SGA
This patch adds a dummy legacy ISA device whose responsibility is todeploy sgabios, an option rom for a serial graphics adapter.The proposal is that this device is always-on when -nographics,but can otherwise be enable in any setup when -device sga is used....
pc_memory_init: Move memory calculation to the caller.
This patch moves above_4g_mem_size and below_4g_mem_size calculation inthe caller of pc_memory_init (pc_init1). And the prototype ofpc_memory_init is changed because there is no need anymore to have...
pc, Disable vmport initialisation with Xen.
This is because there is not synchronisation of the vcpu registerbetween Xen and QEMU, so vmport can't work properly.
This patch introduces no_vmport parameter to pc_basic_device_init.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>...
vmmouse: Fix initialization
Latest refactorings left vmmouse nonfunctional behind. Fix it by addingthe required device initialization.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
pc: fix wrong CMOS values for floppy drives
Before commit 63ffb564dca94f8bda01ed6d209784104630a4d2, states forfloppy drives were calculated in fdc.c:fd_revalidate(). There it isalso considered whether a disk is inserted or not. The commit didn't copythe logic completely to pc.c, which caused a regression....
pc: remove test on TARGET_PHYS_ADDR_BITS == 32
Both i386 and x86_64 targets are now using target_phys_bits=64. Removeuseless code.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>