]> git.ipfire.org Git - thirdparty/qemu.git/log
thirdparty/qemu.git
9 years agoMerge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.6-20160111' into staging
Peter Maydell [Mon, 11 Jan 2016 11:57:53 +0000 (11:57 +0000)] 
Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.6-20160111' into staging

ppc patch queue 2016-01-11

Biggest content is a thorough cleanups of spapr machine type handling.
Also contains several other minor cleanups, bugfixes and extensions.

# gpg: Signature made Mon 11 Jan 2016 04:34:38 GMT using RSA key ID 20D9B392
# gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>"
# gpg:                 aka "David Gibson (Red Hat) <dgibson@redhat.com>"
# gpg:                 aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>"
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392

* remotes/dgibson/tags/ppc-for-2.6-20160111:
  hw/ppc/spapr: fix spapr->kvm_type leak
  spapr vio: fix to incomplete QOMify
  hw/ppc/spapr: Use XHCI as host controller for new spapr machines
  pseries: Add pseries-2.6 machine type
  pseries: Improve setting of default machine version
  pseries: Restructure class_options functions
  pseries: DEFINE_SPAPR_MACHINE
  pseries: Use SET_MACHINE_COMPAT
  Move SET_MACHINE_COMPAT macro to boards.h
  pseries: Remove versions from mc->desc
  pseries: Remove redundant calls to spapr_machine_initfn()
  pseries: Rearrange versioned machine type code
  pseries: Remove redundant setting of mc->name for pseries-2.5 machine
  spapr: Add /system-id
  target-ppc: Define kvmppc_read_int_dt()
  hw/ppc/spapr_rtc: Remove bad class_size value

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agoMerge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
Peter Maydell [Mon, 11 Jan 2016 11:19:05 +0000 (11:19 +0000)] 
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

acpi dsdt rework, misc fixes

This completes the dsdt rewrite, and includes misc fixes all over the place.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
# gpg: Signature made Sat 09 Jan 2016 21:20:34 GMT using RSA key ID D28D5469
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>"
# gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>"

* remotes/mst/tags/for_upstream: (59 commits)
  virtio: fix error message for number of queues
  ivshmem: Store file descriptor for vhost-user negotiation
  migration/virtio: Remove simple .get/.put use
  Add VMSTATE_STRUCT_VARRAY_KNOWN
  i386/pc: expose identifying the floppy controller
  pc: acpi: remove unused ASL templates and related blobs/utils
  pc: acpi: switch to AML API composed DSDT
  pc: acpi: q35: PCST, PCSB opregions and PCIB field into SSDT
  pc: acpi: q35: move PCI0 device definition into SSDT
  pc: acpi: q35: move PCI0._OSC() method into SSDT
  pc: acpi: q35: move _PIC() method into SSDT
  pc: acpi: q35: move PRTP routing table into SSDT
  pc: acpi: q35: move PRTA routing table into SSDT
  pc: acpi: q35: move _PRT() into SSDT
  pc: acpi: q35: move ISA bridge into SSDT
  pc: acpi: q35: move IQST() into SSDT
  pc: acpi: q35: move IQCR() into SSDT
  pc: acpi: q35: move link devices to SSDT
  pc: acpi: q35: move GSI links to SSDT
  pc: acpi: piix4: acpi move PCI0 device to SSDT
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agohw/ppc/spapr: fix spapr->kvm_type leak
David Gibson [Mon, 28 Dec 2015 06:38:26 +0000 (17:38 +1100)] 
hw/ppc/spapr: fix spapr->kvm_type leak

Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Alexander Graf <agraf@suse.de>
Cc: qemu-ppc@nongnu.org
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
[fixed return type of spapr_machine_finalizefn()]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
9 years agospapr vio: fix to incomplete QOMify
Cao jin [Wed, 23 Dec 2015 11:30:12 +0000 (19:30 +0800)] 
spapr vio: fix to incomplete QOMify

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
9 years agohw/ppc/spapr: Use XHCI as host controller for new spapr machines
Thomas Huth [Wed, 9 Dec 2015 12:34:13 +0000 (13:34 +0100)] 
hw/ppc/spapr: Use XHCI as host controller for new spapr machines

The OHCI has some bugs and performance issues, so for
newer machines it's preferable to use XHCI instead.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
9 years agopseries: Add pseries-2.6 machine type
David Gibson [Mon, 7 Dec 2015 03:28:15 +0000 (14:28 +1100)] 
pseries: Add pseries-2.6 machine type

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
9 years agopseries: Improve setting of default machine version
David Gibson [Mon, 7 Dec 2015 03:25:50 +0000 (14:25 +1100)] 
pseries: Improve setting of default machine version

This tweaks the way the default machine version is controlled, so that
there will be a bit less churn when each new version is introduced.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
9 years agopseries: Restructure class_options functions
David Gibson [Mon, 7 Dec 2015 03:27:21 +0000 (14:27 +1100)] 
pseries: Restructure class_options functions

