sdk/emulator/qemu.git
13 years agopci/aer: factor out common code
Michael S. Tsirkin [Wed, 8 Dec 2010 08:46:28 +0000 (17:46 +0900)]
pci/aer: factor out common code

Same logic is used to assert interrupts
and send msix messages, so add a static functin for this.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopci/aer: remove dead code
Michael S. Tsirkin [Wed, 8 Dec 2010 08:46:27 +0000 (17:46 +0900)]
pci/aer: remove dead code

Remove some unused variables and return values.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
13 years agopci/aer: fix interrupt on config write
Michael S. Tsirkin [Wed, 8 Dec 2010 08:46:26 +0000 (17:46 +0900)]
pci/aer: fix interrupt on config write

config write handling for aer seems broken:
For example, it won't clear a level interrupt
when command register is set to 0.

Make it match the spec: level should equal
the logical or of enabled bits, msi only
be sent when the logical or changes.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
13 years agopci/aer: fix error injection
Michael S. Tsirkin [Wed, 8 Dec 2010 08:46:25 +0000 (17:46 +0900)]
pci/aer: fix error injection

Fix the injection logic upon aer message to follow 6.2.4.1.2 more
closely: specifically only send an msi interrupt when the logical or of
the enabled bits changed, not when a bit which was previously clear
becomes set.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
13 years agoMakefile: make msix/msi depend on CONFIG_PCI
Michael S. Tsirkin [Wed, 8 Dec 2010 08:46:24 +0000 (17:46 +0900)]
Makefile: make msix/msi depend on CONFIG_PCI

Possible now that pci is not depending on these.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopci: untangle pci/msi dependency
Michael S. Tsirkin [Wed, 8 Dec 2010 08:46:23 +0000 (17:46 +0900)]
pci: untangle pci/msi dependency

msi depends on pci but pci should not depend on msi.
The only dependency we have is a recent addition
of pci_msi_ functions, IMO they add little enough to
open-code in the small number of users.

Follow-up patches add more cleanups.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
13 years agopci: make command SERR bit writable
Isaku Yamahata [Fri, 26 Nov 2010 12:01:41 +0000 (21:01 +0900)]
pci: make command SERR bit writable

pcie aer needs SERR bit to be writable, and the PCI spec requires
this as well.  For compatibility, introduce compat global property
command_serr_enable and make this bit readonly for a pre 0.14 pc
machine.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agovirtio-net: stop/start bh when appropriate
Michael S. Tsirkin [Mon, 22 Nov 2010 17:52:30 +0000 (19:52 +0200)]
virtio-net: stop/start bh when appropriate

Avoid sending out packets, and modifying
memory, when VM is stopped.
Add assert statements to verify this does not happen.

Avoid scheduling bh when vhost-net is started.

Stop bh when driver disabled bus mastering
(we must not access memory after this).

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Jason Wang <jasowang@redhat.com>
13 years agovirtio-net: don't dma while vm is stopped
Michael S. Tsirkin [Mon, 22 Nov 2010 17:52:19 +0000 (19:52 +0200)]
virtio-net: don't dma while vm is stopped

DMA into memory while VM is stopped makes it
hard to debug migration (consequitive saves
result in different files).
Fixing this completely is a large effort,
this patch does this for virtio-net.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Jason Wang <jasowang@redhat.com>
13 years agomigration/savevm: no need to flush requests
Michael S. Tsirkin [Mon, 22 Nov 2010 17:52:26 +0000 (19:52 +0200)]
migration/savevm: no need to flush requests

There's no need to flush requests after vmstop
as vmstop does it for us automatically now.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Jason Wang <jasowang@redhat.com>
13 years agocpus: flush all requests on each vm stop
Michael S. Tsirkin [Mon, 22 Nov 2010 17:52:22 +0000 (19:52 +0200)]
cpus: flush all requests on each vm stop

Flush all requests once we have stopped all
cpus and devices.
Make sure disk is in consistent state.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Jason Wang <jasowang@redhat.com>
Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
13 years agonet/sock: option to specify local address
Mike Ryan [Wed, 1 Dec 2010 19:16:47 +0000 (11:16 -0800)]
net/sock: option to specify local address

Add an option to specify the host IP to send multicast packets from,
when using a multicast socket for networking. The option takes an IP
address and sets the IP_MULTICAST_IF socket option, which causes the
packets to use that IP's interface as an egress.

This is useful if the host machine has several interfaces with several
virtual networks across disparate interfaces.

Signed-off-by: Mike Ryan <mikeryan@ISI.EDU>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoppc: kvm: fix signedness warning
Alexander Graf [Thu, 25 Nov 2010 07:20:46 +0000 (08:20 +0100)]
ppc: kvm: fix signedness warning

I get a warning on a signed comparison with an unsigned variable, so
let's make the variable signed and be happy.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
13 years agoSpeedup 'tb_find_slow' by using the same heuristic as during memory page lookup
Kirill Batuzov [Thu, 2 Dec 2010 13:12:46 +0000 (16:12 +0300)]
Speedup 'tb_find_slow' by using the same heuristic as during memory page lookup

