summaryrefslogtreecommitdiffstats
path: root/hw
Commit message (Collapse)AuthorAgeFilesLines
* Fix recent pxa270 serial breakageLars Munch2010-03-231-1/+1
| | | | | | | | | This fixes a copy/paste bug introduced in commit 2d48377a8531de63ec1d0c4b9b1959dc4b78356c that pushed TARGET_WORDS_BIGENDIAN dependency to board level. Signed-off-by: Lars Munch <lars@segv.dk> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* pci_host: fix breakageAurelien Jarno2010-03-231-5/+5
| | | | | | This has been broken by commit 952760bb7bce7fbfe0afcf04fee268745f297b87 Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Fix Sparc64 buildBlue Swirl2010-03-211-1/+1
| | | | | | 952760bb7bce7fbfe0afcf04fee268745f297b87 missed one change. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Compile pci_host only onceBlue Swirl2010-03-217-46/+67
| | | | | | | | | | | Convert pci_host_conf_register_mmio_noswap(x) to pci_host_conf_register_mmio(x, 0). Convert pci_host_conf_register_mmio(x) to pci_host_conf_register_mmio(x, 1) for big endian hosts, all cases happen to be BE. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Compile usb-ohci only onceBlue Swirl2010-03-2111-41/+94
| | | | | | Push TARGET_WORDS_BIGENDIAN dependency to board level. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Compile serial only onceBlue Swirl2010-03-2112-56/+163
| | | | | | Push TARGET_WORDS_BIGENDIAN dependency to board level. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Compile isa_mmio only onceBlue Swirl2010-03-2112-35/+95
| | | | | | Push TARGET_WORDS_BIGENDIAN dependency to board level. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Move x86 specific PC declarations to a separate fileBlue Swirl2010-03-216-17/+24
| | | | | | | | | x86 definitions (especially CPUState uses) prevent many files from being compiled within libhw. Move x86 specific declarations (APIC stuff) to a separate file. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Revert "Convert atexit users to exit_notifier"Anthony Liguori2010-03-214-7/+5
| | | | | | | | | | | | This reverts commit d7234f4d7e373a708e1df9ab565a71b71b189025. Conflicts: hw/xen_machine_pv.c This should have never been committed. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix a typoBlue Swirl2010-03-211-1/+2
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix a typo which broke Xen buildBlue Swirl2010-03-201-1/+1
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Convert atexit users to exit_notifierAnthony Liguori2010-03-194-5/+7
| | | | | | | | All of these users have global state so we really don't see a benefit from exit_notifier. However, using exit_notifier means that there's one less justification for having global state in the first place. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Rewrite mouse handlers to use QTAILQ and to have an activation functionAnthony Liguori2010-03-191-4/+11
| | | | | | | | | | | | | | | | | | | | | 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 it until the guest starts using the tablet. We implement this behavior in order to provide a means to delay registration of a mouse handler since we treat the last registered handler as the current handler. This is a usability problem though as we would like to give the user feedback that they've either 1) not added an absolute device 2) there is an absolute device but the guest isn't using it 3) we have an absolute device and it's active. By using QTAILQ and having an explicit activation function that moves the handler to the front of the queue, we can implement the same semantics as before with respect to automatically switching to usb tablet while providing the user with a whole lot more information. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Replace assert(0) with abort() or cpu_abort()Blue Swirl2010-03-185-30/+30
| | | | | | | | | When building with -DNDEBUG, assert(0) will not stop execution so it must not be used for abnormal termination. Use cpu_abort() when in CPU context, abort() otherwise. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* hw/usb-msd: fix some usb requestsArnaud Patard (Rtp)2010-03-171-3/+5
| | | | | | | | | | The usb-msd device emulation needs some small tweaks in the requests emulations. For instance, the reset/maxlun requests are class/interface specific so requests for them with the type class and recipient interface bits sets have to be handled. Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* scsi-disk: fix buffer overflowGerd Hoffmann2010-03-171-1/+3
| | | | | | | | | In case s->version is shorter than 4 bytes we overflow the memcpy src buffer. Fix it by clearing the target buffer, then copy only the amount of bytes we actually have. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* read-only: Another minor cleanupNaphtali Sprei2010-03-171-2/+1
| | | | | | | 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 calculationPaolo Bonzini2010-03-171-2/+4
| | | | | | | | | | Just tell main_loop_wait whether to be blocking or nonblocking, so that there 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 we have stuff to do". Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* balloon: Do not save VM state wrt asynchronous virtio operationsAdam Litke2010-03-171-9/+0
| | | | | | | | | | | | | | | | When working with the VM state (for loadvm/savevm and migration), it is not valid to load and store pointers since the validity of those pointers cannot be assured in the new qemu address space. Therefore, virtio_balloon_save() and virtio_balloon_load() must not handle the stats-related fields in struct VirtIOBalloon. If a memory stats request is in-flight at the time of a migration or savevm, the request will not complete and should be resubmitted once migration or loadvm completes. Note that this extremely small race window can only be triggered using QMP so it is not possible to hang the user monitor. Signed-off-by: Adam Litke <agl@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* block: add logical_block_size propertyChristoph Hellwig2010-03-173-9/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | Add a logical block size attribute as various guest side tools only increase the filesystem sector size based on it, not the advisory physical block size. For scsi we already have support for a different logical block size in place for CDROMs that we can built upon. Only my recent block device characteristics VPD page needs some fixups. Note that we leave the logial block size for CDROMs hardcoded as the 2k value is expected for it in general. For virtio-blk we already have a feature flag claiming to support a variable logical block size that was added for the s390 kuli hypervisor. Interestingly it does not actually change the units in which the protocol works, which is still fixed at 512 bytes, but only communicates a different minimum I/O granularity. So all we need to do in virtio is to add a trap for unaligned I/O and round down the device size to the next multiple of the logical block size. IDE does not support any other logical block size than 512 bytes. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Avoid crash on '-usbdevice <device>' without parametersJan Kiszka2010-03-171-1/+3
| | | | | | | 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 stagingAnthony Liguori2010-03-1716-179/+208
|\
| * monitor: convert do_device_add() to QObjectMarkus Armbruster2010-03-162-9/+35
| |
| * monitor: Use argument type 'O' for device_addMarkus Armbruster2010-03-161-2/+1
| | | | | | | | While there, improve the params help text.
| * qemu-option: Move the implied first name into QemuOptsListMarkus Armbruster2010-03-163-3/+3
| | | | | | | | | | | | | | | | | | | | | | 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(). For each QemuOptsList, we use at most one such name. Move the name into QemuOptsList, and pass whether to permit the abbreviation. This ensures continued consistency, and simplifies the commit after next in this series.
| * error: Convert do_device_add() to QErrorMarkus Armbruster2010-03-161-10/+9
| | | | | | | | Conversion to QObject is still missing.
| * Revert "qdev: Use QError for 'device not found' error"Markus Armbruster2010-03-161-2/+2
| | | | | | | | | | | | | | This reverts commit 3ced9f7a36189aed94d8bf86f3f5087a53012455. The next commit will convert all of qdev_device_add() to QError, and it'll be clearer with this partial conversion reverted.
| * qdev: Convert qbus_find() to QErrorMarkus Armbruster2010-03-161-11/+14
| |
| * qdev: Relax parsing of bus optionMarkus Armbruster2010-03-161-9/+17
| | | | | | | | | | Treat multiple successive slashes as a one slash. Ignore trailing slashes. This is how POSIX pathnames work.
| * qdev: convert setting device properties to QErrorMarkus Armbruster2010-03-162-10/+7
| |
| * qdev: Hide "ptr" properties from usersMarkus Armbruster2010-03-162-13/+23
| | | | | | | | | | | | | | | | | | | | | | Users can't set them, so qdev_device_help() shouldn't list them. Fix that. Also make qdev_prop_parse() hide them instead of printing a meaningless "has no parser" error message. Their value means nothing to users, so qdev_print_props() shouldn't print it. Fix by removing their print method. Their only use is dirty hacks. Document that.
| * qdev: Hide "no_user" devices from usersMarkus Armbruster2010-03-161-6/+4
| | | | | | | | | | | | | | | | | | 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, it rejected them with a "can't be added via command line" message, which wasn't quite right for monitor command device_add.
| * qdev: Factor qdev_create_from_info() out of qdev_create()Markus Armbruster2010-03-161-15/+22
| | | | | | | | | | To make it obvious that -device and device_add can't die in hw_error().
| * qdev: Fix -device and device_add to handle unsuitable bus gracefullyMarkus Armbruster2010-03-161-0/+5
| | | | | | | | "device_add isa-serial,bus=pci.0" kills QEMU. Not good.
| * error: Rename qemu_error_new() to qerror_report()Markus Armbruster2010-03-161-1/+1
| |
| * error: Replace qemu_error() by error_report()Markus Armbruster2010-03-1613-50/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | error_report() terminates the message with a newline. Strip it it from its arguments. This fixes a few error messages lacking a newline: net_handle_fd_param()'s "No file descriptor named %s found", and tap_open()'s "vnet_hdr=1 requested, but no kernel support for IFF_VNET_HDR available" (all three versions). There's one place that passes arguments without newlines intentionally: load_vmstate(). Fix it up.
| * error: Don't abuse qemu_error() for non-error in scsi_hot_add()Markus Armbruster2010-03-161-4/+6
| | | | | | | | | | | | | | | | Commit 30d335d6 converted an informational message from monitor_printf() to qemu_error(), probably because the latter doesn't need a mon argument. A later commit will make qemu_error() print additional stuff that is only appropriate for proper errors, and then this will break. Clean it up.
| * error: Don't abuse qemu_error() for non-error in qbus_find()Markus Armbruster2010-03-161-20/+17
| | | | | | | | | | | | | | | | | | qbus_find() adds an informational line to error messages, and prints both lines with one qemu_error(). Use error_printf() for the informational line instead. While there, simplify: instead of printing buffers filled by qbus_list_bus() and qbus_list_dev() in one go, make them print it.
| * error: Don't abuse qemu_error() for non-error in qdev_device_help()Markus Armbruster2010-03-161-21/+10
| | | | | | | | | | | | | | | | | | | | qdev_device_help() prints device information with qemu_error(). A later commit will make qemu_error() print additional stuff that is only appropriate for proper errors, and then this will break. Use error_printf() instead. While there, simplify: instead of printing a buffer filled by qdev_print_devinfo() in one go, make qdev_print_devinfo() print it.
| * error: Move qemu_error & friends into their own headerMarkus Armbruster2010-03-166-4/+6
| |
| * block: Simplify usb_msd_initfn() test for "can read bdrv key"Markus Armbruster2010-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The old test assumes that "hotplugged" implies "we have a current monitor for reading the key". This is in fact true, but it's not obviously true. Aside: if it were false, we could pass a null pointer to monitor_read_bdrv_key_start(), which would then crash. The previous commit permits us to check for "we have a current monitor" directly, so do that.
| * pc: Factor common code out of pc_boot_set() and cmos_init()Markus Armbruster2010-03-161-20/+8
| | | | | | | | | | | | | | | | | | | | | | | | Code duplicated in commit 0ecdffbb. The two versions are similar, but not identical: * cmos_init() reports errors to stderr, pc_boot_set() via qemu_error(). The latter is fine for both, so pick that for the common code. * cmos_init() obeys fd_bootchk, pc_boot_set() ignores it. Make it a parameter of the common code.
| * pc: Fix error reporting for -boot onceMarkus Armbruster2010-03-161-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 0ecdffbb created pc_boot_set() for use from monitor command "boot_set", via qemu_boot_set(). pc_boot_set() reports errors to cur_mon, which works fine for monitor code. Commit e0f084bf reused the function int reset handler restore_boot_devices(). Use of cur_mon is problematic in that context. For instance, the "Too many boot devices for PC" error for "-boot order=abcdefgh,once=c" goes to the monitor instead of stderr. The monitor may not even exist. Fix by switching to qemu_error().
* | Merge remote branch 'mst/pci' into stagingAnthony Liguori2010-03-172-62/+35
|\ \
| * | pcnet: make subsystem vendor id match hardwareMichael S. Tsirkin2010-03-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Real pcnet device (AT2450) apparently has subsystem device 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 to associate. qemu sets pci subsystem id to qumranet/qemu since d350d97d196a632b6c7493acf07a061017fc6f7d, debian does not yet have this patch. https://bugzilla.redhat.com/show_bug.cgi?id=521247 Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Anthony Liguori <aliguori@us.ibm.com>
| * | eepro100: address pci todo's, use pci_set_xxMichael S. Tsirkin2010-03-151-62/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | eepro100 uses macros which rely on a specific local variable name (pci_conf) which is scary. Some of the uses are wrong or unnecessary, remove them. The rest are small in number, open-code them using pci_set_xx functions. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* | | Large page TLB flushPaul Brook2010-03-171-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QEMU uses a fixed page size for the CPU TLB. If the guest uses large pages then we effectively split these into multiple smaller pages, and populate the corresponding TLB entries on demand. When the guest invalidates the TLB by virtual address we must invalidate all entries covered by the large page. However the address used to invalidate the entry may not be present in the QEMU TLB, so we do not know which regions to clear. Implementing a full vaiable size TLB is hard and slow, so just keep a simple address/mask pair to record which addresses may have been mapped by large pages. If the guest invalidates this region then flush the whole TLB. Signed-off-by: Paul Brook <paul@codesourcery.com>
* | | load_elf: replace the address addend by a translation functionAurelien Jarno2010-03-1623-100/+157
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few machines need to translate the ELF header addresses into physical addresses. Currently the only possibility is to add a value to the addresses. This patch replaces the addend argument by and a translation function and an opaque passed to the function. A NULL function does not translate the address. The patch also convert all machines that have an addend, simplify the PowerPC kernel loading and fix the MIPS kernel loading using this new feature. Other machines may benefit from this feature. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | mips: add header to mips_int.c and mips_timer.cAurelien Jarno2010-03-142-0/+44
| | | | | | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | spelling typo (compatibilty) in hw/fw_cfg.cVagrant Cascadian2010-03-141-1/+1
| | | | | | | | | | | | | | 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>
OpenPOWER on IntegriCloud