qemu.git
10 years agoMerge branch 'ppc-next' of git://repo.or.cz/qemu/agraf
Aurelien Jarno [Sat, 14 May 2011 14:54:59 +0000 (16:54 +0200)] 
Merge branch 'ppc-next' of git://repo.or.cz/qemu/agraf

* 'ppc-next' of git://repo.or.cz/qemu/agraf:
  PPC: Qdev'ify e500 pci
  PPC MPC7544DS: Use new TLB helper function
  PPC: Implement e500 (FSL) MMU
  PPC: Add another 64 bits to instruction feature mask
  PPC: Add GS MSR definition
  PPC: Make MPC8544DS emulation work w/o KVM
  PPC: Make MPC8544DS obey -cpu switch
  Fix off-by-one error in sizing pSeries hcall table
  ppc64: Fix out-of-tree builds
  kvm: ppc: warn user on PAGE_SIZE mismatch
  kvm: ppc: detect old headers
  monitor: add PPC BookE SPRs
  kvm: ppc: fixes for KVM_SET_SREGS on init
  ppc64: Don't try to build sPAPR RTAS on Darwin
  Place pseries vty devices at addresses more similar to existing machines
  Make pSeries 'model' property more closely resemble real hardware
  pseries: Increase maximum CPUs to 256

10 years agosparc64: fix incorrect BPcc target sign extension
Blue Swirl [Sat, 14 May 2011 07:14:57 +0000 (07:14 +0000)] 
sparc64: fix incorrect BPcc target sign extension

Fix wrong number of bits used when sign extending the branch offset of BPcc
instructions.

Reported-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
10 years agosparc64: fix wrpstate and wrtl on delay slot
Blue Swirl [Tue, 26 Apr 2011 18:44:20 +0000 (18:44 +0000)] 
sparc64: fix wrpstate and wrtl on delay slot

Use TCG local to work around TCG register flush due to a branch.

Thanks to Artyom Tarasenko, Igor Kovalenko and Aurelien Jarno.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
10 years agoMerge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Thu, 12 May 2011 13:08:12 +0000 (08:08 -0500)] 
Merge remote-tracking branch 'stefanha/trivial-patches' into staging

Conflicts:
cpu-all.h

10 years agoMerge remote-tracking branch 'agraf/xen-next' into staging
Anthony Liguori [Thu, 12 May 2011 13:06:06 +0000 (08:06 -0500)] 
Merge remote-tracking branch 'agraf/xen-next' into staging

10 years agoPPC: Qdev'ify e500 pci
Alexander Graf [Mon, 30 Aug 2010 22:22:28 +0000 (00:22 +0200)] 
PPC: Qdev'ify e500 pci

The e500 PCI controller isn't qdev'ified yet. This leads to severe issues
when running with -drive.

To be able to use a virtio disk with an e500 VM, let's convert the PCI
controller over to qdev.

Reviewed-by: Paul Brook <paul@codesourcery.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoPPC MPC7544DS: Use new TLB helper function
Alexander Graf [Fri, 6 May 2011 08:37:56 +0000 (10:37 +0200)] 
PPC MPC7544DS: Use new TLB helper function

Now that we have some nice helpers that can find us a TLB entry, let's
use that on the machine initialization code, so we don't need to know
about the internals of the TLB array.

Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoPPC: Implement e500 (FSL) MMU
Alexander Graf [Sat, 30 Apr 2011 21:34:58 +0000 (23:34 +0200)] 
PPC: Implement e500 (FSL) MMU

Most of the code to support e500 style MMUs is already in place, but
we're missing on some of the special TLB0-TLB1 handling code and slightly
different TLB modification.

This patch adds support for the FSL style MMU.

Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoPPC: Add another 64 bits to instruction feature mask
Alexander Graf [Sat, 30 Apr 2011 22:00:58 +0000 (00:00 +0200)] 
PPC: Add another 64 bits to instruction feature mask

To enable quick runtime detection of instruction groups to the currently
selected CPU emulation, we have a feature mask of what exactly the respective
instruction supports.

This feature mask is 64 bits long and we just successfully exceeded those 64
bits. To add more features, we need to think of something.

The easiest solution that came to my mind was to simply add another 64 bits
that we can also match on. Since the comparison is only done on start of the
qemu process to generate an internal opcode calling table, we should be fine
on any performance penalties here.

Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoPPC: Add GS MSR definition
Alexander Graf [Sat, 30 Apr 2011 21:34:56 +0000 (23:34 +0200)] 
PPC: Add GS MSR definition