Move the last found TB to the head of the list so it will be found more quickly next time it will be looked for.

Signed-off-by: Kirill Batuzov <batuzovk@ispras.ru>
Signed-off-by: Pavel Yushchenko <pau@ispras.ru>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoRemove unused spin_trylock() function
Peter Maydell [Wed, 1 Dec 2010 19:44:38 +0000 (19:44 +0000)]
Remove unused spin_trylock() function

Remove the spin_trylock() function, as it is not used anywhere,
and is not even implemented if CONFIG_USE_NPTL is defined.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agodarwin-user: Use GCC_FMT_ATTR (format checking)
Stefan Weil [Mon, 15 Nov 2010 20:00:48 +0000 (21:00 +0100)]
darwin-user: Use GCC_FMT_ATTR (format checking)

The redundant forward declaration of qerror in machload.c
is removed because it should be taken from qemu.h.

Please note that this patch is untested because
I have no matching environment to compile it.

Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoaudio: Use GCC_FMT_ATTR (format checking)
Stefan Weil [Mon, 15 Nov 2010 19:54:12 +0000 (20:54 +0100)]
audio: Use GCC_FMT_ATTR (format checking)

Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agotarget-sparc: Use fprintf_function (format checking)
Stefan Weil [Mon, 15 Nov 2010 18:58:41 +0000 (19:58 +0100)]
target-sparc: Use fprintf_function (format checking)

This change was missing in commit
9a78eead0c74333a394c0f7bbfc4423ac746fcd5.

Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years ago*-dis: Replace fprintf_ftype by fprintf_function (format checking)
Stefan Weil [Mon, 15 Nov 2010 18:39:43 +0000 (19:39 +0100)]
*-dis: Replace fprintf_ftype by fprintf_function (format checking)

This patch adds more printf format checking.

Additional modifications were needed for this code change:

* alpha-dis.c: The local definition of MAX conflicts with
  a previous definition from osdep.h, so add an #undef.

* dis-asm.h: Add include for fprintf_function (qemu-common.h).
  The standard (now redundant) includes are removed.

* mis-dis.c: The definition of ARRAY_SIZE is no longer needed
  and must be removed (conflict with previous definition from
  qemu-common.h).

* sh4-dis.c: Remove some unneeded forward declarations.

Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoFix mingw32 and OpenBSD warnings
Blue Swirl [Sat, 4 Dec 2010 17:37:35 +0000 (17:37 +0000)]
Fix mingw32 and OpenBSD warnings

ffsl() is not universally available, so there are these warnings
on both mingw32 and OpenBSD:
/src/qemu/hw/pcie_aer.c: In function 'pcie_aer_update_log':
/src/qemu/hw/pcie_aer.c:399: warning: implicit declaration of function 'ffsl'

Since status field in PCIEAERErr is uint32_t, we can just use ffs() instead.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoMerge branch 'linux-user-for-upstream' of git://gitorious.org/qemu-maemo/qemu
Edgar E. Iglesias [Sat, 4 Dec 2010 03:18:28 +0000 (04:18 +0100)]
Merge branch 'linux-user-for-upstream' of git://gitorious.org/qemu-maemo/qemu

* 'linux-user-for-upstream' of git://gitorious.org/qemu-maemo/qemu:
  linux-user: fix mips and ppc to use UID16
  update binfmt conf
  linux-user: fix compiler error on nptl
  ARM: linux-user: Restore iWMMXT state from ucontext on sigreturn
  ARM: linux-user: Expose iWMMXT registers to signal handlers
  ARM: linux-user: Restore VFP state from ucontext on sigreturn
  ARM: linux-user: Expose VFP registers to signal handlers
  ARM: Expose vfp_get_fpscr() and vfp_set_fpscr() to C code
  ARM: linux-user: Correct size of padding in target_ucontext_v2
  target-sparc: remove unused functions cpu_lock(), cpu_unlock()
  ARM: enable XScale/iWMMXT in linux-user mode
  linux-user: Translate getsockopt level option
  linux-user: remove unnecessary local from __get_user(), __put_user()
  linux-user: fix memory leaks with NPTL emulation
  linux-user: mmap_reserve() not controlled by RESERVED_VA
  [PATCH] target-arm: remove unused functions cpu_lock(), cpu_unlock()

13 years agoexec: Remove debugging fprintf() that slipped into qemu_ram_alloc_from_ptr()
Stefan Hajnoczi [Fri, 3 Dec 2010 17:09:01 +0000 (17:09 +0000)]
exec: Remove debugging fprintf() that slipped into qemu_ram_alloc_from_ptr()

Remove the debugging fprintf() slipped in via the following commit:

    commit b2e0a138e77245290428a7d599a929e2e1bfe510
    Author: Michael S. Tsirkin <mst@redhat.com>
    Date:   Mon Nov 22 19:52:34 2010 +0200

        migration: stable ram block ordering

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agolinux-user: fix mips and ppc to use UID16
Martin Mohring [Sun, 7 Nov 2010 19:31:57 +0000 (20:31 +0100)]
linux-user: fix mips and ppc to use UID16

