sim-card
/
qemu
Archived
10
0
Fork 0
Commit Graph

2145 Commits

Author SHA1 Message Date
Tristan Gingold f55e9d9a40 target-ppc: fix typo in _cpu_ppc_load_decr
Use parameter 'next' to fix the hdecr case.
Also pass 'next' by value instead of pointer (more easy to read and no
performance issue for an always_inline function).

Signed-off-by: Tristan Gingold <gingold@adacore.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-07-12 23:32:11 +02:00
Blue Swirl d27cf0ae6d Sparc32/Sparc64/PPC: convert m48txx to qdev
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-12 20:07:07 +00:00
Blue Swirl f40070c36c Sparc32: convert tcx to qdev
Also increase QDEV_MAX_MMIO.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-12 19:28:37 +00:00
Blue Swirl 798b721ec3 Sparc32: use the OpenFirmware name for ecc
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-12 21:43:24 +03:00
Blue Swirl 53e3c4f918 Sparc64: convert ebus to qdev
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-12 08:54:49 +00:00
Blue Swirl 49e6637386 Sparc32: convert eccmemctl to qdev
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-12 08:16:55 +00:00
Igor Kovalenko 7d55273fcd sparc64: really initialize irq
Allocate irq just before passing it to pci bridge initialization
and actually use it to initialize pci bridge.

Signed-off-by: igor.v.kovalenko@gmail.com

--
Kind regards,
Igor V. Kovalenko
2009-07-12 07:43:00 +00:00
Paul Brook 616cbc78a5 Fix PCI IRQ breakage
Zero initialize the PCI bus irq count.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-07-11 22:46:51 +01:00
Blue Swirl 110c50fd31 Revert "Fix the PCI header type of APB"
This reverts commit e8d2a88755.
2009-07-11 08:38:39 +00:00
Blue Swirl ac47a60b3f Fix APB by reverting 16eaedf266 partially
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-11 08:20:24 +00:00
Anthony Liguori 0c3271c558 Indent ac97 and es1370 according to audio formatting
For the sake of consistency.  I pulled in the wrong patches from Gerd when
he did the qdev conversion.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-10 15:32:03 -05:00
Michael S. Tsirkin e6da768000 qemu/virtio: mark msi vectors used on load
Usage of msi vectors is controlled by the guest and so needs to be
restored on load. Do this for msi vectors used by the virtio device.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-10 13:44:30 -05:00
Michael S. Tsirkin 72755a7096 qemu/msi: missing braces
MSIX present bit is tested incorrectly, and only happens to work because
the bit we are testing is 0x1.  Add braces to fix this.

Reported-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-10 13:44:30 -05:00
Michael S. Tsirkin 4bfd1712d7 qemu/msi: clean used vectors state on load
Clean up msix vector usage state on load. Since guest might have control
over it through the device, the device will have to load this state from
file.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-10 13:44:30 -05:00
Michael Buesch 1fa63e43e6 usb-ohci: Fix endianness issue
This fixes a possible endianness issue in the usb-ohci hw module.
hcca.frame and ohci->frame_number are 16bit, so use cpu_to_le16().

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-10 13:41:20 -05:00
Michael S. Tsirkin dca61621f8 qemu: remove control vector save
control vector is saved/restored by virtio-pci,
it does not belong in virtio.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09 16:58:08 -05:00
Michael S. Tsirkin 9a3e12c8a4 fix segfault in msix_save
This fixes segfault reported by Kevin Wolf,
and simplifies the code in msix_save.

Reported-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09 16:58:08 -05:00
Mark McLoughlin 391354f126 Unregister savevm callback in eeprom93xx_free()
Otherwise if you hot remove an eepro100 NIC and then migrate,
you get:

  Unknown savevm section or instance 'eeprom' 0

on the destination side.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09 16:58:08 -05:00
Mark McLoughlin ae50b2747f Don't leak VLANClientState on PCI hot remove
destroy_nic() requires that NICInfo::private by a PCIDevice pointer,
but then goes on to require that the same pointer matches
VLANClientState::opaque.

That is no longer the case for virtio-net since qdev and wasn't
previously the case for rtl8139, ne2k_pci or eepro100.

