History | View | Annotate | Download (101.2 kB)
softmmu: move include files to include/sysemu/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
misc: move include files to include/qemu/
net: reorganize headers
Move public headers to include/net, and leave private headers in net/.Put the virtio headers in include/net/tap.h, removing the multiple copiesthat existed. Leave include/net/tap.h as the interface for NICs, andnet/tap_int.h as the interface for OS-specific parts of the tap backend....
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>
rtl8139: 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,...
rtl8139: implement 8139cp link status
Add a link status chang callback and change the link status bit in BMSR& MSR accordingly. Tested in Linux/Windows guests.
The link status bit of MediaStatus is infered from BasicModeStatus,they are inverse.
nc.link_down could not be migrated, this patch updates link_down in...
Make target_phys_addr_t 64 bits unconditionally
The hassle and compile time overhead of maintaining both 32-bit and 64-bitcapable source isn't worth the tiny performance advantage which is seen ona minority of configurations. Switch to compiling libhw only once, with...
net: Rename VLANClientState to NetClientState
The vlan feature is no longer part of net core. Rename VLANClientStateto NetClientState because net clients are not explicitly associated witha vlan at all, instead they have a peer net client to which they are...
net: Rename qemu_del_vlan_client() to qemu_del_net_client()
Another step in moving the vlan feature out of net core. Users onlydeal with NetClientState and therefore qemu_del_vlan_client() should benamed qemu_del_net_client().
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
Merge branch pci into master
Merge master and pci branch, resolve build breakage in hw/esp.cintroduced by f90c2bcd.
Conflicts: hw/esp.c
hw, net: "net_client_type" -> "NetClientOptionsKind" (qapi-generated)
NET_CLIENT_TYPE_ -> NET_CLIENT_OPTIONS_KIND_
Signed-off-by: Laszlo Ersek <lersek@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Merge remote-tracking branch 'mjt/mjt-iov2' into staging
pci: convert PCIUnregisterFunc to void
Not a single driver has any possibility of failure on theirexit function, let's keep it that way.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
rtl8139: validate rx ring before receiving packets
Commit ff71f2e8cacefae99179993204172bc65e4303df prevent the possiblecrash during initialization of linux driver by checking the operatingmode.This seems too strict as:
- the real card could still work in mode other than normal...
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
change iov_* function prototypes to be more appropriate
Reorder arguments to be more natural, readable andconsistent with other iov_* functions, and changeargument names, from: iov_from_buf(iov, iov_cnt, buf, iov_off, size)to iov_from_buf(iov, iov_cnt, offset, buf, bytes)...
rtl8139: honor RxOverflow flag in can_receive method
Some drivers (Linux' 8139too among them) rely on the NICinjecting an interrupt in the event of a receive buffer overflowand, accordingly, set the RxOverflow bit in the interruptmask. Unfortunately rtl8139's can_receive method ignores the...
Revert "Revert "rtl8139: do the network/host communication only in normal operating mode""
This reverts commit 9c92bf7f6c3f675e60b8ba8a5287bb88ea1eac36.
Per Jason's request.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Revert "rtl8139: do the network/host communication only in normal operating mode"
This reverts commit ff71f2e8cacefae99179993204172bc65e4303df. This is becausethe linux 8139cp driver would leave the card in "Config Register Write Enable" mode after the eeprom were read or write ( which is unexpected in the spec...
rtl8139: fix regression in TxStatus/TxAddr read
Commit afe0a595356192 added byte reads for TxStatus/TxAddr, butbroke 32-bit reads; the mask generation
(1 << (8 * size)) - 1
is unspecified in C for size >= sizeof(int), and in fact returns 0on x86....
rtl8139: do not assume TxStatus[] and TxAddr[] are adjacent
Commit afe0a595356192d5f79703cf6462fcc112df007c ("rtl8139: support byteread to TxStatus registers") reused rtl8139_TxStatus_read() for readingTxAddr registers. It relies on the fact that TxStatus[] and TxAddr[]...
net: move compute_mcast_idx() to net.h
Reduce duplicated codes.
Signed-off-by: Jason Wang <jasowang@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
rtl8139: correctly check the opmode
According to the spec, only when opmode is "Config. Register WriteEnable" could driver write to CONFIG0,1,3,4 and bits 13,12,8 of BMCR.
Currently, we allow modifying to those registers also when 8139 is in"Auto-load" mode and "93C46 (93C56) Programming" mode. This patch...
rtl8139: do the network/host communication only in normal operating mode
According the spec, the card works in network/host communication mode only whenboth EEM1 and EEM0 are unset in 93C46 Command Register (normal opmode). So this patch check these bits before trying to receive packets....
rtl8139: limit transmission buffer size in c+ mode
The tx buffer would be re-allocated for tx descriptor with big sizeand without LS bit set, this would make guest driver could easily letqemu to allocate unlimited.
In linux host, a glib failure were easy to be triggered:...
rtl8139: remove unused marco
rtl8139: support byte read to TxStatus registers
Some drivers (such as win7) use byte read for TxStatus registers, so we need tosupport this to let guest driver behave correctly.
For writing, only double-word access is allowed by spec.
Signed-off-by: Jason Wang <jasowang@redhat.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....
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...
pci: convert to QEMU Object Model
qdev: don't access name through info
We already have a QOM interface for this so let's use it.
qdev: move qdev->info to class
Right now, DeviceInfo acts as the class for qdev. In order to switch to aproper ObjectClass derivative, we need to ween all of the callers off ofinteracting directly with the info pointer.
Merge remote-tracking branch 'stefanha/trivial-patches-next' into staging
hw: Fix spelling in comments
adress->addressadvertisment->advertisementbegining->beginningbondary->boundarycontroler->controllercontroll->controlconvertion->conversiondoesnt->doesn'texistant->existentinstuction->instructionloosing->losingmanagment->management...
Remove unnecessary casts from PCI DMA code in rtl8139
This patch removes some unnecessary casts in the rtl8139 device,introduced by commit 3ada003aee2004d24f23b9cd6f4eda87d9601ddb'rtl8139: Use PCI DMA stub functions'.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>...
rtl8139: Fix invalid IO access alignment
This patch makes iPXE work with the rtl8139 emulation. The rtl8139driver in iPXE issues a 16bit access on the ChipCmd register(offset 0x37) to check the status of the rx buffer. The offset of theioport access was getting fixed up to 0x36 in qemu, causing the value...
rtl8139: Use PCI DMA stub functions
This updates the rtl8139 device emulation to use the explicit PCI DMAfunctions, instead of directly calling physical memory access functions.
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>Signed-off-by: David Gibson <david@gibson.dropbear.id.au>...
pci: interrupt pin documentation update
Fix up some erroneous comments in code:interrupt pins are named A-D, theinterrupt pin register is always readonlyand isn't zeroed out on reset.
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
pci: rename pci_register_bar_region() to pci_register_bar()
Reviewed-by: Richard Henderson <rth@twiddle.net>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>
rtl8139: convert to memory API
Merge remote-tracking branch 'origin/master' into pci
Conflicts: hw/virtio-pci.c
hw/rtl8139.c: convert to PCIDeviceInfo to initialize ids
use PCIDeviceInfo to initialize ids.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Fix typo in code and comments
Replace writeable -> writable
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Merge remote branch 'origin/master' into pci
Conflicts: exec.c
rtl8139: Fix compilation for w32/w64
Compilation for Windows needs a different declaration for theprintf format attribute, so use the macro which was defined forthis purpose.
Cc: Benjamin Poirier <benjamin.poirier@gmail.com>Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
rtl8139: add format attribute to DPRINTF
gcc can check the format string for correctness even when debugging output isnot enabled.Have to make sure arguments are always available. They are optimized out ifunneeded.
Signed-off-by: Benjamin Poirier <benjamin.poirier@gmail.com>...
rtl8139: use variadic macro for debug statements
Removes double (( )) to make DEBUG_PRINT compatible with real function calls.Change the name to DPRINTF to be consistent with other DPRINTF macrosthroughout qemu.Include the "RTL8139: " prefix in the macro. This changes some debug output...
rtl8139: use TARGET_FMT_plx in debug messages
Prevents a compilation failure when DEBUG_RTL8139 is defined:
CC libhw32/rtl8139.occ1: warnings being treated as errorshw/rtl8139.c: In function ‘rtl8139_cplus_transmit_one’:hw/rtl8139.c:1960: error: format ‘%8lx’ expects type ‘long unsigned int’, but argument 5 has type ‘target_phys_addr_t’...
PXE: Use consistent naming for PXE ROMs
And add missing ROMs to tarbin build target.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
rtl8139: convert to pci_register_bar_simple()
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
rtl8139: add vlan tag insertion
Add support to the emulated hardware to insert vlan tags in packetsgoing from the guest to the network.
Signed-off-by: Benjamin Poirier <benjamin.poirier@gmail.com>Cc: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>Cc: Jason Wang <jasowang@redhat.com>...
rtl8139: add vlan tag extraction
Add support to the emulated hardware to extract vlan tags in packetsgoing from the network to the guest.
rtl8139: cleanup FCS calculation
clean out ifdef's around ethernet checksum calculation
Signed-off-by: Benjamin Poirier <benjamin.poirier@gmail.com>Acked-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>Cc: Jason Wang <jasowang@redhat.com>Cc: Michael S. Tsirkin <mst@redhat.com>...
change all other clock references to use nanosecond resolution accessors
This was done with:
sed -i 's/qemu_get_clock\>/qemu_get_clock_ns/' \ $(git grep -l 'qemu_get_clock\>' ) sed -i 's/qemu_new_timer\>/qemu_new_timer_ns/' \ $(git grep -l 'qemu_new_timer\>' )...
moving eeprom initialization
The initialization should not be only on reset but also when initializingthe device.It resolves a bug when hot plugging a pci network device: the mac addresswas always null.
Signed-off-by: William Dauchy <wdauchy@gmail.com>...
rtl8139: Use subsection to restrict migration after hotplug
rtl8139 includes a cpu_register_io_memory acquired value in it'smigration data. This is not only unecessary, but we should treatthese values as unique to the VM instances since the value depends...
Add bootindex parameter to net/block/fd device
If bootindex is specified on command line a string that describes devicein firmware readable way is added into sorted list. Later this list willbe passed into firmware to control boot order.
Signed-off-by: Gleb Natapov <gleb@redhat.com>...
rtl8139: Declare as little endian
This patch replaces explicit bswaps with endianness hints to themmio layer.
Because we don't depend on the target endianness anymore, we can alsomove the driver over to Makefile.objs.
Signed-off-by: Alexander Graf <agraf@suse.de>...
Add endianness as io mem parameter
As stated before, devices can be little, big or native endian. Thetarget endianness is not of their concern, so we need to push thingsdown a level.
This patch adds a parameter to cpu_register_io_memory that allows adevice to choose its endianness. For now, all devices simply choose...
rtl8139: address TODOs
Make rtl8139 spec compliant, fixing reset valuesfor command register.
pci: don't overwrite multi functio bit in pci header type.
Don't overwrite pci header type.Otherwise, multi function bit which pci_init_header_type() setsappropriately is lost.Anyway PCI_HEADER_TYPE_NORMAL is zero, so it is unnecessary to zerowhich is already zero cleared....
rewrote timer implementation for rtl8139.
Add a QEMU timer only when needed (timeout status not set, timeoutirq wanted and timer set).
This patch is required for Darwin. Patch has been tested underFreeBSD, Darwin and Linux.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>...
rtl8139: fix clang reporting unused assignment of VLAN tagging data
Currently we do not implement VLAN tagging for rtl8139(C+),still data is read from ring buffer headers.
- augment unused assignment with TODO item- cast txdw1 to void for now
Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>...
rtl: switch to symbolic names for pci registers
No functional changes. I verified that the generated binarydoes not change.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Acked-by: Juan Quintela <quintela@redhat.com>Acked-by: Glauber Costa <glommer@gmail.com>
Support PCI based option rom loading
Currently, we preload option roms into the option rom space in memory. Thisprevents DDIM from functioning correctly which severely limits the numberof roms we can support.
This patch introduces a pci_add_option_rom() which registers the...
pci romfiles: add property, add default to PCIDeviceInfo
This patch adds a romfile property to the pci bus. It allows to specifya romfile to load into the rom bar of the pci device. The default valuecomes from a new field in PCIDeviceInfo. The property allows to change...
savevm: Port to qdev.vmsd all devices that have qdev
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
net: convert rtl8139 to NICState
Signed-off-by: Mark McLoughlin <markmc@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix qemu_malloc/qemu_free use in rtl8139.c
rtl8139.c is using malloc()/free() instead of qemu_malloc()/qemu_free().Fix it.
Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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: 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>...
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,...
rtl8139: port to vmstate
rtl8139: port TallyCounters to vmstate
rtl8139: use qdev properties for configuration.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu/qdev: type safety in reset handler
Add type safety to qdev reset handlers, by declaring them asDeviceState * rather than void *.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci: move unregister from PCIDevice to PCIDeviceInfo
One more cleanup while being at it ;)
Revert "Get rid of _t suffix"
In the very least, a change like this requires discussion on the list.
The naming convention is goofy and it causes a massive merge problem. Somethinglike this must be presented on the list first so people can provide input...
Get rid of _t suffix
Some not so obvious bits, slirp and Xen were left alone for the timebeing.
Signed-off-by: malc <av1474@comtv.ru>
Unexport ticks_per_sec variable. Create get_ticks_per_sec() function
qdev: convert rtl8139 to reset
rtl8139: Remove unneeded double indirection of PCIRTL8139State
rtl8139: remove pointless cast from void *
qdev: add return value to init() callbacks.
Sorry folks, but it has to be. One more of these invasive qdev patches.
We have a serious design bug in the qdev interface: device initcallbacks can't signal failure because the init() callback has noreturn value. This patch fixes it....
Make CPURead/WriteFunc structure 'const'
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Fix Sparse warnings: "Using plain integer as NULL pointer"
qdev: update pci device registration.
Makes pci_qdev_register take a PCIDeviceInfo struct instead of a bunchof parameters. Also adds config_read and config_write callbacks toPCIDeviceInfo, so drivers needing these can be converted to the qdevdevice API too....
Revert "Introduce reset notifier order"
This reverts commit 8217606e6edb49591b4a6fd5a0d1229cebe470a9 (andupdates later added users of qemu_register_reset), we solved theproblem it originally addressed less invasively.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
Revert "Update irqs on reset and device load"
This reverts commit 3dcd219f09d6c1817bf9a132899e6b925f7a0914.
It is incorrect to call qemu_irq functions (or any other functions thataccess other device state) during savevm/loadvm.
Rename pci_register_io_region() to pci_register_bar()
This function is used to manage a PCI BAR, so make the more genericpci_register_io_region() available to other uses.
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Remove io_index argument from cpu_register_io_memory()
The parameter is always zero except when registering the three internalio regions (ROM, unassigned, notdirty). Remove the parameter to reducethe API's power, thus facilitating future change.
Signed-off-by: Avi Kivity <avi@redhat.com>...
Merge branch 'net-queue'
Update irqs on reset and device load
Register reset functions for e1000 and rtl8139
net: add fd_readv() handler to qemu_new_vlan_client() args
This, apparently, is the style we prefer - all VLANClientStateshould be an argument to qemu_new_vlan_client().
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
net: re-name vc->fd_read() to vc->receive()
VLANClientState's fd_read() handler doesn't read from filedescriptors, it adds a buffer to the client's receive queue.
Re-name the handlers to make things a little less confusing.
net: pass VLANClientState* as first arg to receive handlers
Give static type checking a chance to catch errors.
net: add return value to packet receive handler
This allows us to handle queue full conditions rather than droppingthe packet on the floor.