Signed-off-by: Martin Mohring <martin.mohring@5edatasoft.com>
Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
13 years agoupdate binfmt conf
Riku Voipio [Wed, 1 Dec 2010 12:53:10 +0000 (14:53 +0200)]
update binfmt conf

1) dont register i386 qemu on x86_64 host
2) widen sparc and arm match
3) add sh4, based on patch by David Kozub <zub@linux.fjfi.cvut.cz>

Rest based on patch by Jan-Simon Möller <jsmoeller@linuxfoundation.org>

13 years agolinux-user: fix compiler error on nptl
Riku Voipio [Fri, 26 Nov 2010 14:21:34 +0000 (16:21 +0200)]
linux-user: fix compiler error on nptl

Some compilers detect that new_stack isnt used after dd75d784

Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
13 years agoARM: linux-user: Restore iWMMXT state from ucontext on sigreturn
Peter Maydell [Wed, 24 Nov 2010 15:20:08 +0000 (15:20 +0000)]
ARM: linux-user: Restore iWMMXT state from ucontext on sigreturn

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
13 years agoARM: linux-user: Expose iWMMXT registers to signal handlers
Peter Maydell [Wed, 24 Nov 2010 15:20:07 +0000 (15:20 +0000)]
ARM: linux-user: Expose iWMMXT registers to signal handlers

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
13 years agoARM: linux-user: Restore VFP state from ucontext on sigreturn
Peter Maydell [Wed, 24 Nov 2010 15:20:06 +0000 (15:20 +0000)]
ARM: linux-user: Restore VFP state from ucontext on sigreturn

Restore the VFP registers from the ucontext on return from a signal
handler in linux-user mode. This means that signal handlers cannot
accidentally corrupt the interrupted code's VFP state, and allows
them to deliberately modify the state via the ucontext structure.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
13 years agoARM: linux-user: Expose VFP registers to signal handlers
Peter Maydell [Wed, 24 Nov 2010 15:20:05 +0000 (15:20 +0000)]
ARM: linux-user: Expose VFP registers to signal handlers

For ARM linux-user mode signal handlers, fill in the ucontext with
VFP register contents in the same way that the kernel does. We only
do this for v2 format sigframe (2.6.12 and above); this is actually
bug-for-bug compatible with the older kernels, which don't save and
restore VFP registers either.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
13 years agoARM: Expose vfp_get_fpscr() and vfp_set_fpscr() to C code
Peter Maydell [Wed, 24 Nov 2010 15:20:04 +0000 (15:20 +0000)]
ARM: Expose vfp_get_fpscr() and vfp_set_fpscr() to C code

Expose the vfp_get_fpscr() and vfp_set_fpscr() functions to C
code as well as generated code, so we can use them to read and
write the FPSCR when saving and restoring VFP registers across
signal handlers in linux-user mode.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
13 years agoARM: linux-user: Correct size of padding in target_ucontext_v2
Peter Maydell [Wed, 24 Nov 2010 15:20:03 +0000 (15:20 +0000)]
ARM: linux-user: Correct size of padding in target_ucontext_v2