Currently each of the *_class_options() functions for the pseries-2.1 ..
pseries-2.5 machine types are standalone.  This will become harder to
maintain as new versions are added.

This patch restructures them similarly to x86 where each function calls
the one from the next version, then overrides anything necessary for
compatibility with the specific version and older.

The default behaviour - that for the most recent machine are set up in
the base class initializer spapr_machine_class_init().  Previously it had
some things set up to default to older behaviour with the more recent
machines overriding it.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
9 years agopseries: DEFINE_SPAPR_MACHINE
David Gibson [Mon, 7 Dec 2015 03:23:20 +0000 (14:23 +1100)] 
pseries: DEFINE_SPAPR_MACHINE

At the moment all the class_init functions and TypeInfo structures for the
various versioned pseries machine types are open-coded.  As more versions
are created this is getting increasingly clumsy.

This patch borrows the approach used in PC, using a DEFINE_SPAPR_MACHINE()
macro to construct most of the boilerplate from simpler 'class_options' and
'instance_options' functions.

This patch makes a small semantic change - the versioned machine types are
now registered through machine_init() instead of type_init().  Since the
new way is how PC already did it, I'm assuming that's correct.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
9 years agopseries: Use SET_MACHINE_COMPAT
David Gibson [Thu, 3 Dec 2015 06:47:22 +0000 (17:47 +1100)] 
pseries: Use SET_MACHINE_COMPAT

To make the spapr_machine_*_class_init() functions a little less bulky.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
9 years agoMove SET_MACHINE_COMPAT macro to boards.h
David Gibson [Thu, 3 Dec 2015 06:34:38 +0000 (17:34 +1100)] 
Move SET_MACHINE_COMPAT macro to boards.h

pc.h defines a SET_MACHINE_COMPAT macro to make setting up compat_props
for the various PC machine versions less verbose.  There's nothing
inherently PC specific about it, though, so move it to boards.h where other
versioned machine types (like pseries-*) can use it.

While we're doing that, change it's indentation to be a bit more regular.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
9 years agopseries: Remove versions from mc->desc
David Gibson [Mon, 7 Dec 2015 03:29:35 +0000 (14:29 +1100)] 
pseries: Remove versions from mc->desc

Currently, the versioned spapr machine types put the machine type version
into the description string.  PC does not do this, using just the name
itself to distinguish.  Doing the same lets us move setting the description
into the common base class, simplifying the code slightly.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
9 years agopseries: Remove redundant calls to spapr_machine_initfn()
David Gibson [Thu, 3 Dec 2015 06:34:20 +0000 (17:34 +1100)] 
pseries: Remove redundant calls to spapr_machine_initfn()

The instance_init() functions for several of the pseries-x.y versioned
machine types explicitly call spapr_machine_initfn().  But that's the
instance_init function for the common parent of all those machine types,
so will already have been called beforehand by the QOM infrastructure.

Remove the redundant calls.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
9 years agopseries: Rearrange versioned machine type code
David Gibson [Thu, 3 Dec 2015 06:34:10 +0000 (17:34 +1100)] 
pseries: Rearrange versioned machine type code

hw/ppc/spapr.c has a number of definitions related to the various versioned
machine types ("pseries-2.1" .. "pseries-2.5") it defines.  These are
mostly arranged by type of function first, then machine version second, and
it's not consistent about whether it goes in increasing or decreasing
version order.

This rearranges the code to keep all the definitions for a particular
machine version together, and arrange then consistently in order most
recent to least recent.

This brings us closer to matching the way PC does things, and makes later
cleanups easier to follow.

Apart from adding some comments marking each section, this is a pure
mechanical rearrangement with no semantic changes.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
9 years agopseries: Remove redundant setting of mc->name for pseries-2.5 machine
David Gibson [Mon, 30 Nov 2015 05:36:49 +0000 (16:36 +1100)] 
pseries: Remove redundant setting of mc->name for pseries-2.5 machine

98cec76 "machine: Set MachineClass::name automatically" removed the setting
of mc->name for the pseries machine types, since it can be derived
automatically from the type names constructed with MACHINE_TYPE_NAME().

Unfortunately fb0fc8f "spapr: Create pseries-2.5 machine" went in later and
brought one of them back.

This removes it again.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
9 years agospapr: Add /system-id
Alexey Kardashevskiy [Mon, 9 Nov 2015 06:47:17 +0000 (17:47 +1100)] 
spapr: Add /system-id

Section B.6.2.1 Root Node Properties of PAPR specification defines
a set of properties which shall be present in the device tree root,
one of these properties is "system-id" which "should be unique across
all systems and all manufacturers". Since UUID is meant to be unique,
it makes sense to use it as "system-id".

This adds "system-id" property to the device tree root when not empty.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
9 years agotarget-ppc: Define kvmppc_read_int_dt()
Sukadev Bhattiprolu [Sat, 14 Nov 2015 02:13:07 +0000 (18:13 -0800)] 
target-ppc: Define kvmppc_read_int_dt()

