Commit Graph

3537 Commits (6164e6d6e86e8f3f0b5ff7ae08b677026cb291c3)

Author SHA1 Message Date
Gerd Hoffmann af92284bec update bochs vbe interface
The bochs vbe interface got a new register a while back, which specifies
the linear framebuffer size in 64k units.  This patch adds support for
the new register to qemu.  With this patch applied vgabios 0.6c works
with qemu.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-08 11:11:21 +02:00
Stefan Weil f62719ca6f eepro100: fix PCI interrupt pin configuration regression
Commit 15e89f5916
removed this setting, but it is still needed.

Without this patch, e100 device drivers using
interrupts don't work with qemu.

See other nic emulations which also set the
PCI interrupt pin.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-04-07 10:58:00 +03:00
Stefan Weil 269eba0771 eepro100: fix mapping of flash memory
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-04-07 10:58:00 +03:00
Stefan Weil ae543b498c eepro100: Set power management capability using pci_reserve_capability
pci_add_capability automatically updates PCI status and
PCI capability pointer, so use it. Use pci_reserve_capability
to make the new capability appear at the correct offset.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-04-07 10:58:00 +03:00
Stefan Weil 3dec59a1fb eepro100: Set configuration bit for standard TCB
For some devices, this bit is always set.
For the others, it is set by default.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-04-06 15:32:30 +03:00
Stefan Weil db667a1205 eepro100: Add new device variant i82801
This ethernet device is used in Toshiba Tecra 8200 notebooks.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-04-06 15:32:28 +03:00
Stefan Weil 558c86345a eepro100: Simplified device instantiation
By using a private device info structure
(as suggested by Gerd Hoffmann), handling of the
different device variants becomes much easier.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-04-06 15:32:26 +03:00
Stefan Weil 75f5a6cccd eepro100: Simplify status handling
Includes a minor STATUS_NOT_OK -> 0 tweak.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-04-06 15:25:18 +03:00
Stefan Weil e74818f3cd eepro100: Don't allow writing SCBStatus
SCBStatus is readonly, but most drivers which were derived
from the old Linux eepro100.c do a word write to this address
when they want to acknowledge interrupts.

So we have to mask these writes here.

The patch also removes old unused code for status read / write.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-04-06 15:22:46 +03:00
Paul Brook 61d3cf93e2 OHCI qdev conversion
Convert remaining OHCI devices to QDEV interface.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2010-04-05 19:57:40 +01:00
Paul Brook 983fe82611 ARMv7-M reset fixes
Move ARMv7-M PC/SP initialization to the CPU reset routine.  Add a board
reset routine to call this.  Also load values directly from ROM as
images have not been copied yet.

Avoid clearing the NVIC pointer on cpu reset.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2010-04-05 19:43:12 +01:00
Paul Brook 5bd2c0d7a6 UHCI spurious interrut fix
Only raise an interrupt if the TD has actually completed.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2010-04-04 21:48:31 +01:00
Paul Brook a67ba3b6f8 Revert "Compile usb-ohci only once"
This reverts commit f1698408f1.

PCI is always little-endian. Having a user-visible "be" property is just
plain wrong.
2010-04-04 21:18:26 +01:00
Blue Swirl 93c5a32f89 sparc32: add IOMMU chipset doc links
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-03 07:40:47 +00:00
Blue Swirl 240566908f sparc32: rename iommu.c to sun4m_iommu.c to make room for other IOMMUs
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-03 07:35:50 +00:00
Blue Swirl 68fb89a2c0 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.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-03 06:17:35 +00:00
Aurelien Jarno 9caa3ec1e9 hw/r2d: add a USB keyboard
The R2D board does not have a PS/2 port, and only support a keyboard on
the USB bus.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-02 12:16:04 +02:00
TeLeMan 98f22dc172 usb-bus: fix no params
After commit 702f3e0fb5, the params is
nerver NULL. It should check *params instead of params to determine
whether the params is empty.