The padding in the target_ucontext_v2 is defined by the size of
the target's sigset_t type, not the host's. (This bug only causes
problems when we start using the uc_regspace[] array to expose
VFP registers to userspace signal handlers.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
13 years agotarget-sparc: remove unused functions cpu_lock(), cpu_unlock()
Peter Maydell [Fri, 19 Nov 2010 13:54:39 +0000 (13:54 +0000)]
target-sparc: remove unused functions cpu_lock(), cpu_unlock()

13 years agoARM: enable XScale/iWMMXT in linux-user mode
Peter Maydell [Fri, 19 Nov 2010 15:36:47 +0000 (15:36 +0000)]
ARM: enable XScale/iWMMXT in linux-user mode

In linux-user mode, the XScale/iWMMXT coprocessors must be enabled
at reset so that we can run code that uses these instructions.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 years agolinux-user: Translate getsockopt level option
Jamie Lentin [Fri, 26 Nov 2010 13:04:08 +0000 (15:04 +0200)]
linux-user: Translate getsockopt level option

n setsockopt, the socket level options are translated to the hosts'
architecture before the real syscall is called, e.g.
TARGET_SO_TYPE -> SO_TYPE. This patch does the same with getsockopt.

Tested on a x86 host emulating MIPS.  Without it:-

$ grep getsockopt host.strace
31311 getsockopt(3, SOL_SOCKET, 0x1007 /* SO_??? */, 0xbff17208,
0xbff17204) = -1 ENOPROTOOPT (Protocol not available)

With:-

$ grep getsockopt host.strace
25706 getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0

Whitespace cleanup: Riku Voipio

Signed-off-by: Jamie Lentin <jm@lentin.co.uk>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
13 years agolinux-user: remove unnecessary local from __get_user(), __put_user()
Peter Maydell [Mon, 8 Nov 2010 18:13:58 +0000 (18:13 +0000)]
linux-user: remove unnecessary local from __get_user(), __put_user()

Remove an unnecessary local variable from the __get_user() and
__put_user() macros. This avoids confusing compilation failures
if the name of the local variable ('size') happens to be the
same as the variable the macro user is trying to read/write.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
13 years agolinux-user: fix memory leaks with NPTL emulation
Nathan Froyd [Fri, 29 Oct 2010 14:48:57 +0000 (07:48 -0700)]
linux-user: fix memory leaks with NPTL emulation

Running programs that create large numbers of threads, such as this
snippet from libstdc++'s pthread7-rope.cc:

  const int max_thread_count = 4;
  const int max_loop_count = 10000;
  ...
  for (int j = 0; j < max_loop_count; j++)
    {
      ...
      for (int i = 0; i < max_thread_count; i++)
pthread_create (&tid[i], NULL, thread_main, 0);

      for (int i = 0; i < max_thread_count; i++)
pthread_join (tid[i], NULL);
    }

in user-mode emulation will quickly run out of memory.  This is caused
by a failure to free memory in do_syscall prior to thread exit:

          /* TODO: Free CPU state.  */
          pthread_exit(NULL);

The first step in fixing this is to make all TaskStates used by QEMU
dynamically allocated.  The TaskState used by the initial thread was
not, as it was allocated on main's stack.  So fix that, free the
cpu_env, free the TaskState, and we're home free, right?

Not exactly.  When we create a thread, we do:

        ts = qemu_mallocz(sizeof(TaskState) + NEW_STACK_SIZE);
        ...
        new_stack = ts->stack;
        ...
        ret = pthread_attr_setstack(&attr, new_stack, NEW_STACK_SIZE);

If we blindly free the TaskState, then, we yank the current (host)
thread's stack out from underneath it while it still has things to do,
like calling pthread_exit.  That causes problems, as you might expect.

The solution adopted here is to let the C library allocate the thread's
stack (so the C library can properly clean it up at pthread_exit) and
provide a hint that we want NEW_STACK_SIZE bytes of stack.

With those two changes, we're done, right?  Well, almost.  You see,
we're creating all these host threads and their parent threads never
bother to check that their children are finished.  There's no good place
for the parent threads to do so.  Therefore, we need to create the
threads in a detached state so the parent thread doesn't have to call
pthread_join on the child to release the child's resources; the child
does so automatically.

With those three major changes, we can comfortably run programs like the
above without exhausting memory.  We do need to delete 'stack' from the
TaskState structure.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
13 years agolinux-user: mmap_reserve() not controlled by RESERVED_VA
amateur [Tue, 14 Sep 2010 05:22:34 +0000 (13:22 +0800)]
linux-user: mmap_reserve() not controlled by RESERVED_VA

mmap_reserve() should be called only when RESERVED_VA is enabled.
Otherwise, unmaped virtual address space will never be reusable. This
bug will exhaust virtual address space in extreme conditions.

Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
13 years ago[PATCH] target-arm: remove unused functions cpu_lock(), cpu_unlock()
Peter Maydell [Fri, 19 Nov 2010 13:54:44 +0000 (13:54 +0000)]
[PATCH] target-arm: remove unused functions cpu_lock(), cpu_unlock()

Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
13 years agoFix build
Anthony Liguori [Thu, 2 Dec 2010 20:41:59 +0000 (14:41 -0600)]
Fix build

msix.o and msi.o get pulled into the build unconditionally for QMP.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoMerge remote branch 'mst/for_anthony' into staging
Anthony Liguori [Thu, 2 Dec 2010 20:16:40 +0000 (14:16 -0600)]
Merge remote branch 'mst/for_anthony' into staging

13 years agovhost: Fix address calculation in vhost_dev_sync_region()
Jason Wang [Sat, 27 Nov 2010 14:05:07 +0000 (22:05 +0800)]
vhost: Fix address calculation in vhost_dev_sync_region()

We still need advance address even we find there's no dirty pages in
current chunk.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agomigration: allow rate > 4g
Michael S. Tsirkin [Tue, 23 Nov 2010 17:05:54 +0000 (19:05 +0200)]
migration: allow rate > 4g

I'd like to disable bandwidth limit or make it very high,
Use int64_t all over to make values >= 4g work.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Jason Wang <jasowang@redhat.com>
13 years agomigration: stable ram block ordering
Michael S. Tsirkin [Mon, 22 Nov 2010 17:52:34 +0000 (19:52 +0200)]
migration: stable ram block ordering

This makes ram block ordering under migration stable, ordered by offset.
This is especially useful for migration to exec, for debugging.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Jason Wang <jasowang@redhat.com>
13 years agotcg-ia64: Fix warning in qemu_ld.
Richard Henderson [Mon, 22 Nov 2010 22:57:58 +0000 (14:57 -0800)]
tcg-ia64: Fix warning in qemu_ld.

The usermode version of qemu_ld doesn't used mem_index,
leading to set-but-not-used warnings.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
13 years agotcg-ia64: Fix address compilation in qemu_st.
Richard Henderson [Mon, 22 Nov 2010 22:57:57 +0000 (14:57 -0800)]
tcg-ia64: Fix address compilation in qemu_st.

A typo in the usermode address calculation path; R3 used where R2 needed.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
13 years agotcg-ia64: Fix tlb read error for 32-bit targets.
Richard Henderson [Mon, 22 Nov 2010 22:57:56 +0000 (14:57 -0800)]
tcg-ia64: Fix tlb read error for 32-bit targets.

Use ld4 not ld8 for reading the tlb of 32-bit targets.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
13 years agotcg-ia64: Implement qemu_ld32.
Richard Henderson [Mon, 22 Nov 2010 22:57:55 +0000 (14:57 -0800)]
tcg-ia64: Implement qemu_ld32.

The port was not properly merged following
86feb1c860dc38e9c89e787c5210e8191800385e

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
13 years agotcg-ia64: Provide default GUEST_BASE.
Richard Henderson [Mon, 22 Nov 2010 22:57:54 +0000 (14:57 -0800)]
tcg-ia64: Provide default GUEST_BASE.

Fix compilation error when GUEST_BASE is not defined.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
13 years agotcg: Fix default definition of divu_i32 and remu_i32.
Richard Henderson [Mon, 22 Nov 2010 22:57:53 +0000 (14:57 -0800)]
tcg: Fix default definition of divu_i32 and remu_i32.

The arguments to tcg_gen_helper32 for these functions were not
updated correctly in rev 2bece2c88331f024a46527634e3dd91c71d22141.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
13 years agoMerge remote branch 'origin/master' into pci
Michael S. Tsirkin [Wed, 1 Dec 2010 05:11:51 +0000 (07:11 +0200)]
Merge remote branch 'origin/master' into pci

Conflicts:
Makefile.objs
hw/virtio.c

13 years agoMerge remote branch 'kwolf/for-anthony' into staging
Anthony Liguori [Tue, 30 Nov 2010 21:25:34 +0000 (15:25 -0600)]
Merge remote branch 'kwolf/for-anthony' into staging

13 years agoMerge remote branch 'qmp/for-anthony' into staging
Anthony Liguori [Tue, 30 Nov 2010 21:24:26 +0000 (15:24 -0600)]
Merge remote branch 'qmp/for-anthony' into staging

13 years agoUse a Linux-style MAINTAINERS file
Anthony Liguori [Thu, 9 Sep 2010 19:51:31 +0000 (14:51 -0500)]
Use a Linux-style MAINTAINERS file

I make no claims that this is accurate or exhaustive but I think it's a
reasonable place to start.

As the file mentions, the purpose of this file is to give contributors
information about who they can go to with questions about a particular piece of
code or who they can ask for review.

If you sign up for a piece of code and indicate that it's Maintained or
Supported, please be prepared to be responsive to questions about that
subsystem.

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

v1 -> v2
 - Sort alphabetically
 - Copy in instructions from linux MAINTAINERS
 - Fix entries based on review feedback

13 years agoide: Reset current_addr after stopping DMA
Kevin Wolf [Fri, 26 Nov 2010 15:36:16 +0000 (16:36 +0100)]
ide: Reset current_addr after stopping DMA

Whenever SSBM is reset in the command register all state information is lost.
Restarting DMA means that current_addr must be reset to the base address of the
PRD table. The OS is not required to change the base address register before
starting a DMA operation, it can reuse the value it wrote for an earlier
request.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agoide: Ignore double DMA transfer starts/stops
Kevin Wolf [Fri, 26 Nov 2010 15:44:53 +0000 (16:44 +0100)]
ide: Ignore double DMA transfer starts/stops

You can only start a DMA transfer if it's not running yet, and you can only
cancel it if it's running.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agoide: Set bus master inactive on error
Kevin Wolf [Fri, 26 Nov 2010 15:47:42 +0000 (16:47 +0100)]
ide: Set bus master inactive on error

BMIDEA in the status register must be cleared on error. This makes FreeBSD
respond (more) correctly to I/O errors.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agoide: Factor ide_dma_set_inactive out
Kevin Wolf [Fri, 26 Nov 2010 15:31:37 +0000 (16:31 +0100)]
ide: Factor ide_dma_set_inactive out

Several places that stop a DMA transfer duplicate this code. Factor it out into
a common function.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agoAdd pcnet-pci.c
Paul Brook [Sat, 27 Nov 2010 11:56:02 +0000 (11:56 +0000)]
Add pcnet-pci.c

Add file missing from last commit.

Signed-off-by: Paul Brook <paul@codesourcery.com>
13 years agoSplit out common pcnet code
Paul Brook [Sat, 27 Nov 2010 11:23:34 +0000 (11:23 +0000)]
Split out common pcnet code

The core pcnet emulation code is used by both the PCI "pcnet" device
and the SPARC "lance" device.  Split the common code frm the PCI code so
that that can be configures independantly.

Signed-off-by: Paul Brook <paul@codesourcery.com>
13 years agoRemove PCI from sparc32 target
Paul Brook [Sat, 27 Nov 2010 10:33:55 +0000 (10:33 +0000)]
Remove PCI from sparc32 target

None of the (current) sparc32 machines have a PCI bus, so remove the PCI
code from these configs.

Signed-off-by: Paul Brook <paul@codesourcery.com>
13 years agoDetect missing config includes
Paul Brook [Sat, 27 Nov 2010 00:43:04 +0000 (00:43 +0000)]
Detect missing config includes

Terminate make_device_config.sh if the awk command fails.
Typically this means a missing file.

Signed-off-by: Paul Brook <paul@codesourcery.com>
13 years agoFix previous commit
Paul Brook [Sat, 27 Nov 2010 00:34:15 +0000 (00:34 +0000)]
Fix previous commit

Fix breakage from previous commit (missing pci.mak, and incorrect
include in default-configs/s390x-softmmu.mak).

Signed-off-by: Paul Brook <paul@codesourcery.com>
13 years agoVirtIO config option
Paul Brook [Fri, 26 Nov 2010 22:08:48 +0000 (22:08 +0000)]
VirtIO config option

Make virtio devices optional.  Selecting individual devices is not useful
as the host bindings are all in one file.

Signed-off-by: Paul Brook <paul@codesourcery.com>
13 years agoPCI config include
Paul Brook [Fri, 26 Nov 2010 21:39:42 +0000 (21:39 +0000)]
PCI config include

Split PCI config options into a separate file

Signed-off-by: Paul Brook <paul@codesourcery.com>
13 years agoInclude directives in default configs
Paul Brook [Fri, 26 Nov 2010 18:47:45 +0000 (18:47 +0000)]
Include directives in default configs

Allow default configs to be split into several files.

Signed-off-by: Paul Brook <paul@codesourcery.com>
13 years agoAdd missing dependency.
Paul Brook [Fri, 26 Nov 2010 18:46:03 +0000 (18:46 +0000)]
Add missing dependency.

Teach Makefile that cmd.o depends on a generated header (specifically
config-host.h).

Signed-off-by: Paul Brook <paul@codesourcery.com>
13 years agoraw-posix: raw_pwrite comment fixup
Christoph Hellwig [Fri, 26 Nov 2010 13:32:34 +0000 (14:32 +0100)]
raw-posix: raw_pwrite comment fixup

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoscsi-disk: Remove duplicate cdb parsing
Hannes Reinecke [Wed, 24 Nov 2010 11:16:00 +0000 (12:16 +0100)]
scsi-disk: Remove duplicate cdb parsing

We parse the CDB twice, which is completely unnecessary.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoscsi: Move sense handling into the driver
Hannes Reinecke [Wed, 24 Nov 2010 11:15:59 +0000 (12:15 +0100)]
scsi: Move sense handling into the driver

The current sense handling in scsi-bus is only used by the
scsi-disk driver; the scsi-generic driver is using its own.
So we should move the current sense handling into the
scsi-disk driver.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoscsi: INQUIRY VPD fixes
Hannes Reinecke [Wed, 24 Nov 2010 11:15:58 +0000 (12:15 +0100)]
scsi: INQUIRY VPD fixes

We should announce and support the block device characterics page
only on block devices, not on CDROMs. And the VPD page 0x83 has
an off-by-one error.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoscsi: Return SAM status codes
Hannes Reinecke [Wed, 24 Nov 2010 11:15:57 +0000 (12:15 +0100)]
scsi: Return SAM status codes

Traditionally, the linux stack is using SCSI status codes
which are shifted by one as compared to those defined in SAM.
A SCSI emulation should naturally return the SAM defined codes,
not the linux ones.
So to avoid any confusion this patch modifies the existing
definitions to match those found in SAM and removes any
(now obsolete) byte-shift from the returned status codes.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoscsi: Increase the number of possible devices
Hannes Reinecke [Wed, 24 Nov 2010 11:15:56 +0000 (12:15 +0100)]
scsi: Increase the number of possible devices

The SCSI parallel interface has a limit of 8 devices, but
not the SCSI stack in general. So we should be removing the
hard-coded limit and use MAX_SCSI_DEVS instead.
And we only need to scan those devices which are allocated
by the bus.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoblock: Remove unused s->hd in various drivers
Kevin Wolf [Tue, 16 Nov 2010 17:55:01 +0000 (18:55 +0100)]
block: Remove unused s->hd in various drivers

All drivers use bs->file instead of s->hd for quite a while now, so it's time
to remove s->hd.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agoqemu and qemu-xen: support empty write barriers in xen_disk
Stefano Stabellini [Wed, 24 Nov 2010 13:08:03 +0000 (13:08 +0000)]
qemu and qemu-xen: support empty write barriers in xen_disk

This patch can be applied to both qemu-xen and qemu and adds support
for empty write barriers to xen_disk.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoide: convert bmdma address ioport to ioport_register()
Avi Kivity [Sun, 21 Nov 2010 16:29:52 +0000 (18:29 +0200)]
ide: convert bmdma address ioport to ioport_register()

cmd646, via compile tested, pci lightly boot tested.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoblock migration: do not submit multiple AIOs for same sector (v2)
Marcelo Tosatti [Fri, 12 Nov 2010 18:07:50 +0000 (16:07 -0200)]
block migration: do not submit multiple AIOs for same sector (v2)

An old version of this patch was applied to master, so this contains the
differences between v1 and v2.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoImplement drive_del to decouple block removal from device removal
Ryan Harper [Fri, 12 Nov 2010 17:07:13 +0000 (11:07 -0600)]
Implement drive_del to decouple block removal from device removal

Currently device hotplug removal code is tied to device removal via
ACPI.  All pci devices that are removable via device_del() require the
guest to respond to the request.  In some cases the guest may not
respond leaving the device still accessible to the guest.  The management
layer doesn't currently have a reliable way to revoke access to host
resource in the presence of an uncooperative guest.

This patch implements a new monitor command, drive_del, which
provides an explicit command to revoke access to a host block device.

drive_del first quiesces the block device (qemu_aio_flush;
bdrv_flush() and bdrv_close()).  This prevents further IO from being
submitted against the host device.  Finally, drive_del cleans up
pointers between the drive object (host resource) and the device
object (guest resource).

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agoscsi-disk: Move active request asserts
Stefan Hajnoczi [Fri, 12 Nov 2010 09:57:11 +0000 (09:57 +0000)]
scsi-disk: Move active request asserts

SCSI read/write requests should not be re-issued before the current
fragment of I/O completes.  There are asserts in scsi-disk.c that guard
this constraint but they trigger on SPARC Linux 2.4.  It turns out that
the asserts are too early in the code path and don't allow for read
requests to terminate.

Only the read assert needs to be moved but move the write assert too for
consistency.

Reported-by: Nigel Horne <njh@bandsman.co.uk>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
13 years agovirtio: fix up VQ checks
Michael S. Tsirkin [Tue, 23 Nov 2010 19:55:39 +0000 (21:55 +0200)]
virtio: fix up VQ checks

When migration triggers before a VQ is initialized,
base pa is 0 and last_used_index must be 0 too:
we don't have a ring to compare to.

Reported-by: Juan Quintela <quintela@redhat.com>
Tested-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agovirtio: Convert fprintf() to error_report()
Stefan Hajnoczi [Mon, 15 Nov 2010 20:44:36 +0000 (20:44 +0000)]
virtio: Convert fprintf() to error_report()

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit cd92f4cc22fbe12a7bf60c9430731f768dc1537c)