The BookE specification defines MSR bit 28 as Guest State. Add it
to the list of MSR macros.

Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoPPC: Make MPC8544DS emulation work w/o KVM
Alexander Graf [Sat, 30 Apr 2011 21:34:53 +0000 (23:34 +0200)] 
PPC: Make MPC8544DS emulation work w/o KVM

The MPC8544DS board emulation was only used with KVM so far, so some
parts of the code didn't provide proper values for non-KVM execution.

This patch makes the machine work without KVM enabled. To actually use
this, you also need proper e500v2 MMU emulation.

Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoPPC: Make MPC8544DS obey -cpu switch
Alexander Graf [Sat, 30 Apr 2011 21:05:03 +0000 (23:05 +0200)] 
PPC: Make MPC8544DS obey -cpu switch

The MPC8544DS board emulation code ignored the user defined -cpu switch.
This patch enables it to only provide a sane default, not force an e500v2
CPU inside.

Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoFix off-by-one error in sizing pSeries hcall table
David Gibson [Tue, 10 May 2011 06:06:21 +0000 (16:06 +1000)] 
Fix off-by-one error in sizing pSeries hcall table

The pSeries machine uses two tables to look up guest hcalls for emulation.
One of these is exactly one entry too small to hold all the hcalls it needs
to, leading to memory corruption.

This patch fixes the bug, and while we're at it, make both tables 'static'
since they're never used from other modules.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoppc64: Fix out-of-tree builds
Andreas Färber [Sun, 8 May 2011 11:25:56 +0000 (13:25 +0200)] 
ppc64: Fix out-of-tree builds

On ppc64 host, recursion into pc-bios/spapr-rtas/ fails for
out-of-tree builds. Add missing dir and symlink.

Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Alexander Graf <agraf@suse.de>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agokvm: ppc: warn user on PAGE_SIZE mismatch
Alexander Graf [Sat, 16 Apr 2011 08:15:11 +0000 (10:15 +0200)] 
kvm: ppc: warn user on PAGE_SIZE mismatch

On PPC, the default PAGE_SIZE is 64kb. Unfortunately, the hardware
alignments don't match here: There are RAM and MMIO regions within
a single page when it's 64kb in size.

So the only way out for now is to tell the user that he should use 4k
PAGE_SIZE.

This patch gives the user a hint on that, telling him that failing to
register a prefix slot is most likely to be caused by mismatching PAGE_SIZE.

This way it's also more future-proof, as bigger PAGE_SIZE can easily be
supported by other machines then, as long as they stick to 64kb granularities.

Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agokvm: ppc: detect old headers
Alexander Graf [Sat, 16 Apr 2011 00:00:36 +0000 (02:00 +0200)] 
kvm: ppc: detect old headers

When compiling Qemu with older kernel headers, the PVR setting
mechanism isn't available yet. Unfortunately, back then I didn't add
a capability we could check against, so all we can do is add a configure
test to see if we support PVR setting. For BookE, we don't care yet.

This fixes compilation errors with KVM enabled on older kernel headers
(like 2.6.32).

Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agomonitor: add PPC BookE SPRs
Scott Wood [Fri, 29 Apr 2011 22:10:23 +0000 (17:10 -0500)] 
monitor: add PPC BookE SPRs

Read them via KVM_GET_SREGS in kvm_arch_get_registers(),
and display them in "info registers".

Also get CR and PID from the existing KVM_GET_REGS.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agokvm: ppc: fixes for KVM_SET_SREGS on init
Scott Wood [Mon, 11 Apr 2011 23:34:34 +0000 (18:34 -0500)] 
kvm: ppc: fixes for KVM_SET_SREGS on init

Classic/server ppc has had SREGS for a while now (though I think not
always?), but it's still missing for booke.  Check the capability before
calling KVM_SET_SREGS.

Without this, booke kvm fails to boot as of commit
84b4915dd2c0eaa86c970ffc42a68ea8ba9e48b5 (kvm: Handle kvm_init_vcpu
errors).

Also, don't write random stack state into the non-PVR sregs fields --
have kvm fill it in first.

