qemu
15 years agoCosmetics
malc [Sat, 21 Feb 2009 05:48:17 +0000 (05:48 +0000)]
Cosmetics

Avoid repeated creation/initalization/destruction of attr and calls to
getpid

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6633 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAvoid thundering herd problem
malc [Sat, 21 Feb 2009 05:48:15 +0000 (05:48 +0000)]
Avoid thundering herd problem

Broadcast was used so that the I/O threads would wakeup, reset their
ts values and all but one go to sleep, in other words an optimization
to prevent threads from exiting in presence of continuing I/O
activity. Spurious wakeups make the looping around cond_timedwait with
ever reinitialized ts potentially unsafe and as such ts in no longer
reinitilized inside the loop, hence switch to signal is warranted and
this benefits of this particlaur optimization are lost.

(It's worth noting that timed variants of pthread calls use realtime
clock by default, and therefore can hang "forever" should the host
time be changed. Unfortunatelly not all host systems QEMU runs on
support CLOCK_MONOTONIC and/or pthread_condattr_setclock with this
value)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6632 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAvoid infinite loop around timed condition variable
malc [Sat, 21 Feb 2009 05:48:13 +0000 (05:48 +0000)]
Avoid infinite loop around timed condition variable

This can happen due to spurious wakeups

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6631 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoError checking
malc [Sat, 21 Feb 2009 05:48:11 +0000 (05:48 +0000)]
Error checking

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6630 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix branch debugging
blueswir1 [Thu, 19 Feb 2009 20:17:09 +0000 (20:17 +0000)]
Fix branch debugging

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6629 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix cpu_physical_memory_rw() for 64-bit I/O accesses
aurel32 [Wed, 18 Feb 2009 21:37:17 +0000 (21:37 +0000)]
Fix cpu_physical_memory_rw() for 64-bit I/O accesses

KVM uses cpu_physical_memory_rw() to access the I/O devices. When a
read or write with a length of 8-byte is requested, it is split into 2
4-byte accesses.

This has been broken in revision 5849. After this revision, only the
first 4 bytes are actually read/write to the device, as the target
address is changed, so on the next iteration of the loop the next 4
bytes are actually read/written elsewhere (in the RAM for the graphic
card).

This patch fixes screen corruption (and most probably data corruption)
with FreeBSD/amd64. Bug #2556746 in KVM bugzilla.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6628 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAvoid running audio ctl's when vm is not running
malc [Wed, 18 Feb 2009 20:44:04 +0000 (20:44 +0000)]
Avoid running audio ctl's when vm is not running

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6627 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agovirtio: Remove malloc failure checks (Jan Kiszka)
aliguori [Mon, 16 Feb 2009 15:47:27 +0000 (15:47 +0000)]
virtio: Remove malloc failure checks (Jan Kiszka)

No need to check for failing qemu_malloc anymore.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6626 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoGenerate PCI hotplug interrupt only if corespondent EN bit is set. (Gleb Natapov)
aliguori [Mon, 16 Feb 2009 15:36:08 +0000 (15:36 +0000)]
Generate PCI hotplug interrupt only if corespondent EN bit is set. (Gleb Natapov)

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6625 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix GPE registers read/write handling. (Gleb Natapov)
aliguori [Mon, 16 Feb 2009 15:36:03 +0000 (15:36 +0000)]
Fix GPE registers read/write handling. (Gleb Natapov)

For STS register bit are cleared by writing 1 into it.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6624 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agospecify vmchannel as a net option (Gleb Natapov)
aliguori [Mon, 16 Feb 2009 15:34:18 +0000 (15:34 +0000)]
specify vmchannel as a net option (Gleb Natapov)

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6623 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix hardware accelerated video to video copy on Cirrus VGA (Brian Kress)
aliguori [Mon, 16 Feb 2009 14:59:35 +0000 (14:59 +0000)]
Fix hardware accelerated video to video copy on Cirrus VGA (Brian Kress)

