sdk/emulator/qemu.git
13 years agoTCG: fix negative frame offset calculations
Blue Swirl [Sat, 14 May 2011 14:03:22 +0000 (14:03 +0000)]
TCG: fix negative frame offset calculations

size_t is unsigned, so the frame offset calculations can be incorrect for
negative offsets.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoDelegate setup of TCG temporaries to targets
Blue Swirl [Sat, 14 May 2011 12:58:04 +0000 (12:58 +0000)]
Delegate setup of TCG temporaries to targets

Delegate TCG temp_buf setup to targets, so that they can use a stack
frame later instead.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agocpu-exec.c: avoid AREG0 use
Blue Swirl [Sun, 15 May 2011 16:03:25 +0000 (16:03 +0000)]
cpu-exec.c: avoid AREG0 use

Make functions take a parameter for CPUState instead of relying
on global env. Pass CPUState pointer to TCG prologue, which moves
it to AREG0.

Thanks to Peter Maydell and Laurent Desnogues for the ARM prologue
change.

Revert the hacks to avoid AREG0 use on Sparc hosts.

Move cpu_has_work() and cpu_pc_from_tb() from exec.h to cpu.h.

Compile the file without HELPER_CFLAGS.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoRemove exec-all.h include directives
Blue Swirl [Sun, 19 Jun 2011 20:38:22 +0000 (20:38 +0000)]
Remove exec-all.h include directives

Most exec-all.h include directives are now useless, remove them.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoMove cpu_has_work and cpu_pc_from_tb to cpu.h
Blue Swirl [Sat, 21 May 2011 07:10:23 +0000 (07:10 +0000)]
Move cpu_has_work and cpu_pc_from_tb to cpu.h

Move functions cpu_has_work() and cpu_pc_from_tb() from exec.h to cpu.h. This is
needed by later patches.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoexec.h: fix coding style and change cpu_has_work to return bool
Blue Swirl [Sat, 21 May 2011 12:16:05 +0000 (12:16 +0000)]
exec.h: fix coding style and change cpu_has_work to return bool

Before the next patch, fix coding style of the areas affected.

Change the type of the return value from cpu_has_work() and
qemu_cpu_has_work() to bool.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agocpu-exec: unify do_interrupt call
Blue Swirl [Sat, 21 May 2011 08:17:08 +0000 (08:17 +0000)]
cpu-exec: unify do_interrupt call

Now that all targets use common function signature for do_interrupt(), there is no
need for the #ifdeffery anymore.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agom68k: use caller supplied CPUState for interrupt related stuff
Blue Swirl [Sat, 21 May 2011 07:55:24 +0000 (07:55 +0000)]
m68k: use caller supplied CPUState for interrupt related stuff

Pass CPUState to do_interrupt(). This is needed by later patches.

It would be cleaner to move the function to helper.c, but there are
a few dependencies between do_interrupt() and other functions.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agox86: use caller supplied CPUState for interrupt related stuff
Blue Swirl [Mon, 16 May 2011 19:38:48 +0000 (19:38 +0000)]
x86: use caller supplied CPUState for interrupt related stuff

Several x86 specific functions are called from cpu-exec.c with the
assumption that global env register is valid. This will be changed
later, so make the functions use caller supplied CPUState parameter.

It would be cleaner to move the functions to helper.c, but there are
quite a lot of dependencies between do_interrupt() and other functions.

Add helpers for svm_check_intercept() and cpu_cc_compute_all() instead
of calling the helper (which uses global env, AREG0) directly.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agosparc: move do_interrupt to helper.c
Blue Swirl [Sun, 15 May 2011 16:11:04 +0000 (16:11 +0000)]
sparc: move do_interrupt to helper.c

do_interrupt() was mixing CPUState pointer passed from caller
and global env (AREG0).

Fix by moving the function to helper.c. Introduce a helper for calling
change_pstate() safely from outside of execution context.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agosparc: fix coding style of the area to be moved
Blue Swirl [Sat, 21 May 2011 11:41:50 +0000 (11:41 +0000)]
sparc: fix coding style of the area to be moved

Before the next patch, fix coding style of the areas affected.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agocpu_loop_exit: avoid using AREG0
Blue Swirl [Sat, 14 May 2011 12:52:35 +0000 (12:52 +0000)]
cpu_loop_exit: avoid using AREG0

Make cpu_loop_exit() take a parameter for CPUState instead of relying
on global env.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoSparc32: dummy implementation of MXCC MMU breakpoint registers
Blue Swirl [Sat, 18 Jun 2011 20:27:05 +0000 (20:27 +0000)]
Sparc32: dummy implementation of MXCC MMU breakpoint registers

Add dummy registers for SuperSPARC MXCC MMU counter breakpoints, save
and load all MXCC registers.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoFix fallouts from Linux header inclusion
Jan Kiszka [Thu, 23 Jun 2011 08:05:12 +0000 (10:05 +0200)]
Fix fallouts from Linux header inclusion

