Commit Graph

9983 Commits

Author SHA1 Message Date
Gerd Hoffmann d0fef6fbea qdev: add command line option to set global defaults for properties.
This patch adds infrastructure and command line option for setting
global defaults for device properties, i.e. you can for example use

  -global virtio-blk-pci.vectors=0

to turn off msi by default for all virtio block devices.  The config
file syntax is:

[global]
  driver = "virtio-blk-pci"
  property = "vectors"
  value = "0"

This can also be used to set properties for devices which are not
created via -device but implicitly via machine init, i.e.

  -global isa-fdc,driveA=<name>

This patch uses the mechanism which configures properties for the
compatibility machine types (pc-0.10 & friends).  The command line
takes precedence over the machine type values.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:40 -06:00
Gerd Hoffmann 458fb6792d qdev: make compat stuff more generic
This patch renames the compat properties into global properties and
makes them more generic.  The compatibility stuff is only one of
multiple possible users now.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:40 -06:00
Jan Kiszka 4d6e3ac5d4 kvm: x86: Save/restore exception_index
As KVM now makes use of exception_index to keep pending exceptions, we
have to save&restore this field as well.

NOTE: We have to nail the arch-independent exception_index down to a
certain bit width for proper vmstate processing, namely to 32 bit.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:39 -06:00
Markus Armbruster bd9d30640c Fix recently added QERR_ definitions
Commits c7c338c4, 41471a23, 7a046f5f and a488be27 used
lower_case_with_underscores for class values.  Existing usage
CamelCase.  ChangeToThatForConsistency.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:39 -06:00
Markus Armbruster 556cd09885 qdev: Replace device names containing whitespace
Device names with whitespace require quoting in the shell and in the
monitor.  Some of the offenders are also overly long.  Some have a
more convenient alias, some don't.

The place for verbose device names is DeviceInfo member desc.  The
name should be short & sweet.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:38 -06:00
Markus Armbruster 063846984c qdev: Separate USB product description from qdev name
Using the qdev name for the product description makes for inconvenient
qdev names.

Put the product description in new USBDeviceInfo member product_desc.
Make usb_qdev_init() use it.  No user or guest visible change, since
the value is still the same.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:38 -06:00
Markus Armbruster 0fe6d12e0b qdev: Rename USBDevice member devname to product_desc
It's not a device name, it's the USB product description string.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:38 -06:00
Gleb Natapov ba32edab7f fix rtc-td-hack on host without high-res timers
On hosts without high-res timers it is impossible to inject rtc interrupt
faster then 1kHz. Windows sometimes configures RTC to generate 1kHz
interrupts, so we can't inject missed interrupts when running on such
hosts. Always injecting an interrupt on REG_C read is also not an option
since Windows wait for REG_C to become zero with interrupt disabled
during boot. This patch uses mixed approach: accelerate timer + inject
up to 1000 interrupts on REG_C read.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:38 -06:00
Michael S. Tsirkin 6d74ca5aa8 virtio: verify features on load
migrating between hosts which have different features
might break silently, if the migration destination
does not support some features supported by source.

Prevent this from happening by comparing acked feature
bits with the mask supported by the device.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:38 -06:00
Dave Airlie b3c3f123f7 vmware_vga: add rom file so that it boots.
This just adds the rom file to the vmware SVGA chipset so it boots.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:37 -06:00
Anthony Liguori 20ff6c8066 Do not abort on qemu_malloc(0) in production builds
qemu_malloc() does not allow size=0 to be passed in and aborts on this behavior.