cirrus_do_copy() in hw/cirrus_vga.c seems to make some incorrect assumptions
about video memory layout.  It tries to convert addresses to coordinates
assuming that one row of data is (width * depth) bytes long.  The correct way
seems to be to use the pitch fields in the CirrusVGAState structure instead.

Without this patch, I get lots of screen corruption when I try to drag a window
under X as it's passing the wrong coordinates to the display surface for the
copy.  With this patch I can drag a window with no screen corruption.

Signed-off-by: Brian Kress <kressb@moose.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6622 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoSupport multiple VNC clients (Brian Kress)
aliguori [Mon, 16 Feb 2009 14:59:30 +0000 (14:59 +0000)]
Support multiple VNC clients (Brian Kress)

Change structure associated with a display from VncState to a new structure
VncDisplay. Remove client specific fields from VncDisplay. Remove display
specific fields from VncState. Maintain a linked list of VncStates per
VncDisplay structure, update as necessary. When updates/resizes/copies come in
from the hardware, dispatch to all clients.

Signed-off-by: Brian Kress <kressb@moose.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6621 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoUnbreak SDL on Mac OS X
malc [Sun, 15 Feb 2009 20:18:41 +0000 (20:18 +0000)]
Unbreak SDL on Mac OS X

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6620 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAllow disassembling last addresses of the address space
blueswir1 [Fri, 13 Feb 2009 21:44:41 +0000 (21:44 +0000)]
Allow disassembling last addresses of the address space

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6619 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix Sparc64 VGA memory size bug exposed by r6604
blueswir1 [Thu, 12 Feb 2009 17:29:32 +0000 (17:29 +0000)]
Fix Sparc64 VGA memory size bug exposed by r6604

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6618 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoKVM: cpuid function 2: store all values (Amit Shah)
aliguori [Wed, 11 Feb 2009 21:00:43 +0000 (21:00 +0000)]
KVM: cpuid function 2: store all values (Amit Shah)

Incrementing the array index was missed in the previous series which causes
us to not store all the values.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6617 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agomonitor: Don't change VNC server when disabled (Jan Kiszka)
aliguori [Wed, 11 Feb 2009 21:00:38 +0000 (21:00 +0000)]
monitor: Don't change VNC server when disabled (Jan Kiszka)

[ As requested, broken out of the monitor rework series. ]

Avoid a segfault when the user issues 'change vnc' without having vnc
enabled on startup.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6616 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix qemu_realloc() (Kevin Wolf)
aliguori [Wed, 11 Feb 2009 21:00:32 +0000 (21:00 +0000)]
Fix qemu_realloc() (Kevin Wolf)

For qemu_realloc with size == 0 a result of NULL is perfectly fine

Signed-off-by: Kevin Wolf <kwolf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6615 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoTCG: remove obsolete old_op_count profiler field
blueswir1 [Wed, 11 Feb 2009 19:47:39 +0000 (19:47 +0000)]
TCG: remove obsolete old_op_count profiler field

Since we don't generate any "old op" anymore, the old_op_count
is unneeded.

Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6614 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAdd missing r24..r26 to callee save registers
malc [Wed, 11 Feb 2009 18:54:02 +0000 (18:54 +0000)]
Add missing r24..r26 to callee save registers

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6613 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAdd missing r24..r26 to calle save registers
malc [Wed, 11 Feb 2009 18:51:19 +0000 (18:51 +0000)]
Add missing r24..r26 to calle save registers

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6612 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoUse qemu_ram_alloc
blueswir1 [Wed, 11 Feb 2009 18:04:12 +0000 (18:04 +0000)]
Use qemu_ram_alloc

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6611 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu: PCI device, disk and host network hot-add / hot-remove (Marcelo Tosatti)
aliguori [Wed, 11 Feb 2009 15:21:54 +0000 (15:21 +0000)]
qemu: PCI device, disk and host network hot-add / hot-remove (Marcelo Tosatti)