This is an all-in-one fix for the smaller and bigger mistakes of the
build system changes for accompanied Linux headers:
 - only enable KVM and vhost on Linux hosts
 - fix powerpc asm header symlink
 - do not use Linux headers on non-Linux hosts
 - fix kvmclock for !CONFIG_KVM
 - fix s390 build on non-Linux hosts

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Tested-by: Andreas Färber <andreas.faerber@web.de>
Tested-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agocoreaudio: Fix OSStatus format specifier
Andreas Färber [Thu, 23 Jun 2011 14:24:45 +0000 (16:24 +0200)]
coreaudio: Fix OSStatus format specifier

OSStatus type is defined as SInt32. That's signed int on __LP64__ and
signed long otherwise.
Since it is an explicit 32-bit-width type, cast to corresponsing POSIX type
and use PRId32 format specifier. This avoids a warning on ppc64.

Cc: malc <av1474@comtv.ru>
Signed-off-by: Andreas Faerber <andreas.faerber@web.de>
Signed-off-by: malc <av1474@comtv.ru>
13 years agocoreaudio: Avoid formatting UInt32 type
Andreas Färber [Thu, 23 Jun 2011 14:24:46 +0000 (16:24 +0200)]
coreaudio: Avoid formatting UInt32 type

coreaudioVoiceOut's audioDevicePropertyBufferFrameSize is defined as UInt32
and is being used by reference for AudioDevice{Get,Set}Property().
UInt32 is unsigned int on __LP64__ but unsigned long otherwise.

Cast to POSIX type and use PRIu32 format specifier to hide the details.
This avoids a warning on ppc64.

Cc: malc <av1474@comtv.ru>
Signed-off-by: Andreas Faerber <andreas.faerber@web.de>
Signed-off-by: malc <av1474@comtv.ru>
13 years agonet: Warn about "-net nic" options which were ignored
Peter Maydell [Fri, 20 May 2011 15:50:01 +0000 (16:50 +0100)]
net: Warn about "-net nic" options which were ignored

Diagnose the case where the user asked for a NIC via "-net nic"
but the board didn't instantiate that NIC (for example where the
user asked for two NICs but the board only supports one). Note
that this diagnostic doesn't apply to NICs created through -device,
because those are always instantiated.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agonet: Don't warn about the default network setup
Peter Maydell [Fri, 20 May 2011 15:50:00 +0000 (16:50 +0100)]
net: Don't warn about the default network setup

Don't warn about the default network setup that you get if no command line
-net options are specified.  There are two cases that we would otherwise
complain about:

(1) board doesn't support a NIC but the implicit "-net nic" requested one
(2) CONFIG_SLIRP not set, so the implicit "-net nic" sets up a nic that
isn't connected to anything

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoRevert "net: Improve the warnings for dubious command line option combinations"
Peter Maydell [Fri, 20 May 2011 15:49:59 +0000 (16:49 +0100)]
Revert "net: Improve the warnings for dubious command line option combinations"

This reverts commit f68b9d672b90dedc79aeb9b44607f484dbe46a6b.
That attempt at diagnosing unused -net nic options failed to account
for NICs created via -device; back it out cleanly in preparation
for implementing in a different manner.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoOptimize screendump
Avi Kivity [Mon, 20 Jun 2011 08:12:47 +0000 (11:12 +0300)]
Optimize screendump

