]> git.proxmox.com Git - qemu.git/log
qemu.git
11 years agopvpanic: create pvpanic by default for machine 1.5
Hu Tao [Fri, 26 Apr 2013 03:24:46 +0000 (11:24 +0800)]
pvpanic: create pvpanic by default for machine 1.5

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: f840042f0e1205041f8feaf0d39ca639884f3a00.1366945969.git.hutao@cn.fujitsu.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopvpanic: add document of pvpanic
Hu Tao [Fri, 26 Apr 2013 03:24:45 +0000 (11:24 +0800)]
pvpanic: add document of pvpanic

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: a5db4ce406647e8f4663b639eae62d880531df8b.1366945969.git.hutao@cn.fujitsu.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopvpanic: pass configurable ioport to seabios
Hu Tao [Fri, 26 Apr 2013 03:24:44 +0000 (11:24 +0800)]
pvpanic: pass configurable ioport to seabios

This lets seabios patch the corresponding SSDT entry.

Also add fw_cfg object to /machine/fw_cfg so we can reference
it elsewhere.

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: 60c65d95fe2b23b12bea67099126566010a11a1a.1366945969.git.hutao@cn.fujitsu.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agofw_cfg: add required header files
Hu Tao [Fri, 26 Apr 2013 03:24:43 +0000 (11:24 +0800)]
fw_cfg: add required header files

If fw_cfg.h is included alone, gcc gives error messages like these:

  error: unknown type name ‘uint32_t’
  error: unknown type name ‘size_t’
  error: unknown type name ‘hwaddr’
  ...

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: d63f8bcdbfbec8135b1b57f9247c513a3e25762c.1366945969.git.hutao@cn.fujitsu.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agointroduce a new qom device to deal with panicked event
Hu Tao [Fri, 26 Apr 2013 03:24:42 +0000 (11:24 +0800)]
introduce a new qom device to deal with panicked event

pvpanic device is used to send guest panic event from guest to qemu.

When guest panic happens, pvpanic device driver will write a event
number to IO port 0x505(which is the IO port occupied by pvpanic device,
by default). On receiving the event, pvpanic device will pause guest
cpu(s), and send a qmp event QEVENT_GUEST_PANICKED.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: b66077a40235b3531632a05a6ff373850afc7d2e.1366945969.git.hutao@cn.fujitsu.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoadd a new qevent: QEVENT_GUEST_PANICKED
Hu Tao [Fri, 26 Apr 2013 03:24:41 +0000 (11:24 +0800)]
add a new qevent: QEVENT_GUEST_PANICKED

This event will be emited when qemu detects guest panic.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: cf0bc45ecf9ecd3699bc72dc39f8cbab8ed79d8c.1366945969.git.hutao@cn.fujitsu.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoadd a new runstate: RUN_STATE_GUEST_PANICKED
Hu Tao [Fri, 26 Apr 2013 03:24:40 +0000 (11:24 +0800)]
add a new runstate: RUN_STATE_GUEST_PANICKED

The guest will be in this state when it is panicked.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: 0255f263ffdc2a3716f73e89098b96fd79a235b3.1366945969.git.hutao@cn.fujitsu.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqdev: Report errors collected during device realization
Jan Kiszka [Mon, 29 Apr 2013 12:35:08 +0000 (14:35 +0200)]
qdev: Report errors collected during device realization

Better than just releasing the error object silently.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Message-id: 517E68FC.6030400@siemens.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agorules.mk: Fix build breakage
Dunrong Huang [Mon, 29 Apr 2013 14:52:12 +0000 (22:52 +0800)]
rules.mk: Fix build breakage

The following error occurs when building dtc module:

        CHK version_gen.h
         CC libfdt/fdt.o
cc1: error: dtc: No such file or directory [-Werror]
cc1: all warnings being treated as errors
make[1]: *** [libfdt/fdt.o] Error 1
make: *** [subdir-dtc] Error 2

In rules.mak, "-I$(<D) -I$(@D)" was expanded to "-Idtc -I." when
building submodule dct. Due to the using of "-Wmissing-include-dirs,
a warning would be rarsed. To avoid it, add "-I$(<D) -I$(@D)" to
QEMU_INCLUDES instead of QEMU_CFLAGS so that QEMU_CFLAGS does not
contain the "-Idtc".

Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Dunrong Huang <riegamaths@gmail.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1367247132-19622-1-git-send-email-riegamaths@gmail.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoQOM: Fail casts for unknown types
Alexander Graf [Tue, 30 Apr 2013 13:02:16 +0000 (15:02 +0200)]
QOM: Fail casts for unknown types

When we try to cast an object to an unknown type, fail the cast. Today
we would simply run into an assert().

