qdev: Remove hex8/32/64 property types
Replace them with uint8/32/64.
Reviewed-by: Igor Mammedov <imammedo@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
exec: Make stb_phys input an AddressSpace
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
exec: Make stw_*_phys input an AddressSpace
exec: Make stl_*_phys input an AddressSpace
exec: Make stq_*_phys input an AddressSpace
exec: Make lduw_*_phys input an AddressSpace
exec: Make ldq/ldub_*_phys input an AddressSpace
exec: Make ldl_*_phys input an AddressSpace
hw/net: add support for Allwinner EMAC Fast Ethernet controller
This patch adds support for the Fast Ethernet MAC found on AllwinnerSoCs, together with a basic emulation of Realtek RTL8201CP PHY.
Since there is no public documentation of the Allwinner controller, the...
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
acpi,pci,pc,virtio fixes and enhancements
This includes new unit-tests for acpi by Marcel,hotplug for pci bridges by myself (piix only so far)and cpu hotplug for q35.And a bunch of fixes all over the place as usual....
Fix lan9118 TX "CMD A" handling
The 9118 ethernet controller supports transmission of multi-buffer packetswith arbitrary byte alignment of the start and end bytes. All writes tothe packet fifo are 32 bits, so the controller discards bytes at the beginning...
Fix lan9118 buffer length handling
virtio: Fix return value for dummy function vhost_net_virtqueue_pending
cgcc complains that -ENOSYS is not a good value for 'bool'.
A dummy virtio will never have pending queue entries, so let us returnfalse.
Signed-off-by: Stefan Weil <sw@weilnetz.de>...
Merge remote branch 'luiz/queue/qmp' into qmpq
hw: Remove assert_no_error usages
Replace assert_no_error() usages with the error_abort system.&error_abort is passed into API calls to signal to the Error sub-systemthat any errors are fatal. Removes need for caller assertions.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>...
hw: cannot_instantiate_with_device_add_yet due to pointer props
Pointer properties can be set only by code, not by device_add. Adevice with a pointer property can work with device_add only when theproperty may remain null.
This is the case for property "interrupt_vector" of device...
Merge remote-tracking branch 'bonzini/virtio' into staging
Merge remote-tracking branch 'stefanha/net-next' into staging
net/cadence_gem: Don't assert against 0 buffer address
This has no real hardware analog and asserting correctness of DMAaddresses is not a perhiperal level problem. Delete.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Message-id: fc02417eb1874cb05e4f20531c6203c5a00110f1.1386136219.git.peter.crosthwaite@xilinx.com...
net/cadence_gem: simplify rx buf descriptor walking
There was a replication of the rx descriptor address walking logic.Reorder the flow control to remove. This refactoring also obsoletesthe local variables packet_desc_addr and last_desc_addr.
net/cadence_gem: Prefetch rx descriptors ASAP
The real hardware prefetches rx buffer descriptors ASAP andpotentially throws relevant interrupts following the fetcheven in the absence of a received packet.
Reported-by: Deepika Dhamija <deepika@xilinx.com>...
net/cadence_gem: Implement RX descriptor match mode flags
The various Rx packet address matching mode flags were not being set inthe rx descriptor. Implement.
Reported-by: Deepika Dhamija <deepika@xilinx.com>Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>...
net/cadence_gem: Implement SAR match bit in rx desc
Bit 27 of the RX buffer desc word 1 should be set when the packet wasaccepted due to specific address register match. Implement.
This feature is absent from the Xilinx documentation (UG585) but thebehaviour is tested as accurate on real hardware....
net/cadence_gem: Implement SAR (de)activation
The Specific address registers can be enabled or disabled by software.QEMU was assuming they were always enabled. Implement thedisable/enable feature. SARs are disabled by writing to the lower halfregister. They are re-enabled by then writing the upper half....
net/cadence_gem: Add missing VMSTATE_END_OF_LIST
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Message-id: 8f8c2bfb15f40fb5f0d5766aa4cd3d54c596de6a.1386136219.git.peter.crosthwaite@xilinx.comSigned-off-by: Peter Maydell <peter.maydell@linaro.org>
net/cadence_gem: Fix rx multi-fragment packets
Bytes_to_copy was being updated before its final use where itadvances the rx buffer pointer. This was causing total mayhem,where packet data for any subsequent fragments was being fetchedfrom the wrong place....
net/cadence_gem: Fix small packet FCS stripping
The minimum packet size is 64, however this is before FCS strippingoccurs. So when FCS stripping the minimum packet size is 60. Fix.
net/cadence_gem: Fix register w1c logic
This write-1-clear logic was incorrect. It was always clearing w1cbits regardless of whether the written value was 1 or not. i.e. itwas implementing a write-anything-to-clear strategy.
net/cadence_gem: Improve can_receive debug printfery
Currently this just floods indicating that can_receive has been calledby the net framework. Instead, save the result of the most recentcan_receive callback as state and only print a message if the result...
net/cadence_gem: Don't rx packets when no rx buffer available
Return false from can_receive() when no valid buffer descriptor isavailable. Ensures against mass packet droppage in some applications.
net/cadence_gem: Implement mac level loopback mode
Cadence GEM has a MAC level loopback mode. Implement. Use the same basicoperation as the already implemented PHY loopback.
net/cadence_gem: Update DMA rx descriptors as we process them
We were updating the ownership bit of all descriptors if packetsget split and written through several descriptors.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>...
virtio-net: QOM realize preparations
Rename variable qdev -> dev since that's what realize's argument iscalled by convention.
Avoid duplicate VIRTIO_DEVICE() cast.
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virtio-net: Convert to QOM realize
virtio: Convert exit to unrealize
virtio-net: switch exit callback to VirtioDeviceClass
This ensures hot-unplug is handled properly by the proxy, and avoidsleaking bus_name which is freed by virtio_device_exit.
Cc: qemu-stable@nongnu.orgAcked-by: Andreas Faerber <afaerber@suse.de>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virtio-net: don't update mac_table in error state
mac_table was always cleaned up first in handlingVIRTIO_NET_CTRL_MAC_TABLE_SET command, and we din't recovermac_table content in error state, it's not correct.
This patch makes all the changes in temporal variables,...
virtio-net: fix the indent
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>Reviewed-by: Fam Zheng <famz@redhat.com>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Revert "e1000/rtl8139: update HMP NIC when every bit is written"
This reverts commit cd5be5829c1ce87aa6b3a7806524fac07ac9a757.Digging into hardware specs shows this does notactually make QEMU behave more like hardware:
There are valid arguments backed by the spec to indicate why the version...
Merge remote-tracking branch 'stefanha/net' into staging
Message-id: 1384532032-19057-1-git-send-email-stefanha@redhat.com...
Merge remote-tracking branch 'agraf/tags/signed-ppc-for-upstream-1.7' into staging
Patch queue for ppc - 2013-11-08
These are two patches that will hopefully make it into 1.7. The SLOF updatefixes -append kernel command line argument passing into the guest kernel. The...
virtio-net: fix the memory leak in rxfilter_notify()
object_get_canonical_path() returns a gchar*, it should be freed by thecaller.
Signed-off-by: Amos Kong <akong@redhat.com>Reviewed-by: Michael S. Tsirkin <mst@redhat.com>Reviewed-by: Vlad Yasevich <vyasevic@redhat.com>...
smc91c111: Fix receive starvation
In case the smc91c111 interface signals that it cannot receive morepackets the packets are queued and further reception will be disabled.In case the interface is again ready to receive packets notify the upperlayer.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>...
virtio-net: broken RX filtering logic fixed
Upon processing of VIRTIO_NET_CTRL_MAC_TABLE_SET commandmulticast list overwrites unicast list in mac_table.This leads to broken logic for both unicast and multicast RX filtering.
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>...
spapr: add vio-bus devices to categories
In order to get devices appear in output of"./qemu-system-ppc64 -device ?",they must be assigned to one of DEVICE_CATEGORY_XXXX.
This puts VIO devices classes to corresponding categories.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>...
e1000/rtl8139: update HMP NIC when every bit is written
We currently just update the HMP NIC info when the last bit of macaddris written. This assumes that guest driver will write all the macaddrfrom bit 0 to bit 5 when it changes the macaddr, this is the current...
virtio-net: only delete bh that existed
We delete without check whether it existed during exit. This will lead NULLpointer deference since it was created conditionally depends on guest driverstatus and features. So add a check of existence before trying to delete it....
bswap.h: Remove be32_to_cpupu()
Replace the legacy be32_to_cpupu() with ldl_be_p().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Michael S. Tsirkin <mst@redhat.com>Message-id: 1383669517-25598-6-git-send-email-peter.maydell@linaro.org...
bswap.h: Remove cpu_to_be16wu()
Replace the legacy cpu_to_be16wu() with stw_be_p().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Michael S. Tsirkin <mst@redhat.com>Message-id: 1383669517-25598-7-git-send-email-peter.maydell@linaro.org...
bswap.h: Remove cpu_to_be32wu()
Replace the legacy cpu_to_be32wu() with stl_be_p().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Michael S. Tsirkin <mst@redhat.com>Message-id: 1383669517-25598-8-git-send-email-peter.maydell@linaro.org...
bswap.h: Remove le32_to_cpupu()
Replace the legacy le32_to_cpupu() with ldl_le_p().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Michael S. Tsirkin <mst@redhat.com>Message-id: 1383669517-25598-5-git-send-email-peter.maydell@linaro.org...
bswap.h: Remove cpu_to_le32wu()
Replace the legacy cpu_to_le32wu() with stl_le_p().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Michael S. Tsirkin <mst@redhat.com>Message-id: 1383669517-25598-3-git-send-email-peter.maydell@linaro.org...
pci, pc, acpi fixes, enhancements
This includes some pretty big changes:- pci master abort support by Marcel- pci IRQ API rework by Marcel- acpi generation support by myself
Everything has gone through several revisions, latest versions have been on...
net: update nic info during device reset
macaddr is reset during device reset, but nic infoisn't updated, this problem exists in e1000 & rtl8139
Signed-off-by: Amos Kong <akong@redhat.com>Acked-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
net/e1000: update network information when macaddr is changed in guest
If we change macaddr in guest by 'ifconfig eth0 hw ether 12:12:12:34:35:36',the mac register of e1000 is already updated, but we don't updatenetwork information in qemu. Therefor, the information in monitor...
net/rtl8139: update network information when macaddr is changed in guest
rtl8139 has same problem as e1000, nic info isn't updated when macaddris changed in guest.
This patch updates the nic info when the last bit of macaddr is written.
Signed-off-by: Amos Kong <akong@redhat.com>...
hw/vmxnet3: set interrupts using pci irq wrappers
pci_set_irq uses PCI_INTERRUPT_PIN config registerto compute device INTx pin to assert/deassert.
An assert is used to ensure that intx receivedfrom the quest OS corresponds to PCI_INTERRUPT_PIN.
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>...
hw: set interrupts using pci irq wrappers
pci_set_irq and the other pci irq wrappers usePCI_INTERRUPT_PIN config register to compute deviceINTx pin to assert/deassert.
An irq is allocated using pci_allocate_irq wrapperonly if is needed by non pci devices....
pc,pci,virtio fixes and cleanups
This includes pc and pci cleanups and enhancements,and a virtio-net bugfix related to softmac programming.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
virtio-net: fix up HMP NIC info string on reset
When mac is updated on reset, info string has stale data.Fix it up.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pcnet-pci: mark I/O and MMIO as LITTLE_ENDIAN
Now that the memory subsystem is propagating the endianness correctly,the pcnet-pci device should have its I/O ports and MMIO memory markedas LITTLE_ENDIAN, as PCI devices are little endian.
This makes the pcnet-pci NIC to work again on big endian MIPS Malta...
e1000: NetClientInfo.receive_iov implemented
This patch implements the NetClientInfo.receive_iov method for thee1000 device emulation. In this way a network backend that usesqemu_sendv_packet() can deliver the fragmented packet withoutrequiring an additional copy in the frontend/backend network code...
ne2000: mark I/O as LITTLE_ENDIAN
Now that the memory subsystem is propagating the endianness correctly,the ne2000 device should have its I/O ports marked as LITTLE_ENDIAN, asPCI devices are little endian.
This makes the ne2000 NIC to work again on PowerPC....
vmxnet3: Eliminate __packed redefined warning
This eliminates a warning about __packed being redefined as exposed by thevmxnet3 code. __packed is not used anywhere in the vmxnet3 code.
CC hw/net/vmxnet3.oIn file included from hw/net/vmxnet3.c:29:...
e1000: add interrupt mitigation support
This patch partially implements the e1000 interrupt mitigation mechanisms.Using a single QEMUTimer, it emulates the ITR register (which is the newermitigation register, recommended by Intel) and approximately emulates...
qom: Pass available size to object_initialize()
To be passed on to object_initialize_with_type().
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> (virtio-ccw)Signed-off-by: Andreas Färber <afaerber@suse.de>
aio / timers: Switch entire codebase to the new timer API
This is an autogenerated patch using scripts/switch-timer-api.
Switch the entire code base to using the new timer API.
Note this patch may introduce some line length issues.
Signed-off-by: Alex Bligh <alex@alex.org.uk>...
pcnet: Flush queued packets on end of STOP state
Analogously to other NICs, we have to inform the network layer whenthe can_receive handler will no longer report 0. Without this, we mayget stuck waiting on queued incoming packets.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
spapr: Rename 'dprintf' to 'DPRINTF'
'dprintf' is the name of a POSIX standard function so we should not bestealing it for our debug macro. Rename to 'DPRINTF' (in line witha number of other source files.)
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
opencores_eth: QOM cast cleanup
Signed-off-by: Andreas Färber <afaerber@suse.de>
mipsnet: QOM cast cleanup
xgmac: QOM cast cleanup
Introduce type constant and use QOM casts and typedef consistently.
xilinx_ethlite: QOM cast cleanup
cadence_gem: QOM cast cleanup
etraxfs_eth: QOM cast cleanup
etraxfs_eth: Rename fs_eth to ETRAXFSEthState
Also add a typedef.
lan9118: QOM cast cleanup
lance: QOM cast cleanup
milkymist-minimac2: QOM cast cleanup
smc91c111: QOM cast cleanup
stellaris_enet: QOM cast cleanup
stellaris_enet: Fix NetClientInfo::cleanup
Drop freeing stellaris_enet_state - that is done by QOM later on unref.
Both MemoryRegion init and savevm registration happen in SysBusDeviceinitfn currently, so move them into an unrealizefn for now.
hw: import bitmap operations in qdev-core header
Made small tweaks in code to prevent compilation issueswhen importing qemu/bitmap.h in qdev-core
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>Message-id: 1375107465-25767-2-git-send-email-marcel.a@redhat.com...
devices: Associate devices to their logical category
The category will be used to sort the devices displayed inthe command line help.
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>Message-id: 1375107465-25767-4-git-send-email-marcel.a@redhat.com...
pseries: savevm support for PAPR VIO logical lan
This patch adds the necessary VMStateDescription information to supportsavevm/loadvm for the spapr_llan (PAPR logical lan) device.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
misc: Use g_assert_not_reached for code which is expected to be unreachable
The macro g_assert_not_reached is a better self documenting replacementfor assert(0) or assert(false).
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
net/e1000: QOM Upcast Sweep
Define and use standard QOM cast macro. Remove usages of DO_UPCAST()and direct -> style upcasting.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
net/e1000: QOM parent field cleanup
Replace direct uses of E1000State::dev field with QOM casts and renameit to parent_obj.
Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
net/rtl8139: QOM Upcast Sweep
net/rtl8139: QOM parent field cleanup
Replace direct uses of RTL8139State::dev with QOM casts and rename it toparent_obj.
net/pcnet-pci: QOM Upcast Sweep
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>[AF: Renamed parent field, renamed from PC_NET to PCNET]Signed-off-by: Andreas Färber <afaerber@suse.de>
Merge remote-tracking branch 'stefanha/tracing' into staging
pci,net,pc enhancements
This includes some fixes and enhancements that accumulated in my tree:pci fixes by dkoch, virtio-net enhancements by akong and mst,and a fix for xen pc by mst.
milkymist-minimac2: Fix minimac2_read/_write tracepoints
Broken in milkymist-minimac.c from the start (commit 0742454),faithfully moved to milkymist-minimac2.c (commit 57aa265).
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
net: add support of mac-programming over macvtap in QEMU side
Currently macvtap based macvlan device is working in promiscuousmode, we want to implement mac-programming over macvtap throughLibvirt for better performance.
Design: QEMU notifies Libvirt when rx-filter config is changed in guest,...
pci,misc enhancements
This includes some pci enhancements:
Better support for systems with multiple PCI root busesFW cfg interface for more robust pci programming in BIOSMinor fixes/cleanups for fw cfg and cross-version migration -...
hw/n*: pass owner to memory_region_init* functions
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ne2000: pass device to ne2000_setup_io, use it as owner
memory: add owner argument to initialization functions
e1000: cleanup process_tx_desc
Coverity complains about two overruns in process_tx_desc(). Thecomplaints are false positives, but we might as well eliminatethem. The problem is that "hdr" is defined as an unsigned int,but then used to offset an array of size 65536, and another of...