Eventually booke will have sregs and it will have its own capability to
be tested here.  However, we will want a way for platform code to request
to look like the actual CPU we're running on, especially if SoC devices
are being directly assigned.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoppc64: Don't try to build sPAPR RTAS on Darwin
Andreas Färber [Sun, 1 May 2011 16:23:56 +0000 (18:23 +0200)] 
ppc64: Don't try to build sPAPR RTAS on Darwin

The Darwin assembler fails to build it.

Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Alexander Graf <agraf@suse.de>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoPlace pseries vty devices at addresses more similar to existing machines
David Gibson [Tue, 19 Apr 2011 01:54:52 +0000 (11:54 +1000)] 
Place pseries vty devices at addresses more similar to existing machines

Currently the qemu pseries machine numbers its virtual serial devices
from 0.  However, existing pSeries machines running pHyp number them from
0x30000000.

In theory these indices are arbitrary, since everything necessary for the
kernel to find them is advertised in the device tree.  However the debian
installer, at least, incorrectly looks for a device named vty@30... to
determine whether to use the hypervisor console.

Therefore this patch moves the numbers we use to match the existing pHyp
practice, in order to workaround broken userspace apps of this type.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoMake pSeries 'model' property more closely resemble real hardware
David Gibson [Tue, 19 Apr 2011 01:54:51 +0000 (11:54 +1000)] 
Make pSeries 'model' property more closely resemble real hardware

Currently, the qemu emulated pseries machine puts
"qemu,emulated-pSeries-LPAR" in the device tree's root level 'model'
property.  Unfortunately this confuses some installers and ybin, which
expect this to start with "IBM" on pSeries machines.  This patch addresses
this problem, making the property more closely resemble the pattern of
existing real hardware.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agopseries: Increase maximum CPUs to 256
Anton Blanchard [Tue, 19 Apr 2011 01:54:50 +0000 (11:54 +1000)] 
pseries: Increase maximum CPUs to 256

The original pSeries machine was limited to 32 CPUs, more or less
arbitrarily.  Particularly when we get SMT KVM guests it will be
pretty easy to exceed this.  Therefore, raise the max number of CPUs
in a pseries machine guest to 256.

Signed-off-by: Anton Blanchard <anton@au1.ibm.com>
Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agousb-linux: Add missing break statement
Stefan Weil [Sat, 7 May 2011 20:10:53 +0000 (22:10 +0200)] 
usb-linux: Add missing break statement

cppcheck report:
usb-linux.c:661: warning: Redundant assignment of "len" in switch

Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agousb-musb: uninline functions
Gerd Hoffmann [Mon, 9 May 2011 07:44:03 +0000 (09:44 +0200)] 
usb-musb: uninline functions

Prototype without "inline" keyword breaks the build with some gcc
versions.  Noticed by Alexander Graf.

Fix this by removing the inline keywork everywhere.  Some functions
can't be inlined anyway as the are referenced using function pointers.
Beside that gcc does a pretty good job on auto-inlining these days.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoirq: Privatize CPU_INTERRUPT_NMI.
Richard Henderson [Wed, 4 May 2011 20:34:31 +0000 (13:34 -0700)] 
irq: Privatize CPU_INTERRUPT_NMI.

This interrupt name is used by i386, CRIS, and MicroBlaze.
Copy the name into each target.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
10 years agotarget-i386: Privatize some i386-specific interrupt names.
Richard Henderson [Wed, 4 May 2011 20:34:30 +0000 (13:34 -0700)] 
target-i386: Privatize some i386-specific interrupt names.

SMI, VIRQ, INIT, SIPI, and MCE are all only used by the i386 port.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
10 years agotarget-arm: Privatize CPU_INTERRUPT_FIQ.
Richard Henderson [Wed, 4 May 2011 20:34:29 +0000 (13:34 -0700)] 
target-arm: Privatize CPU_INTERRUPT_FIQ.

This interrupt name was only used by the ARM port.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
10 years agoirq: Remove CPU_INTERRUPT_TIMER.
Richard Henderson [Wed, 4 May 2011 20:34:28 +0000 (13:34 -0700)] 
irq: Remove CPU_INTERRUPT_TIMER.

It is no longer used anywhere.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
10 years agotarget-sparc: Do not check CPU_INTERRUPT_TIMER.
Richard Henderson [Wed, 4 May 2011 20:34:27 +0000 (13:34 -0700)] 
target-sparc: Do not check CPU_INTERRUPT_TIMER.