This fixes a bug on qemu-system-s390x for me that gets triggered by the
audio code looking for PCI and ISA buses.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1367326936-28539-1-git-send-email-agraf@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopc_piix: remove undesired change in pc_init1
Paolo Bonzini [Tue, 30 Apr 2013 14:00:32 +0000 (16:00 +0200)]
pc_piix: remove undesired change in pc_init1

Introduced when applying commit f81222b (audio: look for the ISA and
PCI buses, 2013-04-18).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1367330432-14417-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoaudio: enable PCI audio cards for all PCI-enabled targets
Paolo Bonzini [Thu, 18 Apr 2013 16:44:04 +0000 (18:44 +0200)]
audio: enable PCI audio cards for all PCI-enabled targets

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1366303444-24620-9-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoaudio: look for the ISA and PCI buses
Paolo Bonzini [Thu, 18 Apr 2013 16:44:03 +0000 (18:44 +0200)]
audio: look for the ISA and PCI buses

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1366303444-24620-8-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqom: do not return root for empty path
Paolo Bonzini [Thu, 18 Apr 2013 16:44:02 +0000 (18:44 +0200)]
qom: do not return root for empty path

An empty path will return the sole object of that type in the
QOM tree.  This is different from "/", which returns the root.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1366303444-24620-7-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoaudio: replace audio card configuration with default-configs
Paolo Bonzini [Thu, 18 Apr 2013 16:44:01 +0000 (18:44 +0200)]
audio: replace audio card configuration with default-configs

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1366303444-24620-6-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoaudio: remove CONFIG_* symbols
Paolo Bonzini [Thu, 18 Apr 2013 16:44:00 +0000 (18:44 +0200)]
audio: remove CONFIG_* symbols

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1366303444-24620-5-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoaudio: remove HAS_AUDIO
Paolo Bonzini [Thu, 18 Apr 2013 16:43:59 +0000 (18:43 +0200)]
audio: remove HAS_AUDIO

Several targets can have wavcapture/-soundhw support via PCI cards.
HAS_AUDIO is a useless limitation, remove it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1366303444-24620-4-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoaudio: remove the need for audio card CONFIG_* symbols
Paolo Bonzini [Thu, 18 Apr 2013 16:43:58 +0000 (18:43 +0200)]
audio: remove the need for audio card CONFIG_* symbols

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1366303444-24620-3-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoadlib: qdev-ify
Paolo Bonzini [Thu, 18 Apr 2013 16:43:57 +0000 (18:43 +0200)]
adlib: qdev-ify

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1366303444-24620-2-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agodoc: document the Pseudo-encoding of LED state
Lei Li [Thu, 25 Apr 2013 05:29:12 +0000 (13:29 +0800)]
doc: document the Pseudo-encoding of LED state

Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1366867752-11578-5-git-send-email-lilei@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovnc: Adjust lock state sync logic with VNC_FEATURE_LED_STATE
Lei Li [Thu, 25 Apr 2013 05:29:11 +0000 (13:29 +0800)]
vnc: Adjust lock state sync logic with VNC_FEATURE_LED_STATE

Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1366867752-11578-4-git-send-email-lilei@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovnc: Support for LED state extension
Lei Li [Thu, 25 Apr 2013 05:29:10 +0000 (13:29 +0800)]
vnc: Support for LED state extension

Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1366867752-11578-3-git-send-email-lilei@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovnc: Add SCROLL lock key to kbd_leds
Lei Li [Thu, 25 Apr 2013 05:29:09 +0000 (13:29 +0800)]
vnc: Add SCROLL lock key to kbd_leds

Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1366867752-11578-2-git-send-email-lilei@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agolibqos: Convert fw_cfg values to host endianness
Andreas Färber [Sun, 28 Apr 2013 16:45:47 +0000 (18:45 +0200)]
libqos: Convert fw_cfg values to host endianness

The fw_cfg ABI is Little Endian, so byte-swap the generically read
byte array to host endianness.

This unbreaks the fw_cfg tests on ppc.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367167547-19931-1-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agowdt_ib700: QOM'ify
Andreas Färber [Sat, 27 Apr 2013 20:18:55 +0000 (22:18 +0200)]
wdt_ib700: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-21-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovmport: QOM'ify
Andreas Färber [Sat, 27 Apr 2013 20:18:54 +0000 (22:18 +0200)]
vmport: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST().
Prepares for ISA realizefn.

Drop reserved underscore from struct name while at it.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-20-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovmmouse: QOM'ify
Andreas Färber [Sat, 27 Apr 2013 20:18:53 +0000 (22:18 +0200)]
vmmouse: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST() and
container_of(). Prepares for ISA realizefn.

Remove reserved underscore from struct name while at it.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-19-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovga-isa: QOM'ify ISA VGA
Andreas Färber [Sat, 27 Apr 2013 20:18:52 +0000 (22:18 +0200)]
vga-isa: QOM'ify ISA VGA