13 years agopci: fix bus walk under secondary bus reset
Michael S. Tsirkin [Wed, 24 Nov 2010 05:23:25 +0000 (07:23 +0200)]
pci: fix bus walk under secondary bus reset

Take into account secondary bus reset bit for
bus walk: devices behind a reset bus should not
respond to configuration cycles.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agomicroblaze: target-ify target_ucontext
Richard Henderson [Mon, 22 Nov 2010 22:57:52 +0000 (14:57 -0800)]
microblaze: target-ify target_ucontext

Rename the members of target_ucontext so that they don't conflict
with possible host macros for ucontext members.  This has already
been done for the other targets.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
13 years agopci bridge: implement secondary bus reset
Isaku Yamahata [Fri, 19 Nov 2010 09:56:03 +0000 (18:56 +0900)]
pci bridge: implement secondary bus reset

Trigger secondary bus reset when secondary bus reset bit
value changes from 0 to 1.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopci: use qdev reset framework for pci bus reset
Isaku Yamahata [Fri, 19 Nov 2010 09:56:02 +0000 (18:56 +0900)]
pci: use qdev reset framework for pci bus reset

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoqdev: trigger reset from a given device
Isaku Yamahata [Fri, 19 Nov 2010 09:56:01 +0000 (18:56 +0900)]
qdev: trigger reset from a given device