Signed-off-by: TeLeMan <geleman@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-02 12:12:17 +02:00
Stefan Weil 2b3af99984 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)
/qemu/ar7/hw/virtio.c:776: error: (Each undeclared identifier is reported only once
/qemu/ar7/hw/virtio.c:776: error: for each function it appears in.)

Replacing u_int64_t by uint64_t helps.

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-01 17:01:02 -05:00
Michael S. Tsirkin 9bc6304c15 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 vnet
header capability in tap.

We start/stop backend on driver start/stop as
well as on save and vm start (for migration).

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-01 13:56:43 -05:00
Michael S. Tsirkin d59700553e vhost: vhost net support
This adds vhost net device support in qemu. Will be tied to tap device
and virtio by following patches.  Raw backend is currently missing,
will be worked on/submitted separately.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-01 13:56:43 -05:00
Michael S. Tsirkin ade80dc845 virtio-pci: fill in notifier support
Support host/guest notifiers in virtio-pci.
The last one only with kvm, that's okay
because vhost relies on kvm anyway.

Note on kvm usage: kvm ioeventfd API
is implemented on non-kvm systems as well,
this is the reason we don't need if (kvm_enabled())
around it.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-01 13:56:43 -05:00
Michael S. Tsirkin 2be24aaafe virtio: move typedef to qemu-common
make it possible to use type without header include,
simplifying header dependencies.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-01 13:56:43 -05:00
Michael S. Tsirkin 3e607cb503 virtio: add set_status callback
vhost net backend needs to be notified when
frontend 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>
2010-04-01 13:56:43 -05:00
Michael S. Tsirkin 1cbdabe203 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 set
host/guest notifiers.  Will be used by vhost.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-01 13:56:43 -05:00
Michael S. Tsirkin 2292b33986 notifier: event notifier implementation
event notifiers are slightly generalized eventfd descriptors. Current
implementation depends on eventfd because vhost is the only user, and
vhost depends on eventfd anyway, but a stub is provided for non-eventfd
case.

We'll be able to further generalize this when another user comes along
and we see how to best do this.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-01 13:56:43 -05:00
Anthony Liguori b33612d035 Fix -enable-kvm
Make vl.o compiled per target and fix a thinko in hw/acpi.c.  It's not trivial
to make kvm.h consumable by compiled-once files.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-01 09:58:48 -05:00
Alexander Graf c81131db15 Don't check for bus master for old guests
Older Linux guests don't activate the bus master enable bit. So for those we
can just try to be clever and track if they set the DEVICE_OK bit even though
bus mastering is still disabled.

Under that condition we can disable the windows safety check. With that logic
in place both guests should work just fine. Without PCI hotplug breaks
virtio-net in Linux < 2.6.34 guests.

Signed-off-by: Alexander Graf <agraf@suse.de>
CC: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-31 11:16:52 -05:00
Max Reitz f3571b1a5b usb: class specific interface requests
Mass Storage Reset and Get Max LUN are class specific requests, but
they were not marked as such in hw/usb-msd.c, moved therefore
ClassInterfaceRequest and ClassInterfaceOutRequest from hw/usb-net.c
to hw/usb.h.
Furthermore there was a problem in hw/usb-ohci.c when using DEBUG
concerning systems where size_t is a 32 bit integer (printf resulted
in a segmentation fault).

Signed-off-by: Max Reitz <max@tyndur.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-31 11:16:52 -05:00
Blue Swirl 2b5eb37123 Compile most PPC devices only once
Make byte swapping unconditional since PPC is big endian.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-30 17:36:23 +00:00
Blue Swirl add85a76bb Compile prep_pci only once
Make byte swapping unconditional since PPC is big endian.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-29 19:24:04 +00:00
Blue Swirl 5c4532ee78 Compile openpic only once
Replace TARGET_PAGE_SIZE with 4096. Make byte swapping unconditional
since PPC is big endian.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-29 19:23:59 +00:00
Blue Swirl 02c7c992f0 Compile ide/macio only once
Replace TARGET_PAGE_SIZE with 4096. Make byte swapping unconditional
since PPC is big endian.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-29 19:23:57 +00:00
Blue Swirl 3d08ff698b Compile pflash_cfi01 only once
Push TARGET_WORDS_BIGENDIAN dependency to board level.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-29 19:23:56 +00:00
Blue Swirl 5f9fc5ad7e Compile pflash_cfi02 only once
Push TARGET_WORDS_BIGENDIAN dependency to board level.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-29 19:23:55 +00:00
Blue Swirl 53b67b3052 Compile acpi only once
Use qemu_irqs to trigger CMOS S3 and SMI events.