Introduce type constant and cast macro to obsolete DO_UPCAST() and
container_of(). Prepares for ISA realizefn.

Unify function naming scheme while at it.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-18-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agosga: QOM'ify
Andreas Färber [Sat, 27 Apr 2013 20:18:51 +0000 (22:18 +0200)]
sga: QOM'ify

Introduce type constant and cast macro.

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-17-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoserial: QOM'ify ISA serial
Andreas Färber [Sat, 27 Apr 2013 20:18:50 +0000 (22:18 +0200)]
serial: QOM'ify ISA serial

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-16-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agosb16: QOM'ify
Andreas Färber [Sat, 27 Apr 2013 20:18:49 +0000 (22:18 +0200)]
sb16: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-15-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopcspk: QOM'ify
Andreas Färber [Sat, 27 Apr 2013 20:18:48 +0000 (22:18 +0200)]
pcspk: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-14-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopckbd: QOM'ify
Andreas Färber [Sat, 27 Apr 2013 20:18:47 +0000 (22:18 +0200)]
pckbd: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-13-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopc: QOM'ify port 92
Andreas Färber [Sat, 27 Apr 2013 20:18:46 +0000 (22:18 +0200)]
pc: QOM'ify port 92

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-12-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoparallel: QOM'ify
Andreas Färber [Sat, 27 Apr 2013 20:18:45 +0000 (22:18 +0200)]
parallel: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-11-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agone2000-isa: QOM'ify
Andreas Färber [Sat, 27 Apr 2013 20:18:44 +0000 (22:18 +0200)]
ne2000-isa: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-10-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agomc146818rtc: QOM'ify
Andreas Färber [Sat, 27 Apr 2013 20:18:43 +0000 (22:18 +0200)]
mc146818rtc: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-9-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agom48t59: QOM'ify ISA M48T59 NVRAM
Andreas Färber [Sat, 27 Apr 2013 20:18:42 +0000 (22:18 +0200)]
m48t59: QOM'ify ISA M48T59 NVRAM

Introduce type constant and cast macro to obsolete DO_UPCAST() and
container_of().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-8-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoide: QOM'ify ISA IDE
Andreas Färber [Sat, 27 Apr 2013 20:18:41 +0000 (22:18 +0200)]
ide: QOM'ify ISA IDE

Introduce type constant and cast macro to obsolete DO_UPCAST().
Add missing braces.

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-7-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoi8259: QOM cleanups
Andreas Färber [Sat, 27 Apr 2013 20:18:40 +0000 (22:18 +0200)]
i8259: QOM cleanups

Eliminate DO_UPCAST() for PICCommonState. Prepares for ISA realizefn.

Also give the i8259_common type registration functions unique names
while at it.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-6-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoi82374: QOM'ify
Andreas Färber [Sat, 27 Apr 2013 20:18:39 +0000 (22:18 +0200)]
i82374: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-5-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agofdc: QOM'ify ISA floppy controller
Andreas Färber [Sat, 27 Apr 2013 20:18:38 +0000 (22:18 +0200)]
fdc: QOM'ify ISA floppy controller

Introduce type constant and cast macro to obsolete DO_UPCAST().
Reuse type constant for PC machine compatibility settings.

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-4-git-send-email-afaerber@suse.de
Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agocirrus_vga: QOM'ify ISA Cirrus VGA
Andreas Färber [Sat, 27 Apr 2013 20:18:37 +0000 (22:18 +0200)]
cirrus_vga: QOM'ify ISA Cirrus VGA

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-3-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoapplesmc: QOM'ify
Andreas Färber [Sat, 27 Apr 2013 20:18:36 +0000 (22:18 +0200)]
applesmc: QOM'ify

Add a typedef for the state struct and rename from Status to State.
Add type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-2-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-net: unbreak the minix guest
Jason Wang [Thu, 25 Apr 2013 07:24:23 +0000 (15:24 +0800)]
virtio-net: unbreak the minix guest

Multiqueue patchset conditionally add control vq only when guest negotiate the
feature. Though the spec is not clear on this but it breaks the minix guest
since it will identify the ctrl vq even if it does not support it. Though this
behavior seems a violation on the spec "If the VIRTIO_NET_F_CTRL_VQ feature bit
is negotiated, identify the control virtqueue.", to keep the backward
compatibility, always add the ctrl vq at end of the queues.

Reported-by: Aurelien Jarno <aurelien@aurel32.net>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Message-id: 1366874663-2566-1-git-send-email-jasowang@redhat.com
Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'bonzini/migration-writev' into staging
Anthony Liguori [Mon, 29 Apr 2013 13:26:47 +0000 (08:26 -0500)]
Merge remote-tracking branch 'bonzini/migration-writev' into staging