Introduce a helper function which triggers reset from a given device.
Will be used by pci bus emulation.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoqdev: introduce reset call back for qbus level
Isaku Yamahata [Fri, 19 Nov 2010 09:56:00 +0000 (18:56 +0900)]
qdev: introduce reset call back for qbus level

and make it called via qbus_reset_all().
The qbus reset callback will be used by pci bus reset.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoqdev: reset qdev along with qdev tree
Anthony Liguori [Fri, 19 Nov 2010 09:55:59 +0000 (18:55 +0900)]
qdev: reset qdev along with qdev tree

This patch changes the reset handling so that qdev has no knowledge of the
global system reset.  Instead, a new bus/device level function is introduced
that allows all devices/buses on the bus/device to be reset using a depth
first transversal.

N.B. we have to expose the implicit system bus because we have various hacks
that result in an implicit system bus existing.  Instead, we ought to have an
explicitly created system bus that we can trigger reset from.  That's a topic
for a future patch though.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoqbus: add functions to walk both devices and busses
Anthony Liguori [Fri, 19 Nov 2010 09:55:58 +0000 (18:55 +0900)]
qbus: add functions to walk both devices and busses

There are some cases where you want to walk the busses, in particular, when
searching for a bus either by name or DeviceInfo.
Paolo suggested that we model the return values on how GCC's walkers work which
allows an actor to skip child transversal, or terminate walking with a positive
value that's returned as the qbus_walk_children's result.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoeepro100: Use a single rom file for all i825xx devices
Stefan Weil [Fri, 15 Oct 2010 20:51:07 +0000 (22:51 +0200)]
eepro100: Use a single rom file for all i825xx devices