This bit is never set, therefore we should not read it either.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
10 years agotarget-mips: Do not check CPU_INTERRUPT_TIMER.
Richard Henderson [Wed, 4 May 2011 20:34:26 +0000 (13:34 -0700)] 
target-mips: Do not check CPU_INTERRUPT_TIMER.

This bit is never set, therefore we should not read it either.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
10 years agoirq: Introduce and use CPU_INTERRUPT_SSTEP_MASK.
Richard Henderson [Wed, 4 May 2011 20:34:25 +0000 (13:34 -0700)] 
irq: Introduce and use CPU_INTERRUPT_SSTEP_MASK.

This mask contains all of the bits that should be ignored while single
stepping in the debugger.  The mask contains 2 bits that are not currently
cleared, but are also never set.  The bits are included in the mask for
consistency in handling of the CPU_INTERRUPT_TGT_EXT_N bits.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
10 years agoirq: Introduce CPU_INTERRUPT_TGT_* defines.
Richard Henderson [Wed, 4 May 2011 20:34:24 +0000 (13:34 -0700)] 
irq: Introduce CPU_INTERRUPT_TGT_* defines.

These defines will be place-holders for cpu-specific functionality.
Generic code will, at the end of the patch series, no longer have to
concern itself about how SMI, NMI, etc should be handled.  Instead,
generic code will know only that the interrupt is internal or external.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
10 years agolsi53c895a: Rename 'sense' to 'status'
Hannes Reinecke [Mon, 2 May 2011 07:54:05 +0000 (09:54 +0200)] 
lsi53c895a: Rename 'sense' to 'status'

The 'sense' field in the HBA status structure is misnamed, as it
actually carries the SCSI status. Rename it.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-trivial@nongnu.org
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agolibcacard: add correct subdirectory dependencies
Paolo Bonzini [Mon, 2 May 2011 07:54:03 +0000 (09:54 +0200)] 
libcacard: add correct subdirectory dependencies

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-trivial@nongnu.org
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agolinux-user: Replace deprecated function
Stefan Weil [Sat, 7 May 2011 20:32:25 +0000 (22:32 +0200)] 
linux-user: Replace deprecated function

Function bzero is deprecated, so replace it by function memset.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix spelling in comments (intruction -> instruction)
Stefan Weil [Sat, 7 May 2011 20:20:03 +0000 (22:20 +0200)] 
Fix spelling in comments (intruction -> instruction)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoac97: Remove unused local variables
Stefan Weil [Sun, 8 May 2011 06:58:11 +0000 (08:58 +0200)] 
ac97: Remove unused local variables

cppcheck report:
hw/ac97.c:1004: style:
 Variable 'written' is assigned a value that is never used
hw/ac97.c:1072: style:
 Variable 'written' is assigned a value that is never used

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comment (threshhold -> threshold, mapp -> map)
Stefan Weil [Thu, 28 Apr 2011 15:20:42 +0000 (17:20 +0200)] 
Fix typos in comment (threshhold -> threshold, mapp -> map)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typo in comment (truely -> truly)
Stefan Weil [Thu, 28 Apr 2011 15:20:41 +0000 (17:20 +0200)] 
Fix typo in comment (truely -> truly)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typo in comment (responsiblity -> responsibility)
Stefan Weil [Thu, 28 Apr 2011 15:20:40 +0000 (17:20 +0200)] 
Fix typo in comment (responsiblity -> responsibility)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typo in comment (relevent -> relevant)
Stefan Weil [Thu, 28 Apr 2011 15:20:39 +0000 (17:20 +0200)] 
Fix typo in comment (relevent -> relevant)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments and code (occured -> occurred and related)
Stefan Weil [Thu, 28 Apr 2011 15:20:38 +0000 (17:20 +0200)] 
Fix typos in comments and code (occured -> occurred and related)