# By Paolo Bonzini
# Via Paolo Bonzini
* bonzini/migration-writev:
  win32: add readv/writev emulation
  win32: generate console executable again
  win32: move Makefile dependencies on version-obj-y to rules.mak
  win32: add generic RC rules to rules.mak

Message-id: 1367230284-24612-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'alon/libcacard_ccid.2' into staging
Anthony Liguori [Mon, 29 Apr 2013 13:26:39 +0000 (08:26 -0500)]
Merge remote-tracking branch 'alon/libcacard_ccid.2' into staging

# By Cole Robinson
# Via Alon Levy
* alon/libcacard_ccid.2:
  ccid: Fix crash when backend isn't specified

Message-id: 20130426234357.GA12457@garlic.tami
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agowin32: add readv/writev emulation
Paolo Bonzini [Sun, 21 Apr 2013 10:01:06 +0000 (12:01 +0200)]
win32: add readv/writev emulation

Commit e9d8fbf (qemu-file: do not use stdio for qemu_fdopen, 2013-03-27)
introduced a usage of writev, which mingw32 does not have.  Even though
qemu_fdopen itself is not used on mingw32, the future-proof solution is
to add an implementation of it.  This is simple and similar to how we
emulate sendmsg/recvmsg in util/iov.c.

Some files include osdep.h without qemu-common.h, so move the definition
of iovec to osdep.h too, and include osdep.h from qemu-common.h
unconditionally (protection against including files when NEED_CPU_H is
defined is not needed since the removal of AREG0).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agosparc64: use direct interrupt mapping for PCI devices
Artyom Tarasenko [Sat, 27 Apr 2013 05:55:13 +0000 (07:55 +0200)]
sparc64: use direct interrupt mapping for PCI devices

Every PCI Slot in PBM has 4 directly mapped IRQ lines.
Use the IRQ routing schema 0bssnn (Bus, Slot, interrupt Number)
described in Section 19.3.3 of UltraSPARC™-IIi User's Manual.

Please note that this patch requires the OpenBIOS counterpart patch.

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agosparc64: fix loosing interrupts
Artyom Tarasenko [Sat, 27 Apr 2013 05:55:12 +0000 (07:55 +0200)]
sparc64: fix loosing interrupts

- clear interrupts only on writing to the interrupt clear registers
- don't overwrite a currently active interrupt request
- use the correct addresses for the interrupt clear registers
  (section 19.3.3.3 of the UltraSPARC™-IIi User’s Manual)

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agosparc64: allow 64 IRQ lines
Artyom Tarasenko [Sat, 27 Apr 2013 05:55:11 +0000 (07:55 +0200)]
sparc64: allow 64 IRQ lines

According to UltraSPARC™-IIi User’s Manual, PBM has 64 IRQ lines.

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotcg-arm: Remove long jump from tcg_out_goto_label
Richard Henderson [Tue, 23 Apr 2013 20:07:40 +0000 (13:07 -0700)]
tcg-arm: Remove long jump from tcg_out_goto_label

Branches within a TB will always be within 16MB.

Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-arm: Convert to CONFIG_QEMU_LDST_OPTIMIZATION
Richard Henderson [Wed, 13 Mar 2013 22:24:33 +0000 (15:24 -0700)]
tcg-arm: Convert to CONFIG_QEMU_LDST_OPTIMIZATION

Move the slow path out of line, as the TODO's mention.
This allows the fast path to be unconditional, which can
speed up the fast path as well, depending on the core.

Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-arm: Use movi32 + blx for calls on v7
Richard Henderson [Wed, 13 Mar 2013 20:40:43 +0000 (13:40 -0700)]
tcg-arm: Use movi32 + blx for calls on v7

Work better with branch predition when we have movw+movt,
as the size of the code is the same.  Perhaps re-evaluate
when we have a proper constant pool.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-arm: Delete the 'S' constraint
Richard Henderson [Tue, 23 Apr 2013 15:38:50 +0000 (08:38 -0700)]
tcg-arm: Delete the 'S' constraint

After the previous patch, 's' and 'S' are the same.

Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-arm: Improve scheduling of tcg_out_tlb_read
Richard Henderson [Wed, 13 Mar 2013 06:18:30 +0000 (23:18 -0700)]
tcg-arm: Improve scheduling of tcg_out_tlb_read

The schedule was fully serial, with no possibility for dual issue.
The old schedule had a minimal issue of 7 cycles; the new schedule
has a minimal issue of 5 cycles.

Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-arm: Split out tcg_out_tlb_read
Richard Henderson [Wed, 13 Mar 2013 01:18:07 +0000 (18:18 -0700)]
tcg-arm: Split out tcg_out_tlb_read

Share code between qemu_ld and qemu_st to process the tlb.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-arm: Cleanup most primitive load store subroutines
Richard Henderson [Tue, 12 Mar 2013 22:06:53 +0000 (15:06 -0700)]
tcg-arm: Cleanup most primitive load store subroutines

