]> git.proxmox.com Git - qemu.git/log
qemu.git
12 years agokvm: fix build error in ppc kvm due to memory_region_init_ram_ptr() change
Avi Kivity [Thu, 5 Jan 2012 10:30:31 +0000 (12:30 +0200)]
kvm: fix build error in ppc kvm due to memory_region_init_ram_ptr() change

Commit c5705a772 ("vmstate, memory: decouple vmstate from memory API") changed
the signature of memory_region_init_ram_ptr() but did not update a caller in
the ppc kvm module.  Fix.

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoMerge branch 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm
Aurelien Jarno [Sat, 7 Jan 2012 21:19:14 +0000 (22:19 +0100)]
Merge branch 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm

* 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm:
  arm: add dummy A9-specific cp15 registers
  target-arm: Ignore attempts to set invalid modes in CPSR
  target-arm: Don't use cpu_single_env in bank_number()

12 years agoMerge branch 'ppc-next' of git://repo.or.cz/qemu/agraf
Aurelien Jarno [Sat, 7 Jan 2012 21:01:57 +0000 (22:01 +0100)]
Merge branch 'ppc-next' of git://repo.or.cz/qemu/agraf

* 'ppc-next' of git://repo.or.cz/qemu/agraf:
  PPC: Add description for the Freescale e500mc core.
  pseries: Check for duplicate addresses on the spapr-vio bus
  pseries: Populate "/chosen/linux,stdout-path" in the FDT
  pseries: Add a routine to find a stable "default" vty and use it
  pseries: Emit device tree nodes in reg order
  pseries: FDT NUMA extensions to support multi-node guests
  pseries: Remove hcalls callback
  kvm-ppc: halt secondary cpus when guest reset
  console: Fix segfault on screendump without VGA adapter
  PPC: monitor: add ability to dump SLB entries

12 years agosm501: Fix size of color_reg
Stefan Weil [Wed, 4 Jan 2012 21:50:09 +0000 (22:50 +0100)]
sm501: Fix size of color_reg

color_reg is expected to hold 32 bit values, so it was too small.

This bug was reported by coverity:

hw/sm501.c:624:
result_independent_of_operands:
color_reg >> 16 is 0 regardless of the values of its operands.
This occurs as the bitwise first operand of '&'.

Cc: Shin-ichiro Kawasaki <kawasaki@juno.dti.ne.jp>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
12 years agotarget-sh4: Fix operands for fipr, ftrv instructions
Stefan Weil [Thu, 5 Jan 2012 12:11:48 +0000 (13:11 +0100)]
target-sh4: Fix operands for fipr, ftrv instructions

Coverity complained about right shifts of opcode (16, 18) which were
larger than the size of opcode (16 bit).

Using the correct shift values fixes this.

Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
12 years agomalta: Fix regression (i8259 interrupts did not work)
Stefan Weil [Tue, 29 Nov 2011 05:34:48 +0000 (06:34 +0100)]
malta: Fix regression (i8259 interrupts did not work)

Commit 5632ae46d5bda798e971dae48ebb318ac2c3686a passes the address
of i8259 to qemu_irq_proxy. i8259 is an auto variable with undefined
value outside of mips_malta_init.

This made the interrupt proxy unusable: either QEMU crashes, or
the interrupt handler was not called.

Ethernet for example no longer worked with MIPS Malta.

v2:
While v1 used a static variable for i8259, this patch introduces
a qdev for the malta machine. i8259 is now part of the device status.
This is a minimal qdev implementation to keep the patch small.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
12 years agoMerge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Fri, 6 Jan 2012 18:51:21 +0000 (12:51 -0600)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging

* stefanha/trivial-patches:
  qemu-nbd: drop loop which can never loop
  Make python mandatory
  net/socket.c: Fix fd leak in net_socket_listen_init() error paths
  gdbstub: Fix fd leak in gdbserver_open() error path
  configure: Fix test for supported host CPU type
  configure: CONFIG_QEMU_INTERP_PREFIX only for user mode
  scsi virtio-blk usb-msd: Clean up device init error messages
  Strip trailing '\n' from error_report()'s first argument (again)
  qemu-options.hx: fix tls-channel help text

12 years agovirtio-9p-proxy: Fix typo causing compile failure on 32 bit hosts
Peter Maydell [Fri, 6 Jan 2012 18:47:21 +0000 (18:47 +0000)]
virtio-9p-proxy: Fix typo causing compile failure on 32 bit hosts

Fix a compile failure on 32 bit hosts (integer constant is too large
for 'unsigned long' type) by correcting a typo where the mask used
for filling in the second f_fsid word had too many 'F's in it.
Also drop the 'L' suffix that allowed this typo to go undetected on
64 bit hosts.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqemu-nbd: drop loop which can never loop
Stefan Hajnoczi [Thu, 5 Jan 2012 13:16:07 +0000 (13:16 +0000)]
qemu-nbd: drop loop which can never loop

For some reason nbd_client_thread() has a do..while loop which can never
loop, the condition is bogus because we would take a goto instead.  Drop
the loop.

Reported-by: Dr David Alan Gilbert <davidagilbert@uk.ibm.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoMake python mandatory
Sebastian Herbszt [Sat, 31 Dec 2011 11:14:47 +0000 (12:14 +0100)]
Make python mandatory