Add monitor command to hot-add PCI devices (nic and storage).

Syntax is:

pci_add pci_addr=[[<domain>:]<bus>:]<slot> nic|storage params

It returns the domain, bus and slot for the newly added device on success.

It is possible to attach a disk to a device after PCI initialization via
the drive_add command. If so, a manual scan of the SCSI bus on the guest
is necessary.

Save QEMUMachine necessary for drive_init.

Add monitor command to hot-remove devices, remove device data on _EJ0 notification.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6610 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoParse full PCI device addresses (Markus Armbruster)
aliguori [Wed, 11 Feb 2009 15:21:48 +0000 (15:21 +0000)]
Parse full PCI device addresses (Markus Armbruster)

This code parses full PCI device addresses.  It then rejects domains
other than zero, because these are not supported in QEMU.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6609 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu: pci hotplug GPE support (Marcelo Tosatti)
aliguori [Wed, 11 Feb 2009 15:21:41 +0000 (15:21 +0000)]
qemu: pci hotplug GPE support (Marcelo Tosatti)

Enable the corresponding bit on the PCIST region and trigger the SCI
and handle the _EJ0 notifications.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6608 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu: initialize hot add system / acpi gpe (Marcelo Tosatti)
aliguori [Wed, 11 Feb 2009 15:21:35 +0000 (15:21 +0000)]
qemu: initialize hot add system / acpi gpe (Marcelo Tosatti)

ACPI GPE support, used by PCI (and CPU) hotplug.

From: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6607 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu: zero ioport_opaque on isa_unassign_ioport (Marcelo Tosatti)
aliguori [Wed, 11 Feb 2009 15:21:29 +0000 (15:21 +0000)]
qemu: zero ioport_opaque on isa_unassign_ioport (Marcelo Tosatti)

If the io port is unassigned, the previous private pointer is
meaningless.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6606 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu: LSI SCSI and e1000 unregister callbacks (Marcelo Tosatti)
aliguori [Wed, 11 Feb 2009 15:21:22 +0000 (15:21 +0000)]
qemu: LSI SCSI and e1000 unregister callbacks (Marcelo Tosatti)

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6605 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu: warn if PCI region is not power of two (Marcelo Tosatti)
aliguori [Wed, 11 Feb 2009 15:21:16 +0000 (15:21 +0000)]
qemu: warn if PCI region is not power of two (Marcelo Tosatti)

Otherwise the PCI size for such regions can be calculated erroneously.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6604 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu: add pci_unregister_device (Marcelo Tosatti)
aliguori [Wed, 11 Feb 2009 15:21:10 +0000 (15:21 +0000)]
qemu: add pci_unregister_device (Marcelo Tosatti)

Unregister the pci device, unassign its IO and memory regions, and free
associated data.

Add a callback so drivers can free device state.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6603 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu: add qemu_free_irqs (Marcelo Tosatti)
aliguori [Wed, 11 Feb 2009 15:21:04 +0000 (15:21 +0000)]
qemu: add qemu_free_irqs (Marcelo Tosatti)

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6602 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu: add cpu_unregister_io_memory and make io mem table index dynamic (Marcelo Tosatti)
aliguori [Wed, 11 Feb 2009 15:20:58 +0000 (15:20 +0000)]
qemu: add cpu_unregister_io_memory and make io mem table index dynamic (Marcelo Tosatti)

So drivers can clear their mem io table entries on exit back to unassigned
state.

Also make the io mem index allocation dynamic.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6601 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu: add net_client_uninit / qemu_find_vlan_client (Marcelo Tosatti)
aliguori [Wed, 11 Feb 2009 15:20:51 +0000 (15:20 +0000)]
qemu: add net_client_uninit / qemu_find_vlan_client (Marcelo Tosatti)

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6600 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu: net/drive add/remove tweaks (Marcelo Tosatti)
aliguori [Wed, 11 Feb 2009 15:20:46 +0000 (15:20 +0000)]
qemu: net/drive add/remove tweaks (Marcelo Tosatti)