Use even more primitive helper functions to avoid lots of duplicated code.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-arm: Cleanup multiply subroutines
Richard Henderson [Tue, 12 Mar 2013 17:34:18 +0000 (10:34 -0700)]
tcg-arm: Cleanup multiply subroutines

Make the code more readable by only having one copy of the magic
numbers, swapping registers as needed prior to that.  Speed the
compiler by not applying the rd == rn avoidance for v6 or later.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-arm: Use R12 for the tcg temporary
Richard Henderson [Tue, 12 Mar 2013 16:50:25 +0000 (09:50 -0700)]
tcg-arm: Use R12 for the tcg temporary

R12 is call clobbered, while R8 is call saved.  This change
gives tcg one more call saved register for real data.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-arm: Use TCG_REG_TMP name for the tcg temporary
Richard Henderson [Tue, 12 Mar 2013 16:49:04 +0000 (09:49 -0700)]
tcg-arm: Use TCG_REG_TMP name for the tcg temporary

Don't hard-code R8.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-arm: Implement division instructions
Richard Henderson [Tue, 12 Mar 2013 05:11:30 +0000 (22:11 -0700)]
tcg-arm: Implement division instructions

An armv7 extension implements division, present on Cortex A15.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-arm: Implement deposit for armv7
Richard Henderson [Tue, 5 Mar 2013 05:12:30 +0000 (21:12 -0800)]
tcg-arm: Implement deposit for armv7

We have BFI and BFC available for implementing it.

Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-arm: Improve constant generation
Richard Henderson [Tue, 5 Mar 2013 07:16:24 +0000 (23:16 -0800)]
tcg-arm: Improve constant generation

Try fully rotated arguments to mov and mvn before trying movt
or full decomposition.  Begin decomposition with mvn when it
looks like it'll help.  Examples include

-:        mov   r9, #0x00000fa0
-:        orr   r9, r9, #0x000ee000
-:        orr   r9, r9, #0x0ff00000
-:        orr   r9, r9, #0xf0000000
+:        mvn   r9, #0x0000005f
+:        eor   r9, r9, #0x00011000

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-arm: Handle constant arguments to add2/sub2
Richard Henderson [Tue, 12 Mar 2013 02:51:56 +0000 (19:51 -0700)]
tcg-arm: Handle constant arguments to add2/sub2

We get to re-use the _rIN and _rIK subroutines to handle the various
combinations of add vs sub.  Fold the << 21 into the opcode enum values
so that we can explicitly add TO_CPSR as desired.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-arm: Use tcg_out_dat_rIN for compares
Richard Henderson [Tue, 12 Mar 2013 01:21:59 +0000 (18:21 -0700)]
tcg-arm: Use tcg_out_dat_rIN for compares

This allows us to emit CMN instructions.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-arm: Allow constant first argument to sub
Richard Henderson [Tue, 12 Mar 2013 01:04:14 +0000 (18:04 -0700)]
tcg-arm: Allow constant first argument to sub

This allows the generation of RSB instructions.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-arm: Handle negated constant arguments to and/sub
Richard Henderson [Tue, 5 Mar 2013 06:06:21 +0000 (22:06 -0800)]
tcg-arm: Handle negated constant arguments to and/sub

This greatly improves code generation for addition of small
negative constants.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-arm: Use bic to implement and with constant
Richard Henderson [Tue, 5 Mar 2013 05:36:45 +0000 (21:36 -0800)]
tcg-arm: Use bic to implement and with constant

This greatly improves the code we can produce for deposit
without armv7 support.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg: Log the contents of the prologue with -d out_asm
Richard Henderson [Sun, 31 Mar 2013 20:15:19 +0000 (13:15 -0700)]
tcg: Log the contents of the prologue with -d out_asm

This makes it easier to verify changes to the code
generating the prologue.

[Aurelien: change the format from %i to %zu]

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agoccid: Fix crash when backend isn't specified
Cole Robinson [Sun, 14 Apr 2013 20:06:59 +0000 (16:06 -0400)]
ccid: Fix crash when backend isn't specified

Reproducer:

./x86_64-softmmu/qemu-system-x86_64 -device usb-ccid,id=ccid0 -usb -device ccid-card-emulated -monitor stdio

Signed-off-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
11 years agotcg-arm: Fix local stack frame
Richard Henderson [Wed, 13 Mar 2013 00:11:40 +0000 (17:11 -0700)]
tcg-arm: Fix local stack frame

We were not allocating TCG_STATIC_CALL_ARGS_SIZE, so this meant that
any helper with more than 4 arguments would clobber the saved regs.
Realizing that we're supposed to have this memory pre-allocated means
we can clean up the tcg_out_arg functions, which were trying to do
more stack allocation.