Avoid using kvm.h, which uses CPUState.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-29 19:23:52 +00:00
Blue Swirl d745bef890 Move KVM and Xen global flags to vl.c
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-29 19:23:49 +00:00
Blue Swirl f8be67ee14 pflash_cfi02: fix incorrect TARGET_FMT_lx/d use
Also use target_phys_addr_t for addresses.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-27 18:24:35 +00:00
Markus Armbruster 9f59b566a6 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>
2010-03-27 14:30:36 +01:00
Adam Litke bd12ff9df7 balloon: Fix overflow when reporting actual memory size
Beginning with its introduction, the virtio balloon has had an overflow error
that causes 'info balloon' to misreport the actual memory size when the balloon
itself becomes larger than 4G.  Use a cast when converting dev->actual from
pages to kB to prevent overflows.

Before:
(qemu) info balloon
balloon: actual=5120
(qemu) balloon 1025
(qemu) info balloon
balloon: actual=1025
(qemu) balloon 1024
(qemu) info balloon
balloon: actual=5120

After:
(qemu) info balloon
balloon: actual=5120
(qemu) balloon 1025
(qemu) info balloon
balloon: actual=1025
(qemu) balloon 1024
(qemu) info balloon
balloon: actual=1024

Signed-off-by: Adam Litke <agl@us.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-27 13:53:34 +01:00
Blue Swirl b970ea8f8d Compile some MIPS devices only once
Move CPU specific declarations to a separate file.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-27 07:26:16 +00:00
Blue Swirl 6450a334c4 Fix build
Actually some systems don't define PAGE_SIZE. Fixes build breakage
by f7736b91c4.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-27 06:58:53 +00:00
Blue Swirl f7736b91c4 Compile ide/core only once
Make win2k install hack unconditional as it is still restricted to
x86 only in vl.c.

Replace TARGET_PAGE_SIZE and 4096 with PAGE_SIZE.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-27 06:20:53 +00:00
Lars Munch 6725f3fa1d Fix recent pxa270 serial breakage
This fixes a copy/paste bug introduced in commit
2d48377a85 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>
2010-03-23 19:26:45 +00:00
Aurelien Jarno 4dcf7d87d9 pci_host: fix breakage
This has been broken by commit 952760bb7b

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-23 09:59:54 +01:00
Blue Swirl c9a43af9af Fix Sparc64 build
952760bb7b missed one change.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-21 20:37:50 +00:00
Blue Swirl 952760bb7b Compile pci_host only once
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>
2010-03-21 19:47:15 +00:00
Blue Swirl f1698408f1 Compile usb-ohci only once
Push TARGET_WORDS_BIGENDIAN dependency to board level.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-21 19:47:12 +00:00
Blue Swirl 2d48377a85 Compile serial only once
Push TARGET_WORDS_BIGENDIAN dependency to board level.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-21 19:47:11 +00:00
Blue Swirl 84108e128e Compile isa_mmio only once
Push TARGET_WORDS_BIGENDIAN dependency to board level.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-21 19:47:09 +00:00
Blue Swirl aa28b9bf9b Move x86 specific PC declarations to a separate file
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>
2010-03-21 19:46:26 +00:00
Anthony Liguori 28695489e3 Revert "Convert atexit users to exit_notifier"
This reverts commit d7234f4d7e.