Export net/drive add/remove functions for device hotplug usage.

Return the table index on add.

Return failure instead of exiting if limit has been reached
on drive_add.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6599 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu: move drives_opt for external use (Marcelo Tosatti)
aliguori [Wed, 11 Feb 2009 15:20:37 +0000 (15:20 +0000)]
qemu: move drives_opt for external use (Marcelo Tosatti)

Device hotplug will use that structure from a separate
file.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6598 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu: record devfn on block driver instance (Marcelo Tosatti)
aliguori [Wed, 11 Feb 2009 15:20:29 +0000 (15:20 +0000)]
qemu: record devfn on block driver instance (Marcelo Tosatti)

Record PCIDev on the BlockDriverState structure to locate for release
on hot-removal.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6597 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu: drive removal support (Marcelo Tosatti)
aliguori [Wed, 11 Feb 2009 15:20:20 +0000 (15:20 +0000)]
qemu: drive removal support (Marcelo Tosatti)

To be used by hot-remove.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6596 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu: dynamic nic info index allocation (Marcelo Tosatti)
aliguori [Wed, 11 Feb 2009 15:20:03 +0000 (15:20 +0000)]
qemu: dynamic nic info index allocation (Marcelo Tosatti)

Dynamically allocate nic info index, so to reuse indexes when devices are
removed.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6595 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu: dynamic drive/drive_opt index allocation (Marcelo Tosatti)
aliguori [Wed, 11 Feb 2009 15:19:58 +0000 (15:19 +0000)]
qemu: dynamic drive/drive_opt index allocation (Marcelo Tosatti)

Dynamically allocate drive options and drive table index, to reuse
indexes when devices are removed.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6594 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu: return PCIDevice on net device init and record devfn (Marcelo Tosatti)
aliguori [Wed, 11 Feb 2009 15:19:52 +0000 (15:19 +0000)]
qemu: return PCIDevice on net device init and record devfn (Marcelo Tosatti)

Change the PCI network drivers init functions to return the PCIDev, to
inform which slot has been hot-plugged.

Also record PCIDevice structure on NICInfo to locate for release on
hot-removal.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6593 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu: add pci helper functions (Marcelo Tosatti)
aliguori [Wed, 11 Feb 2009 15:19:46 +0000 (15:19 +0000)]
qemu: add pci helper functions (Marcelo Tosatti)

Add pci_find_bus/pci_find_device to be used by PCI hotplug.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6592 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAdd a description for the set_link monitor command.
aliguori [Wed, 11 Feb 2009 15:19:16 +0000 (15:19 +0000)]
Add a description for the set_link monitor command.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6591 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAdd BIOS patches necessary for hotplug (Marcelo Tosatti)
aliguori [Wed, 11 Feb 2009 15:11:43 +0000 (15:11 +0000)]
Add BIOS patches necessary for hotplug (Marcelo Tosatti)

See each patch for appropriate Signed-off-by's.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6590 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoUpdate PC BIOS to latest bits from Bochs
aliguori [Wed, 11 Feb 2009 14:55:47 +0000 (14:55 +0000)]
Update PC BIOS to latest bits from Bochs

A number of patches were merged since we last pulled.

Thanks to Marcelo Tosatti for rebasing the existing patches and testing.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6589 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAdd "static"
blueswir1 [Tue, 10 Feb 2009 19:00:31 +0000 (19:00 +0000)]
Add "static"

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6588 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix fr-be keymap
aurel32 [Mon, 9 Feb 2009 23:19:44 +0000 (23:19 +0000)]
Fix fr-be keymap

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6587 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix AltGr and dead keys with VNC
aurel32 [Mon, 9 Feb 2009 23:19:32 +0000 (23:19 +0000)]
Fix AltGr and dead keys with VNC

(Marcel Zumstein)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6586 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix DEBUG_TCGV compile error.
aurel32 [Mon, 9 Feb 2009 20:43:53 +0000 (20:43 +0000)]
Fix DEBUG_TCGV compile error.