Allocate stack memory for the TCG temporaries while we're at it.

Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg: fix deposit_i64 op on 32-bit targets
Aurelien Jarno [Sat, 20 Apr 2013 22:42:56 +0000 (00:42 +0200)]
tcg: fix deposit_i64 op on 32-bit targets

On 32-bit TCG targets, when emulating deposit_i64 with a mov_i32 +
deposit_i32, care should be taken to not overwrite the low part of
the second argument before the deposit when it is the same the
destination.

This fixes the shld instruction in qemu-system-x86_64, which in turns
fixes booting "system rescue CD version 2.8.0" on this target.

Reported-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-ppc: slightly optimize lfiwax
Aurelien Jarno [Fri, 26 Apr 2013 22:37:46 +0000 (00:37 +0200)]
target-ppc: slightly optimize lfiwax

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agoMerge branch 'ppc-for-upstream' of git://github.com/agraf/qemu
Aurelien Jarno [Fri, 26 Apr 2013 22:33:23 +0000 (00:33 +0200)]
Merge branch 'ppc-for-upstream' of git://github.com/agraf/qemu

* 'ppc-for-upstream' of git://github.com/agraf/qemu: (30 commits)
  target-ppc: add support for extended mtfsf/mtfsfi forms
  target-ppc: emulate store doubleword pair instructions
  target-ppc: emulate load doubleword pair instructions
  target-ppc: emulate lfiwax instruction
  target-ppc: emulate fcpsgn instruction
  target-ppc: emulate prtyw and prtyd instructions
  target-ppc: emulate cmpb instruction
  target-ppc: add instruction flags for Book I 2.05
  disas: Disassemble all ppc insns for the guest
  target-ppc: optimize fabs, fnabs, fneg
  PPC: Fix dcbz for linux-user on 970
  powerpc: correctly handle fpu exceptions.
  pseries: Generate device paths for VIO devices
  pseries: Convert VIO code to QOM style type safe(ish) casts
  target-ppc: Synchronize VPA state with KVM
  pseries: Fix some small errors in XICS logic
  target-ppc: Add more stubs for POWER7 PMU registers
  pseries: Fixes and enhancements to L1 cache properties
  pseries: Fix incorrect calculation of RMA size in certain configurations
  PPC: Fix compile with profiling enabled
  ...

11 years agowin32: generate console executable again
Paolo Bonzini [Wed, 24 Apr 2013 20:57:59 +0000 (22:57 +0200)]
win32: generate console executable again

The -mwindows option is not anymore in LIBS at this point of the Makefile,
it is only in libs_softmmu.  Check the right variable.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agowin32: move Makefile dependencies on version-obj-y to rules.mak
Paolo Bonzini [Fri, 26 Apr 2013 22:27:48 +0000 (00:27 +0200)]
win32: move Makefile dependencies on version-obj-y to rules.mak

This makes the test on $(LIBTOOL) work.  Otherwise, LIBTOOL
is /bin/false by the time the test is done.

Fixes Win32 compilation without a working cross-libtool.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agowin32: add generic RC rules to rules.mak
Paolo Bonzini [Fri, 26 Apr 2013 22:25:31 +0000 (00:25 +0200)]
win32: add generic RC rules to rules.mak

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agotarget-ppc: add support for extended mtfsf/mtfsfi forms
Aurelien Jarno [Sat, 20 Apr 2013 08:56:22 +0000 (08:56 +0000)]
target-ppc: add support for extended mtfsf/mtfsfi forms

Power ISA 2.05 adds support for extended mtfsf/mtfsfi form, with a new
W field to select the upper part of the FPCSR register.

For that the helper is changed to handle 64-bit input values and mask with
up to 16 bits. The mtfsf/mtfsfi instructions do not have the W bit
marked as invalid anymore. Instead this is checked in the helper, which
therefore needs to access to the insns/insns_flags2. They are added in
the DisasContext struct. Finally change all accesses to the opcode fields
through extract helpers, prefixed with FP for consistency.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agotarget-ppc: emulate store doubleword pair instructions
Aurelien Jarno [Sat, 20 Apr 2013 08:56:21 +0000 (08:56 +0000)]
target-ppc: emulate store doubleword pair instructions

Needed for Power ISA version 2.05 compliance. The check for odd register
pairs is done using the invalid bits.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agotarget-ppc: emulate load doubleword pair instructions
Aurelien Jarno [Sat, 20 Apr 2013 08:56:20 +0000 (08:56 +0000)]
target-ppc: emulate load doubleword pair instructions

Needed for Power ISA version 2.05 compliance. The check for odd register
pairs is done using the invalid bits.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agotarget-ppc: emulate lfiwax instruction
Aurelien Jarno [Sat, 20 Apr 2013 08:56:19 +0000 (08:56 +0000)]
target-ppc: emulate lfiwax instruction