Extract code from the function kvmppc_read_int_cpu_dt() that actually
reads the file into a separate function, so it can be called from
other places.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
9 years agohw/ppc/spapr_rtc: Remove bad class_size value
Thomas Huth [Fri, 18 Dec 2015 09:06:14 +0000 (10:06 +0100)] 
hw/ppc/spapr_rtc: Remove bad class_size value

class_size = sizeof(XICSStateClass) does not make much sense
in the RTC code and likely was just a copy-n-paste error.
Let's simply remove it.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
9 years agovirtio: fix error message for number of queues
Cornelia Huck [Fri, 8 Jan 2016 10:00:00 +0000 (11:00 +0100)] 
virtio: fix error message for number of queues

There's no such thing as "PCI queues" in the virtio core.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agoivshmem: Store file descriptor for vhost-user negotiation
Tetsuya Mukawa [Mon, 21 Dec 2015 03:47:34 +0000 (12:47 +0900)] 
ivshmem: Store file descriptor for vhost-user negotiation

If virtio-net driver allocates memory in ivshmem shared memory,
vhost-net will work correctly, but vhost-user will not work because
a fd of shared memory will not be sent to vhost-user backend.
This patch fixes ivshmem to store file descriptor of shared memory.
It will be used when vhost-user negotiates vhost-user backend.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agomigration/virtio: Remove simple .get/.put use
Dr. David Alan Gilbert [Wed, 6 Jan 2016 12:23:39 +0000 (12:23 +0000)] 
migration/virtio: Remove simple .get/.put use

The 'virtqueue_state' and 'ringsize' can be saved using VMSTATE
macros rather than hand coded .get/.put

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
9 years agoAdd VMSTATE_STRUCT_VARRAY_KNOWN
Dr. David Alan Gilbert [Wed, 6 Jan 2016 12:23:38 +0000 (12:23 +0000)] 
Add VMSTATE_STRUCT_VARRAY_KNOWN

At the moment we have VMSTATE_STRUCT_ARRAY that requires
the field is declared as an array of fixed size.
We also have VMSTATE_STRUCT_VARRAY_UINT* that allows
a field declared as a pointer, but requires that the length
is a field member in the structure being loaded/saved.

VMSTATE_STRUCT_VARRAY_KNOWN is for arrays defined as pointers
yet we somehow know the length of.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
9 years agoi386/pc: expose identifying the floppy controller
Roman Kagan [Wed, 30 Dec 2015 20:11:51 +0000 (23:11 +0300)] 
i386/pc: expose identifying the floppy controller

Factor out and expose the function to locate the floppy controller in
the system.
It will allow to dynamically populate the relevant objects in the ACPI
tables.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: John Snow <jsnow@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: qemu-block@nongnu.org
Cc: qemu-stable@nongnu.org
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: remove unused ASL templates and related blobs/utils
Igor Mammedov [Mon, 28 Dec 2015 17:02:58 +0000 (18:02 +0100)] 
pc: acpi: remove unused ASL templates and related blobs/utils

QEMU now uses internally composed DSDT so drop now
empty *.dsl templates and related *.generated
binary blobs.

Also since templates are not used anymore/obolete
remove utility scripts used for extracting/patching
AML blobs compiled by IASL and for updating them
in git tree.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: switch to AML API composed DSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:57 +0000 (18:02 +0100)] 
pc: acpi: switch to AML API composed DSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: q35: PCST, PCSB opregions and PCIB field into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:56 +0000 (18:02 +0100)] 
pc: acpi: q35: PCST, PCSB opregions and PCIB field into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: q35: move PCI0 device definition into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:55 +0000 (18:02 +0100)] 
pc: acpi: q35: move PCI0 device definition into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: q35: move PCI0._OSC() method into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:54 +0000 (18:02 +0100)] 
pc: acpi: q35: move PCI0._OSC() method into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: q35: move _PIC() method into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:53 +0000 (18:02 +0100)] 
pc: acpi: q35: move _PIC() method into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: q35: move PRTP routing table into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:52 +0000 (18:02 +0100)] 
pc: acpi: q35: move PRTP routing table into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: q35: move PRTA routing table into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:51 +0000 (18:02 +0100)] 
pc: acpi: q35: move PRTA routing table into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: q35: move _PRT() into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:50 +0000 (18:02 +0100)] 
pc: acpi: q35: move _PRT() into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: q35: move ISA bridge into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:49 +0000 (18:02 +0100)] 
pc: acpi: q35: move ISA bridge into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: q35: move IQST() into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:48 +0000 (18:02 +0100)] 
pc: acpi: q35: move IQST() into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: q35: move IQCR() into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:47 +0000 (18:02 +0100)] 
pc: acpi: q35: move IQCR() into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: q35: move link devices to SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:46 +0000 (18:02 +0100)] 
pc: acpi: q35: move link devices to SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: q35: move GSI links to SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:45 +0000 (18:02 +0100)] 
pc: acpi: q35: move GSI links to SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: piix4: acpi move PCI0 device to SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:44 +0000 (18:02 +0100)] 
pc: acpi: piix4: acpi move PCI0 device to SSDT