Make the situation a lot more clear by maintaining a VLANClientState
pointer in NICInfo.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09 16:58:07 -05:00
Isaku Yamahata d56dd6cf03 use constant IOPORTS_MASK instead of 0xffff.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09 16:06:39 -05:00
Isaku Yamahata 3299397760 split out ioport related stuffs from vl.c into ioport.c.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09 16:06:38 -05:00
Gerd Hoffmann d88a76d1d3 qdev: convert ac97.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-07-09 13:07:03 +01:00
Gerd Hoffmann 6806e59567 qdev: convert es1370.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-07-09 13:07:03 +01:00
Gerd Hoffmann 16eaedf266 qdev/pci: misc fixes.
* fix secondary bus setup.
 * use base->name instead of "FIXME" for device name.
   Yes, the device name is redundant.  Only for drivers converted
   to qdev already though.  Once all drivers are converted we can
   and should kill it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-07-09 13:07:03 +01:00
Gerd Hoffmann 042f84d0af qdev: remove DeviceType
The only purpose DeviceType serves is creating a linked list of
DeviceInfo structs.  This removes DeviceType and add a next field to
DeviceInfo instead, so the DeviceInfo structs can be changed that way.
Elimitates a pointless extra level of indirection.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-07-09 13:07:03 +01:00
Gerd Hoffmann 10c4c98ab7 qdev: replace bus_type enum with bus_info struct.
BusInfo is filled with name and size (pretty much like I did for
DeviceInfo as well).  There is also a function pointer to print
bus-specific device information to the monitor.  sysbus is hooked
up there, I've also added a print function for PCI.

Device creation is slightly modified as well:  The device type search
loop now also checks the bus type while scanning the list instead of
complaining thereafter in case of a mismatch.  This effectively gives
each bus a private namespace for device names.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-07-09 13:07:03 +01:00
Gerd Hoffmann 0aab0d3a4a qdev: update pci device registration.
Makes pci_qdev_register take a PCIDeviceInfo struct instead of a bunch
of parameters.  Also adds config_read and config_write callbacks to
PCIDeviceInfo, so drivers needing these can be converted to the qdev
device API too.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-07-09 13:07:02 +01:00
Blue Swirl e8d2a88755 Fix the PCI header type of APB
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-05 20:33:02 +00:00
Blue Swirl 98846d73cb Fix Sparse warning
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-05 08:11:39 +00:00
Markus Armbruster 7d4c3d535c Replace -no-virtio-balloon by -balloon
We want to do (at least) two things to the virtio-balloon device:
suppress it, and control its PCI address.  Option -no-virtio-balloon
lets us do only the former.  To get the latter, replace
-no-virtio-balloon with

    -balloon none   disable balloon device
    -balloon virtio[,addr=str]
                    enable virtio balloon device (default)

Syntax suggested by Anthony Liguori.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29 14:18:08 -05:00
Jan Kiszka 3a31f36a07 x86: Factor out pc_new_cpu
At this point, this refactoring looks like overkill. But we will need it
for CPU hotplugging, and qemu-kvm already carries it. Merging it early
would help qemu-kvm when rebasing against upstream.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29 14:18:08 -05:00
Jan Kiszka a08d43677f Revert "Introduce reset notifier order"
This reverts commit 8217606e6e (and
updates later added users of qemu_register_reset), we solved the
problem it originally addressed less invasively.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29 14:18:08 -05:00
Jan Kiszka a62acdc0cc monitor: Make pci_add device options truely optional
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29 14:18:07 -05:00
Jan Kiszka 8d2ba1fb9c kvm: Rework VCPU synchronization
During startup and after reset we have to synchronize user space to the
in-kernel KVM state. Namely, we need to transfer the VCPU registers when
they change due to VCPU as well as APIC reset.

This patch refactors the required hooks so that kvm_init_vcpu registers
its own per-VCPU reset handler and adds a cpu_synchronize_state to the
APIC reset. That way we no longer depend on the new reset order (and can
drop this disliked interface again) and we can even drop a KVM hook in
main().

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29 14:18:07 -05:00
Jan Kiszka e9283f8b88 monitor: Drop pci_addr prefix from hotplug commands
The "pci_addr=" prefix currently required by pci_add/remove and
drive_add has no practical use. Drop it, but still silently accept it
for backward compatibility.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29 14:18:07 -05:00
Alexander Graf f16408dfb0 Multiboot support v5
This patch implements support for Multiboot on x86 for -kernel.
Multiboot is a "new" approach to get rid of different bootloaders, providing
a unified interface for the kernel. It supports command line options and
kernel modules.

The two probably best known projects using multiboot are Xen and GNU Hurd.

This implementation should be mostly feature-complete. It is missing VBE
extensions, but as no system uses them currently it does not really hurt.

To use multiboot, specify the kernel as -kernel option. Modules should be given
as -initrd options, seperated by a comma (,). -append also works.