The code changed here is an unused data type name (evt_flush_occurred).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments (neccessary -> necessary)
Stefan Weil [Thu, 28 Apr 2011 15:20:37 +0000 (17:20 +0200)] 
Fix typos in comments (neccessary -> necessary)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments (instanciation -> instantiation)
Stefan Weil [Thu, 28 Apr 2011 15:20:36 +0000 (17:20 +0200)] 
Fix typos in comments (instanciation -> instantiation)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments (interupt -> interrupt)
Stefan Weil [Thu, 28 Apr 2011 15:20:35 +0000 (17:20 +0200)] 
Fix typos in comments (interupt -> interrupt)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments (existance -> existence)
Stefan Weil [Thu, 28 Apr 2011 15:20:34 +0000 (17:20 +0200)] 
Fix typos in comments (existance -> existence)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments (imediately -> immediately)
Stefan Weil [Thu, 28 Apr 2011 15:20:33 +0000 (17:20 +0200)] 
Fix typos in comments (imediately -> immediately)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typo in comment (dieing -> dying)
Stefan Weil [Thu, 28 Apr 2011 15:20:32 +0000 (17:20 +0200)] 
Fix typo in comment (dieing -> dying)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typo in comment (consistant -> consistent)
Stefan Weil [Thu, 28 Apr 2011 15:20:31 +0000 (17:20 +0200)] 
Fix typo in comment (consistant -> consistent)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typo in comment (embeded -> embedded)
Stefan Weil [Thu, 28 Apr 2011 15:20:30 +0000 (17:20 +0200)] 
Fix typo in comment (embeded -> embedded)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typo in comment (auxilliary -> auxiliary)
Stefan Weil [Thu, 28 Apr 2011 15:20:29 +0000 (17:20 +0200)] 
Fix typo in comment (auxilliary -> auxiliary)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typo in comment (colum -> column)
Stefan Weil [Thu, 28 Apr 2011 15:20:28 +0000 (17:20 +0200)] 
Fix typo in comment (colum -> column)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments (accessable -> accessible, priveleged -> privileged)
Stefan Weil [Thu, 28 Apr 2011 15:20:27 +0000 (17:20 +0200)] 
Fix typos in comments (accessable -> accessible, priveleged -> privileged)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments (accross -> across)
Stefan Weil [Thu, 28 Apr 2011 15:20:26 +0000 (17:20 +0200)] 
Fix typos in comments (accross -> across)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments (dependancy -> dependency)
Stefan Weil [Thu, 28 Apr 2011 15:20:25 +0000 (17:20 +0200)] 
Fix typos in comments (dependancy -> dependency)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoxen: Add Xen hypercall for sleep state in the cmos_s3 callback.
Anthony PERARD [Tue, 5 Oct 2010 15:40:22 +0000 (16:40 +0100)] 
xen: Add Xen hypercall for sleep state in the cmos_s3 callback.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Set running state in xenstore.
Anthony PERARD [Mon, 6 Sep 2010 19:07:33 +0000 (20:07 +0100)] 
xen: Set running state in xenstore.

This tells to the xen management tool that the machine can begin run.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Initialize event channels and io rings
Arun Sharma [Mon, 6 Sep 2010 19:07:14 +0000 (20:07 +0100)] 
xen: Initialize event channels and io rings

Open and bind event channels; map ioreq and buffered ioreq rings.

Signed-off-by: Arun Sharma <arun.sharma@intel.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agovl.c: Introduce getter for shutdown_requested and reset_requested.
Anthony PERARD [Thu, 22 Jul 2010 14:52:48 +0000 (15:52 +0100)] 
vl.c: Introduce getter for shutdown_requested and reset_requested.

Introduce two functions qemu_shutdown_requested_get and
qemu_reset_requested_get to get the value of shutdown/reset_requested
without reset it.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agopci: Use of qemu_put_ram_ptr in pci_add_option_rom.
John Baboval [Tue, 22 Mar 2011 14:52:09 +0000 (14:52 +0000)] 
pci: Use of qemu_put_ram_ptr in pci_add_option_rom.

Prevent a deadlock caused by leaving a map cache bucket locked by the
preceding qemu_get_ram_ptr() call.

Signed-off-By: John Baboval <john.baboval@virtualcomputer.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoconfigure: Always use 64bits target physical addresses with xen enabled.
Anthony PERARD [Thu, 21 Oct 2010 11:47:08 +0000 (12:47 +0100)] 
configure: Always use 64bits target physical addresses with xen enabled.

With MapCache, we can handle a 64b target, even with a 32b host/qemu.
So, we need to have target_phys_addr_t to 64bits.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoIntroduce qemu_put_ram_ptr
Anthony PERARD [Thu, 16 Sep 2010 12:57:49 +0000 (13:57 +0100)] 
Introduce qemu_put_ram_ptr

This function allows to unlock a ram_ptr give by qemu_get_ram_ptr. After
a call to qemu_put_ram_ptr, the pointer may be unmap from QEMU when
used with Xen.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Adds a cap to the number of map cache entries.
John Baboval [Tue, 22 Mar 2011 14:50:28 +0000 (14:50 +0000)] 
xen: Adds a cap to the number of map cache entries.