leave Scope(\_SB) definition in DSDT so that iasl
would be able to compile DSDT since we are still
need definition block for table.
After Q35 ASL is converted, DSDT templates will
be completly replaced by AML API generated tables.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: piix4: move remaining PCI hotplug bits into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:43 +0000 (18:02 +0100)] 
pc: acpi: piix4: move remaining PCI hotplug bits into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: piix4: move PCI0._PRT() into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:42 +0000 (18:02 +0100)] 
pc: acpi: piix4: move PCI0._PRT() into SSDT

PCI routing table for expander buses is build with help
of build_prt() using AML API. And it's almost the same
as PRT for PCI0 bus except of power-management device.
So make existing build_prt() build PRT table for PCI0
bus as well.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: piix4: move IQST() into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:41 +0000 (18:02 +0100)] 
pc: acpi: piix4: move IQST() into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: piix4: move IQCR() into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:40 +0000 (18:02 +0100)] 
pc: acpi: piix4: move IQCR() into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: pci: move link devices into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:39 +0000 (18:02 +0100)] 
pc: acpi: pci: move link devices into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: move remaining GPE handlers into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:38 +0000 (18:02 +0100)] 
pc: acpi: move remaining GPE handlers into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: move PIIX4 isa-bridge and pm devices into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:37 +0000 (18:02 +0100)] 
pc: acpi: move PIIX4 isa-bridge and pm devices into SSDT

and also move PRQx fields declaration as it can't be
split out into separate patch since fields use
PCI0.ISA.P40C operation region and OperationRegion
must be declared in the same table as a Field that
uses it. If this condition is not statisfied Windows
will BSOD ans IASL (make check) will error out as well.

For the same reason pm is moved together with isa-bridge
as the later refernces P13C OperationRegion from pm device.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: move COM devices from DSDT to SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:36 +0000 (18:02 +0100)] 
pc: acpi: move COM devices from DSDT to SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: move LPT device from DSDT to SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:35 +0000 (18:02 +0100)] 
pc: acpi: move LPT device from DSDT to SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: move FDC0 device from DSDT to SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:34 +0000 (18:02 +0100)] 
pc: acpi: move FDC0 device from DSDT to SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: move MOU device from DSDT to SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:33 +0000 (18:02 +0100)] 
pc: acpi: move MOU device from DSDT to SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: move KBD device from DSDT to SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:32 +0000 (18:02 +0100)] 
pc: acpi: move KBD device from DSDT to SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: move RTC device from DSDT to SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:31 +0000 (18:02 +0100)] 
pc: acpi: move RTC device from DSDT to SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: move DBUG() from DSDT to SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:30 +0000 (18:02 +0100)] 
pc: acpi: move DBUG() from DSDT to SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: move HPET from DSDT to SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:29 +0000 (18:02 +0100)] 
pc: acpi: move HPET from DSDT to SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: factor out cpu hotplug code from build_ssdt() into separate function
Igor Mammedov [Mon, 28 Dec 2015 17:02:28 +0000 (18:02 +0100)] 
pc: acpi: factor out cpu hotplug code from build_ssdt() into separate function

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: cpuhp: move \_GPE._E02() into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:27 +0000 (18:02 +0100)] 
pc: acpi: cpuhp: move \_GPE._E02() into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: cpuhp: move PRSC() method into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:26 +0000 (18:02 +0100)] 
pc: acpi: cpuhp: move PRSC() method into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: cpuhp: move CPST() method into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:25 +0000 (18:02 +0100)] 
pc: acpi: cpuhp: move CPST() method into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: cpuhp: move CPMA() method into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:24 +0000 (18:02 +0100)] 
pc: acpi: cpuhp: move CPMA() method into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: cpuhp: move CPEJ() method to SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:23 +0000 (18:02 +0100)] 
pc: acpi: cpuhp: move CPEJ() method to SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: drop unused CPU_STATUS_LEN from DSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:22 +0000 (18:02 +0100)] 
pc: acpi: drop unused CPU_STATUS_LEN from DSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: memhp: drop not needed stringify(MEMORY_foo) usage
Igor Mammedov [Mon, 28 Dec 2015 17:02:21 +0000 (18:02 +0100)] 
pc: acpi: memhp: drop not needed stringify(MEMORY_foo) usage

most of MEMORY_foo defines are not shared
with ASL anymore and are used only inside of
memory_hotplug_acpi_table.c, so move them
there and make them strings. As result we
can replace stringify(MEMORY_foo) with just
MEMORY_foo, which makes code a bit cleaner.