Please bear in mind that grub also does gzip decompression, which qemu does
not do yet. To run existing images, please ungzip them first.

The guest multiboot loader code is implemented as option rom using int 19.
Parts of the work are based on efforts by Rene Rebe, who originally ported
my code to int 19.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29 13:52:12 -05:00
Alexander Graf bf483392e6 Expose fw_cfg v2
Multiboot passes options to the option rom using the fw_cfg device.
Right now, that device is local to the bochs_bios_init function.

Let's change that and expose it, so everyone may put data in there.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29 13:52:12 -05:00
Alexander Graf 1d108d9734 Change bochs bios init order
For multiboot support, we need bochs_bios_init to happen before
load_linux, so we get the fw_cfg device.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29 13:52:12 -05:00
Jan Kiszka 1a60952027 net: Provide VLAN client lookup helper
Introduce qemu_find_vlan_client_by_name for VLANClientState lookup based
on VLAN ID and client name. This is useful for monitor commands.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29 08:52:50 -05:00
john cooper bf011293fa Add serial number support for virtio_blk
[brought forward to current qemu-kvm.git]

This patch implements the missing qemu logic to
interpret a '-drive .. serial=XYZ ..' flag for
a virtio_blk device.

The serial number string is contained in a
skeletal IDENTIFY DEVICE data structure and
this structure is made available to the guest
virtio_blk driver via pci i/o region 0.

Signed-off-by: john cooper <john.cooper@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-24 09:09:15 -05:00
Michael S. Tsirkin ffe6370c9f qemu/net: flag to control the number of vectors a nic has
Add an option to specify the number of MSI-X vectors for PCI NIC cards. This
can also be used to disable MSI-X, for compatibility with old qemu. This
option currently only affects virtio cards.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-24 09:09:15 -05:00
Michael S. Tsirkin 566e2d3e88 qemu/net: request 3 vectors in virtio-net
Request up to 3 vectors in virtio-net. Actual bindings might supply
less.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-24 09:09:15 -05:00
Michael S. Tsirkin 64d50b8b0a qemu/pci: add pci_get/set_byte
Add pci_get/set_byte to keep *_word and *_long access functions company.
They are unused for now.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-24 09:09:15 -05:00
Michael S. Tsirkin ff24bd589c qemu/virtio: virtio save/load bindings
Implement bindings for virtio save/load. Use them in virtio pci.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-24 09:09:15 -05:00
Michael S. Tsirkin aba800a3ff qemu/virtio: MSI-X support in virtio PCI
This enables actual support for MSI-X in virtio PCI.
First user will be virtio-net.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-24 09:09:14 -05:00
Michael S. Tsirkin 7055e687cd qemu/virtio: virtio support for many interrupt vectors
Extend virtio to support many interrupt vectors, and rearrange code in
preparation for multi-vector support (mostly move reset out to bindings,
because we will have to reset the vectors in transport-specific code).
Actual bindings in pci, and use in net, to follow.
Load and save are not connected to bindings yet, so they are left
stubbed out for now.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-24 09:09:14 -05:00
Michael S. Tsirkin 54c96da798 qemu/apic: minimal MSI/MSI-X implementation for PC
Implement MSI support in APIC. Note that MSI and MMIO APIC registers
are at the same memory location, but actually not on the global bus: MSI
is on PCI bus, APIC is connected directly to the CPU. We map them on the
global bus at the same address which happens to work because MSI
registers are reserved in APIC MMIO and vice versa.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-24 09:09:14 -05:00
Michael S. Tsirkin 02eb84d0ec qemu/pci: MSI-X support functions
Add functions implementing MSI-X support. First user will be virtio-pci.
Note that platform must set a flag to declare MSI supported: this
is a safety measure to avoid breaking platforms which should support
MSI-X but currently lack this in the interrupt controller emulation.
For PC this will be set by APIC.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-24 09:09:14 -05:00
Michael S. Tsirkin bd4b65ee5e qemu/pci: check constant registers on load
Add "cmask" table of constant register masks: if a bit is not writeable
and is set in cmask table, this bit is checked on load.  An attempt to
load an image that would change such a register causes load to fail.
Use this table to make sure that load does not modify registers that
guest can not change (directly or indirectly).

Note: we can't just assume that read-only registers never change,
because the guest could change a register indirectly.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-24 09:09:14 -05:00
Michael S. Tsirkin 6f4cbd3950 qemu/pci: add routines to manage PCI capabilities
Add routines to manage PCI capability list. First user will be MSI-X.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-24 09:09:14 -05:00