Adds a cap to the number of map cache entries. This prevents the map
cache from overwhelming system memory.

I also removed the bitmap macros and #included bitmap.h instead.

Signed-off-By: John Baboval <john.baboval@virtualcomputer.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Introduce the Xen mapcache
Jun Nakajima [Tue, 31 Aug 2010 15:41:25 +0000 (16:41 +0100)] 
xen: Introduce the Xen mapcache

On IA32 host or IA32 PAE host, at present, generally, we can't create
an HVM guest with more than 2G memory, because generally it's almost
impossible for Qemu to find a large enough and consecutive virtual
address space to map an HVM guest's whole physical address space.
The attached patch fixes this issue using dynamic mapping based on
little blocks of memory.

Each call to qemu_get_ram_ptr makes a call to qemu_map_cache with the
lock option, so mapcache will not unmap these ram_ptr.

Blocks that do not belong to the RAM, but usually to a device ROM or to
a framebuffer, are handled in a separate function. So the whole RAMBlock
can be map.

Signed-off-by: Jun Nakajima <jun.nakajima@intel.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>
10 years agoxen: Introduce Xen Interrupt Controller
Anthony PERARD [Wed, 30 Jun 2010 16:50:10 +0000 (17:50 +0100)] 
xen: Introduce Xen Interrupt Controller

Every set_irq call makes a Xen hypercall.

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>
10 years agopiix_pci: Introduces Xen specific call for irq.
Anthony PERARD [Fri, 16 Jul 2010 13:55:39 +0000 (14:55 +0100)] 
piix_pci: Introduces Xen specific call for irq.

This patch introduces Xen specific call in piix_pci.

The specific part for Xen is in write_config, set_irq and get_pirq.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agopc, Disable vmport initialisation with Xen.
Anthony PERARD [Tue, 3 May 2011 16:06:54 +0000 (17:06 +0100)] 
pc, Disable vmport initialisation with Xen.

This is because there is not synchronisation of the vcpu register
between Xen and QEMU, so vmport can't work properly.

This patch introduces no_vmport parameter to pc_basic_device_init.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Add xenfv machine
Anthony PERARD [Wed, 30 Jun 2010 11:58:34 +0000 (12:58 +0100)] 
xen: Add xenfv machine

Introduce the Xen FV (Fully Virtualized) machine to Qemu, some more Xen
specific call will be added in further patches.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agopc_memory_init: Move memory calculation to the caller.
Anthony PERARD [Mon, 11 Apr 2011 18:48:11 +0000 (19:48 +0100)] 
pc_memory_init: Move memory calculation to the caller.

This patch moves above_4g_mem_size and below_4g_mem_size calculation in
the caller of pc_memory_init (pc_init1). And the prototype of
pc_memory_init is changed because there is no need anymore to have
variable pointer and the ram_size parameter.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Add initialisation of Xen
Anthony PERARD [Thu, 19 Aug 2010 11:27:56 +0000 (12:27 +0100)] 
xen: Add initialisation of Xen

The xenpv machine use the common init function.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Support new libxc calls from xen unstable.
Anthony PERARD [Fri, 25 Feb 2011 16:20:34 +0000 (16:20 +0000)] 
xen: Support new libxc calls from xen unstable.

This patch updates the libxenctrl calls in Qemu to use the new interface,
otherwise Qemu wouldn't be able to build against new versions of the
library.

We check libxenctrl version in configure, from Xen 3.3.0 to Xen
unstable.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Make Xen build once.
Anthony PERARD [Tue, 29 Mar 2011 17:39:00 +0000 (18:39 +0100)] 
xen: Make Xen build once.

xen_domainbuild and xen_machine_pv are built only for i386 targets.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Replace some tab-indents with spaces (clean-up).
Anthony PERARD [Thu, 23 Sep 2010 11:28:45 +0000 (12:28 +0100)] 
xen: Replace some tab-indents with spaces (clean-up).

And put braces for blocks with a single statement.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agomachine, Add default_machine_opts to QEMUMachine.
Anthony PERARD [Mon, 22 Nov 2010 15:44:15 +0000 (15:44 +0000)] 
machine, Add default_machine_opts to QEMUMachine.