When running kvm-autotest, fputc() is often the second highest (sometimes #1)
function showing up in a profile.  This is due to fputc() locking the file
for every byte written.

Optimize by buffering a line's worth of pixels and writing that out in a
single call.

Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoMerge remote-tracking branch 'qmp/for-anthony' into staging
Anthony Liguori [Wed, 22 Jun 2011 12:14:00 +0000 (07:14 -0500)]
Merge remote-tracking branch 'qmp/for-anthony' into staging

13 years agoMerge remote-tracking branch 'qemu-kvm/uq/master' into staging
Anthony Liguori [Wed, 22 Jun 2011 12:13:10 +0000 (07:13 -0500)]
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging

13 years agoMerge remote-tracking branch 'mst/for_anthony' into staging
Anthony Liguori [Wed, 22 Jun 2011 12:11:09 +0000 (07:11 -0500)]
Merge remote-tracking branch 'mst/for_anthony' into staging

Conflicts:
hw/usb-uhci.c

13 years agoMerge remote-tracking branch 'agraf/xen-next' into staging
Anthony Liguori [Wed, 22 Jun 2011 12:07:55 +0000 (07:07 -0500)]
Merge remote-tracking branch 'agraf/xen-next' into staging

13 years agokvm: fix FPU state subsection
Marcelo Tosatti [Tue, 21 Jun 2011 16:53:18 +0000 (13:53 -0300)]
kvm: fix FPU state subsection

There is no need to specify version on the subsection fields.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
13 years agoKVM: Fix XSAVE feature bit enumeration
Andre Przywara [Fri, 10 Jun 2011 13:56:28 +0000 (15:56 +0200)]
KVM: Fix XSAVE feature bit enumeration

When iterating through the XSAVE feature enumeration CPUID leaf (0xD)
we should not stop at the first zero EAX, but instead keep scanning
since there are gaps in the enumeration (ECX=1 for instance).
This fixes the proper usage of AVX in KVM guests.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
13 years agoRemove unneeded kvm.h from cpu-exec.c
Jan Kiszka [Wed, 8 Jun 2011 14:11:06 +0000 (16:11 +0200)]
Remove unneeded kvm.h from cpu-exec.c

This was obsoleted by 6792a57bf1.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
13 years agokvm: x86: Pass KVMState to kvm_arch_get_supported_cpuid
Jan Kiszka [Wed, 8 Jun 2011 14:11:05 +0000 (16:11 +0200)]
kvm: x86: Pass KVMState to kvm_arch_get_supported_cpuid

kvm_arch_get_supported_cpuid checks for global cpuid restrictions, it
does not require any CPUState reference. Changing its interface allows
to call it before any VCPU is initialized.

CC: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
13 years agokvm: Clean up stubs
Jan Kiszka [Wed, 8 Jun 2011 14:11:04 +0000 (16:11 +0200)]
kvm: Clean up stubs

No one references kvm_check_extension, kvm_has_vcpu_events, and
kvm_has_robust_singlestep outside KVM code.

kvm_update_guest_debug is never called, thus has no job besides
returning an error.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
13 years agokvm: ppc: Drop KVM_CAP build dependencies
Jan Kiszka [Wed, 8 Jun 2011 14:11:03 +0000 (16:11 +0200)]
kvm: ppc: Drop KVM_CAP build dependencies

No longer needed with accompanied kernel headers.

CC: Alexander Graf <agraf@suse.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
13 years agokvm: x86: Drop KVM_CAP build dependencies
Jan Kiszka [Wed, 8 Jun 2011 14:11:02 +0000 (16:11 +0200)]
kvm: x86: Drop KVM_CAP build dependencies

No longer needed with accompanied kernel headers.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
13 years agokvm: Drop KVM_CAP build dependencies
Jan Kiszka [Wed, 8 Jun 2011 14:11:01 +0000 (16:11 +0200)]
kvm: Drop KVM_CAP build dependencies

No longer needed with accompanied kernel headers. We are only left with
build dependencies that are controlled by kvm arch headers.

CC: Alexander Graf <agraf@suse.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
13 years agokvm: Drop useless zero-initializations
Jan Kiszka [Wed, 8 Jun 2011 14:11:00 +0000 (16:11 +0200)]
kvm: Drop useless zero-initializations

Backing KVMState is alreay zero-initialized.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
13 years agokvm: ppc: Drop CONFIG_KVM_PPC_PVR
Jan Kiszka [Wed, 8 Jun 2011 14:10:59 +0000 (16:10 +0200)]
kvm: ppc: Drop CONFIG_KVM_PPC_PVR

Required header support is now unconditionally available.

CC: Alexander Graf <agraf@suse.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
13 years agokvm: Drop CONFIG_KVM_PARA
Jan Kiszka [Wed, 8 Jun 2011 14:10:58 +0000 (16:10 +0200)]
kvm: Drop CONFIG_KVM_PARA

The kvm_para.h header is now always available.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
13 years agoSwitch build system to accompanied kernel headers
Jan Kiszka [Wed, 8 Jun 2011 14:10:57 +0000 (16:10 +0200)]
Switch build system to accompanied kernel headers

This helps reducing our build-time checks for feature support in the
available Linux kernel headers. And it helps users that do not have
sufficiently recent headers installed on their build machine.

Consequently, the patch removes and build-time checks for kvm and vhost
in configure, the --kerneldir switch, and KVM_CFLAGS. Kernel headers are
supposed to be provided by QEMU only.

s390 needs some extra love as it carries redefinitions from kernel
headers.

CC: Alexander Graf <agraf@suse.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
13 years agoImport kernel headers
Jan Kiszka [Wed, 8 Jun 2011 14:10:56 +0000 (16:10 +0200)]
Import kernel headers

These kernel headers and the COPYING file were automatically imported
from current Linux git, cb0a02ecf9 (post 3.0-rc2).

Licensing:
asm-powerpc GPLv2
asm-s390 GPLv2
asm-x86 Linux top-level license (GPLv2 with exception)
linux/kvm*: Linux top-level license (GPLv2 with exception)
linux/vhost: Linux top-level license (GPLv2 with exception)
linux/virtio*: 3-clause BSB

CC: Alexander Graf <agraf@suse.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
13 years agoAdd kernel header update script
Jan Kiszka [Wed, 8 Jun 2011 16:22:17 +0000 (18:22 +0200)]
Add kernel header update script

This helper pulls the required kernel headers for KVM and vhost into a
specified directory. The update is triggered via

    scripts/update-linux-headers.sh LINUX_PATH

and will place the output under linux-headers/linux and linux-headers/asm-*.
It also imports the COPYING to care for headers without an explicit license.

CC: Alexander Graf <agraf@suse.de>
CC: Christoph Hellwig <hch@lst.de>
CC: Peter Maydell <peter.maydell@linaro.org>
CC: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
13 years agocmd: fix operator precedence
Frediano Ziglio [Mon, 20 Jun 2011 16:08:57 +0000 (17:08 +0100)]
cmd: fix operator precedence

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agoFix typo in cpus.c
Alexandre Raymond [Tue, 14 Jun 2011 02:16:36 +0000 (22:16 -0400)]
Fix typo in cpus.c

filed -> failed

Signed-off-by: Alexandre Raymond <cerbere@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agolsi: Fix unused-but-set-variable warning
Christophe Fergeau [Wed, 1 Jun 2011 12:56:30 +0000 (14:56 +0200)]
lsi: Fix unused-but-set-variable warning

This warning is new in gcc 4.6.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agokvm: x86: Save/restore FPU OP, IP and DP
Jan Kiszka [Wed, 15 Jun 2011 13:17:26 +0000 (15:17 +0200)]
kvm: x86: Save/restore FPU OP, IP and DP

These FPU states are properly maintained by KVM but not yet by TCG. So
far we unconditionally set them to 0 in the guest which may cause
state corruptions, though not with modern guests.

To avoid breaking backward migration, use a conditional subsection that
is only written if any of the three fields is non-zero. The guest's
FNINIT clears them frequently, and cleared IA32_MISC_ENABLE MSR[2]
reduces the probability of non-zero values further so that this
subsection is not expected to restrict migration in any common scenario.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
13 years agoxen: Add the Xen platform pci device
Steven Smith [Thu, 16 Jun 2011 16:05:17 +0000 (17:05 +0100)]
xen: Add the Xen platform pci device

Introduce a new emulated PCI device, specific to fully virtualized Xen
guests.  The device is necessary for PV on HVM drivers to work.

Signed-off-by: Steven Smith <ssmith@xensource.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
13 years agoxen: fix interrupt routing
Stefano Stabellini [Wed, 15 Jun 2011 16:36:56 +0000 (17:36 +0100)]
xen: fix interrupt routing

Compared to the last version I only added a comment to the code.

- remove i440FX-xen and i440fx_write_config_xen
we don't need to intercept pci config writes to i440FX anymore;

- introduce PIIX3-xen and piix3_write_config_xen
we do need to intercept pci config write to the PCI-ISA bridge to update
the PCI link routing;

- set the number of PIIX3-xen interrupts line to 128;

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
13 years agoxen: only track the linear framebuffer
Stefano Stabellini [Wed, 15 Jun 2011 16:29:27 +0000 (17:29 +0100)]
xen: only track the linear framebuffer

Xen can only do dirty bit tracking for one memory region, so we should
explicitly avoid trying to track anything but the vga vram region.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
13 years agocirrus_vga: reset lfb_addr after a pci config write if the BAR is unmapped
Stefano Stabellini [Fri, 3 Jun 2011 15:56:54 +0000 (16:56 +0100)]
cirrus_vga: reset lfb_addr after a pci config write if the BAR is unmapped

If the cirrus_vga PCI BAR is unmapped than we should not only reset
map_addr but also lfb_addr, otherwise we'll keep trying to map
the old lfb_addr in map_linear_vram.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
13 years agoxen: mapcache performance improvements
Stefano Stabellini [Thu, 19 May 2011 17:35:46 +0000 (18:35 +0100)]
xen: mapcache performance improvements

Use qemu_invalidate_entry in cpu_physical_memory_unmap.

Do not lock mapcache entries in qemu_get_ram_ptr if the address falls in
the ramblock with offset == 0. We don't need to do that because the
callers of qemu_get_ram_ptr either try to map an entire block, other
from the main ramblock, or until the end of a page to implement a single
read or write in the main ramblock.
If we don't lock mapcache entries in qemu_get_ram_ptr we don't need to
call qemu_invalidate_entry in qemu_put_ram_ptr anymore because we can
leave with few long lived block mappings requested by devices.

Also move the call to qemu_ram_addr_from_mapcache at the beginning of
qemu_ram_addr_from_host.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
13 years agoexec.c: refactor cpu_physical_memory_map
Stefano Stabellini [Thu, 19 May 2011 17:35:45 +0000 (18:35 +0100)]
exec.c: refactor cpu_physical_memory_map

Introduce qemu_ram_ptr_length that takes an address and a size as
parameters rather than just an address.

Refactor cpu_physical_memory_map so that we call qemu_ram_ptr_length only
once rather than calling qemu_get_ram_ptr one time per page.
This is not only more efficient but also tries to simplify the logic of
the function.
Currently we are relying on the fact that all the pages are mapped
contiguously in qemu's address space: we have a check to make sure that
the virtual address returned by qemu_get_ram_ptr from the second call on
is consecutive. Now we are making this more explicit replacing all the
calls to qemu_get_ram_ptr with a single call to qemu_ram_ptr_length
passing a size argument.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CC: agraf@suse.de
CC: anthony@codemonkey.ws
Signed-off-by: Alexander Graf <agraf@suse.de>
13 years agoxen: remove xen_map_block and xen_unmap_block
Stefano Stabellini [Thu, 19 May 2011 17:35:44 +0000 (18:35 +0100)]
xen: remove xen_map_block and xen_unmap_block

Replace xen_map_block with qemu_map_cache with the appropriate locking
and size parameters.
Replace xen_unmap_block with qemu_invalidate_entry.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
13 years agoxen: remove qemu_map_cache_unlock
Stefano Stabellini [Thu, 19 May 2011 17:35:43 +0000 (18:35 +0100)]
xen: remove qemu_map_cache_unlock

There is no need for qemu_map_cache_unlock, just use
qemu_invalidate_entry instead.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
13 years agoxen: fix qemu_map_cache with size != MCACHE_BUCKET_SIZE
Stefano Stabellini [Thu, 19 May 2011 17:35:42 +0000 (18:35 +0100)]
xen: fix qemu_map_cache with size != MCACHE_BUCKET_SIZE

Fix the implementation of qemu_map_cache: correctly support size
arguments different from 0 or MCACHE_BUCKET_SIZE.
The new implementation supports locked mapcache entries with size
multiple of MCACHE_BUCKET_SIZE. qemu_invalidate_entry can correctly
find and unmap these "large" mapcache entries given that the virtual
address passed to qemu_invalidate_entry is the same returned by
qemu_map_cache when the locked mapcache entry was created.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
13 years agoxen: Introduce VGA sync dirty bitmap support
Anthony PERARD [Tue, 24 May 2011 13:34:21 +0000 (14:34 +0100)]
xen: Introduce VGA sync dirty bitmap support

This patch introduces phys memory client for Xen.

Only sync dirty_bitmap and set_memory are actually implemented.
migration_log will stay empty for the moment.

Xen can only log one range for bit change, so only the range in the
first call will be synced.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
13 years agoxen: Add xc_domain_add_to_physmap to xen_interface.
Anthony PERARD [Tue, 24 May 2011 13:34:20 +0000 (14:34 +0100)]
xen: Add xc_domain_add_to_physmap to xen_interface.

This function will be used to support sync dirty bitmap.

This come with a check against every Xen release, and special
implementation for Xen version that doesn't have this specific call.

This function will not be usable with Xen 3.3 because the behavior is
different.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
13 years agoReset system before loadvm
Jan Kiszka [Tue, 14 Jun 2011 16:29:45 +0000 (18:29 +0200)]
Reset system before loadvm

In case we load the vmstate during incoming migration, we start from a
clean, default machine state as we went through system reset before. But
if we load from a snapshot, the machine can be in any state. That can
cause troubles if loading an older image which does not carry all state
information the executing QEMU requires. Hardly any device takes care of
this scenario.

However, fixing this is trivial. We just need to issue a system reset
during loadvm as well.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
13 years agoAllow silent system resets
Jan Kiszka [Tue, 14 Jun 2011 16:29:43 +0000 (18:29 +0200)]
Allow silent system resets

This allows qemu_system_reset to be issued silently for internal
purposes, ie. without sending out a monitor event. Convert the system
reset after startup to the silent mode.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
13 years agoerror framework: Fix compilation for w32/w64
Stefan Weil [Mon, 13 Jun 2011 21:01:53 +0000 (23:01 +0200)]
error framework: Fix compilation for w32/w64

The declaration of function error_set() should use macro GCC_FMT_ATTR
instead of gcc's format printf attribute.

For w32/w64, both declarations are different and GCC_FMT_ATTR is needed.
Compilation for w64 even failed with the original code because mingw64
defines a macro for printf.

GCC_FMT_ATTR requires qemu-common.h, so add it in error.c
(it's also included by error_int.h but too late).

Remove assert.h which is included by qemu-common.h.

Cc: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
13 years agowdt: remove unused variables
Michael S. Tsirkin [Tue, 14 Jun 2011 14:29:34 +0000 (17:29 +0300)]
wdt: remove unused variables

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
13 years agoalpha: remove unused variable
Michael S. Tsirkin [Tue, 14 Jun 2011 17:06:06 +0000 (20:06 +0300)]
alpha: remove unused variable

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Richard Henderson <rth@twiddle.net>
13 years agoalpha/translate: remve unused variables
Michael S. Tsirkin [Tue, 14 Jun 2011 15:06:40 +0000 (18:06 +0300)]
alpha/translate: remve unused variables

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Richard Henderson <rth@twiddle.net>
13 years agoget_maintainer: update to match qemu tree
Michael S. Tsirkin [Tue, 14 Jun 2011 17:15:41 +0000 (20:15 +0300)]
get_maintainer: update to match qemu tree

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoget_maintainer.pl: copy utility from Linux
Michael S. Tsirkin [Tue, 14 Jun 2011 17:13:42 +0000 (20:13 +0300)]
get_maintainer.pl: copy utility from Linux

Our MAINTAINERS file format matches Linux so
get the utility to parse it from there.
Updated as of linux 3.0-rc3

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agousb-ehci: move device/vendor/class id to qdev
Michael S. Tsirkin [Tue, 14 Jun 2011 14:15:34 +0000 (17:15 +0300)]
usb-ehci: move device/vendor/class id to qdev

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoppce500: move device/vendor/class id to qdev
Michael S. Tsirkin [Tue, 14 Jun 2011 14:14:52 +0000 (17:14 +0300)]
ppce500: move device/vendor/class id to qdev

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopci: don't call qdev pci init method
Isaku Yamahata [Tue, 14 Jun 2011 22:37:47 +0000 (07:37 +0900)]
pci: don't call qdev pci init method

As pci id initialization is moved to common layer,
some initialization function can be empty.
So don't call init method if NULL.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoMerge remote-tracking branch 'origin/master' into pci
Michael S. Tsirkin [Tue, 14 Jun 2011 14:51:11 +0000 (17:51 +0300)]
Merge remote-tracking branch 'origin/master' into pci

Conflicts:
hw/virtio-pci.c

13 years agohw/9118.c: Implement active-low interrupt support
Peter Maydell [Thu, 26 May 2011 16:34:11 +0000 (17:34 +0100)]
hw/9118.c: Implement active-low interrupt support

The 9118 ethernet controller interrupt line is active low unless
the IRQ config register is programmed to set both the IRQ_POL
(polarity: active-high) and IRQ_TYPE (type: push-pull) bits:
implement support for inverting the irq output in other configurations.
This also requires that we support setting the bits in the first
place, and that we correctly preserve them across software reset.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agoIntroduce format string for pid_t
Andreas Färber [Thu, 2 Jun 2011 17:58:06 +0000 (19:58 +0200)]
Introduce format string for pid_t

BeOS and Haiku on i386 use long for 32-bit types, including pid_t.
Using %d with pid_t therefore results in a warning.

Unfortunately POSIX:2008 does not define a PRId* string for pid_t.

In some places pid_t was previously casted to long and %ld hardcoded.
The predecessor of this patch added another upcast for the simpletrace
filename but was not applied to date.

Since new uses of pid_t with %d keep creeping in, let's instead define
an OS-dependent format string and use that consistently.

Cc: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: Ingo Weinhold <ingo_weinhold@gmx.de>
Cc: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agosmc91c111: qdevify reset
Juha Riihimäki [Tue, 31 May 2011 16:48:23 +0000 (17:48 +0100)]
smc91c111: qdevify reset

Register the smc91c111 reset function as a qdev reset function.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoMerge branch 'cocoa-for-upstream' of git://repo.or.cz/qemu/afaerber
Blue Swirl [Wed, 15 Jun 2011 18:31:56 +0000 (18:31 +0000)]
Merge branch 'cocoa-for-upstream' of git://repo.or.cz/qemu/afaerber

* 'cocoa-for-upstream' of git://repo.or.cz/qemu/afaerber:
  Darwin: Fix compilation warning regarding the deprecated daemon() function
  cocoa: Avoid warning related to multiple handleEvent: definitions
  cocoa: Revert dependency on VNC
  cocoa: Provide central qemu_main() prototype
  Fix libfdt warnings on Darwin
  configure: Fix check for fdatasync()
  Remove warning in printf due to type mismatch
  Cocoa: avoid displaying window when command-line contains '-h' or '-help'
  Fix compilation warning due to incorrectly specified type
  cocoa: do not create a spurious window for -version

13 years agoCommand line support for altering the log file location
Matthew Fernandez [Tue, 7 Jun 2011 16:32:40 +0000 (16:32 +0000)]
Command line support for altering the log file location

Add command line support for logging to a location other than /tmp/qemu.log.

With logging enabled (command line option -d), the log is written to
the hard-coded path /tmp/qemu.log. This patch adds support for writing
the log to a different location by passing the -D option.

Signed-off-by: Matthew Fernandez <matthew.fernandez@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoMerge remote-tracking branch 'alon/pull-libcacard-1' into staging
Anthony Liguori [Wed, 15 Jun 2011 14:03:49 +0000 (09:03 -0500)]
Merge remote-tracking branch 'alon/pull-libcacard-1' into staging

13 years agoMerge remote-tracking branch 'qemu-kvm/uq/master' into staging
Anthony Liguori [Wed, 15 Jun 2011 14:03:33 +0000 (09:03 -0500)]
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging

13 years agoMerge remote-tracking branch 'kraxel/usb.16' into staging
Anthony Liguori [Wed, 15 Jun 2011 14:03:22 +0000 (09:03 -0500)]
Merge remote-tracking branch 'kraxel/usb.16' into staging

13 years agoMerge remote-tracking branch 'kwolf/for-anthony' into staging
Anthony Liguori [Wed, 15 Jun 2011 14:02:18 +0000 (09:02 -0500)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging

13 years agoAllow nested qemu_bh_poll() after BH deletion
Kevin Wolf [Tue, 7 Jun 2011 15:51:21 +0000 (17:51 +0200)]
Allow nested qemu_bh_poll() after BH deletion

Without this, qemu segfaults when a BH handler first deletes its BH and
then calls another function which involves a nested qemu_bh_poll() call.

This can be reproduced by generating an I/O error (e.g. with blkdebug) on
an IDE device and using rerror/werror=stop to stop the VM. When continuing
the VM, qemu segfaults.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agoide: Clear error_status after restarting flush
Kevin Wolf [Fri, 10 Jun 2011 14:32:13 +0000 (16:32 +0200)]
ide: Clear error_status after restarting flush

Clearing the error status flag was missing for restarting flushes. Now that the
error status is separate from the BM status register, we can simply set it to 0
after restarting the request. This ensures that we never forget to clear a bit.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoide: add TRIM support
Christoph Hellwig [Thu, 19 May 2011 08:58:19 +0000 (10:58 +0200)]
ide: add TRIM support

Add support for TRIM sub function of the data set management command,
and wire it up to the qemu discard infrastructure.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoide: allow other dma comands than read and write
Christoph Hellwig [Thu, 19 May 2011 08:58:09 +0000 (10:58 +0200)]
ide: allow other dma comands than read and write

Replace the is_read flag with a dma_cmd flag to allow the dma and
restart logic to handler other commands like TRIM.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agomake dma_bdrv_io available to drivers
Christoph Hellwig [Thu, 19 May 2011 08:57:59 +0000 (10:57 +0200)]
make dma_bdrv_io available to drivers

Make dma_bdrv_io available for drivers, and pass an explicit I/O function
instead of hardcoding bdrv_aio_readv/bdrv_aio_writev.  This is required
to implement non-READ/WRITE dma commands in the ide driver, e.g. the
upcoming TRIM support.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoide: Add forgotten VMSTATE_END_OF_LIST in subsection
Kevin Wolf [Thu, 9 Jun 2011 12:15:18 +0000 (14:15 +0200)]
ide: Add forgotten VMSTATE_END_OF_LIST in subsection

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoide: Fix ide_drive_pio_state_needed()
Kevin Wolf [Thu, 9 Jun 2011 12:12:57 +0000 (14:12 +0200)]
ide: Fix ide_drive_pio_state_needed()

When a failed PIO request caused the VM to stop, we still need to transfer the
PIO state even though DRQ=0 at this point.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoide: Split error status from status register
Kevin Wolf [Thu, 26 May 2011 13:00:34 +0000 (15:00 +0200)]
ide: Split error status from status register

When adding the werror=stop mode, some flags were added to s->status
which are used to determine what kind of operation should be restarted
when the VM is continued.

Unfortunately, it turns out that s->status is in fact a device register
and as such is visible to the guest (some of the abused bits are even
writable for the guest).

For migration we keep on using the old VMState field (renamed to
migration_compat_status) if the status register doesn't use any of the
previously abused bits. If it does, we use a subsection with a clean copy of
the status register.

The error status is always sent in a subsection if there is any error. It can't
use the old field because errors happen even without PCI.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoqcow2: Fix in-flight list after qcow2_cache_put failure
Kevin Wolf [Tue, 24 May 2011 14:40:02 +0000 (16:40 +0200)]
qcow2: Fix in-flight list after qcow2_cache_put failure

If qcow2_cache_put returns an error during cluster allocation and the
allocation fails, it must be removed from the list of in-flight allocations.
Otherwise we'd get a loop in the list when the ACB is used for the next
allocation.

Luckily, this qcow2_cache_put shouldn't fail anyway because the L2 table is
only read, so that qcow2_cache_put doesn't even involve I/O.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
13 years agoReplaced tabs with spaces in block.h and block_int.h
Devin Nakamura [Thu, 9 Jun 2011 05:06:43 +0000 (01:06 -0400)]
Replaced tabs with spaces in block.h and block_int.h

Signed-off-by: Devin Nakamura <devin122@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agovdi: Avoid direct AIO callback
Kevin Wolf [Tue, 7 Jun 2011 14:12:58 +0000 (16:12 +0200)]
vdi: Avoid direct AIO callback

bdrv_aio_* must not call the callback before returning to its caller. In vdi,
this could happen in some error cases. This starts the real requests processing
in a BH to avoid this situation.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoqcow: Avoid direct AIO callback
Kevin Wolf [Tue, 7 Jun 2011 13:20:44 +0000 (15:20 +0200)]
qcow: Avoid direct AIO callback

bdrv_aio_* must not call the callback before returning to its caller. In qcow,
this could happen in some error cases. This starts the real requests processing
in a BH to avoid this situation.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoqcow2: Avoid direct AIO callback
Kevin Wolf [Tue, 7 Jun 2011 13:04:32 +0000 (15:04 +0200)]
qcow2: Avoid direct AIO callback

bdrv_aio_* must not call the callback before returning to its caller. In qcow2,
this could happen in some error cases. This starts the real requests processing
in a BH to avoid this situation.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agokvm: Enable CPU SMEP feature
Yang, Wei Y [Mon, 30 May 2011 15:17:42 +0000 (23:17 +0800)]
kvm: Enable CPU SMEP feature

This patchset enables a new CPU feature SMEP (Supervisor Mode Execution
Protection) in QEMU-KVM. SMEP prevents kernel from executing code in application.
Updated Intel SDM describes this CPU feature. The document will be published soon.

SMEP is identified by CPUID leaf 7 EBX[7], which is 0 before. Get the right value by query KVM kernel module, so that guest can get SMEP through CPUID.

Signed-off-by: Yang, Wei <wei.y.yang@intel.com>
Singed-off-by: Shan, Haitao <haitao.shan@intel.com>
Singed-off-by: Li, Xin <xin.li@intel.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
13 years agokvm: Add CPUID support for VIA CPU
brillywu@viatech.com.cn [Wed, 1 Jun 2011 01:59:52 +0000 (09:59 +0800)]
kvm: Add CPUID support for VIA CPU

When KVM is running on VIA CPU with host cpu's model, the
feautures of VIA CPU will be passed into kvm guest by calling
the CPUID instruction for Centaur.

Signed-off-by: BrillyWu<brillywu@viatech.com.cn>
Signed-off-by: KaryJin<karyjin@viatech.com.cn>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
13 years agousb-ccid: Plug memory leak on qdev exit()
Markus Armbruster [Tue, 24 May 2011 16:09:10 +0000 (18:09 +0200)]
usb-ccid: Plug memory leak on qdev exit()

ccid_initfn() allocates CCIDBus dynamically, but there is no exit
callback to free it.

Fix by getting rid of the allocation.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
13 years agolibcacard: add libcacard.la target
Alon Levy [Sun, 15 May 2011 08:51:28 +0000 (11:51 +0300)]
libcacard: add libcacard.la target

No flag to configure is required. Instead, added a libcacard.la target that
is not built by default, only when requested explicitly via:

mkdir build
cd build
../configure
make libcacard.la
make install-libcacard

Uses libtool to do actual linking of object files and shared library, and
installing. Tested only under linux, but supposed to work on other systems as
well.

If libtool isn't found you get a message complaining about that, only at build
time (since it is not a default target I did not add a message at configure
time).

New build artifacts:
 .libs subdirectories (at <buildroot> and <buildroot>/libcacard)
 *.lo files (at same locations as the respective o files)

Added %.lo : %.c rule that uses libtool.
Updated clean rule to clean up those artifacts.
Added specific rule to call dtrace with libtool wrapper (note that because of
a current upstream dtrace bug fixed by systemtap b1568fd85 commit the -fPIC flag
isn't actually passed on. still current dtrace+libtool produced object links fine).
If libtool is missing any of the following targets will complain and exit 1:
 any subdir: *.lo
 root and libcacard: libcacard.la, libcacard-instsall

Tested to link and load with all tracing backends.

13 years agoconfigure: add libdir and --libdir
Alon Levy [Sun, 15 May 2011 09:08:59 +0000 (12:08 +0300)]
configure: add libdir and --libdir

13 years agoprint meaningful error message in case of --disable-vhost-net
Michael Tokarev [Thu, 9 Jun 2011 20:55:57 +0000 (00:55 +0400)]
print meaningful error message in case of --disable-vhost-net

When qemu gets compiled without support of vhost-net, any attempt
to use it fails with a very clear error message:

 qemu-system-x86_64: -netdev ...,vhost=on: vhost-net requested but could not be initialized

there's absolutely no reason given _why_ it coult not be
initialized, and even strace'ing the process in question
does not reveal any errors.  So print a message telling
what's going on.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agovirtio: compat event idx support
Michael S. Tsirkin [Sun, 12 Jun 2011 13:31:38 +0000 (16:31 +0300)]
virtio: compat event idx support

Disable event index for compat machine types.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agousb-uhci: fix expire time initialization.
Gerd Hoffmann [Fri, 10 Jun 2011 12:38:08 +0000 (14:38 +0200)]
usb-uhci: fix expire time initialization.

expire_time must be initialited when the guest activates the
usb scheduler, not at device creation time.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agohw/usb-ohci.c: Implement remote wakeup
Peter Maydell [Tue, 7 Jun 2011 18:50:12 +0000 (19:50 +0100)]
hw/usb-ohci.c: Implement remote wakeup

Implement the wakeup callback in the OHCI USBPortOps, so that when
a downstream device wakes up it correctly causes the OHCI controller
to come out of suspend.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agohw/usb-ohci.c: Ignore writes to HcPeriodCurrentED register
Peter Maydell [Tue, 7 Jun 2011 19:02:29 +0000 (20:02 +0100)]
hw/usb-ohci.c: Ignore writes to HcPeriodCurrentED register

HcPeriodCurrentED is read-only, but Linux writes to it anyway; silently
ignore this rather than printing a warning message.

(Specifically, drivers/usb/host/ohci-hub.c:ohci_rh_resume() writes a
0, in at least kernels 2.6.25 through 2.6.39.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agousb: Use defines for serial bus release number register for EHCI
Brad Hards [Thu, 2 Jun 2011 01:18:48 +0000 (11:18 +1000)]
usb: Use defines for serial bus release number register for EHCI

Signed-off-by: Brad Hards <bradh@frogmouth.net>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agousb: Use defines for serial bus release number register for UHCI
Brad Hards [Thu, 2 Jun 2011 01:18:47 +0000 (11:18 +1000)]
usb: Use defines for serial bus release number register for UHCI

Signed-off-by: Brad Hards <bradh@frogmouth.net>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agousb: Add defines for USB Serial Bus Release Number register
Brad Hards [Thu, 2 Jun 2011 01:18:46 +0000 (11:18 +1000)]
usb: Add defines for USB Serial Bus Release Number register

Signed-off-by: Brad Hards <bradh@frogmouth.net>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>