No AML change introduced by this patch.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: memhp: move \_GPE._E03 into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:20 +0000 (18:02 +0100)] 
pc: acpi: memhp: move \_GPE._E03 into SSDT

in addition remove no longer needed acpi-dsdt-mem-hotplug.dsl.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: factor out memhp code from build_ssdt() into separate function
Igor Mammedov [Mon, 28 Dec 2015 17:02:19 +0000 (18:02 +0100)] 
pc: acpi: factor out memhp code from build_ssdt() into separate function

before consolidating memhp code in memory_hotplug_acpi_table.c
and for simplifying review, first factor out memhp code into
new function build_memory_devices() in i386/acpi-build.c

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
----
PS:
   no functional change, only code movement.
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: memhp: move MHPD Device into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:18 +0000 (18:02 +0100)] 
pc: acpi: memhp: move MHPD Device into SSDT

move remnants of MHPD device from DSDT into SSDT.
 i.e. Device(MHPD), _UID, _HID

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: memhp: move MHPD.MCRS method into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:17 +0000 (18:02 +0100)] 
pc: acpi: memhp: move MHPD.MCRS method into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: memhp: move MHPD.MEJ0 method into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:16 +0000 (18:02 +0100)] 
pc: acpi: memhp: move MHPD.MEJ0 method into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: memhp: move MHPD.MOST method into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:15 +0000 (18:02 +0100)] 
pc: acpi: memhp: move MHPD.MOST method into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: memhp: move MHPD.MPXM method into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:14 +0000 (18:02 +0100)] 
pc: acpi: memhp: move MHPD.MPXM method into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: memhp: move MHPD.MRST method into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:13 +0000 (18:02 +0100)] 
pc: acpi: memhp: move MHPD.MRST method into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: memhp: move MHPD.MSCN method into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:12 +0000 (18:02 +0100)] 
pc: acpi: memhp: move MHPD.MSCN method into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: memhp: move MHPD.MLCK mutex into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:11 +0000 (18:02 +0100)] 
pc: acpi: memhp: move MHPD.MLCK mutex into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: memhp: move MHPD._STA method into SSDT
Igor Mammedov [Mon, 28 Dec 2015 17:02:10 +0000 (18:02 +0100)] 
pc: acpi: memhp: move MHPD._STA method into SSDT

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: acpi: memhp: prepare context in SSDT for moving memhp DSDT code
Igor Mammedov [Mon, 28 Dec 2015 17:02:09 +0000 (18:02 +0100)] 
pc: acpi: memhp: prepare context in SSDT for moving memhp DSDT code

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agotests: acpi: print ASL diff in verbose mode
Igor Mammedov [Mon, 28 Dec 2015 17:02:08 +0000 (18:02 +0100)] 
tests: acpi: print ASL diff in verbose mode

print ASL difference if there is any when
executing 'make V=1 check'.
Use 'DIFF' environment variable to determine
which diff utility to use and if it's not set
notify user by printing warning that DIFF is
not set if run in verbose mode and there is
difference in ASL.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agohw/i386: fill in the CENTURY field of the FADT (FACP) ACPI table
Laszlo Ersek [Thu, 10 Dec 2015 17:25:34 +0000 (18:25 +0100)] 
hw/i386: fill in the CENTURY field of the FADT (FACP) ACPI table

The ACPI specification (minimally versions 1.0b through 6.0) define the
FADT.CENTURY field as:

  The RTC CMOS RAM index to the century of data value (hundred and
  thousand year decimals). If this field contains a zero, then the RTC
  centenary feature is not supported. If this field has a non-zero value,
  then this field contains an index into RTC RAM space that OSPM can use
  to program the centenary field.

The x86 targets generate ACPI payload, emulate an RTC
(CONFIG_MC146818RTC), and that RTC supports the "centenary feature" (see
occurrences of RTC_CENTURY in cmos_ioport_write() and cmos_ioport_read()
in "hw/timer/mc146818rtc.c".)

However, FADT.CENTURY is left at zero currently:

  [06Ch 0108   1]            RTC Century Index : 00

which -- according to analysis done by Ruiyu Ni at Intel -- should cause
Linux and Windows 8+ to think the RTC centenary feature is unavailable,
and cause Windows 7 to (incorrectly) assume that the offset to use is
constant 0x32. (0x32 happens to be the right value on QEMU, but Windows 7
is wrong to assume anything at all).

Exposing the right nonzero offset in FADT.CENTURY informs Linux and
Windows 8+ about the right capabilities of the hardware, plus it retrofits
our FADT to Windows 7's behavior.

Regression tested with the following guests (all UEFI installs):
- i386 Q35: Fedora 21 ("Fedlet" edition)
- x86_64:
  - i440fx:
    - Fedora 21
    - RHEL 6 and 7
    - Windows 7 and 10
    - Windows Server 2008 R2 and 2012 R2
  - Q35:
    - Fedora 22
    - Windows 8.1