With this new field, we can specified which accelerator use to run the
machine, if the accelerator is not already specified by either a
configuration file or the command line options.

Currently, the only use will be made in the xenfv machine.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoIntroduce -machine command option.
Anthony PERARD [Tue, 21 Sep 2010 19:05:31 +0000 (20:05 +0100)] 
Introduce -machine command option.

This option gives the ability to switch one "accelerator" like kvm, xen
or the default one tcg. We can specify more than one accelerator by
separate them by a colon. QEMU will try each one and use the first whose
works.

So,
./qemu -machine accel=xen:kvm:tcg

which would try Xen support first, then KVM and finally TCG if none of
the other works.

By default, QEMU will use TCG. But we can specify another default in the
global configuration file.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoFix typo in code and comments
Stefan Weil [Tue, 26 Apr 2011 08:29:36 +0000 (10:29 +0200)] 
Fix typo in code and comments

Replace writeable -> writable

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoMerge remote-tracking branch 'mst/for_anthony' into staging
Anthony Liguori [Thu, 5 May 2011 18:05:32 +0000 (13:05 -0500)] 
Merge remote-tracking branch 'mst/for_anthony' into staging

10 years agoMerge remote-tracking branch 'kraxel/usb.7.pull' into staging
Anthony Liguori [Thu, 5 May 2011 18:04:57 +0000 (13:04 -0500)] 
Merge remote-tracking branch 'kraxel/usb.7.pull' into staging

10 years agoMerge remote branch 'origin/master' into pci
Michael S. Tsirkin [Thu, 5 May 2011 13:39:47 +0000 (16:39 +0300)] 
Merge remote branch 'origin/master' into pci

Conflicts:
exec.c

10 years agoCPUPhysMemoryClient: Pass guest physical address not region offset
Alex Williamson [Tue, 3 May 2011 18:36:46 +0000 (12:36 -0600)] 
CPUPhysMemoryClient: Pass guest physical address not region offset

When we're trying to get a newly registered phys memory client updated
with the current page mappings, we end up passing the region offset
(a ram_addr_t) as the start address rather than the actual guest
physical memory address (target_phys_addr_t).  If your guest has less
than 3.5G of memory, these are coincidentally the same thing.  If
there's more, the region offset for the memory above 4G starts over
at 0, so the set_memory client will overwrite it's lower memory entries.

Instead, keep track of the guest phsyical address as we're walking the
tables and pass that to the set_memory client.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoCPUPhysMemoryClient: Fix typo in phys memory client registration
Alex Williamson [Tue, 3 May 2011 18:36:32 +0000 (12:36 -0600)] 
CPUPhysMemoryClient: Fix typo in phys memory client registration

When we register a physical memory client, we try to walk the page
tables, calling the set_memory hook for every entry.  Effectively
playing catchup for the client for everything already registered.
With this type, we only walk the 2nd entry of the l1 table,
typically missing all of the registered memory.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agopci: Add class 0x403 as 'audio controller'
Jan Kiszka [Mon, 2 May 2011 18:01:37 +0000 (20:01 +0200)] 
pci: Add class 0x403 as 'audio controller'

Used by HD audio controllers like our intel-hda.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoMSI: Robust resource release
Jan Kiszka [Mon, 2 May 2011 18:00:47 +0000 (20:00 +0200)] 
MSI: Robust resource release

msi_init may fail, so we need to check on uninit if the cap was
actually installed. This also avoids that the users need to check.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoeepro100: Support 32 bit read/write access to flash register
Stefan Weil [Sat, 30 Apr 2011 20:40:13 +0000 (22:40 +0200)] 
eepro100: Support 32 bit read/write access to flash register

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoeepro100: Support byte read access to general control register
Stefan Weil [Sat, 30 Apr 2011 20:40:12 +0000 (22:40 +0200)] 
eepro100: Support byte read access to general control register

The general control register is a byte register.
Add support for byte reads.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoeepro100: Support byte/word read/write access to MDI control register
Stefan Weil [Sat, 30 Apr 2011 20:40:11 +0000 (22:40 +0200)] 
eepro100: Support byte/word read/write access to MDI control register

MDI control is a 32 bit register, but may be read or written using
8 or 16 bit access. Data is latched when the MSB is written.

Add support for byte/word read/write access.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoeepro100: Support byte/word writes to pointer register
Stefan Weil [Sat, 30 Apr 2011 20:40:10 +0000 (22:40 +0200)] 
eepro100: Support byte/word writes to pointer register