Don't call TCGV_LOW on arg2.  This section of code falls under

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6585 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu_chr_open_tcp: allow ipv4 and ipv6 options
aurel32 [Mon, 9 Feb 2009 20:09:29 +0000 (20:09 +0000)]
qemu_chr_open_tcp: allow ipv4 and ipv6 options

Those new options are parsed in qemu-sockets.c. Allow them instead of
printing "Unknown option".

Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6584 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoUpdate ppc-dis.c from binutils from 4th July, 2007, just before GPLv3 switch
blueswir1 [Mon, 9 Feb 2009 19:59:57 +0000 (19:59 +0000)]
Update ppc-dis.c from binutils from 4th July, 2007, just before GPLv3 switch

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6583 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoUpdate ppc-dis.c from binutils 2.17
blueswir1 [Mon, 9 Feb 2009 19:58:22 +0000 (19:58 +0000)]
Update ppc-dis.c from binutils 2.17

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6582 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoppc newworld: default to a G4 CPU
aurel32 [Mon, 9 Feb 2009 19:03:02 +0000 (19:03 +0000)]
ppc newworld: default to a G4 CPU

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6581 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix crash caused by missing command line arguments
aurel32 [Mon, 9 Feb 2009 19:02:09 +0000 (19:02 +0000)]
Fix crash caused by missing command line arguments

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6580 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoRemove unused code from dyngen-exec.h
aurel32 [Mon, 9 Feb 2009 18:28:36 +0000 (18:28 +0000)]
Remove unused code from dyngen-exec.h

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6579 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoMake qemu-img argument handling POSIX compliant
aurel32 [Mon, 9 Feb 2009 18:14:31 +0000 (18:14 +0000)]
Make qemu-img argument handling POSIX compliant

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6578 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix displaystate (r6344) regression in blizzard
aurel32 [Mon, 9 Feb 2009 17:00:41 +0000 (17:00 +0000)]
Fix displaystate (r6344) regression in blizzard

Testcase:

qemu-system-arm -M n810 -kernel /dev/null -m 130

Without this patch, we get a segfault.

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6577 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-ppc: Model e500v{1,2} CPUs more accurately
aurel32 [Mon, 9 Feb 2009 16:50:00 +0000 (16:50 +0000)]
target-ppc: Model e500v{1,2} CPUs more accurately

The e500v1 chips only have single-precision floating point; don't say we
support the double-precision floating-point instructions on such chips.
Also add an e500v1 -cpu argument for a generic e500v1.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6576 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-ppc: Model SPE floating-point instructions more accurately
aurel32 [Mon, 9 Feb 2009 16:49:50 +0000 (16:49 +0000)]
target-ppc: Model SPE floating-point instructions more accurately

Single-precision and double-precision floating-point instructions should
be separated into their own categories, since some chips only support
single-precision instructions.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6575 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-ppc: Add vrsqrtefp instruction
aurel32 [Mon, 9 Feb 2009 16:49:40 +0000 (16:49 +0000)]
target-ppc: Add vrsqrtefp instruction

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6574 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-ppc: Add vrefp instruction
aurel32 [Mon, 9 Feb 2009 16:49:29 +0000 (16:49 +0000)]
target-ppc: Add vrefp instruction

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6573 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-ppc: Add vct{u,s}xs instructions
aurel32 [Mon, 9 Feb 2009 16:49:20 +0000 (16:49 +0000)]
target-ppc: Add vct{u,s}xs instructions

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6572 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-ppc: Add vcmp{eq, ge, gt, b}fp{, .} instructions
aurel32 [Mon, 9 Feb 2009 16:49:10 +0000 (16:49 +0000)]
target-ppc: Add vcmp{eq, ge, gt, b}fp{, .} instructions

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6571 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-ppc: Add vmaddfp and vnmsubfp instructions
aurel32 [Mon, 9 Feb 2009 16:48:59 +0000 (16:48 +0000)]
target-ppc: Add vmaddfp and vnmsubfp instructions

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6570 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-ppc: Add v{add,sub}fp instructions
aurel32 [Mon, 9 Feb 2009 16:48:51 +0000 (16:48 +0000)]
target-ppc: Add v{add,sub}fp instructions

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6569 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-ppc: Add v{max,min}fp instructions
aurel32 [Mon, 9 Feb 2009 16:48:39 +0000 (16:48 +0000)]
target-ppc: Add v{max,min}fp instructions

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6568 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoKVM: Get all cpuid values from function 2 (Amit Shah)
aliguori [Mon, 9 Feb 2009 15:50:36 +0000 (15:50 +0000)]
KVM: Get all cpuid values from function 2 (Amit Shah)