Needed for Power ISA version 2.05 compliance.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
[agraf: fix tcg debug error]
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agotarget-ppc: emulate fcpsgn instruction
Aurelien Jarno [Sat, 20 Apr 2013 08:56:18 +0000 (08:56 +0000)]
target-ppc: emulate fcpsgn instruction

Needed for Power ISA version 2.05 compliance.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agotarget-ppc: emulate prtyw and prtyd instructions
Aurelien Jarno [Sat, 20 Apr 2013 08:56:17 +0000 (08:56 +0000)]
target-ppc: emulate prtyw and prtyd instructions

Needed for Power ISA version 2.05 compliance.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
[agraf: fix 32-bit host compile, simplify code]
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agotarget-ppc: emulate cmpb instruction
Aurelien Jarno [Sat, 20 Apr 2013 08:56:16 +0000 (08:56 +0000)]
target-ppc: emulate cmpb instruction

Needed for Power ISA version 2.05 compliance.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agotarget-ppc: add instruction flags for Book I 2.05
Aurelien Jarno [Sat, 20 Apr 2013 08:56:15 +0000 (08:56 +0000)]
target-ppc: add instruction flags for Book I 2.05

.. and enable it on POWER7 CPU.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agodisas: Disassemble all ppc insns for the guest
Aurelien Jarno [Sat, 20 Apr 2013 08:56:14 +0000 (08:56 +0000)]
disas: Disassemble all ppc insns for the guest

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agotarget-ppc: optimize fabs, fnabs, fneg
Aurelien Jarno [Sat, 20 Apr 2013 08:56:13 +0000 (08:56 +0000)]
target-ppc: optimize fabs, fnabs, fneg

fabs, fnabs and fneg are just flipping the bit sign of an FP register,
this can be implemented in TCG instead of using softfloat.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agoPPC: Fix dcbz for linux-user on 970
Alexander Graf [Fri, 26 Apr 2013 07:18:58 +0000 (09:18 +0200)]
PPC: Fix dcbz for linux-user on 970

The default with linux-user for dcbz on 970 is to emulate 32 byte clears.
However, redoing the dcbzl support we added a check to not honor the bit
in HID5 that sets this.

Remove the #ifdef check on linux user, so that we get 32 byte clears again.

Reported-by: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agopowerpc: correctly handle fpu exceptions.
Tristan Gingold [Tue, 9 Apr 2013 05:00:55 +0000 (05:00 +0000)]
powerpc: correctly handle fpu exceptions.

Raise the exception on the first occurence, do not wait for the next
floating point operation.

Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agopseries: Generate device paths for VIO devices
David Gibson [Sun, 7 Apr 2013 19:08:17 +0000 (19:08 +0000)]
pseries: Generate device paths for VIO devices

This patch implements a get_dev_path qdev hook for the pseries paravirtual
VIO bus.  With upcoming savevm support, this will become very important for
scsi disks hanging of VIO virtual SCSI adapters.  scsibus_get_dev_path
uses the get_dev_path of the parent adapter if available, but otherwise
just uses a local channel/target/lun number to identify the device.  So if
two disks are present in the system having the same target and lun on
seperate VIO scsi adapters, savevm cannot distinguish them.  Since the
conventional way of using VSCSI adapters is to have just one disk per
adapter, such a conflict is very likely.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agopseries: Convert VIO code to QOM style type safe(ish) casts
David Gibson [Sun, 7 Apr 2013 19:08:16 +0000 (19:08 +0000)]
pseries: Convert VIO code to QOM style type safe(ish) casts

Curerntly the pseries VIO device code contains quite a few explicit
uses of DO_UPCAST and plain C casts.  This is (obviously) type unsafe,
and not the conventional way of doing things in the QOM model.  This
patch converts the code to use the QOM convention of per-type macros
to do verified casts with OBJECT_CHECK().

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agotarget-ppc: Synchronize VPA state with KVM
David Gibson [Sun, 7 Apr 2013 19:08:22 +0000 (19:08 +0000)]
target-ppc: Synchronize VPA state with KVM