Patching the rom data during load (in qemu) now
also supports i82801 (which had no rom file).

We only need a single rom file for the whole device family,
so remove the second one which is no longer needed.

Cc: Markus Armbruster <armbru@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopci: Automatically patch PCI vendor id and device id in PCI ROM
Stefan Weil [Tue, 19 Oct 2010 21:08:21 +0000 (23:08 +0200)]
pci: Automatically patch PCI vendor id and device id in PCI ROM

PCI devices with different vendor or device ids sometimes share
the same rom code. Only the ids and the checksum
differs in a boot rom for such devices.

The i825xx ethernet controller family is a typical example
which is implemented in hw/eepro100.c. It uses at least
3 different device ids, so normally 3 boot roms would be needed.

By automatically patching vendor id and device id (and the checksum)
in qemu, all emulated family members can share the same boot rom.

VGA bios roms are another example with different vendor and device ids.

Only qemu's built-in default rom files will be patched.

v2:
    * Patch also the vendor id (and remove the sanity check for vendor id).

v3:
    * Don't patch a rom file when its name was set by the user.
      Thus we avoid modifications of unknown rom data.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopci: Replace unneeded type casts in calls of pci_register_bar
Stefan Weil [Fri, 19 Nov 2010 18:29:07 +0000 (19:29 +0100)]
pci: Replace unneeded type casts in calls of pci_register_bar