cpuid function 2 can have multiple values to describe cache behaviour.
Loop till we have fetched all the values.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6567 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoKVM: Fetch sub-leaf cpuid values for functions 4, 0xb, 0xd. (Amit Shah)
aliguori [Mon, 9 Feb 2009 15:50:31 +0000 (15:50 +0000)]
KVM: Fetch sub-leaf cpuid values for functions 4, 0xb, 0xd. (Amit Shah)

CPUID functions 4, 0xb and 0xd have sub-leaf values which depend on the
input value of ECX. Store these values as well.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6566 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoKVM: CPUID takes ecx as input value for some functions (Amit Shah)
aliguori [Mon, 9 Feb 2009 15:50:08 +0000 (15:50 +0000)]
KVM: CPUID takes ecx as input value for some functions (Amit Shah)

The CPUID instruction takes the value of ECX as an input parameter
in addition to the value of EAX as the count for functions 4, 0xb
and 0xd. Make sure we pass the value to the instruction.

Also convert to the qemu-style whitespace for the surrounding code.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6565 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoRemove GenOpFunc typedefs
blueswir1 [Sun, 8 Feb 2009 17:17:52 +0000 (17:17 +0000)]
Remove GenOpFunc typedefs

This patch removes the GenOpFunc typedefs from exec-all.h, which are no
longer needed, now that dyngen has been removed.

Signed-off-by: Stuart Brady <stuart.brady@gmail.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6564 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoUpdate Sparc images
blueswir1 [Sun, 8 Feb 2009 16:08:08 +0000 (16:08 +0000)]
Update Sparc images

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6563 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix UniNorth
blueswir1 [Sun, 8 Feb 2009 16:01:38 +0000 (16:01 +0000)]
Fix UniNorth

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6562 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoUse Mac NVRAM
blueswir1 [Sun, 8 Feb 2009 16:01:01 +0000 (16:01 +0000)]
Use Mac NVRAM

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6561 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoSwitch Mac99 to OpenBIOS
blueswir1 [Sun, 8 Feb 2009 15:59:36 +0000 (15:59 +0000)]
Switch Mac99 to OpenBIOS

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6560 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoQEMU Microsoft serial mouse emulation
aurel32 [Sun, 8 Feb 2009 15:53:20 +0000 (15:53 +0000)]
QEMU Microsoft serial mouse emulation

Adds "msmouse" character device, which emulates a serial mouse.
Use it with -serial msmouse.

Signed-Off-By: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6559 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAdd load/save capability to rc4030 chipset
aurel32 [Sun, 8 Feb 2009 14:56:04 +0000 (14:56 +0000)]
Add load/save capability to rc4030 chipset

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6558 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAdditional VGA options for MIPS Malta
aurel32 [Sun, 8 Feb 2009 14:51:19 +0000 (14:51 +0000)]
Additional VGA options for MIPS Malta

Support all kinds of pci vga cards (including none)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6557 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agofix use of host serial port
aurel32 [Sun, 8 Feb 2009 14:46:17 +0000 (14:46 +0000)]
fix use of host serial port

