History | View | Annotate | Download (33.5 kB)
isa: pic: convert to QEMU Object Model
This converts two devices at once because PIC subclasses ISA and convertingsubclasses independently is extremely hard.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
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>
i8254: convert to qdev
Convert to qdev. Don't expose PITState.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
fdc: refactor device creation
Turn fdc_init_isa into an inline function.
Get floppy geometry directly from the drives.
Don't expose FDCtrl.
fdc: use FDriveType for floppy drive type
hpet: make optional
Ignore failure with hpet device creation.
x86: make vmmouse optional
Compile vmmouse in hwlib. Ignore failure if vmmouse device can't becreated.
vmmouse: convert to qdev
Convert to qdev, also add a proper reset function.
vmport: convert to qdev
x86,MIPS: make vmware_vga optional
Allow failure with vmware_vga device creation and use standardVGA instead.
audio: consolidate audio_init()
consolidate audio_init() and remove references to shoundhw.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
pc: move port 92 stuff back to pc.c from pckbd.c
956a3e6bb7386de48b642d4fee11f7f86a2fcf9a introduced a bug concerningreset bit for port 92.
Since the keyboard output port and port 92 are not compatible anyway,let's separate them.
Reported-by: Peter Lieven <pl@dlh.net>...
Merge branch 'spice.v23.pull' of git://anongit.freedesktop.org/spice/qemu
Add bootindex for option roms.
Extend -option-rom command to have additional parameter ,bootindex=.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
spice: add qxl device
qxl is a paravirtual graphics card. The qxl device is the bridgebetween the guest and the spice server (aka libspice-server). Thespice server will send the rendering commands to the spice client, whichwill actually render them....
pc: disable the BOCHS BIOS panic port
We have an OS which writes to port 0x400 when probing for special hardware.This causes an exit of the VM. With SeaBIOS this port isn't used anyway.
Signed-off-by: Alexander Graf <agraf@suse.de>Reviewed-By: Paolo Bonzini <pbonzini@redhat.com>...
pc: e820 qemu_cfg tables need to be packed
We can't let the compiler define the alignment for qemu_cfg data.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pc: Fix e820 fw_cfg for big endian
more stdvga cleanups.
video.x is gone now. It was the only user of thevga bios_offset + bios_size logic. Zap it.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Rearrange block headers
Changing block.h or blockdev.h resulted in recompiling most objects.
Move DriveInfo typedef and BlockInterfaceType enum definitionsto qemu-common.h and rearrange blockdev.h use to decrease churn.
pc: Avoid registering zero sized memory
No need to call cpu_register_physical_memory() for a zero sized area.
qemu_ram_alloc: Add DeviceState and name parameters
These will be used to generate unique id strings for ramblocks. The namefield is required, the device pointer is optional as most callers don'thave a device. When there's no device or the device isn't a child of...
pc: Allocate all ram in a single qemu_ram_alloc()
This will benefit us when we migrate based on ramblock name sincewe won't be bouncing between separate blocks.
pc: Fix CMOS info for drives defined with -device
Drives defined with drive if=ide get get created along with the IDEcontroller, inside machine>init(). That's before cmos_init().Drives defined with -device get created during generic device init.That's after cmos_init(). Because of that, CMOS has no information on...
x86: Clean up CPU reset
Remove useless device dependency of HAS_AUDIO
System architecture dictates whether HAS_AUDIO is defined. It's thenuseless to check for HAS_AUDIO in files which are only used on thosearchitectures which always have audio.
apic: qdev conversion cleanup
Make APICState completely private to apic.c by using DeviceStatein external APIs.
Move apic_init() to pc.c.
apic: avoid using CPUState internals
Move the actual CPUState contents handling to cpu.h and cpuid.c.
Handle CPU reset and set env->halted in pc.c.
Add a function to get the local APIC state of the currentCPU for the MMIO.
apic: avoid passing CPUState from devices
Pass only APICState from pc.c.
pass info about hpets to seabios.]
Currently HPET ACPI table is created regardless of whether qemu actuallycreated hpet device. This may confuse some guests that don't check thathpet is functional before using it. Solve this by passing info abouthpets in qemu to seabios via fw config interface. Additional benefit is...
Merge remote branch 'kwolf/for-anthony' into staging
Conflicts: hw/pc.c
hpet/rtc: Rework RTC IRQ replacement by HPET
Allow the intercept the RTC IRQ for the HPET legacy mode. Then pushrouting to IRQ8 completely into the HPET. This allows to turnhpet_in_legacy_mode() into a private function. Furthermore, this stopsthe RTC from clearing IRQ8 even if the HPET is in control....
hpet: Convert to qdev
Register the HPET as a sysbus device and create it that way. As it canroute its IRQs to any ISA IRQ, we need to connect it to all 24 of them.Once converted to qdev, we can move reset handler and vmstateregistration into its hands as well....
blockdev: Collect block device code in new blockdev.c
Anything that moves hundreds of lines out of vl.c can't be all bad.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
pc: improve debugging
Add a DPRINTF macro and use it for ISA and PIC interrupts.
Compile dma only once
Use a qemu_irq to request CPU exit.
7 compilations less for the full build.
Compile pckbd only once
Use a qemu_irq to indicate A20 line changes. Move I/O port 92to pckbd.c.
pc: fix segfault introduced by 3d53f5c36ff6
Commit 3d53f5c36ff6 introduced a segfault by erroneously making fw_cfg a'void **' and passing it around in different ways.
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
rtc: make rtc_xxx accept/return ISADevice instead of RTCState.
To match rtc_xxx with qdev, make rtc_xxx accept and return ISADeviceinstead of RTCState.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
pc: split out piix specific part from pc.c into pc_piix.c
Finally, we can safely split out the piix specific part from pc.cinto pc_piix.c.
pc: split out pci device init from pc_init1() into pc_pci_device_init()
Split out pci device initialization from pc_init1() into pc_pci_device_init().and removed unnecessary braces.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Gerd Hoffmann <kraxel@redhat.com>...
pc: split out basic device init from pc_init1() into pc_basic_device_init()
Split out basic device, i.e. legacy devices like floppy, initializationfrom pc_init1() into pc_basic_device_init().Later it will be used.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>...
pc: split out vga initialization from pc_init1() into pc_vga_init().
Split out vga initialization which is independent of piixfrom pc_init1() as pc_vga_init().Later it will be used.
pc: split out memory allocation from pc_init1() into pc_memory_init()
Split out memory allocation and rom/bios loading which doesn't dependon piix from pc_init1() into pc_memory_init().Later it will be used.
pc: split out cpu initialization from pc_init1() into pc_cpus_init().
split out cpu initialization which is piix independent from pc_init1()into pc_cpus_init(). Later it will be used.
pc: make pc_init1() not refer ferr_irq directly.
By introducing a registering function, make pc_init1() not refer toferr_irq directly in order to make ferr_irq piix independent.Later pc_init1() will be split out into another file keeping ferr_irqstatic....
pc: introduce a function to allocate cpu irq.
Introduce a function, pc_allocate_cpu_irq(), to allocate cpu irqin order to make pic_irq_request() piix independent.Later piix code will be split out to another file keeping pic_irq_request()static.
pc: remove global variable rtc_state by using qemu_irq.
Remove the reference to the global variable, rtc_state, by passingfunction argument to cmos_init_hd(), cmos_init().
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Cc: Paolo Bonzini <bonzini@gnu.org>...
pc: remove a global variable, floppy_controller.
Remove a global variable, floppy_controller.Since it is unnecessarily global, make it local and pass it asa function argument.
pc: make an unnecessary global variable, pit, local.
remove unnecessary global static variables, pit.Make it local.
pc, i440fx: Make smm enable/disable function i440fx independent.
make cpu_smm_update() generic to be independent on i440fx byregistering a callback.
pc: initialize ioapic before use.
The changeset of 2c8d9340203c7f19265fd4cb2341f568217a3af6prevents isa_irq_handler() from NULL refering of IsaIrqState::ioapic.However it would be better to initialize the member before reference.
hw: better i440 emulation
updated version of an old patchhttp://xenon.stanford.edu/~eswierk/misc/qemu-linuxbios/qemu-piix-ram-size.patchthat together withhttp://www.mail-archive.com/linuxbios@linuxbios.org/msg02390.html(which is already in coreboot trunk) allows coreboot to autodetect the amount of RAM within qemu/kvm from a register in i440 northbridge....
x86: remove dead assignments, spotted by clang analyzer
Value stored is never read.
Check for invalid initrd file
When qemu is invoked with an invalid initrd file, it crashes. Followingpatch prints a error message and exits if an invalid initrd isspecified. Includes changes suggested by JV.
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>...
Compile acpi only once
Use qemu_irqs to trigger CMOS S3 and SMI events.
Avoid using kvm.h, which uses CPUState.
Move x86 specific PC declarations to a separate file
x86 definitions (especially CPUState uses) prevent many files frombeing compiled within libhw.
Move x86 specific declarations (APIC stuff) to a separate file.
error: Replace qemu_error() by error_report()
error_report() terminates the message with a newline. Strip it itfrom its arguments.
This fixes a few error messages lacking a newline:net_handle_fd_param()'s "No file descriptor named %s found", andtap_open()'s "vnet_hdr=1 requested, but no kernel support for...
pc: Fix error reporting for -boot once
Commit 0ecdffbb created pc_boot_set() for use from monitor command"boot_set", via qemu_boot_set(). pc_boot_set() reports errors tocur_mon, which works fine for monitor code.
Commit e0f084bf reused the function int reset handler...
pc: Factor common code out of pc_boot_set() and cmos_init()
Code duplicated in commit 0ecdffbb. The two versions are similar, butnot identical:
x86: Extend validity of bsp_to_cpu
As we hard-wire the BSP to CPU 0 anyway and cpuid_apic_id equalscpu_index, bsp_to_cpu can also be based on the latter directly. Thiswill help an early user of it: KVM while initializing mp_state.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
Allocate memory below 4GB as one chunk
Instead of allocating a separate chunk for the first 640KB and anotherfor 1MB+, allocate one large chunk. This plays well in terms of alignmentand size with large pages.
Signed-off-by: Avi Kivity <avi@redhat.com>...
QEMU e820 reservation patch
Hi,
Kevin and I have agreed on the approach for this one now. So here isthe latest version of the patch for QEMU, submitting e820 reservationentries via fw_cfg.
Cheers,Jes
Use qemu-cfg to provide the BIOS with an optional table of e820 entries....
pc: Bump up pc version to 0.13 and add a 0.12 compat version
The version 0.13 will be the new default and compatibility options willbe added to the 0.12 version.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pc: Add backward compatibility options for virtio-serial
virtio-serial-pci can support multiple ports in the current developmentversion that will become 0.13. Add compatibility options for the 0.12and 0.11 pc machine types.
Signed-off-by: Amit Shah <amit.shah@redhat.com>...
Remove conditional rom loading support
Commit c2039bd0ffce8807e0eaac55254fde790825fa92 made rom loadingautomatic for non-PC architectures. Remove now mostly unusedconditional rom loading support.
fdc: don't use reserved _t suffix
virtio-console: qdev conversion, new virtio-serial-bus
This commit converts the virtio-console device to create a newvirtio-serial bus that can host console and generic serial ports. Thefile hosting this code is now called virtio-serial-bus.c.
The virtio console is now a very simple qdev device that sits on the...