For PAPR guests, KVM tracks the various areas registered with the
H_REGISTER_VPA hypercall.  For full emulation, of course, these are tracked
within qemu.  At present these values are not synchronized.  This is a
problem for reset (qemu's reset of the VPA address is not pushed to KVM)
and will also be a problem for savevm / migration.

The kernel now supports accessing the VPA state via the ONE_REG interface,
this patch adds code to qemu to use that interface to keep the qemu and
KVM ideas of the VPA state synchronized.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agopseries: Fix some small errors in XICS logic
David Gibson [Sun, 7 Apr 2013 19:08:21 +0000 (19:08 +0000)]
pseries: Fix some small errors in XICS logic

Under certain circumstances the emulation for the pseries "XICS" interrupt
controller was clearing a pending interrupt from the XISR register, without
also clearing the corresponding priority variable.  This will cause
problems later when can trigger sanity checks in the under-development
in-kernel XICS implementation.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agotarget-ppc: Add more stubs for POWER7 PMU registers
David Gibson [Sun, 7 Apr 2013 19:08:20 +0000 (19:08 +0000)]
target-ppc: Add more stubs for POWER7 PMU registers

In addition to the performance monitor registers found on nearly all
6xx chips, the POWER7 has two additional counters (PMC5 & PMC6) and an
extra control register (MMCRA).  This patch adds stub support for them to
qemu - the registers won't do anything, but with this change won't cause
illegal instruction traps accessing them.  They're also registered with
their ONE_REG ids, so their value will be kept in sync with KVM where
appropriate.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agopseries: Fixes and enhancements to L1 cache properties
David Gibson [Sun, 7 Apr 2013 19:08:19 +0000 (19:08 +0000)]
pseries: Fixes and enhancements to L1 cache properties

PAPR requires that the device tree's CPU nodes have several properties
with information about the L1 cache.  We already create two of these
properties, but with incorrect names - "[id]cache-block-size" instead
of "[id]-cache-block-size" (note the extra hyphen).

We were also missing some of the required cache properties.  This
patch adds the [id]-cache-line-size properties (which have the same
values as the block size properties in all current cases).  We also
add the [id]-cache-size properties.

Adding the cache sizes requires some extra infrastructure in the
general target-ppc code to (optionally) set the cache sizes for
various CPUs.  The CPU family descriptions in translate_init.c can set
these sizes - this patch adds correct information for POWER7, I'm
leaving other CPU types to people who have a physical example to
verify against.  In addition, for -cpu host we take the values
advertised by the host (if available) and use those to override the
information based on PVR.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agopseries: Fix incorrect calculation of RMA size in certain configurations
David Gibson [Sun, 7 Apr 2013 19:08:18 +0000 (19:08 +0000)]
pseries: Fix incorrect calculation of RMA size in certain configurations

For the pseries machine, we need to advertise to the guest the size of its
RMA - that is the amount of memory it can access with the MMU off.  For HV
KVM, this is constrained by the hardware limitations on the virtual RMA of
one hash PTE per PTE group in the hash page table.  We already had code to
calculate this, but it was assuming the VRMA page size was the same as the
(host) backing page size for guest RAM.

In the case of a host kernel configured for 64k base page size, but running
on hardware (or firmware) which only allows 4k pages, the hose will do all
its allocations with a 64k page size, but still use 4k hardware pages for
actual mappings.  Usually that's transparent to things running under the
host, but in the case of the maximum VRMA size it's not.

This patch refines the RMA size calculation to instead use the largest
available hardware page size (as reported by the SMMU_INFO call) which is
less than or equal to the backing page size.  This now gives the correct
RMA size in all cases I've tested.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agoPPC: Fix compile with profiling enabled
Alexander Graf [Fri, 19 Apr 2013 00:35:08 +0000 (02:35 +0200)]
PPC: Fix compile with profiling enabled

When using profiling, we rely on profile_getclock() being available
at our disposal. Somehow that function got moved from an indirect
include we used to have in translate-init.c, so that we were now
left not properly compiling anymore.

Add an explicit include to timer.h which defines profile_getclock,
so that we can compile again.

Signed-off-by: Alexander Graf <agraf@suse.de>
11 years agoPPC: mac newworld: fix cpu NIP reset value
Alexander Graf [Thu, 4 Apr 2013 16:45:07 +0000 (18:45 +0200)]
PPC: mac newworld: fix cpu NIP reset value

On -M mac99, we can run 970 CPUs. However, these CPUs define the initial
instruction pointer they start execution at as part of their bootup protocol,
so effectively it's up to the board to decide where they start.

This went unnoticed, because they used to boot at the same location our flash
was mapped to, but due to the recent reset changes our 970 CPUs want to reset
to 0x100 now, which is always a 0 instruction.

Set the initial IP to something reasonable for -M mac99.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Fabien Chouteau <chouteau@adacore.com>
11 years agoEnable kvm emulated watchdog
Bharat Bhushan [Sun, 24 Feb 2013 18:16:21 +0000 (18:16 +0000)]
Enable kvm emulated watchdog

Enable the KVM emulated watchdog if KVM supports (use the
capability enablement in watchdog handler). Also watchdog exit
(KVM_EXIT_WATCHDOG) handling is added.
Watchdog state machine is cleared whenever VM state changes to running.
This is to handle the cases like return from debug halt etc.

Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
[agraf: rebase to current code base, fix non-kvm cases]
Signed-off-by: Alexander Graf <agraf@suse.de>