Conflicts:

	hw/xen_machine_pv.c

This should have never been committed.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-21 14:13:02 -05:00
Blue Swirl 8ec68b06bd Fix a typo
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-21 12:30:46 +00:00
Blue Swirl bafd20cec9 Fix a typo which broke Xen build
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-20 08:55:06 +00:00
Anthony Liguori d7234f4d7e Convert atexit users to exit_notifier
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>
2010-03-19 15:27:38 -05:00
Anthony Liguori 6fef28ee6e 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 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>
2010-03-19 15:27:38 -05:00
Blue Swirl 43dc2a645e Replace assert(0) with abort() or cpu_abort()
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>
2010-03-18 18:41:57 +00:00
Arnaud Patard (Rtp) e5322f76a7 hw/usb-msd: fix some usb requests
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>
2010-03-17 11:17:05 -05:00
Gerd Hoffmann 314b1811c1 scsi-disk: fix buffer overflow
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>
2010-03-17 11:17:05 -05:00
Naphtali Sprei 0056dcc114 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>
2010-03-17 11:16:15 -05:00
Paolo Bonzini d6f4ade214 disentangle tcg and deadline calculation
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>
2010-03-17 11:14:54 -05:00
Adam Litke 6d0ee85040 balloon: Do not save VM state wrt asynchronous virtio operations
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>
2010-03-17 10:42:40 -05:00
Christoph Hellwig 8cfacf0790 block: add logical_block_size property
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>
2010-03-17 10:42:27 -05:00
Jan Kiszka 702f3e0fb5 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>
2010-03-17 10:42:12 -05:00
Anthony Liguori 4a39943bd1 Merge remote branch 'markus/qerror' into staging 2010-03-17 09:44:37 -05:00
Anthony Liguori 7d834c7450 Merge remote branch 'mst/pci' into staging 2010-03-17 09:42:58 -05:00
Paul Brook d4c430a80f Large page TLB flush
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>
2010-03-17 02:44:41 +00:00
Markus Armbruster 8bc27249f0 monitor: convert do_device_add() to QObject 2010-03-16 17:45:35 +01:00
Markus Armbruster c7e4e8ceb3 monitor: Use argument type 'O' for device_add
While there, improve the params help text.
2010-03-16 17:45:35 +01:00
Markus Armbruster 8212c64f0e 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().
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.
2010-03-16 17:45:34 +01:00
Markus Armbruster 0204276bc9 error: Convert do_device_add() to QError
Conversion to QObject is still missing.
2010-03-16 17:45:34 +01:00
Markus Armbruster 3801cf8ae5 Revert "qdev: Use QError for 'device not found' error"
This reverts commit 3ced9f7a36.