Cc: "Michael S. Tsirkin" <mst@redhat.com> (supporter:ACPI/SMBIOS)
Cc: Igor Mammedov <imammedo@redhat.com> (supporter:ACPI/SMBIOS)
Cc: Paolo Bonzini <pbonzini@redhat.com> (maintainer:X86)
Cc: Richard Henderson <rth@twiddle.net> (maintainer:X86)
Cc: Eduardo Habkost <ehabkost@redhat.com> (maintainer:X86)
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agoigd-passthrough: fix use of host_pci_config_read
Cao jin [Sat, 2 Jan 2016 08:02:20 +0000 (16:02 +0800)] 
igd-passthrough: fix use of host_pci_config_read

Fix the bug introduced by 595a4f07: function host_pci_config_read() should be
pass-by-reference, not value.
This probably means this function never worked for anyone.

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agonvdimm: fix header pointer in nvdimm_build_nfit()
Haozhong Zhang [Fri, 25 Dec 2015 02:57:42 +0000 (10:57 +0800)] 
nvdimm: fix header pointer in nvdimm_build_nfit()

In the current nvdimm_build_nfit(), the pointer 'header' initially equals
to table_data->data + table_data->len. However, the following
g_array_append_vals(table_data, structures->data, structures->len)
may resize and relocate table_data->data[]. Therefore, the usage of 'header'
afterwards may be illegal.

This patch fixes this issue by storing an offset within table_data->data[]
(rather than an address) in 'header'.

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
Reviewed-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20160108-1' into staging
Peter Maydell [Fri, 8 Jan 2016 12:50:19 +0000 (12:50 +0000)] 
Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20160108-1' into staging

sdl2/opengl: add opengl context and scanout support
ui/curses: Fix color attribute of monitor for curses

# gpg: Signature made Fri 08 Jan 2016 12:42:02 GMT using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-ui-20160108-1:
  sdl2/opengl: add opengl context and scanout support
  ui/curses: Fix color attribute of monitor for curses

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-usb-20160108-1' into staging
Peter Maydell [Fri, 8 Jan 2016 11:24:15 +0000 (11:24 +0000)] 
Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-20160108-1' into staging

usb: mtp and ohci fixes.

# gpg: Signature made Fri 08 Jan 2016 10:14:59 GMT using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-usb-20160108-1:
  ohci: clear pending SOF on suspend
  ohci: delay first SOF interrupt
  usb-mtp: fix call to trace function
  usb-mtp: use safe variant when cleaning events list
  ohci: fix command HostControllerReset
  ohci: fix Host Controller USBRESET
  ohci: split reset method in 3 parts

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agosdl2/opengl: add opengl context and scanout support
Gerd Hoffmann [Wed, 19 Nov 2014 13:56:46 +0000 (14:56 +0100)] 
sdl2/opengl: add opengl context and scanout support

This allows virtio-gpu to render in 3d mode.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
9 years agoui/curses: Fix color attribute of monitor for curses
OGAWA Hirofumi [Sun, 29 Nov 2015 13:28:24 +0000 (22:28 +0900)] 
ui/curses: Fix color attribute of monitor for curses

Current text_console_update() writes totally broken color attributes
to console_write_ch(). The format now is writing,

[WRONG]
bold << 21 | fg << 12 | bg << 8 | char
fg == 3bits curses color number
bg == 3bits curses color number

I can't see this format is where come from. Anyway, this doesn't work
at all.

What curses expects is actually (and vga.c is using),

[RIGHT]
bold << 21 | bg << 11 | fg << 8 | char
fg == 3bits vga color number
bg == 3bits vga color number

And curses set COLOR_PAIR() up to match this format, and curses's
chtype. I.e,

bold | color_pair | char
color_pair == (bg << 3 | fg)

To fix, this simply uses VGA color number everywhere except curses.c
internal. Then, convert it to above [RIGHT] format to write by
console_write_ch(). And as bonus, this reduces to expose curses define
to other parts (removes COLOR_* from console.c).

[Tested the first line is displayed as white on blue back for monitor
in curses console]

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Message-id: 87r3j95407.fsf@mail.parknet.co.jp
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9 years agoMerge remote-tracking branch 'remotes/maxreitz/tags/pull-block-for-peter-2016-01...
Peter Maydell [Fri, 8 Jan 2016 10:45:07 +0000 (10:45 +0000)] 
Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-for-peter-2016-01-07' into staging

Block patches from 2015-12-23 until 2016-01-07.

# gpg: Signature made Thu 07 Jan 2016 22:46:08 GMT using RSA key ID E838ACAD
# gpg: Good signature from "Max Reitz <mreitz@redhat.com>"

