PXE: Use consistent naming for PXE ROMs
And add missing ROMs to tarbin build target.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
pseries: Abolish envs array
Currently the pseries machine init code builds up an array, envs, ofCPUState pointers for all the cpus in the system. This is kind ofpointless, given the generic code already has a perfectly good linked listof the cpus.
In addition, there are a number of places which assume that the cpu's...
Delay creation of pseries device tree until reset
At present, the 'pseries' machine creates a flattened device tree in themachine->init function to pass to either the guest kernel or to firmware.
However, the machine->init function runs before processing of -device...
Don't call cpu_synchronize_state() from machine init.
This will deadlock when the I/O thread is used, since theCPU thread is blocked waiting for qemu_system_ready.
The synchronization is unnecessary since this is beforecpu_synchronize_all_post_init()....
spapr_vscsi: Set uninitialized variable
cppcheck reports this error:
hw/spapr_vscsi.c:274: error: Uninitialized variable: rc
If llen == 0, rc was indeed used without being initialized.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Alexander Graf <agraf@suse.de>
Merge remote branch 'kwolf/for-anthony' into staging
virtio-blk: fail unaligned requests
Like all block drivers virtio-blk should not allow small than block sizegranularity access. But given that the protocol specifies abyte unit length field we currently accept such requests, which causeqemu to abort() in lower layers. Add checks to the main read and...
usb-ccid: Spelling fixes
While looking at David Gibson's build-fix for hw/usb-ccid.c, I noticed a spelloin a comment on the following (unchanged) line.
Signed-off-by: Brad Hards <bradh@frogmouth.net>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
qdev: Fix comment around qdev_init_nofail()
In previous life qdev_init_nofail() used to call hw_error() whichdid register dump and other scary things. Now it callserror_report() and does a regular exit(1). Fix the commentto match reality.
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>...
spapr_llan: Fix warning when compiled with -dDEBUG
Compiling with the DEBUG macro causes leaves hw/spapr_llan.c with anunused variable, which is treated as an error in the qemu build.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>Signed-off-by: David Gibson <david@gibson.dropbear.id.au>...
virtio-9p: fixed LE-to-host conversion bug when QEMU is called from guest
The 9p code already contains an attempt at the necessary endianconversions, but it's broken.
The code which does conversion from host to guest does it correctlyand this code was copied to the function which does guest to host...
virtio-balloon: fixed endianness bug in the config space
The specification for the virtio balloon device requres that the valuesin the config space be encoded little-endian. This differs from mostvirtio things, where guest-native endian is the norm.
Currently, the qemu virtio-balloon code correctly makes the conversion...
ide: consolidate drive_get(IF_IDE)
factor out ide initialization to call drive_get(IF_IDE)
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
floppy: save and restore DIR register
We need to keep DIR register unchanged across migration, but currently itdepends on the media_changed flags from block layer. Since we do notsave/restore it and the bdrv_open() called in dest node may set themedia_changed flag when trying to open floppy image, guest driver may think the...
hw/xen_disk: ioreq not finished on error
Bug fix: routines 'ioreq_runio_qemu_sync' and 'ioreq_runio_qemu_aio'won't call 'ioreq_unmap' or 'ioreq_finish' on errors, leaving ioreq inthe blkdev->inflight list and a leak.
Signed-off-by: Feiran Zheng <famcool@gmail.com>...
Fix non-portable format string in usb-ccid.c
At one point, usb-ccid.c attempts to use a %lX format specifier to printa uint64_t, which is only correct on some host platforms. This patchcorrects the statement to use the stdint specified PRIX64 constant instead....
lm32: add support for the Milkymist board
This patch adds almost complete support for the Milkymist system-on-chip(http://www.milkymist.org).
Additional to running bare metal applications, booting a linux kernel withinitrd is supported.
Signed-off-by: Michael Walle <michael@walle.cc>...
lm32: add Milkymist AC97 support
This patch adds support for the Milkymist AC97 compatible sound output andinput core.
Signed-off-by: Michael Walle <michael@walle.cc>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
lm32: add Milkymist HPDMC support
This patch adds support for the Milkymist's High Performance Dynamic MemoryController. This is just a dumb model without any functionality. While thereal hardware acts for example as a bridge between software and hardware...
lm32: add Milkymist memory card support
This patch adds support for Milkymist's memory card core.
lm32: add Milkymist Minimac support
This patch adds support for Milkymist's minimal Ethernet MAC.
lm32: add Milkymist PFPU support
This patch adds support for Milkymist's Programmable FPU.
lm32: add Milkymist SoftUSB support
This patch adds support for Milkymist's SoftUSB core. This model differfrom the real hardware in its functionality. The real hardware consits of atiny freely programmable microcontroller which controls the USB ports. For...
lm32: add Milkymist System Controller support
This patch adds support for Milkymist's System Controller core. The modelhas the following features: - support for shutting down and restarting the board - provide two timers and GPIO - provide registers for system identification and reading the boards...
lm32: add Milkymist TMU2 support
This patch adds support for Milkymist's texture mapping unit. For fastcomputation this model needs hardware accelerated 3D graphics support(OpenGL). There is no graphical output, all computations belong to internalframebuffers only....
lm32: add Milkymist UART support
This patch adds support for Milkymist's simple UART.
lm32: add Milkymist VGAFB support
This patch adds support for Milkymist's VGA framebuffer.
lm32: add milkymist hw support functions
This patch adds wrappers for easy creation of the qdev devices.
Revert "ioapic: when switches to level trigger mode, interrupts raised repeatedly."
This reverts commit 9bcfc7daabb138b0fe3d64d74892942d482e5bbd.
s390x: fix s390-virtio-serial
Commit 6b331efb733a0f913ddc0b7762a1307dec304061 broke the s390 proxy versionof virtio-serial by only taking its PCI brother into account.
So let's adjust s390-virtio-serial the same way as its PCI counterpart, makingit compile and work again....
virtio: use generic name when possible
We have two different virtio buses: pci and s390. The abstraction pathtaken in qemu is to have generic aliases for each device type in thearchitecture specific qdev devices.
So let's make use of these aliases whenever we can and define them...
w32: Fix compilation (wrong include file)
arpa/inet.h is not available for w32, so commitedbb21363fbfe40e050f583df921484cbc31c79d breaksw32 compilations.
This is fixed by using qemu_socket.h.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Reviewed-by: Alon Levy <alevy@redhat.com>...
e1000: Mask out lower bits of RDBAL/TDBAL
Rx and Tx descriptors are 16 byte aligned, so the lower bits areignored by real hardware. In fact, they always read back as zero on realhardware, but probably nobody relies on that.
Signed-off-by: Kevin Wolf <mail@kevin-wolf.de>...
ioapic: when switches to level trigger mode, interrupts raised repeatedly.
- the trigger mode is edge at first- During initializatoin, the interrupt is raised as edge which is masked. The corresponding bit of irr is set.- Then the mode is switched to level and it's unmasked....
hw/vexpress.c: Add model of ARM Versatile Express board
Add a model of the ARM Versatile Express board (with A9MPx4daughterboard).
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
ccid: add ccid-card-emulated device
This devices uses libcacard (internal) to emulate a smartcard conformingto the CAC standard. It attaches to the usb-ccid bus. Usage instructions(example command lines) are in the following patch in docs/ccid.txt. Ituses libcacard which uses nss, so it can work with both hw cards and...
usb-ccid: add CCID bus
A CCID device is a smart card reader. It is a USB device, defined at [1].This patch introduces the usb-ccid device that is a ccid bus. Next patches willintroduce two card types to use it, a passthru card and an emulated card.
[1] http://www.usb.org/developers/devclass_docs/DWG_Smart-Card_CCID_Rev110....
ccid: add passthru card device
The passthru ccid card is a device sitting on the usb-ccid bus andusing a chardevice to communicate with a remote device using theVSCard protocol defined in libcacard/vscard_common.h
Usage docs available in following patch in docs/ccid.txt...
hw/versatilepb, realview: Fix condition for instantiation of onboard NIC
Correct the condition determining whether we instantiate the onboardNIC or a PCI card NIC on VersatilePB and Realview boards. This was brokenin two ways: (1) if the user asked for two default NICs ("-net nic -net nic") we would...
pcnet: Fix sign extension: make ipxe work with >2G RAM
The problem is with definitions in hw/pcnet.c such as:
#define CSR_CRDA(S) ((S)->csr[28] | ((S)->csr[29] << 16))
"(S)->csr29" is a uint16_t, but "(S)->csr29 << 16" gets promoted toint, so the overall CSR_CRDA(s) is a (signed) int rather than a uint32_t....
lsi53c895a: add support for ABORT messages
If these messages are not handled correctly the guest driver may hang.
Always mandatory:- ABORT- BUS DEVICE RESET
Mandatory if tagged queuing is implemented (which disks usually do):- ABORT TAG- CLEAR QUEUE...
fix build errors when we enable acpi_piix4 debug
Implement PAPR virtual SCSI interface (ibmvscsi)
This patch implements the infrastructure and hypercalls necessary forthe PAPR specified Virtual SCSI interface. This is the normal methodfor providing (virtual) disks to PAPR partitions.
Signed-off-by: Ben Herrenschmidt <benh@kernel.crashing.org>...
Add a PAPR TCE-bypass mechanism for the pSeries machine
Usually, PAPR virtual IO devices use a virtual IOMMU mechanism, TCEs,to mediate all DMA transfers. While this is necessary for some sorts ofoperation, it can be complex to program and slow for others....
Implement PAPR VPA functions for pSeries shared processor partitions
Shared-processor partitions are those where a CPU is time-sliced betweenpartitions, rather than being permanently dedicated to a singlepartition. qemu emulated partitions, since they are just scheduled with...
Add SLOF-based partition firmware for pSeries machine, allowing more boot options
Currently, the emulated pSeries machine requires the use of the-kernel parameter in order to explicitly load a guest kernel. Thismeans booting from the virtual disk, cdrom or network is not possible....
Implement hcall based RTAS for pSeries machines
On pSeries machines, operating systems can instantiate "RTAS" (Run-TimeAbstraction Services), a runtime component of the firmware which implementsa number of low-level, infrequently used operations. On logical partitions...
Implement assorted pSeries hcalls and RTAS methods
This patch adds several small utility hypercalls and RTAS methods tothe pSeries platform emulation. Specifically:
This just prints a character to the console, it's occasionally used...
Implement the PAPR (pSeries) virtualized interrupt controller (xics)
PAPR defines an interrupt control architecture which is logically dividedinto ICS (Interrupt Control Presentation, each unit is responsible forpresenting interrupts to a particular "interrupt server", i.e. CPU) and...
Add PAPR H_VIO_SIGNAL hypercall and infrastructure for VIO interrupts
This patch adds infrastructure to support interrupts from PAPR virtual IOdevices. This includes correctly advertising those interrupts in thedevice tree, and implementing the H_VIO_SIGNAL hypercall, used to...
Add (virtual) interrupt to PAPR virtual tty device
Now that we have implemented the PAPR "xics" virtualized interruptcontroller, we can add interrupts in PAPR VIO devices. This patch addsinterrupt support to the PAPR virtual tty/console device.
Signed-off-by: David Gibson <dwg@au1.ibm.com>...
Implement TCE translation for sPAPR VIO
This patch implements the necessary infrastructure and hypercalls forsPAPR's TCE (Translation Control Entry) IOMMU mechanism. This is necessaryfor all virtual IO devices which do DMA (i.e. nearly all of them).
Implement sPAPR Virtual LAN (ibmveth)
This patch implements the PAPR specified Inter Virtual Machine LogicalLAN; that is the virtual hardware used by the Linux ibmveth driver.
Signed-off-by: Paul Mackerras <paulus@samba.org>Signed-off-by: David Gibson <dwg@au1.ibm.com>...
Implement PAPR CRQ hypercalls
This patch implements the infrastructure and hypercalls necessary for thePAPR specified CRQ (Command Request Queue) mechanism. This generalrequest queueing system is used by many of the PAPR virtual IO devices,including the virtual scsi adapter....
Add POWER7 support for ppc
This adds emulation support for the recent POWER7 cpu to qemu. It's farfrom perfect - it's missing a number of POWER7 features so far, includingany support for VSX or decimal floating point instructions. However, it'sclose enough to boot a kernel with the POWER7 PVR....
Start implementing pSeries logical partition machine
This patch adds a "pseries" machine to qemu. This aims to emulate alogical partition on an IBM pSeries machine, compliant to the"PowerPC Architecture Platform Requirements" (PAPR) document.
This initial version is quite limited, it implements a basic machine...
Implement the bus structure for PAPR virtual IO
This extends the "pseries" (PAPR) machine to include a virtual IO bussupporting the PAPR defined hypercall based virtual IO mechanisms.
So far only one VIO device is provided, the vty / vterm, providinga full console (polled only, for now)....
Virtual hash page table handling on pSeries machine
On pSeries logical partitions, excepting the old POWER4-style full systempartitions, the guest does not have direct access to the hardware pagetable. Instead, the pagetable exists in hypervisor memory, and the guest...
virtio-pci: fix bus master work around on load
Commit c81131db15dd1844d0db1d51f3cd7a105cfd2cf3detects old guests by comparing virtio andPCI status. It attempts to do this on load,as well, but load_config callback in a bindingis invoked too early and so the virtio status...
e1000: check buffer availability
Reduce spurious packet drops on RX ring emptyby verifying that we have at least 1 bufferahead of the time.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
virtio-serial: don't crash on invalid input
Fix crash on invalid input in virtio-serial.Discovered by code review, untested.
vhost: fix dirty page handling
vhost was passing a physical address to cpu_physical_memory_set_dirty,which is wrong: we need to translate to ram address first.
Note: this lead to crashes during migration, so the patch...
pci: replace the magic, 256, for the maximum of devfn
Introduce symbol PCI_SLOT_MAX for the # of slots,and replace the magic, 256.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pci: use devfn for pci_find_device() instead of (slot, fn) pair
(slot, fn) pair is somewhat confusing because of ARI.So use devfn for pci_find_device() instead of (slot, fn).
pci: use PCI_DEVFN in pci_get_bus_devfn()
Replace hardcoded logic by a common macro.
pci: use uint8_t for devfn_min
use uint8_t for devfn_min instead of int.
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>...
Merge remote branch 'amit/for-anthony' into staging
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>
vmmouse: Register vmstate via qdev
fix applesmc REV key
Fix applesmc REV key string literal hex encoding.
Signed-off-by: René Rebe <rene@exactcode.de>Acked-by: Alexander Graf <agraf@suse.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
e1000: Fix multi-descriptor packet checksum offload
The PCI/PCI-X Family of Gigabit Ethernet Controllers SoftwareDeveloper’s Manual states the following about the POPTS field:
Provides a number of options which control the handling of this packet. This field is ignored except on the first data descriptor of...
Merge branch 'for-anthony' of git://github.com/bonzini/qemu
Merge branch 'for-anthony' of git://repo.or.cz/qemu/kevin
hw/arm_sysctl.c: Add the Versatile Express system registers
Add support for the Versatile Express SYS_CFG registers, which providea generic means of reading or writing configuration information fromvarious parts of the board. We only implement shutdown and reset....
char: Prevent multiple devices opening same chardev
Prevent:
-chardev socket,path=/tmp/foo,server,nowait,id=c0 \-device virtserialport,chardev=c0,id=vs0 \-device virtserialport,chardev=c0,id=vs1
Reported-by: Mike Cao <bcao@redhat.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>
virtio-console: Keep chardev open for other users after hot-unplug
After a hot-unplug operation, the previous behaviour was to close thechardev. That meant the chardev couldn't be re-used. Also, sincechardev hot-plug isn't possible so far, this means virtio-console...
virtio-serial: Enable ioeventfd
Enable ioeventfd for virtio-serial devices by default. Commit25db9ebe15125deb32958c6df74996f745edf1f9 lists the benefits of usingioeventfd.
Copying a file from guest to host over a virtio-serial channel didn'tshow much difference in time or io_exit rate....
virtio-serial-bus: Simplify handle_output() function
There's no code change, just re-arrangement to simplify the functionafter recent modifications.
Reported-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>
virtio-serial: Don't clear ->have_data() pointer after unplug
After a port unplug operation, the port->info->have_data() pointer wasset to NULL. The problem is, the ->info struct is shared by all ports,effectively disabling writes to other ports.
Reported-by: juzhang <juzhang@redhat.com>...
virtio-serial: Use a struct to pass config information from proxy
Instead of using a single variable to pass to the virtio_serial_initfunction, use a struct so that expanding the number of variables to bepassed on later is easier.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
virtio-serial: Disallow generic ports at id 0
Port 0 is reserved for virtconsole devices for backward compatibilitywith the old -virtioconsole (from qemu 0.12) device type.
libvirt prior to commit 8e28c5d40200b4c5d483bd585d237b9d870372e5 usedport 0 for generic ports. libvirt will no longer do that, but disallow...
change all rt_clock references to use millisecond resolution accessors
This was done with:
sed -i '/get_clock\>.*rt_clock/s/get_clock\>/get_clock_ms/' \ $(git grep -l 'get_clock\>.*rt_clock' ) sed -i '/new_timer\>.*rt_clock/s/new_timer\>/new_timer_ms/' \...
change all other clock references to use nanosecond resolution accessors
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\>' )...
petalogix_ml605_mmu: remove unused variable
Remove a write-only variable, spotted by GCC 4.6.0:/src/qemu/hw/petalogix_ml605_mmu.c: In function 'petalogix_ml605_init':/src/qemu/hw/petalogix_ml605_mmu.c:153:11: error: variable 'serial' set but not used [-Werror=unused-but-set-variable]...
i8254: Fix migration from older versions
qdev conversion broke migration as the previous version used vmstateinstance IDs derived from the iobase. Fix it by registering a legacyalias.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
xilinx: Add AXIENET & DMA models
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
microblaze: Add PetaLogix ml605 MMU little-endian ref design
Add the first Microblaze little endian platform.Platform uses uart16550, axi ethernet, timer, intc.
Signed-off-by: Michal Simek <monstr@monstr.eu>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
Fix ATA SMART and CHECK POWER MODE
This patch fixes two things:
1) CHECK POWER MODE
The error return value wasn't always zero, so it would show up asoffline. Error is now explicitly set to zero.
2) SMART
The smart values that were returned were invalid and tools like skdump...
hw/xen_disk: aio_inflight not released in handling ioreq when nr_segments==0
In hw/xen_disk.c, async writing ioreq is leaked whenioreq->req.nr_segments==0, because `aio_inflight` flag is not releasedproperly (skipped by misplaced "break").
always qemu_cpu_kick after unhalting a cpu
This ensures env->halt_cond is broadcast, and the loop inqemu_tcg_wait_io_event and qemu_kvm_wait_io_event is exitednaturally rather than through a timeout.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
hw/fmopl: Fix buffer access out-of-bounds errors
Index 75 is one too large for AR_TABLE75, DR_TABLE75.This error was reported by cppcheck.
hw/fmopl.c:600: error: Buffer access out-of-bounds: OPL.AR_TABLEhw/fmopl.c:601: error: Buffer access out-of-bounds: OPL.DR_TABLE...
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>...
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....
microblaze: Fix PetaLogix company name
trivial fix.
vmstate: Add a way to send a partial array
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vmstate: be able to store/save a pci device from a pointer
vmstate: move timers to use test instead of version