The QEMU build depends on Python so make it an explicit requirement.

Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agonet/socket.c: Fix fd leak in net_socket_listen_init() error paths
Peter Maydell [Sat, 24 Dec 2011 23:47:11 +0000 (23:47 +0000)]
net/socket.c: Fix fd leak in net_socket_listen_init() error paths

Fix a leak of a file descriptor due to missing closesocket() calls
in error paths in net_socket_listen_init().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agogdbstub: Fix fd leak in gdbserver_open() error path
Peter Maydell [Sat, 24 Dec 2011 23:37:24 +0000 (23:37 +0000)]
gdbstub: Fix fd leak in gdbserver_open() error path

Fix a leak of a file descriptor in error exit paths in
gdbserver_open().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoconfigure: Fix test for supported host CPU type
Peter Maydell [Sat, 24 Dec 2011 13:07:25 +0000 (13:07 +0000)]
configure: Fix test for supported host CPU type

The test for whether the host CPU is supported had several problems:
 * the attempt to fall back to TCI was done as a duplicate
   test, very late (so "--cpu foo" would fail early but "--cpu unicore32"
   would fail late, differently, and after configure had already
   printed a lot of output)
 * a number of CPUs only supported as guests were included in the
   list of CPUs we would accept as valid hosts, which would result
   in a late compile failure on those systems rather than a
   configure failure or fallback to TCI
 * bailing out for an unsupported CPU happened before the main
   option parsing, so "configure --help" wouldn't work

Fix these by folding the setting of ARCH into the first test for
supported host CPU, removing spurious guest-only CPU names from it,
and moving the "fall back to TCI" code earlier.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoconfigure: CONFIG_QEMU_INTERP_PREFIX only for user mode
Stefan Weil [Thu, 22 Dec 2011 10:26:10 +0000 (11:26 +0100)]
configure: CONFIG_QEMU_INTERP_PREFIX only for user mode

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoscsi virtio-blk usb-msd: Clean up device init error messages
Markus Armbruster [Wed, 21 Dec 2011 10:37:57 +0000 (11:37 +0100)]
scsi virtio-blk usb-msd: Clean up device init error messages

Replace

    error_report("DEVICE-NAME: MESSAGE");

by just

    error_report("MESSAGE");

in block device init functions.

DEVICE-NAME is bogus in some cases: it's "scsi-disk" for device
scsi-hd and scsi-cd, "virtio-blk-pci" for virtio-blk-s390, and
"usb-msd" for usb-storage.

There is no real need to put a device name in the message, because
error_report() points to the offending command line option already:

$ qemu-system-x86_64 --nodefaults --enable-kvm -vnc :0 -S -monitor stdio -usb -device virtio-blk-pci
upstream-qemu: -device virtio-blk-pci: virtio-blk-pci: drive property not set
upstream-qemu: -device virtio-blk-pci: Device 'virtio-blk-pci' could not be initialized

And for a monitor command, it's obvious anyway:

$ qemu-system-x86_64 --nodefaults --enable-kvm -vnc :0 -S -monitor stdio -usb
(qemu) device_add virtio-blk-pci
virtio-blk-pci: drive property not set
Device 'virtio-blk-pci' could not be initialized

Reported-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoStrip trailing '\n' from error_report()'s first argument (again)
Markus Armbruster [Tue, 20 Dec 2011 17:13:08 +0000 (18:13 +0100)]
Strip trailing '\n' from error_report()'s first argument (again)

Commit 6daf194d got rid of them, but Hans and Gerd added some more
lately.  Tracked down with this Coccinelle semantic patch:

@r@
    expression fmt;
    position p;
@@
    error_report(fmt, ...)@p
@script:python@
    fmt << r.fmt;
    p << r.p;
@@
if "\\n" in str(fmt):
    print "%s:%s:%s:%s" % (p[0].file, p[0].line, p[0].column, fmt)

Signed-off-by: Markus Armbruster <armbru@redhat.com>
12 years agoqemu-options.hx: fix tls-channel help text
Alon Levy [Tue, 20 Dec 2011 11:05:18 +0000 (13:05 +0200)]
qemu-options.hx: fix tls-channel help text

Remove the default compiled out tunnel channel, add the always available
cursor channel. Optimally the man page would depend on compiled in
options, but that's harder to do.

RHBZ: 688586

Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoMerge remote-tracking branch 'amit/master' into staging
Anthony Liguori [Fri, 6 Jan 2012 14:15:39 +0000 (08:15 -0600)]
Merge remote-tracking branch 'amit/master' into staging

* amit/master:
  virtio-console: Fix failure on unconnected pty

12 years agoMerge remote-tracking branch 'aneesh/for-upstream' into staging
Anthony Liguori [Fri, 6 Jan 2012 14:14:28 +0000 (08:14 -0600)]
Merge remote-tracking branch 'aneesh/for-upstream' into staging

* aneesh/for-upstream:
  hw/9pfs: Add support to use named socket for proxy FS
  hw/9pfs: man page for proxy helper
  hw/9pfs: Documentation changes related to proxy fs
  hw/9pfs: Proxy getversion
  hw/9pfs: xattr interfaces in proxy filesystem driver
  hw/9pfs: File ownership and others
  hw/9pfs: Add stat/readlink/statfs for proxy FS
  hw/9pfs: Create other filesystem objects
  hw/9pfs: Open and create files
  hw/9pfs: File system helper process for qemu 9p proxy FS
  hw/9pfs: Add new proxy filesystem driver
  hw/9pfs: Add validation to {un}marshal code
  hw/9pfs: Move pdu_marshal/unmarshal code to a seperate file
  hw/9pfs: Move opt validation to FsDriver callback