* remotes/maxreitz/tags/pull-block-for-peter-2016-01-07: (21 commits)
  iotests: Add test cases for blockdev-mirror
  qmp: Add blockdev-mirror command
  block: Add check on mirror target
  block: Extract blockdev part of qmp_drive_mirror
  block: Rename BLOCK_OP_TYPE_MIRROR to BLOCK_OP_TYPE_MIRROR_SOURCE
  qemu-iotests: s390x: fix test 051
  iotests: 095: Filter _img_info output
  iotests: 095: Use TEST_IMG override instead of "mv"
  iotests: 050: Use TEST_IMG override instead of "mv"
  iotests: 038: Use TEST_IMG override instead of "mv"
  iotests: 037: Use TEST_IMG override instead of "mv"
  iotests: 034: Use TEST_IMG override instead of "mv"
  iotests: 028: Use TEST_IMG override instead of "mv"
  iotests: 024: Use TEST_IMG override instead of "mv"
  iotests: 020: Use TEST_IMG override instead of "mv"
  iotests: 019: Use TEST_IMG override instead of "mv"
  iotests: 018: Use TEST_IMG override instead of "mv"
  block/qapi: Clear err for further error
  block: use drained section in bdrv_close
  qemu-iotests: make check-block.sh work on out-of-tree builds
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agoohci: clear pending SOF on suspend
Laurent Vivier [Wed, 6 Jan 2016 19:45:25 +0000 (20:45 +0100)] 
ohci: clear pending SOF on suspend

On overcommitted CPU, kernel can be so slow that an interrupt can
be triggered by the device whereas the driver is not ready to receive
it. This drives us into an infinite loop.

On suspend, if a SOF interrupt is raised between the stop of the
device processing and the change of the device internal state to
OHCI_USB_SUSPEND (QEMU stops SOF timer on this state change), this
interrupt is never acknowledged.

This patch clears pending SOF interrupt on OHCI_USB_SUSPEND setting.

Some details:

- ohci_irq(): the OHCI interrupt handler, acknowledges the SOF IRQ
  only if the state of the driver (rh_state) is OHCI_STATE_RUNNING.
  So if this interrupt happens and the driver is not in this state,
  the function is called again and again, moving the system to a
  CPU starvation.