The next commit will convert all of qdev_device_add() to QError, and
it'll be clearer with this partial conversion reverted.
2010-03-16 17:45:34 +01:00
Markus Armbruster ac8dae6794 qdev: Convert qbus_find() to QError 2010-03-16 17:45:34 +01:00
Markus Armbruster fc98eb430e qdev: Relax parsing of bus option
Treat multiple successive slashes as a one slash.  Ignore trailing
slashes.  This is how POSIX pathnames work.
2010-03-16 17:45:34 +01:00
Markus Armbruster fdcfa190ab qdev: convert setting device properties to QError 2010-03-16 17:45:26 +01:00
Markus Armbruster 036f7166c7 qdev: Hide "ptr" properties from users
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.
2010-03-16 17:01:08 +01:00
Markus Armbruster c64eafaf0c 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, it
rejected them with a "can't be added via command line" message, which
wasn't quite right for monitor command device_add.
2010-03-16 16:58:32 +01:00
Markus Armbruster 0c17542d90 qdev: Factor qdev_create_from_info() out of qdev_create()
To make it obvious that -device and device_add can't die in
hw_error().
2010-03-16 16:58:32 +01:00
Markus Armbruster 327867b62a qdev: Fix -device and device_add to handle unsuitable bus gracefully
"device_add isa-serial,bus=pci.0" kills QEMU.  Not good.
2010-03-16 16:58:32 +01:00
Markus Armbruster ab5b027ee6 error: Rename qemu_error_new() to qerror_report() 2010-03-16 16:58:32 +01:00
Markus Armbruster 1ecda02b24 error: Replace qemu_error() by error_report()
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.
2010-03-16 16:58:32 +01:00
Markus Armbruster 6fdb03d58c error: Don't abuse qemu_error() for non-error in scsi_hot_add()
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.
2010-03-16 16:55:06 +01:00
Markus Armbruster 53db16b5b0 error: Don't abuse qemu_error() for non-error in qbus_find()
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.
2010-03-16 16:55:05 +01:00
Markus Armbruster 8a9662ca67 error: Don't abuse qemu_error() for non-error in qdev_device_help()
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.
2010-03-16 16:55:05 +01:00
Markus Armbruster 2f7920166d error: Move qemu_error & friends into their own header 2010-03-16 16:55:05 +01:00
Markus Armbruster a44264880e block: Simplify usb_msd_initfn() test for "can read bdrv key"
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.
2010-03-16 16:55:05 +01:00
Markus Armbruster d9346e81de pc: Factor common code out of pc_boot_set() and cmos_init()
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.
2010-03-16 16:55:05 +01:00
Markus Armbruster 8ad00f8425 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 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().
2010-03-16 16:55:05 +01:00
Aurelien Jarno 409dbce54b load_elf: replace the address addend by a translation function
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>
2010-03-16 08:38:05 +01:00
Michael S. Tsirkin 7a7e5db993 pcnet: make subsystem vendor id match hardware
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 d350d97d19,
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>
2010-03-15 13:52:06 +02:00
Michael S. Tsirkin 15e89f5916 eepro100: address pci todo's, use pci_set_xx
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>
2010-03-15 13:52:05 +02:00
Aurelien Jarno 7b9cbadb2b mips: add header to mips_int.c and mips_timer.c
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-14 23:30:44 +01:00
Vagrant Cascadian 66c80e7575 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>
2010-03-14 08:52:55 +00:00
Gerd Hoffmann 995bf0ca57 fdc: fix drive property handling.
Fix the floppy controller init wrappers to set the drive properties
only in case the DriveInfo pointers passed in are non NULL.  This allows
to set the properties using -global.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-13 12:14:16 +01:00
Luiz Capitulino 9eedeb3b88 QMP: Introduce WATCHDOG event
It's emitted whenever the watchdog device's timer expires. The action
taken is provided in the 'data' member.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09 08:47:27 -06:00
Gerd Hoffmann bd87813e8c kbd leds: usb kbd
Add led status notification support to the usb kbd driver.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09 08:47:20 -06:00
Gerd Hoffmann 6937b3766f kbd leds: ps/2 kbd
Add led status notification support to the ps/2 kbd driver.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09 08:47:20 -06:00
Markus Armbruster 32bb404a6a scsi: Make device scsi-disk reject /dev/sg*
You're supposed to use scsi-generic for that.  Which rejects anything
but /dev/sg*.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09 08:47:20 -06:00
Markus Armbruster 27f3f8a362 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
    QEMU 0.12.50 monitor - type 'help' for more information
    (qemu) info network
    Devices not on any VLAN:
      net0: net=10.0.2.0, restricted=n peer=virtio-net-pci.0
      e1000.0: model=e1000,macaddr=52:54:00:12:34:56 peer=net0
      virtio-net-pci.0: model=virtio-net-pci,macaddr=52:54:00:12:34:57 peer=net0

It's all downhill from there.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09 08:47:20 -06:00
Markus Armbruster 6bf38816df qdev: Improve diagnostics for bad property values
Property "vlan" reports "failed to parse" even when the value parses
just 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.

Change PropertyInfo method parse to return an error code, so that
qdev_prop_parse() can report the error more accurately.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09 08:47:19 -06:00