12 years agoMerge remote-tracking branch 'sstabellini/xen_mem_fix' into staging
Anthony Liguori [Fri, 6 Jan 2012 14:12:23 +0000 (08:12 -0600)]
Merge remote-tracking branch 'sstabellini/xen_mem_fix' into staging

* sstabellini/xen_mem_fix:
  xen: Fix after recent change in dirty bitmap tracking.

12 years agoMerge remote-tracking branch 'kraxel/usb.33' into staging
Anthony Liguori [Fri, 6 Jan 2012 14:11:41 +0000 (08:11 -0600)]
Merge remote-tracking branch 'kraxel/usb.33' into staging

* kraxel/usb.33:
  usb-ohci: td.cbp incorrectly updated near page end
  usb-host: properly release port on unplug & exit
  usb-storage: cancel I/O on reset
  Fix parse of usb device description with multiple configurations

12 years agousb-ohci: td.cbp incorrectly updated near page end
Andriy Gapon [Thu, 22 Dec 2011 09:34:30 +0000 (11:34 +0200)]
usb-ohci: td.cbp incorrectly updated near page end

The current code that updates the cbp value after a transfer looks like this:
td.cbp += ret;
if ((td.cbp & 0xfff) + ret > 0xfff) {
<handle page overflow>
because the 'ret' value is effectively added twice the check may fire too early
when the overflow hasn't happened yet.

Below is one of the possible changes that correct the behavior:

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-host: properly release port on unplug & exit
Gerd Hoffmann [Thu, 5 Jan 2012 14:49:18 +0000 (15:49 +0100)]
usb-host: properly release port on unplug & exit

Factor out port release into a separate function.  Call release function
in exit notifier too.  Add explicit call the USBDEVFS_RELEASE_PORT
ioctl, just closing the hub file handle seems not to be enougth.  Make
sure we release the port before resetting the device, otherwise host
drivers will not re-attach.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-storage: cancel I/O on reset
Gerd Hoffmann [Wed, 4 Jan 2012 17:13:54 +0000 (18:13 +0100)]
usb-storage: cancel I/O on reset

When resetting the usb-storage device we'll have to carefully cancel
and clear any requests which might be in flight, otherwise we'll confuse
the state machine.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoarm: add dummy A9-specific cp15 registers
Mark Langsdorf [Thu, 5 Jan 2012 15:49:06 +0000 (15:49 +0000)]
arm: add dummy A9-specific cp15 registers

Add dummy register support for the cp15, CRn=c15 registers.

config_base_register and power_control_register currently
default to 0, but may have improved support after the QOM
CPU patches are finished.

Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agotarget-arm: Ignore attempts to set invalid modes in CPSR
Peter Maydell [Thu, 5 Jan 2012 15:49:06 +0000 (15:49 +0000)]
target-arm: Ignore attempts to set invalid modes in CPSR

Ignore attempts to set the CPSR mode field to an invalid value.
This is UNPREDICTABLE, but we should not cpu_abort() for things
a malicious guest (or a confused user on the gdbstub interface)
can provoke.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agotarget-arm: Don't use cpu_single_env in bank_number()
Peter Maydell [Thu, 5 Jan 2012 15:49:06 +0000 (15:49 +0000)]
target-arm: Don't use cpu_single_env in bank_number()

Avoid using cpu_single_env in bank_number() -- if we were
called via the gdb stub reading or writing the CPSR then
it is NULL and we will segfault if we take the cpu_abort().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoxen: Fix after recent change in dirty bitmap tracking.
Anthony PERARD [Thu, 5 Jan 2012 12:47:08 +0000 (12:47 +0000)]
xen: Fix after recent change in dirty bitmap tracking.

A recent patch set from Avi break the dirty bitmap support of Xen. But
this is because xen_sync_dirty_bitmap will return an error for an
unhandled memory range (a0000 - bffff). However this is not a fatal
error, so we should just continue instead of aborting.

There is now an error printed when the Xen call failed.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
12 years agoMerge remote-tracking branch 'pmaydell/arm-devs.for-upstream' into staging
Anthony Liguori [Wed, 4 Jan 2012 16:06:25 +0000 (10:06 -0600)]
Merge remote-tracking branch 'pmaydell/arm-devs.for-upstream' into staging

* pmaydell/arm-devs.for-upstream:
  add L2x0/PL310 cache controller device
  arm: add dummy gic security registers
  arm: Set frequencies for arm_timer
  arm: add missing scu registers
  hw/omap_gpmc: Fix region map/unmap when configuring prefetch engine
  hw/omap1.c: Drop unused includes
  hw/omap1.c: Separate dpll_ctl from omap_mpu_state
  hw/omap1.c: Separate PWT from omap_mpu_state
  hw/omap1.c: Separate PWL from omap_mpu_state
  hw/omap1.c: omap_mpuio_init() need not be public
  hw/pl110.c: Add post-load hook to invalidate display
  hw/pl181.c: Add save/load support

12 years agohw/9pfs: Add support to use named socket for proxy FS
M. Mohan Kumar [Wed, 14 Dec 2011 08:28:47 +0000 (13:58 +0530)]
hw/9pfs: Add support to use named socket for proxy FS

Add option to use named socket for communicating between proxy helper
and qemu proxy FS. Access to socket can be given by using command line
options -u and -g.

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: man page for proxy helper
M. Mohan Kumar [Wed, 14 Dec 2011 08:28:47 +0000 (13:58 +0530)]
hw/9pfs: man page for proxy helper

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Documentation changes related to proxy fs
M. Mohan Kumar [Wed, 14 Dec 2011 08:28:46 +0000 (13:58 +0530)]
hw/9pfs: Documentation changes related to proxy fs

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Proxy getversion
M. Mohan Kumar [Wed, 14 Dec 2011 08:28:46 +0000 (13:58 +0530)]
hw/9pfs: Proxy getversion

Add proxy getversion to get generation number

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: xattr interfaces in proxy filesystem driver
M. Mohan Kumar [Wed, 14 Dec 2011 08:28:46 +0000 (13:58 +0530)]
hw/9pfs: xattr interfaces in proxy filesystem driver

Add xattr support for proxy FS

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: File ownership and others
M. Mohan Kumar [Wed, 14 Dec 2011 08:28:45 +0000 (13:58 +0530)]
hw/9pfs: File ownership and others

Add file ownership interfaces like chmod/chown, utime update, rename,
remove and truncating files for proxy FS

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Add stat/readlink/statfs for proxy FS
M. Mohan Kumar [Wed, 14 Dec 2011 08:28:45 +0000 (13:58 +0530)]
hw/9pfs: Add stat/readlink/statfs for proxy FS

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Create other filesystem objects
M. Mohan Kumar [Wed, 14 Dec 2011 08:28:45 +0000 (13:58 +0530)]
hw/9pfs: Create other filesystem objects

Add interfaces to create filesystem objects like directory,
device nodes, symbolic links, links for proxy filesytem driver

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Open and create files
M. Mohan Kumar [Wed, 14 Dec 2011 08:28:44 +0000 (13:58 +0530)]
hw/9pfs: Open and create files

Add interfaces to open and create files for proxy file system driver.

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: File system helper process for qemu 9p proxy FS
M. Mohan Kumar [Wed, 14 Dec 2011 08:28:42 +0000 (13:58 +0530)]
hw/9pfs: File system helper process for qemu 9p proxy FS

Provide root privilege access to QEMU 9p proxy filesystem using socket
communication.

Proxy helper is started by root user as:
~ # virtfs-proxy-helper -f|--fd <socket descriptor> -p|--path <path-to-share>

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Add new proxy filesystem driver
M. Mohan Kumar [Wed, 14 Dec 2011 08:19:28 +0000 (13:49 +0530)]
hw/9pfs: Add new proxy filesystem driver

Add new proxy filesystem driver to add root privilege to qemu process.
It needs a helper process to be started by root user.

Following command line can be used to utilize proxy filesystem driver
-virtfs proxy,id=<id>,mount_tag=<tag>,socket_fd=<socket-fd>

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Add validation to {un}marshal code
M. Mohan Kumar [Wed, 14 Dec 2011 08:19:13 +0000 (13:49 +0530)]
hw/9pfs: Add validation to {un}marshal code

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Move pdu_marshal/unmarshal code to a seperate file
M. Mohan Kumar [Wed, 14 Dec 2011 08:19:06 +0000 (13:49 +0530)]
hw/9pfs: Move pdu_marshal/unmarshal code to a seperate file

Move p9 marshaling/unmarshaling code to a separate file so that
proxy filesytem driver can use these calls. Also made marshaling
code generic to accept "struct iovec" instead of V9fsPDU.

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Move opt validation to FsDriver callback
Aneesh Kumar K.V [Wed, 14 Dec 2011 08:18:59 +0000 (13:48 +0530)]
hw/9pfs: Move opt validation to FsDriver callback

This remove all conditional code from common code path and
make opt validation a FSDriver callback.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agoadd L2x0/PL310 cache controller device
Rob Herring [Thu, 29 Dec 2011 06:19:54 +0000 (06:19 +0000)]
add L2x0/PL310 cache controller device

This is just a dummy device for ARM L2 cache controllers, based on the
pl310. The cache type parameter can be defined by a property value
and has a meaningful default.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com>
[Peter Maydell: removed stray blank line at end]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoarm: add dummy gic security registers
Rob Herring [Thu, 29 Dec 2011 06:19:53 +0000 (06:19 +0000)]
arm: add dummy gic security registers

Implement handling for the RAZ/WI gic security registers.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoarm: Set frequencies for arm_timer
Mark Langsdorf [Thu, 29 Dec 2011 06:19:51 +0000 (06:19 +0000)]
arm: Set frequencies for arm_timer

Use qdev properties to allow board modelers to set the frequencies
for the sp804 timer. Each of the sp804's timers can have an
individual frequency. The timers default to 1MHz.

Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoarm: add missing scu registers
Rob Herring [Thu, 29 Dec 2011 06:19:50 +0000 (06:19 +0000)]
arm: add missing scu registers

Add power control register to a9mpcore

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agohw/omap_gpmc: Fix region map/unmap when configuring prefetch engine
Peter Maydell [Tue, 20 Dec 2011 00:21:56 +0000 (00:21 +0000)]
hw/omap_gpmc: Fix region map/unmap when configuring prefetch engine

When configuring the prefetch engine (and also when resetting from
a state where the prefetch engine was enabled) be careful to adhere
to the "unmap/change config fields/map" ordering, to avoid trying
to delete the wrong MemoryRegions. This fixes an assertion failure
in some cases.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reported-by: Alexander Graf <agraf@suse.de>
Tested-by: Alexander Graf <agraf@suse.de>
12 years agohw/omap1.c: Drop unused includes
Peter Maydell [Tue, 20 Dec 2011 08:11:36 +0000 (08:11 +0000)]
hw/omap1.c: Drop unused includes

Drop includes of qemu-timer.h, qemu-char.h and pc.h as they are no
longer needed.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agohw/omap1.c: Separate dpll_ctl from omap_mpu_state
Juha Riihimäki [Tue, 20 Dec 2011 08:11:34 +0000 (08:11 +0000)]
hw/omap1.c: Separate dpll_ctl from omap_mpu_state

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agohw/omap1.c: Separate PWT from omap_mpu_state
Juha Riihimäki [Tue, 20 Dec 2011 08:11:33 +0000 (08:11 +0000)]
hw/omap1.c: Separate PWT from omap_mpu_state

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoRemove IO_MEM_SHIFT
Avi Kivity [Mon, 2 Jan 2012 15:21:07 +0000 (17:21 +0200)]
Remove IO_MEM_SHIFT

We no longer use any of the lower bits of a ram_addr, so we might as well
use them for the io table index.  This increases the number of potential
I/O handlers by a factor of 8.

Signed-off-by: Avi Kivity <avi@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
12 years agoDrop IO_MEM_ROMD
Avi Kivity [Mon, 2 Jan 2012 13:40:52 +0000 (15:40 +0200)]
Drop IO_MEM_ROMD

Unlike ->readonly, ->readable is not inherited from aliase, so we can simply
query the memory region.

Signed-off-by: Avi Kivity <avi@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
12 years agoRemove IO_MEM_SUBPAGE
Avi Kivity [Mon, 2 Jan 2012 11:20:11 +0000 (13:20 +0200)]
Remove IO_MEM_SUBPAGE

Replace with a MemoryRegion flag.

Signed-off-by: Avi Kivity <avi@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
12 years agoDirect dispatch through MemoryRegion
Avi Kivity [Mon, 2 Jan 2012 11:12:08 +0000 (13:12 +0200)]
Direct dispatch through MemoryRegion

Now that all mmio goes through MemoryRegions, we can convert
io_mem_opaque to be a MemoryRegion pointer, and remove the thunks
that convert from old-style CPU{Read,Write}MemoryFunc to MemoryRegionOps.

Signed-off-by: Avi Kivity <avi@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
12 years agoConvert io_mem_watch to be a MemoryRegion
Avi Kivity [Mon, 2 Jan 2012 10:47:48 +0000 (12:47 +0200)]
Convert io_mem_watch to be a MemoryRegion

Signed-off-by: Avi Kivity <avi@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
12 years agoConvert IO_MEM_SUBPAGE_RAM to be a MemoryRegion
Avi Kivity [Mon, 2 Jan 2012 10:41:07 +0000 (12:41 +0200)]
Convert IO_MEM_SUBPAGE_RAM to be a MemoryRegion

Signed-off-by: Avi Kivity <avi@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
12 years agoConvert the subpage wrapper to be a MemoryRegion
Avi Kivity [Mon, 2 Jan 2012 10:32:48 +0000 (12:32 +0200)]
Convert the subpage wrapper to be a MemoryRegion

Signed-off-by: Avi Kivity <avi@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
12 years agoSwitch cpu_register_physical_memory_log() to use MemoryRegions
Avi Kivity [Mon, 2 Jan 2012 10:17:03 +0000 (12:17 +0200)]
Switch cpu_register_physical_memory_log() to use MemoryRegions

Still internally using ram_addr.

Signed-off-by: Avi Kivity <avi@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
12 years agoConvert IO_MEM_{RAM,ROM,UNASSIGNED,NOTDIRTY} to MemoryRegions
Avi Kivity [Sun, 1 Jan 2012 22:32:15 +0000 (00:32 +0200)]
Convert IO_MEM_{RAM,ROM,UNASSIGNED,NOTDIRTY} to MemoryRegions

Convert the fixed-address IO_MEM_RAM, IO_MEM_ROM, IO_MEM_UNASSIGNED,
and IO_MEM_NOTDIRTY io handlers to MemoryRegions.  These aren't real
regions, since they are never added to the memory hierarchy, but they
allow reuse of the dispatch functionality.

Signed-off-by: Avi Kivity <avi@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
12 years agoUninline get_page_addr_code()
Avi Kivity [Sun, 1 Jan 2012 21:35:10 +0000 (23:35 +0200)]
Uninline get_page_addr_code()

Its use of IO_MEM_ROM and friends will later cause #include loops; and it
is too large to merit inlining.

Signed-off-by: Avi Kivity <avi@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
12 years agoAvoid range comparisons on io index types
Avi Kivity [Sun, 1 Jan 2012 19:15:42 +0000 (21:15 +0200)]
Avoid range comparisons on io index types

The code sometimes uses range comparisons on io indexes (e.g.
index =< IO_MEM_ROM).  Avoid these as they make moving to objects harder.

Signed-off-by: Avi Kivity <avi@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
12 years agoFix wrong region_offset when overlaying a page with another
Avi Kivity [Sun, 1 Jan 2012 16:24:24 +0000 (18:24 +0200)]
Fix wrong region_offset when overlaying a page with another

cpu_register_physical_memory_log() does not update region_offset
if a page was previously registered for the same address.  This
could cause mmio accesses going to the wrong place, by using the
old region_offset.

Signed-off-by: Avi Kivity <avi@redhat.com>
Acked-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Richard Henderson <rth@twiddle.net>
12 years agomemory: remove MemoryRegion::backend_registered
Avi Kivity [Sun, 1 Jan 2012 16:02:31 +0000 (18:02 +0200)]
memory: remove MemoryRegion::backend_registered

backend_registered was used to lazify the process of registering an
mmio region, since the it is different for the I/O address space and
the memory address space.  However, it also makes registration dependent
on the region being visible in the address space.  This is not the case
for "fake" regions, like watchpoints or IO_MEM_UNASSIGNED.

Remove backend_registered and always initialize the region.  If it turns
out to be part of the I/O address space, we've wasted an I/O slot, but
that's not too bad.  In any case this will be optimized later on.

Signed-off-by: Avi Kivity <avi@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
12 years agomemory: move mmio access to functions
Avi Kivity [Mon, 21 Nov 2011 10:27:03 +0000 (12:27 +0200)]
memory: move mmio access to functions

Currently mmio access goes directly to the io_mem_{read,write} arrays.
In preparation for eliminating them, add indirection via a function.

Signed-off-by: Avi Kivity <avi@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
12 years agoexec: make phys_page_find() return a temporary
Avi Kivity [Sun, 20 Nov 2011 15:52:22 +0000 (17:52 +0200)]
exec: make phys_page_find() return a temporary

Instead of returning a PhysPageDesc pointer, return a temporary.
This lets us move away from actually storing PhysPageDesc's, and
instead sythesising them when needed.

Signed-off-by: Avi Kivity <avi@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
12 years agomemory: move endianness compensation to memory core
Avi Kivity [Sun, 20 Nov 2011 14:22:55 +0000 (16:22 +0200)]
memory: move endianness compensation to memory core

Instead of doing device endianness compensation in cpu_register_io_memory(),
do it in the memory core.

Signed-off-by: Avi Kivity <avi@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
12 years agomemory: obsolete more dirty memory related functions
Avi Kivity [Wed, 21 Dec 2011 12:16:38 +0000 (14:16 +0200)]
memory: obsolete more dirty memory related functions

No longer used outside memory.c and exec.c.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoxen: convert framebuffer dirty tracking to memory API
Avi Kivity [Wed, 21 Dec 2011 12:21:27 +0000 (14:21 +0200)]
xen: convert framebuffer dirty tracking to memory API

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agomemory: obsolete cpu_physical_memory_[gs]et_dirty_tracking()
Avi Kivity [Wed, 21 Dec 2011 12:14:07 +0000 (14:14 +0200)]
memory: obsolete cpu_physical_memory_[gs]et_dirty_tracking()

The getter is no longer used, so it is completely removed.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoConvert ram_load() to the memory API
Avi Kivity [Wed, 21 Dec 2011 11:54:33 +0000 (13:54 +0200)]
Convert ram_load() to the memory API

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoRemove support for version 3 ram_load
Avi Kivity [Wed, 21 Dec 2011 11:37:56 +0000 (13:37 +0200)]
Remove support for version 3 ram_load

Version 3 ram_load depends on ram_addrs, which are not stable.  Version 4
was introduced in 0.13 (and RHEL 6), so this means live migration from 0.12
and earlier to 1.1 or later will not work.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoSort RAMBlocks by ID for migration, not by ram_addr
Avi Kivity [Wed, 21 Dec 2011 11:22:16 +0000 (13:22 +0200)]
Sort RAMBlocks by ID for migration, not by ram_addr

ram_addr is (a) unstable (b) going away.  Sort by idstr instead.

Commit b2e0a138e initially introduced the sorting for the purpose
of improving debuggability.  After this patch, the order is still
stable, but perhaps less usable by a human.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoSwitch ram_save to the memory API
Avi Kivity [Wed, 21 Dec 2011 11:11:22 +0000 (13:11 +0200)]
Switch ram_save to the memory API

Avoid using ram_addr_t, instead use (MemoryRegion *, offset) pairs.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoStore MemoryRegion in RAMBlock
Avi Kivity [Wed, 21 Dec 2011 11:09:49 +0000 (13:09 +0200)]
Store MemoryRegion in RAMBlock

As a step in moving live migration from RAMBlocks to MemoryRegions,
store the MemoryRegion in a RAMBlock.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agovmstate, memory: decouple vmstate from memory API
Avi Kivity [Tue, 20 Dec 2011 13:59:12 +0000 (15:59 +0200)]
vmstate, memory: decouple vmstate from memory API

Currently creating a memory region automatically registers it for
live migration.  This differs from other state (which is enumerated
in a VMStateDescription structure) and ties the live migration code
into the memory core.

Decouple the two by introducing a separate API, vmstate_register_ram(),
for registering a RAM block for migration.  Currently the same
implementation is reused, but later it can be moved into a separate list,
and registrations can be moved to VMStateDescription blocks.

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agomemory: introduce memory_region_name()
Avi Kivity [Tue, 20 Dec 2011 13:53:11 +0000 (15:53 +0200)]
memory: introduce memory_region_name()

Trivial accessor for the name attribute.

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoFix parse of usb device description with multiple configurations
Cao,Bing Bu [Tue, 13 Dec 2011 01:22:20 +0000 (09:22 +0800)]
Fix parse of usb device description with multiple configurations

Changed From V1:
Use DPRINTF instead of fprintf,because it is not an error.

When testing ipod on QEMU by He Jie Xu<xuhj@linux.vnet.ibm.com>,qemu made a assertion.
We found that the ipod with 2 configurations,and the usb-linux did not parse the descriptor correctly.
The descr_len returned is the total length of the all configurations,not one configuration.
The older version will through the other configurations instead of skip,continue parsing the descriptor of interfaces/endpoints in other configurations,then went wrong.

This patch will put the configuration descriptor parse in loop outside and dispel the other configurations not requested.

Signed-off-by: Cao,Bing Bu <mars@linux.vnet.ibm.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agohw/omap1.c: Separate PWL from omap_mpu_state
Juha Riihimäki [Tue, 20 Dec 2011 08:11:32 +0000 (08:11 +0000)]
hw/omap1.c: Separate PWL from omap_mpu_state

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agohw/omap1.c: omap_mpuio_init() need not be public
Peter Maydell [Tue, 20 Dec 2011 08:11:31 +0000 (08:11 +0000)]
hw/omap1.c: omap_mpuio_init() need not be public

omap_mpuio_init() is only used and defined in omap1.c, so make it static.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agohw/pl110.c: Add post-load hook to invalidate display
Peter Maydell [Mon, 19 Dec 2011 12:01:58 +0000 (12:01 +0000)]
hw/pl110.c: Add post-load hook to invalidate display

Add a post-load hook which invalidates the display. In particular, if we
don't do this and the display size we've just reloaded is larger than
the default then we will segfault trying to read off the end of the buffer.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agohw/pl181.c: Add save/load support
Peter Maydell [Mon, 19 Dec 2011 12:01:44 +0000 (12:01 +0000)]
hw/pl181.c: Add save/load support

Add save/load support to the PL181.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoMerge remote-tracking branch 'qemu-kvm/memory/page_desc' into staging
Anthony Liguori [Tue, 3 Jan 2012 20:39:05 +0000 (14:39 -0600)]
Merge remote-tracking branch 'qemu-kvm/memory/page_desc' into staging

* qemu-kvm/memory/page_desc: (22 commits)
  Remove cpu_get_physical_page_desc()
  sparc: avoid cpu_get_physical_page_desc()
  virtio-balloon: avoid cpu_get_physical_page_desc()
  vhost: avoid cpu_get_physical_page_desc()
  kvm: avoid cpu_get_physical_page_desc()
  memory: remove CPUPhysMemoryClient
  xen: convert to MemoryListener API
  memory: temporarily add memory_region_get_ram_addr()
  xen, vga: add API for registering the framebuffer
  vhost: convert to MemoryListener API
  kvm: convert to MemoryListener API
  kvm: switch kvm slots to use host virtual address instead of ram_addr_t
  memory: add API for observing updates to the physical memory map
  memory: replace cpu_physical_sync_dirty_bitmap() with a memory API
  framebuffer: drop use of cpu_physical_sync_dirty_bitmap()
  loader: remove calls to cpu_get_physical_page_desc()
  framebuffer: drop use of cpu_get_physical_page_desc()
  memory: introduce memory_region_find()
  memory: add memory_region_is_logging()
  memory: add memory_region_is_rom()
  ...

12 years agoRemove cpu_get_physical_page_desc()
Avi Kivity [Mon, 19 Dec 2011 14:01:08 +0000 (16:01 +0200)]
Remove cpu_get_physical_page_desc()

No longer used.

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agosparc: avoid cpu_get_physical_page_desc()
Avi Kivity [Mon, 19 Dec 2011 11:18:13 +0000 (13:18 +0200)]
sparc: avoid cpu_get_physical_page_desc()

This reaches into the innards of the memory core, which are being
changed.  Switch to a memory API version.

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agovirtio-balloon: avoid cpu_get_physical_page_desc()
Avi Kivity [Mon, 19 Dec 2011 11:18:13 +0000 (13:18 +0200)]
virtio-balloon: avoid cpu_get_physical_page_desc()

This reaches into the innards of the memory core, which are being
changed.  Switch to a memory API version.

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agovhost: avoid cpu_get_physical_page_desc()
Avi Kivity [Mon, 19 Dec 2011 11:18:13 +0000 (13:18 +0200)]
vhost: avoid cpu_get_physical_page_desc()

This reaches into the innards of the memory core, which are being
changed.  Switch to a memory API version.

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agokvm: avoid cpu_get_physical_page_desc()
Avi Kivity [Mon, 19 Dec 2011 11:18:13 +0000 (13:18 +0200)]
kvm: avoid cpu_get_physical_page_desc()

This reaches into the innards of the memory core, which are being
changed.  Switch to a memory API version.

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agomemory: remove CPUPhysMemoryClient
Avi Kivity [Mon, 19 Dec 2011 10:53:48 +0000 (12:53 +0200)]
memory: remove CPUPhysMemoryClient

No longer used.

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoxen: convert to MemoryListener API
Avi Kivity [Mon, 19 Dec 2011 10:07:50 +0000 (12:07 +0200)]
xen: convert to MemoryListener API

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoPPC: Add description for the Freescale e500mc core.
Varun Sethi [Thu, 22 Dec 2011 12:26:17 +0000 (12:26 +0000)]
PPC: Add description for the Freescale e500mc core.

This core is found on chips such as p4080, p3041, p2040, and p5020.

More needs to be done to make this viable for TCG (such as missing SPRs
and instructions), but this suffices to get KVM running with appropriate
kernel support.

Signed-off-by: Varun Sethi <Varun.Sethi@freescale.com>
[scottwood@freescale.com: tweak some flags]
Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agopseries: Check for duplicate addresses on the spapr-vio bus
Michael Ellerman [Mon, 12 Dec 2011 18:24:35 +0000 (18:24 +0000)]
pseries: Check for duplicate addresses on the spapr-vio bus

Check that devices on the spapr vio bus aren't given duplicate
addresses. Currently we will not run with duplicate devices, the
fdt code will spot it, but the error reporting is not great. With
this patch we can report the error nicely in terms of the device
names given by the user.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agopseries: Populate "/chosen/linux,stdout-path" in the FDT
David Gibson [Tue, 13 Dec 2011 04:24:34 +0000 (15:24 +1100)]
pseries: Populate "/chosen/linux,stdout-path" in the FDT

There is a device tree property "/chosen/linux,stdout-path" which indicates
which device should be used as stdout - ie. "the console".

Currently we don't specify anything, which means both firmware and Linux
choose something arbitrarily. Use the routine we added in the last patch
to pick a default vty and specify it as stdout.

Currently SLOF doesn't use the property, but we are hoping to update it
to do so.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agopseries: Add a routine to find a stable "default" vty and use it
David Gibson [Mon, 12 Dec 2011 18:24:33 +0000 (18:24 +0000)]
pseries: Add a routine to find a stable "default" vty and use it

In vty_lookup() we have a special case for supporting early debug in
the kernel. This accepts reg == 0 as a special case to mean "any vty".

We implement this by searching the vtys on the bus and returning the
first we find. This means that the vty we chose depends on the order
the vtys are specified on the QEMU command line - because that determines
the order of the vtys on the bus.

We'd rather the command line order was irrelevant, so instead return
the vty with the lowest reg value. This is still a guess as to what the
user really means, but it is at least stable WRT command line ordering.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
[agraf] fix braces

12 years agopseries: Emit device tree nodes in reg order
David Gibson [Mon, 12 Dec 2011 18:24:32 +0000 (18:24 +0000)]
pseries: Emit device tree nodes in reg order

Although in theory the device tree has no inherent ordering, in practice
the order of nodes in the device tree does effect the order that devices
are detected by software.

Currently the ordering is determined by the order the devices appear on
the QEMU command line. Although that does give the user control over the
ordering, it is fragile, especially when the user does not generate the
command line manually - eg. when using libvirt etc.

So order the device tree based on the reg value, ie. the address of on
the VIO bus of the devices. This gives us a sane and stable ordering.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
[agraf] add braces

12 years agopseries: FDT NUMA extensions to support multi-node guests
Bharata B Rao [Mon, 12 Dec 2011 18:24:30 +0000 (18:24 +0000)]
pseries: FDT NUMA extensions to support multi-node guests

Add NUMA specific properties to guest's device tree to boot a multi-node
guests. This patch adds the following properties:

ibm,associativity
ibm,architecture-vec-5
ibm,associativity-reference-points

With this, it becomes possible to use -numa option on pseries targets.

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agopseries: Remove hcalls callback
David Gibson [Mon, 12 Dec 2011 18:24:28 +0000 (18:24 +0000)]
pseries: Remove hcalls callback

For forgotten historical reasons, PAPR hypercalls for specific virtual IO
devices (oh which there are quite a number) are registered via a callback
in the VIOsPAPRDeviceInfo structure.

This is kind of ugly, so this patch instead registers hypercalls from
device_init() functions for each device type.  This works just as well,
and is cleaner.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agokvm-ppc: halt secondary cpus when guest reset
Liu Yu-B13201 [Mon, 28 Nov 2011 20:41:18 +0000 (20:41 +0000)]
kvm-ppc: halt secondary cpus when guest reset

When guest reset, we need to halt secondary cpus until guest kick them.
This already works for tcg. The patch add the support for kvm.

Signed-off-by: Liu Yu <yu.liu@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
[agraf: remove in-kernel irqchip code]

12 years agoconsole: Fix segfault on screendump without VGA adapter
Alexander Graf [Fri, 18 Nov 2011 15:41:59 +0000 (16:41 +0100)]
console: Fix segfault on screendump without VGA adapter

When trying to create a screen dump without having any VGA adapter
inside the guest, QEMU segfaults.

This is because it's trying to switch back to the "previous" screen
it was on before dumping the VGA screen. Unfortunately, in my case
there simply is no previous screen so it accesses a NULL pointer.

Fix it by checking if previous_active_console is actually available.

This is 1.0 material.

Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agoPPC: monitor: add ability to dump SLB entries
Nishanth Aravamudan [Tue, 1 Nov 2011 09:57:52 +0000 (09:57 +0000)]
PPC: monitor: add ability to dump SLB entries

When run with a PPC Book3S (server) CPU Currently 'info tlb' in the
qemu monitor reports "dump_mmu: unimplemented".  However, during
bringup work, it can be quite handy to have the SLB entries, which are
available in the CPUPPCState.  This patch adds an implementation of
info tlb for book3s, which dumps the SLB.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>