eepro100: Set power management capability using pci_reserve_capability
pci_add_capability automatically updates PCI status andPCI capability pointer, so use it. Use pci_reserve_capabilityto make the new capability appear at the correct offset.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
eepro100: fix mapping of flash memory
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
eepro100: Set configuration bit for standard TCB
For some devices, this bit is always set.For the others, it is set by default.
eepro100: Add new device variant i82801
This ethernet device is used in Toshiba Tecra 8200 notebooks.
eepro100: Simplified device instantiation
By using a private device info structure(as suggested by Gerd Hoffmann), handling of thedifferent device variants becomes much easier.
eepro100: Simplify status handling
Includes a minor STATUS_NOT_OK -> 0 tweak.
eepro100: Don't allow writing SCBStatus
SCBStatus is readonly, but most drivers which were derivedfrom the old Linux eepro100.c do a word write to this addresswhen they want to acknowledge interrupts.
So we have to mask these writes here.
The patch also removes old unused code for status read / write....
OHCI qdev conversion
Convert remaining OHCI devices to QDEV interface.
Signed-off-by: Paul Brook <paul@codesourcery.com>
ARMv7-M reset fixes
Move ARMv7-M PC/SP initialization to the CPU reset routine. Add a boardreset routine to call this. Also load values directly from ROM asimages have not been copied yet.
Avoid clearing the NVIC pointer on cpu reset.
UHCI spurious interrut fix
Only raise an interrupt if the TD has actually completed.
Revert "Compile usb-ohci only once"
This reverts commit f1698408f1dcb7548a21828a0b1e2b530fae3af3.
PCI is always little-endian. Having a user-visible "be" property is justplain wrong.
sparc32: add IOMMU chipset doc links
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
sparc32: rename iommu.c to sun4m_iommu.c to make room for other IOMMUs
sparc32: improve timer implementation
Timer with zero period (free-run) will never match.
Timer counting starts with tick value of 0x200, not from 0,so the period must calculated from one tick less than the limit.
hw/r2d: add a USB keyboard
The R2D board does not have a PS/2 port, and only support a keyboard onthe USB bus.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
usb-bus: fix no params
After commit 702f3e0fb52c124c07f215426eeadb70a716643f, the params isnerver NULL. It should check *params instead of params to determinewhether the params is empty.
Signed-off-by: TeLeMan <geleman@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
win32: Fix compiler errors from u_int64_t
u_int64_t raises compiler error messages:
CC libhw32/virtio.o/qemu/ar7/hw/virtio.c: In function ‘virtio_queue_get_avail_size’:/qemu/ar7/hw/virtio.c:776: error: ‘u_int64_t’ undeclared (first use in this function)...
notifier: event notifier implementation
event notifiers are slightly generalized eventfd descriptors. Currentimplementation depends on eventfd because vhost is the only user, andvhost depends on eventfd anyway, but a stub is provided for non-eventfdcase....
virtio: notifier support + APIs for queue fields
vhost needs physical addresses for ring and other queue fields,so add APIs for these. In particular, add binding API to sethost/guest notifiers. Will be used by vhost.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
virtio: add set_status callback
vhost net backend needs to be notified whenfrontend status changes. Add a callback,similar to set_features.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio: move typedef to qemu-common
make it possible to use type without header include,simplifying header dependencies.
virtio-pci: fill in notifier support
Support host/guest notifiers in virtio-pci.The last one only with kvm, that's okaybecause vhost relies on kvm anyway.
Note on kvm usage: kvm ioeventfd APIis implemented on non-kvm systems as well,this is the reason we don't need if (kvm_enabled())...
vhost: vhost net support
This adds vhost net device support in qemu. Will be tied to tap deviceand virtio by following patches. Raw backend is currently missing,will be worked on/submitted separately.
virtio-net: vhost net support
This connects virtio-net to vhost net backend.The code is structured in a way analogous to what we have with vnetheader capability in tap.
We start/stop backend on driver start/stop aswell as on save and vm start (for migration)....
Fix -enable-kvm
Make vl.o compiled per target and fix a thinko in hw/acpi.c. It's not trivialto make kvm.h consumable by compiled-once files.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
usb: class specific interface requests
Mass Storage Reset and Get Max LUN are class specific requests, butthey were not marked as such in hw/usb-msd.c, moved thereforeClassInterfaceRequest and ClassInterfaceOutRequest from hw/usb-net.cto hw/usb.h.Furthermore there was a problem in hw/usb-ohci.c when using DEBUG...
Don't check for bus master for old guests
Older Linux guests don't activate the bus master enable bit. So for those wecan just try to be clever and track if they set the DEVICE_OK bit even thoughbus mastering is still disabled.
Under that condition we can disable the windows safety check. With that logic...
Compile most PPC devices only once
Make byte swapping unconditional since PPC is big endian.
Compile prep_pci only once
Compile openpic only once
Replace TARGET_PAGE_SIZE with 4096. Make byte swapping unconditionalsince PPC is big endian.
Compile ide/macio only once
Compile pflash_cfi01 only once
Push TARGET_WORDS_BIGENDIAN dependency to board level.
Compile pflash_cfi02 only once
Compile acpi only once
Use qemu_irqs to trigger CMOS S3 and SMI events.
Avoid using kvm.h, which uses CPUState.
Move KVM and Xen global flags to vl.c
pflash_cfi02: fix incorrect TARGET_FMT_lx/d use
Also use target_phys_addr_t for addresses.
error: Trim includes after "Move qemu_error & friends..."
Missed in commit 2f792016.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
balloon: Fix overflow when reporting actual memory size
Beginning with its introduction, the virtio balloon has had an overflow errorthat causes 'info balloon' to misreport the actual memory size when the balloonitself becomes larger than 4G. Use a cast when converting dev->actual from...
Compile some MIPS devices only once
Move CPU specific declarations to a separate file.
Fix build
Actually some systems don't define PAGE_SIZE. Fixes build breakageby f7736b91c40a617e93505e32dcbd2cb56aad8a23.
Compile ide/core only once
Make win2k install hack unconditional as it is still restricted tox86 only in vl.c.
Replace TARGET_PAGE_SIZE and 4096 with PAGE_SIZE.
Fix recent pxa270 serial breakage
This fixes a copy/paste bug introduced in commit2d48377a8531de63ec1d0c4b9b1959dc4b78356c that pushed TARGET_WORDS_BIGENDIANdependency to board level.
Signed-off-by: Lars Munch <lars@segv.dk>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
pci_host: fix breakage
This has been broken by commit 952760bb7bce7fbfe0afcf04fee268745f297b87
Fix Sparc64 build
952760bb7bce7fbfe0afcf04fee268745f297b87 missed one change.
Compile pci_host only once
Convert pci_host_conf_register_mmio_noswap(x) topci_host_conf_register_mmio(x, 0).
Convert pci_host_conf_register_mmio(x) topci_host_conf_register_mmio(x, 1) for big endian hosts, all caseshappen to be BE.
Compile usb-ohci only once
Compile serial only once
Compile isa_mmio only once
Move x86 specific PC declarations to a separate file
x86 definitions (especially CPUState uses) prevent many files frombeing compiled within libhw.
Move x86 specific declarations (APIC stuff) to a separate file.
Revert "Convert atexit users to exit_notifier"
This reverts commit d7234f4d7e373a708e1df9ab565a71b71b189025.
Conflicts:
hw/xen_machine_pv.c
This should have never been committed.
Fix a typo
Fix a typo which broke Xen build
Rewrite mouse handlers to use QTAILQ and to have an activation function
And convert usb-hid to use it (to avoid regression with bisection)
Right now, when we do info mice and we've added a usb tablet, we don't see ituntil the guest starts using the tablet. We implement this behavior in order...
Convert atexit users to exit_notifier
All of these users have global state so we really don't see a benefit fromexit_notifier. However, using exit_notifier means that there's one lessjustification for having global state in the first place.
Replace assert(0) with abort() or cpu_abort()
When building with -DNDEBUG, assert(0) will not stop executionso it must not be used for abnormal termination.
Use cpu_abort() when in CPU context, abort() otherwise.
scsi-disk: fix buffer overflow
In case s->version is shorter than 4 bytes we overflow the memcpy srcbuffer. Fix it by clearing the target buffer, then copy only theamount of bytes we actually have.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/usb-msd: fix some usb requests
The usb-msd device emulation needs some small tweaks in the requestsemulations. For instance, the reset/maxlun requests are class/interfacespecific so requests for them with the type class and recipient interfacebits sets have to be handled....
read-only: Another minor cleanup
Don't rely on CDROM hint for read_only attribute
Signed-off-by: Naphtali Sprei <nsprei@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
disentangle tcg and deadline calculation
Just tell main_loop_wait whether to be blocking or nonblocking, so thatthere is no need to call qemu_cpus_have_work from the timer subsystem.Instead, tcg_cpu_exec can say "we want the main loop not to block because...
balloon: Do not save VM state wrt asynchronous virtio operations
When working with the VM state (for loadvm/savevm and migration), it is notvalid to load and store pointers since the validity of those pointers cannot beassured in the new qemu address space. Therefore, virtio_balloon_save() and...
block: add logical_block_size property
Add a logical block size attribute as various guest side tools onlyincrease the filesystem sector size based on it, not the advisoryphysical block size.
For scsi we already have support for a different logical block size...
Avoid crash on '-usbdevice <device>' without parameters
Many usbdevice_init implementors assume params is non-NULL.
Signed-off-by: Jan Kiszka <jan.kiszka@web.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote branch 'markus/qerror' into staging
Merge remote branch 'mst/pci' into staging
Large page TLB flush
QEMU uses a fixed page size for the CPU TLB. If the guest uses largepages then we effectively split these into multiple smaller pages, andpopulate the corresponding TLB entries on demand.
When the guest invalidates the TLB by virtual address we must invalidate...
monitor: Use argument type 'O' for device_add
While there, improve the params help text.
monitor: convert do_device_add() to QObject
qdev: Relax parsing of bus option
Treat multiple successive slashes as a one slash. Ignore trailingslashes. This is how POSIX pathnames work.
qdev: Convert qbus_find() to QError
Revert "qdev: Use QError for 'device not found' error"
This reverts commit 3ced9f7a36189aed94d8bf86f3f5087a53012455.
The next commit will convert all of qdev_device_add() to QError, andit'll be clearer with this partial conversion reverted.
error: Convert do_device_add() to QError
Conversion to QObject is still missing.
qemu-option: Move the implied first name into QemuOptsList
We sometimes permit omitting the first option name, for example-device foo is short for -device driver=foo. The name to use("driver" in the example) is passed as argument to qemu_opts_parse()....
qdev: convert setting device properties to QError
qdev: Hide "ptr" properties from users
Users can't set them, so qdev_device_help() shouldn't list them. Fixthat. Also make qdev_prop_parse() hide them instead of printing ameaningless "has no parser" error message.
Their value means nothing to users, so qdev_print_props() shouldn't...
error: Replace qemu_error() by error_report()
error_report() terminates the message with a newline. Strip it itfrom its arguments.
This fixes a few error messages lacking a newline:net_handle_fd_param()'s "No file descriptor named %s found", andtap_open()'s "vnet_hdr=1 requested, but no kernel support for...
error: Rename qemu_error_new() to qerror_report()
qdev: Fix -device and device_add to handle unsuitable bus gracefully
"device_add isa-serial,bus=pci.0" kills QEMU. Not good.
qdev: Factor qdev_create_from_info() out of qdev_create()
To make it obvious that -device and device_add can't die inhw_error().
qdev: Hide "no_user" devices from users
Users can't create them, so qdev_device_help() shouldn't list them.Fix that.
Also make qdev_device_add() pretend they don't exist. Before, itrejected them with a "can't be added via command line" message, which...
error: Don't abuse qemu_error() for non-error in scsi_hot_add()
Commit 30d335d6 converted an informational message frommonitor_printf() to qemu_error(), probably because the latter doesn'tneed a mon argument. A later commit will make qemu_error() print...
pc: Fix error reporting for -boot once
Commit 0ecdffbb created pc_boot_set() for use from monitor command"boot_set", via qemu_boot_set(). pc_boot_set() reports errors tocur_mon, which works fine for monitor code.
Commit e0f084bf reused the function int reset handler...
pc: Factor common code out of pc_boot_set() and cmos_init()
Code duplicated in commit 0ecdffbb. The two versions are similar, butnot identical:
block: Simplify usb_msd_initfn() test for "can read bdrv key"
The old test assumes that "hotplugged" implies "we have a currentmonitor for reading the key". This is in fact true, but it's notobviously true.
Aside: if it were false, we could pass a null pointer to...
error: Move qemu_error & friends into their own header
error: Don't abuse qemu_error() for non-error in qdev_device_help()
qdev_device_help() prints device information with qemu_error(). Alater commit will make qemu_error() print additional stuff that isonly appropriate for proper errors, and then this will break. Use...
error: Don't abuse qemu_error() for non-error in qbus_find()
qbus_find() adds an informational line to error messages, and printsboth lines with one qemu_error(). Use error_printf() for theinformational line instead.
While there, simplify: instead of printing buffers filled by...
load_elf: replace the address addend by a translation function
A few machines need to translate the ELF header addresses into physicaladdresses. Currently the only possibility is to add a value to theaddresses.
This patch replaces the addend argument by and a translation function...
pcnet: make subsystem vendor id match hardware
Real pcnet device (AT2450) apparently has subsystemdevice and vendor id set to 0, this is out of spec(which requires that vendor id is obtained from PCI SIG)but windows xp driver seems to need this in order...
eepro100: address pci todo's, use pci_set_xx
eepro100 uses macros which rely on a specificlocal variable name (pci_conf) which is scary.Some of the uses are wrong or unnecessary,remove them. The rest are small in number, open-codethem using pci_set_xx functions....
mips: add header to mips_int.c and mips_timer.c
spelling typo (compatibilty) in hw/fw_cfg.c
here's a trivial patch to fix the spelling of "compatibility":
Signed-off-by: Vagrant Cascadian <vagrant@freegeek.org>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
fdc: fix drive property handling.
Fix the floppy controller init wrappers to set the drive propertiesonly in case the DriveInfo pointers passed in are non NULL. This allowsto set the properties using -global.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
QMP: Introduce WATCHDOG event
It's emitted whenever the watchdog device's timer expires. The actiontaken is provided in the 'data' member.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev: Catch attempt to attach more than one device to a netdev
Guest device and host netdev are peers, i.e. it's a 1:1 relation.However, we fail to enforce that:
$ qemu -nodefaults --nographic -netdev user,id=net0 -device e1000,netdev=net0 -device virtio-net-pci,netdev=net0 -monitor stdio...
scsi: Make device scsi-disk reject /dev/sg*
You're supposed to use scsi-generic for that. Which rejects anythingbut /dev/sg*.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
kbd leds: ps/2 kbd
Add led status notification support to the ps/2 kbd driver.
kbd leds: usb kbd
Add led status notification support to the usb kbd driver.
qdev: Improve diagnostics for bad property values
Property "vlan" reports "failed to parse" even when the value parsesjust fine, but the result doesn't name an existing VLAN.
Similarly, properties "drive", "chr" and "netdev" misleadingly report"failed to parse" when the value doesn't name an existing host device....
qdev: Add a DEV_NVECTORS_UNSPECIFIED enum for unspecified nr of MSI vectors
net.c used a constant to signify no MSI vectors were specified. Extendthat to all qdev devices.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Reported-by: "Michael S. Tsirkin" <mst@redhat.com>...
virtio-pci: Use DEV_NVECTORS_UNSPECIFIED instead of -1 for virtio-serial
Use the named constant instead of -1.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Reported-by: "Michael S. Tsirkin" <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>