Signed-off-by: David Ahern <daahern@cisco.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6556 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoUse CMD646 IDE for now
blueswir1 [Sun, 8 Feb 2009 13:05:12 +0000 (13:05 +0000)]
Use CMD646 IDE for now

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6555 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoLoad 32 bit ELF BIOS images also on PPC64
blueswir1 [Sun, 8 Feb 2009 12:50:56 +0000 (12:50 +0000)]
Load 32 bit ELF BIOS images also on PPC64

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6554 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoRename ppc_chrp.c to ppc_newworld.c
blueswir1 [Sun, 8 Feb 2009 12:49:13 +0000 (12:49 +0000)]
Rename ppc_chrp.c to ppc_newworld.c

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6553 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix bug in omap_sx1.c introduced by r6344
aurel32 [Sat, 7 Feb 2009 15:20:14 +0000 (15:20 +0000)]
Fix bug in omap_sx1.c introduced by r6344

This patch changes the QEMUMachine init function not to take a
DisplayState as an argument because is not needed any more;

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6552 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix tosa_dac_recv warning
aurel32 [Sat, 7 Feb 2009 15:19:40 +0000 (15:19 +0000)]
Fix tosa_dac_recv warning

This patch fixes:

/scratch/froydnj/qemu.git/hw/tosa.c:176: warning: no previous prototype for 'tosa_dac_recv'

by making the function static.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6551 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix cpu_arm_handle_mmu_fault warning
aurel32 [Sat, 7 Feb 2009 15:19:20 +0000 (15:19 +0000)]
Fix cpu_arm_handle_mmu_fault warning

This patch fixes:

/scratch/froydnj/qemu.git/target-arm/helper.c:451: warning: no previous prototype for 'cpu_arm_handle_mmu_fault'

by moving the declaration of the function to cpu.h from exec.h.  cpu.h
seems to be the place most other ports declare the corresponding
function.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6550 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoSH4: fix TMU init
aurel32 [Sat, 7 Feb 2009 15:18:47 +0000 (15:18 +0000)]
SH4: fix TMU init

Init the TMU and the ptimer with the correct cpu reset value

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6549 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoSH7750/51: add register BCR3, BCR4, PCR, RTCOR, RTCNT, RTCSR, SDMR2, SDMR3 and fix...
aurel32 [Sat, 7 Feb 2009 15:18:14 +0000 (15:18 +0000)]
SH7750/51: add register BCR3, BCR4, PCR, RTCOR, RTCNT, RTCSR, SDMR2, SDMR3 and fix BCR2 support

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6548 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAdd it_shift
blueswir1 [Sat, 7 Feb 2009 10:48:26 +0000 (10:48 +0000)]
Add it_shift

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6547 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix VGA RAM offsets
blueswir1 [Sat, 7 Feb 2009 09:51:59 +0000 (09:51 +0000)]
Fix VGA RAM offsets

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6546 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix SIGSEGV crash in slirp networking code
blueswir1 [Fri, 6 Feb 2009 21:37:40 +0000 (21:37 +0000)]
Fix SIGSEGV crash in slirp networking code

Fix SIGSEGV crash in networking code (bug was introduced in r6288).
Thanks to Gleb Natapov for finding this fix.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6545 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAdd savevm and reset support for OpenPic
blueswir1 [Fri, 6 Feb 2009 21:30:02 +0000 (21:30 +0000)]
Add savevm and reset support for OpenPic

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6544 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoRevert part of 6531, fix build failure
aurel32 [Fri, 6 Feb 2009 00:49:42 +0000 (00:49 +0000)]
Revert part of 6531, fix build failure

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6543 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoReplace exit() in oom_check with abort()
aliguori [Fri, 6 Feb 2009 00:19:42 +0000 (00:19 +0000)]
Replace exit() in oom_check with abort()

So that we can get a core dump with a stack trace.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6542 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoRevert changes to fmopl.c
aliguori [Fri, 6 Feb 2009 00:15:19 +0000 (00:15 +0000)]
Revert changes to fmopl.c