Unfortunately, there is good reason to believe that within qemu, there are a
number of, so far, undetected places that assume size=0 can be safely passed.
Since we do not want to abort unnecessarily in production builds, return
qemu_malloc(1) whenever the version file indicates that this is a production
build.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:37 -06:00
Paul Brook 725b8a6983 Fix ARM userspace strex implementation.
Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-12-11 15:38:50 +00:00
Edgar E. Iglesias 7029a83bd6 microblaze: Make boot_info static.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-12-10 14:46:18 +01:00
Edgar E. Iglesias be5e834986 microblaze: Add missing cpu_reset.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-12-10 14:43:13 +01:00
Edgar E. Iglesias b4d34d5e9b microblaze: Boot and reset fixes.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-12-10 14:40:35 +01:00
Edgar E. Iglesias 6287462ef5 microblaze: Update disasm to latest GPLv2 version.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-12-10 12:33:49 +01:00
Michael S. Tsirkin 7dbbbb0c9e qemu: delete rule target on error
Instruct make to remove any rule target on error. This prevetns
situation where there was an error during build but generated file still
stays behind.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-07 16:34:37 -06:00
Markus Armbruster 77e595e7c6 QMP: add human-readable description to error response
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-07 16:34:36 -06:00
Markus Armbruster 7cdfcfe18f monitor: convert do_getfd() to QError
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-07 16:34:36 -06:00
Markus Armbruster a488be27e5 QError: New QERR_TOO_MANY_FILES
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-07 16:34:36 -06:00
Markus Armbruster 7a046f5f14 New QERR_INVALID_PARAMETER
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-07 16:34:36 -06:00
Markus Armbruster 41471a2338 QError: New QERR_FD_NOT_SUPPLIED
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-07 16:34:36 -06:00
Markus Armbruster 063c1a0918 monitor: convert do_closefd() to QError
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-07 16:34:35 -06:00
Markus Armbruster c7c338c497 QError: New QERR_FD_NOT_FOUND
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-07 16:34:35 -06:00
Markus Armbruster ec3b82afaa monitor: convert do_change() to QObject, QError
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-07 16:34:35 -06:00
Markus Armbruster a6906e31a8 QError: New QERR_VNC_SERVER_FAILED
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-07 16:34:35 -06:00
Markus Armbruster 7a84cb23c0 QError: New QERR_SET_PASSWD_FAILED
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-07 16:34:34 -06:00
Markus Armbruster 17901e7532 QError: New QERR_INVALID_BLOCK_FORMAT
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-07 16:34:34 -06:00
Markus Armbruster 2c2a6bb860 monitor: convert do_eject() to QError
Also affects do_change(), because the two share eject_device().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-07 16:34:34 -06:00
Markus Armbruster 5cfe026475 QError: New QERR_DEVICE_NOT_REMOVABLE
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-07 16:34:34 -06:00
Markus Armbruster b086838090 QError: New QERR_DEVICE_LOCKED
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-07 16:34:33 -06:00
Markus Armbruster e16a181222 QError: Put error definitions in alphabetical order
Also fix the odd typoe and clean up whitespace.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-07 16:34:33 -06:00
Markus Armbruster 2895e075c6 monitor: Fix double-prompt after "change vnc passwd BLA"
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-07 16:34:33 -06:00
Luiz Capitulino 94171e119c monitor: do_cont(): Don't ask for passwords
The do_cont() function will ask the user to enter a password if a
device is encrypted.

This is invalid under QMP, so we raise a QERR_DEVICE_ENCRYPTED
error.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-07 16:34:33 -06:00
Luiz Capitulino 0df37c411c QError: new class for device encrypted errors
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-07 16:34:32 -06:00
Anthony Liguori ad382a1257 Merge commit 'mst/pci' into staging 2009-12-07 14:31:38 -06:00
Luiz Capitulino a3a55a2edb monitor: Introduce 'block_passwd' command
When using encrypted disk images, QEMU will prompt the user
for passwords when started.

This makes sense for the user protocol, but doesn't for QMP.

The solution is to have Monitor command which allows the user
or a Client to set passwords in advance, so that we avoid
the prompt completely.

This is what block_passwd does, for example:

(QEMU) block_passwd ide0-hd0 foobar

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-07 14:04:20 -06:00
Luiz Capitulino f6d855c50d QError: Add class for invalid passwords
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-07 14:04:19 -06:00
Michael S. Tsirkin b6981cb57b pci: interrupt disable bit support
Interrupt disable bit is mandatory in PCI spec.
Implement it to make devices spec compliant.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-12-07 21:50:53 +02:00
Michael S. Tsirkin f9bf77dd1f pci: interrupt status bit implementation
interrupt status is a mandatory feature in PCI spec,
so devices must implement it to be spec compliant.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-12-07 21:50:53 +02:00
Michael S. Tsirkin d036bb215e pci: prepare irq code for interrupt state
This rearranges code in preparation for interrupt state
implementation.
Changes:
	- split up bus walk away from interrupt handling
          into a subroutine
	- change irq_state from an array to bitmask
	- verify that irq_state values are 0 or 1 on load

There are no functional changes.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-12-07 21:50:53 +02:00
Michael S. Tsirkin 5b5cb08683 msix: function mask support
Function mask is a mandatory feature in MSIX
spec so not implementing it is a spec violation.
Implement.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-07 21:50:53 +02:00
Michael S. Tsirkin 2760952ba9 msix: macro rename for function mask support
rename ENABLE_OFFSET -> CONTROL_OFFSET, since
same byte includes function mask.
This is in preparation for function mask support.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-07 21:50:52 +02:00
Andre Przywara 6d9fef1a02 cpuid: Fix multicore setup on Intel
The multicore CPUID code detects whether the guest is an Intel or an
AMD CPU, because the Linux kernel is picky about the CmpLegacy bit.
KVM by default passes through the host's vendor, which was not
catched by the code. So fork out the vendor determining bits into a
separate function to be used from both places and always get the real
vendor.
This fixes KVM's multicore setup on Intel CPUs.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Reported-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-07 11:13:42 -06:00
Jan Kiszka 6fb6d24554 kvm: x86: Fix initial kvm_has_msr_star
KVM_GET_MSR_INDEX_LIST returns -E2BIG when the provided space is too
small for all MSRs. But this is precisely the error we trigger with the
initial request in order to obtain that size. Do not fail in that case.

This caused a subtle corruption of the guest state as MSR_STAR was not
properly saved/restored. The corruption became visible with latest kvm
optimizing the MSR updates.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-07 08:45:47 -06:00
Andreas Faerber 5d7ff5bbde TCG: Mac OS X support for ppc64 target
Darwin/ppc64 does not use function descriptors,
adapt prologue and tcg_out_call accordingly.
GPR2 is available for general use, so let's use it.

http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/LowLevelABI/110-64-bit_PowerPC_Function_Calling_Conventions/64bitPowerPC.html

v2:
- Don't mark reserved GPR13 as callee-save.
- Move tcg_out_b up.
- Fix unused variable warning in prologue.

Signed-off-by: Andreas Faerber <andreas.faerber@web.de>
Cc: malc <av1474@comtv.ru>
Signed-off-by: malc <av1474@comtv.ru>
2009-12-06 18:20:26 +03:00
Blue Swirl ee4660f925 Update OpenBIOS images to r640
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-06 09:25:06 +00:00
Alexander Graf 749717a0ea Add S390 maintainer information
This patch adds information about who handles what when it comes to S390.
I'll gladly support anything that's related to the device emulation model and
S390 KVM parts.

Since this patchset doesn't implement S390 CPU emulation, I left that part
with a question mark. As soon as Uli's patchset gets committed I'd recommend
setting him there.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-05 17:36:06 +01:00
Alexander Graf 93d434b4ae Set default console to virtio on S390x
All "normal" system emulation targets in qemu I'm aware of display output
on either VGA or serial output.

Our S390x virtio machine doesn't have such kind of legacy hardware. So
instead we need to default to a virtio console.

I'm not particularly proud of this patch. It would be a lot better to
have something in the machine description that tells us about the default
terminal.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-05 17:36:06 +01:00
Alexander Graf afcb0e4559 S390 GDB stub
In order to debug funny kernel breakages it's always good to have a working
gdb stub around.

While Uli's patches don't include one one, I needed one that's at least good
enough for 'bt' and some variable examinations during early bootup.

So here it is - the absolute basics to get the qemu gdb stub running with s390x
targets.

Sgined-off-by: Alexander Graf <agraf@suse.de>

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-05 17:36:06 +01:00