- ohci_rh_suspend(): the function stop the operation and acknowledge
  pending interrupts (but doesn't disable it). Later in the function,
  the device is moved to OHCI_SUSPEND_STATE, and the driver to
  OHCI_RH_SUSPENDED. If between the moment when the interrupt is
  acknowledged and the moment when the device is suspended a new
  interrupt is raised, it will be never acknowledged because the
  driver is now not in OHCI_RH_RUNNING state.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-id: 1452109525-32150-3-git-send-email-lvivier@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9 years agoohci: delay first SOF interrupt
Laurent Vivier [Wed, 6 Jan 2016 19:45:24 +0000 (20:45 +0100)] 
ohci: delay first SOF interrupt

On overcommitted CPU, kernel can be so slow that an interrupt can
be triggered by the device whereas the driver is not ready to receive
it. This drives us into an infinite loop.

This does not happen on real hardware because real hardware never send
interrupt immediately after the controller has been moved to OPERATION state.

This patch tries to delay the first SOF interrupt to let driver exits from
the critical section (which is not protected against interrupts...)

Some details:

- ohci_irq(): the OHCI interrupt handler, acknowledges the SOF IRQ
  only if the state of the driver (rh_state) is OHCI_STATE_RUNNING.
  So if this interrupt happens and the driver is not in this state,
  the function is called again and again, moving the system to a
  CPU starvation.

- ohci_rh_resume(): the driver re-enables operation with OHCI_USB_OPER.
  In QEMU this start the SOF timer and QEMU starts to send IRQs. As
  the driver is not in OHCI_STATE_RUNNING and not protected against IRQ,
  the ohci_irq() can be called and the driver never moved to
  OHCI_STATE_RUNNING.

Suggested-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-id: 1452109525-32150-2-git-send-email-lvivier@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9 years agousb-mtp: fix call to trace function
Bandan Das [Wed, 23 Dec 2015 09:09:47 +0000 (14:39 +0530)] 
usb-mtp: fix call to trace function

trace_usb_mtp_inotify_event() was being called after the object was
being freed.

Signed-off-by: Bandan Das <bsd@redhat.com>
Message-id: 1450861787-16213-3-git-send-email-bsd@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9 years agousb-mtp: use safe variant when cleaning events list
Bandan Das [Wed, 23 Dec 2015 09:09:46 +0000 (14:39 +0530)] 
usb-mtp: use safe variant when cleaning events list

usb_mtp_inotify_cleanup uses QLIST_FOREACH to pick events
from a list and free them which is incorrect. Use QLIST_FOREACH_SAFE
instead.

Signed-off-by: Bandan Das <bsd@redhat.com>
Message-id: 1450861787-16213-2-git-send-email-bsd@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9 years agoohci: fix command HostControllerReset
Hervé Poussineau [Sat, 19 Dec 2015 23:23:51 +0000 (00:23 +0100)] 
ohci: fix command HostControllerReset

Specification says that: "This bit is set by HCD to initiate a software reset of HC."

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-id: 1450567431-31795-4-git-send-email-hpoussin@reactos.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9 years agoohci: fix Host Controller USBRESET
Hervé Poussineau [Sat, 19 Dec 2015 23:23:50 +0000 (00:23 +0100)] 
ohci: fix Host Controller USBRESET

Specification says that, when entering this state, "the contents of the registers
(except Root Hub registers) are preserved by the HC. [...] The Root Hub is being reset,
which causes the Root Hub's downstream ports to be reset and possibly powered off."

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-id: 1450567431-31795-3-git-send-email-hpoussin@reactos.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9 years agoohci: split reset method in 3 parts
Hervé Poussineau [Sat, 19 Dec 2015 23:23:49 +0000 (00:23 +0100)] 
ohci: split reset method in 3 parts

The three parts are:
- root hub reset (ohci_roothub_reset)
- host controller soft reset (ohci_soft_reset)
- host controller hard reset (ohci_hard_reset)

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-id: 1450567431-31795-2-git-send-email-hpoussin@reactos.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9 years agoiotests: Add test cases for blockdev-mirror
Fam Zheng [Thu, 24 Dec 2015 04:45:06 +0000 (12:45 +0800)] 
iotests: Add test cases for blockdev-mirror

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1450932306-13717-6-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
9 years agoqmp: Add blockdev-mirror command
Fam Zheng [Thu, 24 Dec 2015 04:45:05 +0000 (12:45 +0800)] 
qmp: Add blockdev-mirror command

This will start a mirror job from a named device to another named
device, its relation with drive-mirror is similar with blockdev-backup
to drive-backup.

In blockdev-mirror, the target node should be prepared by blockdev-add,
which will be responsible for assigning a name to the new node, so
we don't have 'node-name' parameter.

Signed-off-by: Fam Zheng <famz@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Message-id: 1450932306-13717-5-git-send-email-famz@redhat.com
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
9 years agoblock: Add check on mirror target
Fam Zheng [Thu, 24 Dec 2015 04:45:04 +0000 (12:45 +0800)] 
block: Add check on mirror target

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1450932306-13717-4-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
9 years agoblock: Extract blockdev part of qmp_drive_mirror
Fam Zheng [Thu, 24 Dec 2015 04:45:03 +0000 (12:45 +0800)] 
block: Extract blockdev part of qmp_drive_mirror

This is the part that will be reused by blockdev-mirror.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1450932306-13717-3-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
9 years agoblock: Rename BLOCK_OP_TYPE_MIRROR to BLOCK_OP_TYPE_MIRROR_SOURCE
Fam Zheng [Thu, 24 Dec 2015 04:45:02 +0000 (12:45 +0800)] 
block: Rename BLOCK_OP_TYPE_MIRROR to BLOCK_OP_TYPE_MIRROR_SOURCE

It's necessary to distinguish source and target before we can add
blockdev-mirror, because we would want a concrete type of operation to
check on target bs before starting.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1450932306-13717-2-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
9 years agoqemu-iotests: s390x: fix test 051
Bo Tu [Mon, 4 Jan 2016 05:29:20 +0000 (13:29 +0800)] 
qemu-iotests: s390x: fix test 051

Replace the remaining "-drive file..."
by "-drive file=...,if=none,id=$device_id", then x86 and s390x
can get the common output.
"if=ide, if=floppy, if=scsi" are not supported by s390x,
so these test cases are not executed for s390x platform.

Signed-off-by: Bo Tu <tubo@linux.vnet.ibm.com>
Message-id: 1451885360-20236-2-git-send-email-tubo@linux.vnet.ibm.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
9 years agoiotests: 095: Filter _img_info output
Fam Zheng [Tue, 22 Dec 2015 02:49:21 +0000 (10:49 +0800)] 
iotests: 095: Filter _img_info output

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-id: 1450752561-9300-12-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
9 years agoiotests: 095: Use TEST_IMG override instead of "mv"
Fam Zheng [Tue, 22 Dec 2015 02:49:20 +0000 (10:49 +0800)] 
iotests: 095: Use TEST_IMG override instead of "mv"

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-id: 1450752561-9300-11-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
9 years agoiotests: 050: Use TEST_IMG override instead of "mv"
Fam Zheng [Tue, 22 Dec 2015 02:49:19 +0000 (10:49 +0800)] 
iotests: 050: Use TEST_IMG override instead of "mv"

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1450752561-9300-10-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
9 years agoiotests: 038: Use TEST_IMG override instead of "mv"
Fam Zheng [Tue, 22 Dec 2015 02:49:18 +0000 (10:49 +0800)] 
iotests: 038: Use TEST_IMG override instead of "mv"

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1450752561-9300-9-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
9 years agoiotests: 037: Use TEST_IMG override instead of "mv"
Fam Zheng [Tue, 22 Dec 2015 02:49:17 +0000 (10:49 +0800)] 
iotests: 037: Use TEST_IMG override instead of "mv"

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1450752561-9300-8-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>