pci: 64bit bar support.
implemented pci 64bit bar support.The tricky bit is pci_update_mapping().An OS is allowed to set the BAR such that OS can't address the areapointed by BAR. It doesn't make sense, though.In that case, don't map the BAR.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>...
pci: remove bus_num member from struct PCIBus.
Since It can be retrieved from pci configuration space,the member is unnecessary.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci: make pci configuration transaction more accurate.
This patch sorts out/enhances pci code to track pci bus topologymore accurately.- Track host bus bridge with pci domain number. Although the current qemu implementation supports only pci domian 0 yet....
pci: factor out the conversion logic from io port address into pci device.
factor out the logic which converts io port address into pci deviceand offset in PCI configuration space.
pci: move pci host stuff from pci.c to pci_host.c
Move pci host stuff from pci.c to pci_host.c.And add some comments.Later pcie host bridge functions will be defined in pcie_host.cnot to bloat pci.c.
pci_host: change the signature of pci_data_{read, write}.
change the first argument, void opaque to PCIBus *sof the pci_data_{read, write}.They aren't used as direct callback so the argument typedon't have to be void. So change it to the right type....
vmstate: introduce VMSTATE_BUFFER_UNSAFE_INFO.
VMSTATE_BUFFER_UNSAFE_INFO for as a buffer with specified VMStateInfo.It will be used later.
pci: pcie host and mmcfg support.
This patch adds common routines for pcie host bridge and pcie mmcfg.This will be used by q35 based chipset emulation.
pci_host: consolidate pci config address access.
consolidate pci_config address access into pci_host.c
pci: introduce pcibus_t to represent pci bus address/size instead of uint32_t
This patch is preliminary for 64 bit BAR support.Introduce dedicated type, pcibus_t, to represent pci bus address/sizeinstead of uint32_t.Later this type will be changed to uint64_t....
pci: introduce FMT_PCIBUS for printf format for pcibus_t.
This patch is preliminary for 64bit BAR.Later pcibus_t will be changed from uint32_t to uint64_t.Introduce FMT_PCIBUS for printf format for pcibus_t.
pci: typedef pcibus_t as uint64_t instead of uint32_t.
This patch is preliminary for 64bit bar.For 64bit bar support, change pcibus_t which representspci bus addr/size from uint32_t to uint64_t.And also change FMT_pcibus for printf.
In pci_update_mapping() checks 32bit overflow....
pci: s/PCI_ADDRESS_SPACE_/PCI_BASE_ADDRESS_SPACE_/ to match pci_regs.h
make constants for pci base address match pci_regs.h byrenaming PCI_ADDRESS_SPACE_xxx to PCI_BASE_ADDRESS_SPACE_xxx.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Michael S. Tsirkin <mst@redhat.com>...
pci: clean up of pci_default_read_config.
This patch cleans up pci_default_read_config() removingugly length and range check.
Suggested by "Michael S. Tsirkin" <mst@redhat.com>Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Michael S. Tsirkin <mst@redhat.com>...
pci: make pci_bar() aware of header type 1.
make pci_bar() aware of header type 1. When PCI_ROM_SLOTit should return PCI_ROM_ADDRESS1 (!= PCI_ROM_ADDRESS)
pci_host.h: move functions in pci_host.h into .c file.
split static functions in pci_host.h into pci_host.c andpci_host_template.h.Later a structures declared in pci_host.h, PCIHostState, will be used.However pci_host.h doesn't allow to include itself easily. This patches...
pci: use helper functions to access pci config space.
use pci_[gs]et_{byte, word, long}() to access pci configurationspace.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci/bridge: clean up of pci_bridge_initfn()
- use symbolic constant- use helper function pci_set_xxx()- removed lines which initializes to 0. It is unnecessary because it is already zeroed.- add some comments on command registers.
Some initial values are suspicious because they seems to...
pci: clean up pci_init_wmask()
use pci_set_word() for pci command register.
pci: fix PCI_DPRINTF() wrt variadic macro.
add missing ## in PCI_DPRINTF() to compile.
pci: introduce constant PCI_NUM_PINS for the number of interrupt pins, 4.
introduce constant PCI_NUM_PINS for the number of interrupt pins, 4.and use it.
pci: use PCI_SLOT() and PCI_FUNC().
use PCI_SLOT() and PCI_FUNC() where appropriate instead ofdirect use of bit operation.
pci: define a constant to represent a unmapped bar and use it.
define a constant to represent a unmapped bar instead of -1 and use it.
pci: helper functions to access PCIDevice::config
add helper functions to get/set PCIDevice::configThose will be used later.
whitelist host virtio networking features
This patch is a followup to 8eca6b1bc770982595db2f7207c65051572436cb,fixing crashes when guests with 2.6.25 virtio drivers have saturatedvirtio network connections.
https://bugs.edge.launchpad.net/ubuntu/+source/qemu-kvm/+bug/458521...
scsi: move scsi.h -> esp.h
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
scsi: move scsi-disk.h -> scsi.h
qdev: Tag isa-fdc, PIIX3 IDE and PIIX4 IDE as no-user
These devices are created automatically, and attempting to createanother one with -device fails with "qemu: hardware error:register_ioport_write: invalid opaque".
Signed-off-by: Markus Armbruster <armbru@redhat.com>...
Configurable block format whitelist
We have code for a quite a few block formats. While I trust that allof these formats are useful at least for some people in somecircumstances, some of them are of a kind that friends don't letfriends use in production....
virtio-net: split the has_buffers() logic from can_receive()
We should only return zero from receive() for a condition which we'llget notification of when it changes. Currently, we're returning zeroif the guest driver is not ready, but we won't ever flush our queue...
Pass the drive's readonly attribute to the guest OS
Implemented for virtio-blk and for scsi
Signed-off-by: Naphtali Sprei <nsprei@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
IDE: Fix reset handling
Problem: x86 systems could not survive a few system_resets.
Clear most of IDE state when reset. Implement the missing reset handlers.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
PPC: rename cpu_ppc_reset to cpu_reset for consistency
Sparc64/x86: remove unneeded calls to device reset
PPC: remove unneeded calls to device reset
sparc32 (mostly): remove unneeded calls to device reset
v3: don't call reset functions on cpu initialization
There is absolutely no need to call reset functions when initializingdevices. Since we are already registering them, calling qemu_system_reset()should suffice. Actually, it is what happens when we reboot the machine,...
vga: fix line comparison
Line counter doesn't wrap.
Signed-off-by: malc <av1474@comtv.ru>
vga: Respect Line Compare Register in text modes
Unbreaks setup screen of Act1/PL
hw/sd: Support SDHC size cards
This patch adds SHDC support (-sd sd.img, where sd.img islarger than 1GB) to qemu.
Signed-off-by: Jason S. McMullan <jason.mcmullan@gmail.com>Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
Remove e1000 rom loading hack
The gPXE rom supports BEV properly.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-net: fix macaddr config regression
This commit:
commit 97b15621 virtio: use qdev properties for configuration.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
makes a guest using virtio-net see an empty macaddr because we never...
qemu/virtio: make wmb compiler barrier + comments
wmb must be at least a compiler barrier, even without SMP.Further, we likely need some rmb()/mb() as well:I have not audited the code but lguest has mb(),add a comment for now.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
qemu/msix: fix table access issues
Fixes a couple of issues with msix table access:- With misbehaving guests, misaligned 4 byte access could overflow msix table and cause qemu to segfault. Since PCI spec requires host to only issue dword-aligned accesses, as a fix,...
usb: print attached status in info qtree
serial: Add missing bit
Serial frames always start with a start bit.This bit was missing in frame size calculation.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
usb-serial and braille: use qdev for -usbdevice
usb: make attach optional.
Add a auto_attach field to USBDevice, which is enabled by default.USB drivers can clear this field in case they do not want the devicebeing attached (i.e. plugged into a usb port) automatically aftersuccessfull init().
Use cases (see next patches):...
usb-storage: use qdev for -usbdevice
Hook up usb_msd_init.
Also rework handling of encrypted block devices,move the code out vl.c.
usb core: use qdev for -usbdevice
This patchs adds infrastructure to handle -usbdevice via qdev callbacks.USBDeviceInfo gets a name field (for the -usbdevice driver name) and acallback for -usbdevice parameter parsing.
The new usbdevice_create() function walks the qdev driver list and looks...
usb-hid: use qdev for -usbdevice
rom loader: use qemu_strdup.
rom loader: make vga+rom loading configurable.
The rom_add_vga() and rom_add_option() macros are transformed intofunctions. They look at the new rom_enable_driver_roms variableand only do something if it is set to non-zero, making vga+option romloading runtime option. pc_init() sets rom_enable_driver_roms to 1....
vga roms: move loading from pc.c to vga drivers.
use rom loader for pc bios.
The pc bios shows up in 'info roms' now.
Note that the BIOS is mapped to two places: The complete rom at the topof the memory, and the first 128k at 0xe0000. Only the first place islisted in 'info roms'.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
net: move more stuff into net/tap-win32.c, add net/tap.h
Signed-off-by: Mark McLoughlin <markmc@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
net: move net-checksum.c under net/
Also add a new net/checksum.h header
virtio-net: add tap_has_ufo flag to saved state
If we tell the guest we support UFO and then migrate to host whichdoesn't support it, we will find ourselves in grave difficulties.
Prevent this scenario by adding a flag to virtio-net's savevm formatwhich indicates whether the device requires host UFO support....
Work around dhclient brokenness
With the latest GSO/csum offload patches, any guest using an unpatched versionof dhclient (any Ubuntu guest, for instance), will no longer be able to geta DHCP address.
dhclient is actually at fault here. It uses AF_PACKET to receive DHCP responses...
Enable UFO on virtio-net and tap devices
Enable UFO on the host tap device if supported and allow setting UFOon virtio-net in the guest.
Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>Signed-off-by: Mark McLoughlin <markmc@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-net: enable tap offload if guest supports it
We query the guest's feature set to see if it supports offload and,if so, we enable those features on the tap interface.
net: add receive_raw parameter to qemu_new_vlan_client()
Trivial patch to allow supplying a receive_raw function.
A future cleanup should combine this function pointer parameters into atable.
virtio-net: add vnet_hdr support
With '-netdev tap,id=foo -nic model=virtio,netdev=foo' virtio-net candetect that its peer (i.e. the tap backend) supports vnet headersand advertise to the guest that it can send packets with partialchecksums and/or TSO packets....
net: add a client type code
This is so as to allow APIs which operate on specific client typeswithout having to add a function table entry which is only implementedby a single client type.
vmware_vga: port to vmstate
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vmstate: Add VMSTATE_BUFFER_UNSAFE
Just sent <anything> as a buffer. We put the pointer and the sizecode does the rest.
lsi_scsi: port to vmstate
monitor: Convert do_pci_device_hot_remove() to QObject
Errors are still directly printed, as we are only convertingregular output.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vmware_vga: Remove uselss casts from void *
vmware_vga: qemu_malloc() returns void *
vmware_vga: remove !EMBED_STDVGA code
It don't compile. And the trivial fixes (change vga.foo field to foo fielddon't work either. No output
vmware_vga: scratch is really an array of uint32_t
vmware_vga: the support to change dinamically depth is not there
For a start bypp is not changed after vmsvga_reset() and it depends on depth
vga: port vga-isa-mm to vmstate
vga: port vga-isa to vmstate
vga: port vmware std vga to vmstate
vga: port vga-pci to vmstate
vga: remove unused vga_common_save/load
vmware_vga: Pass pci_vmsga_state_t arg no VGACommonState
e1000: unfold mac_reg_tosave array
e1000: unfold mac_regarraystosave array
e1000: port to vmstate
vga: create is_vbe_vmstate field
vga: port vga_common_save/load to vmstate
ne2000: port to vmstate
rtl8139: port to vmstate
eeprom93xx: port to vmstate
eepro100: port to vmstate
pcnet: port to vmstate
vmstate: Unfold VMSTATE_INT32_VARRAY() only use and remove it
vmstate: add VMS_VARRAY_UINT16_UNSAFE (varrays with uint16 indexes)
It don't check types.Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vmstate: Add version arg to VMSTATE_SINGLE_TEST()
This allows to define VMSTATE_SINGLE with VMSTATE_SINGLE_TESTSigned-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vmstate: Add VMSTATE_BUFFER_UNUSED
It allows to have 'things' in savevm format not backed in the device stateSigned-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vmstate: Add VMSTATE_MACADDR for the new type
vmstate: Introduce the concept of sub-arrays
VMSTATE_SUB_ARRAY(..., start, num, ...) saves the num elems starting atposition start of the arraySigned-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
rtl8139: port TallyCounters to vmstate
vmstate: factor vmstate_offset_pointer
vmstate: factor vmstate_offset_array
vmstate: factor vmstate_offset_buffer
vmstate: factor VMSTATE_*BUFFER* definitions