There is no need for these type casts (as other existing
code shows). So re-write the first argument without
type cast (and remove a related TODO comment).

Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopcie/port: fix bridge control register wmask
Isaku Yamahata [Fri, 19 Nov 2010 11:28:45 +0000 (13:28 +0200)]
pcie/port: fix bridge control register wmask

pci generic layer initialized wmask for bridge control register
according to pci spec. pcie deviates slightly from it,
so initialize it properly.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopci: fix bridge control bit wmask
Michael S. Tsirkin [Thu, 18 Nov 2010 08:42:50 +0000 (10:42 +0200)]
pci: fix bridge control bit wmask

Bits 12 to 15 in bridge control register are reserver and must be
read-only zero, curent mask is 0xffff which makes them writeable. Fix
this up by using symbolic bit names for writeable bits instead of a
hardcoded constant.

Fix a comment w1mask -> w1cmask as well.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agox3130/downstream: support aer.
Isaku Yamahata [Tue, 16 Nov 2010 08:26:12 +0000 (17:26 +0900)]
x3130/downstream: support aer.

add aer support.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agox3130/upstream: support aer
Isaku Yamahata [Tue, 16 Nov 2010 08:26:11 +0000 (17:26 +0900)]
x3130/upstream: support aer

add aer support.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agoioh3420: support aer
Isaku Yamahata [Tue, 16 Nov 2010 08:26:10 +0000 (17:26 +0900)]
ioh3420: support aer

Add aer support.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopcie_aer: complete unwinding recursion
Michael S. Tsirkin [Wed, 17 Nov 2010 13:45:39 +0000 (15:45 +0200)]
pcie_aer: complete unwinding recursion

Open-code functions created in the previous patch,
to make code more compact and clear.
Detcted and documented what looks like a bug in code
that becomes apparent from this refactoring.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopcie_aer: get rid of recursion
Michael S. Tsirkin [Wed, 17 Nov 2010 13:02:26 +0000 (15:02 +0200)]
pcie_aer: get rid of recursion

Added some TODOs: they are trivial but omitted here
to make the patch logic as transparent as possible.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopcie/aer: helper functions for pcie aer capability
Isaku Yamahata [Tue, 16 Nov 2010 08:26:09 +0000 (17:26 +0900)]
pcie/aer: helper functions for pcie aer capability

This patch implements helper functions for pcie aer capability
which will be used later.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
13 years agopcie_regs.h: more constants
Isaku Yamahata [Tue, 16 Nov 2010 08:26:08 +0000 (17:26 +0900)]
pcie_regs.h: more constants

Add constants for PCI AER log.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>