fmopl.c was taken from MAME and doesn't include QEMU header files so we cannot
use qemu_malloc in it.  It happens to build because C is a silly language.

Unfortunately, it doesn't play nicely with the QEMU headers so lets just revert
the changes that were made to it.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6541 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu:virtio-net: Add VLAN filtering (Alex Williamson)
aliguori [Thu, 5 Feb 2009 22:36:32 +0000 (22:36 +0000)]
qemu:virtio-net: Add VLAN filtering (Alex Williamson)

Use the control virtqueue to allow the guest to enable and manipulate
a VLAN filter table.  This allows us to drop more packets the guest
doesn't want to see.  We define a new VLAN class for the control
virtqueue with commands ADD and DEL with usage defined in virtio-net.h.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6540 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu:virtio-net: Add additional MACs via a filter table (Alex Williamson)
aliguori [Thu, 5 Feb 2009 22:36:28 +0000 (22:36 +0000)]
qemu:virtio-net: Add additional MACs via a filter table (Alex Williamson)

Create a filter table and allow the guest to populate it with the
MAC class control commands.  We manage the size and usage of the
filter table including enabling promiscuous and all-multi modes
as necessary.  The guest should therefore assume the table is
infinite.  Eventually this might allow us to bind directly to a
hardware NIC and manipulate a physical MAC filter.

The specifics of the TABLE_SET command are documented in
virtio-net.h.  Separate buffers in the same command are used
for unicaste and multicast addresses for priority and
sychronization.  With this we can export the VIRTIO_NET_F_CTRL_RX
feature bit.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6539 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu:virtio-net: Enable filtering based on MAC, promisc, broadcast and allmulti ...
aliguori [Thu, 5 Feb 2009 22:36:24 +0000 (22:36 +0000)]
qemu:virtio-net: Enable filtering based on MAC, promisc, broadcast and allmulti (Alex Williamson)

Make use of the new RX_MODE control virtqueue class by dropping
packets the guest doesn't want to see.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6538 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu:virtio-net: Add promiscuous and all-multicast mode bits (Alex Williamson)
aliguori [Thu, 5 Feb 2009 22:36:20 +0000 (22:36 +0000)]
qemu:virtio-net: Add promiscuous and all-multicast mode bits (Alex Williamson)

Add a new RX_MODE control virtqueue class with commands PROMISC and
ALLMULTI and usage documented in virtio-net.h allowing the guest to
manipulate packet receiving options.  We don't export a feature for
this until we also add the MAC filter table.

Note, for compatibility with older guest drivers we need to default
to promiscuous.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6537 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu:virtio-net: Add a virtqueue for control commands from the guest (Alex Williamson)
aliguori [Thu, 5 Feb 2009 22:36:16 +0000 (22:36 +0000)]
qemu:virtio-net: Add a virtqueue for control commands from the guest (Alex Williamson)

This will be used for RX mode, MAC table, VLAN table control, etc...

The control transaction consists of one or more "out" sg entries and
one or more "in" sg entries.  The first out entry contains a header
defining the class and command.  Additional out entries may provide
data for the command.  A response via the ack entry is required
and the guest will typically be waiting for it.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6536 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu:virtio-net: Define ETH_ALEN for use when manipulating MAC addresses (Alex Willia...
aliguori [Thu, 5 Feb 2009 22:36:12 +0000 (22:36 +0000)]
qemu:virtio-net: Define ETH_ALEN for use when manipulating MAC addresses (Alex Williamson)

Makes it much easier to search too.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6535 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu:virtio-net: Allow setting the MAC address via set_config (Alex Williamson)
aliguori [Thu, 5 Feb 2009 22:36:08 +0000 (22:36 +0000)]
qemu:virtio-net: Allow setting the MAC address via set_config (Alex Williamson)

Allow the guest to write to the MAC address config space and update
the network info string when it does.  Rename get_config for symmetry.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6534 c046a42c-6fe2-441c-8c8c-71466251a162