pointer is a 32 bit register, but may be written using 8 or 16 bit writes.
Add support for byte/word writes.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoeepro100: Support byte/word writes to port address
Stefan Weil [Sat, 30 Apr 2011 20:40:09 +0000 (22:40 +0200)] 
eepro100: Support byte/word writes to port address

port is a 32 bit register, but may be written using 8 or 16 bit writes.
Add support for byte/word writes.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoeepro100: Fix endianness issues
Stefan Weil [Sat, 30 Apr 2011 20:40:08 +0000 (22:40 +0200)] 
eepro100: Fix endianness issues

Like other Intel devices, e100 (eepro100) uses little endian byte order.

This patch was tested with these combinations:

i386 host, i386 + mipsel guests (le-le)
mipsel host, i386 guest (le-le)
i386 host, mips + ppc guests (le-be)
mips host, i386 guest (be-le)

mips and mipsel hosts were emulated machines.

v2:
Use prefix for new functions. Add the same prefix to stl_le_phys.
Fix alignment of mem (needed for word/dword reads/writes).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoeepro100: Pad received short frames
Stefan Weil [Sat, 30 Apr 2011 20:40:07 +0000 (22:40 +0200)] 
eepro100: Pad received short frames

QEMU sends frames smaller than 60 bytes to ethernet nics.
Such frames are rejected by real NICs and their emulations.
To avoid this behaviour, other NIC emulations pad received
frames. This patch enables this workaround for eepro100, too.

All related code is marked with CONFIG_PAD_RECEIVED_FRAMES,
so we can drop this in case QEMU's networking code is
ever changed.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoeepro100: Remove unused structure element
Stefan Weil [Sat, 30 Apr 2011 20:40:06 +0000 (22:40 +0200)] 
eepro100: Remove unused structure element

cppcheck reports that 'packet' is unused.

It was only used to calculate the size of the preceding data.
Removing it saves a lot of stack space (local variable rx).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoeepro100: Remove type casts which are no longer needed
Stefan Weil [Sat, 30 Apr 2011 20:40:05 +0000 (22:40 +0200)] 
eepro100: Remove type casts which are no longer needed

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoeepro100: Avoid duplicate debug messages
Stefan Weil [Sat, 30 Apr 2011 20:40:04 +0000 (22:40 +0200)] 
eepro100: Avoid duplicate debug messages

When DEBUG_EEPRO100 was enabled, unsupported writes were logged twice.
Now logging in eepro100_write1 and eepro100_write2 is similar to the
logging in eepro100_write4 (which already was correct).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agousb: mass storage fix
Gerd Hoffmann [Wed, 4 May 2011 14:49:56 +0000 (16:49 +0200)] 
usb: mass storage fix

Initialize scsi_len with zero when starting a new request, so any
stuff leftover from the previous request is cleared out.  This may
happen in case the data returned by the scsi command doesn't fit
into the buffer provided by the guest.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agousb: move complete callback to port ops
Gerd Hoffmann [Thu, 16 Dec 2010 16:03:44 +0000 (17:03 +0100)] 
usb: move complete callback to port ops

10 years agomusb: get musb state via container_of()
Gerd Hoffmann [Thu, 16 Dec 2010 12:23:13 +0000 (13:23 +0100)] 
musb: get musb state via container_of()

10 years agoohci: get ohci state via container_of()
Gerd Hoffmann [Wed, 15 Dec 2010 10:47:19 +0000 (11:47 +0100)] 
ohci: get ohci state via container_of()

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agouhci: keep uhci state pointer in async packet struct.
Gerd Hoffmann [Wed, 15 Dec 2010 09:26:15 +0000 (10:26 +0100)] 
uhci: keep uhci state pointer in async packet struct.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agouhci: switch to QTAILQ
Gerd Hoffmann [Tue, 14 Dec 2010 17:19:47 +0000 (18:19 +0100)] 
uhci: switch to QTAILQ

10 years agousb: control buffer fixes
Hans de Goede [Wed, 2 Feb 2011 16:46:00 +0000 (17:46 +0100)] 
usb: control buffer fixes

Windows allows control transfers to pass up to 4k of data, so raise our
control buffer size to 4k. For control out transfers the usb core code copies
the control request data to a buffer before calling the device's handle_control
callback. Add a check for overflowing the buffer before copying the data.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>