OSDN Git Service

qmiga/qemu.git
9 years agoAdd David Gibson for sPAPR in MAINTAINERS file
David Gibson [Fri, 8 May 2015 00:11:00 +0000 (10:11 +1000)]
Add David Gibson for sPAPR in MAINTAINERS file

At Alex Graf's request I'm now acting as sub-maintainer for the sPAPR
(-machine pseries) code.  This updates MAINTAINERS accordingly.

While we're at it, change the label to mention pseries since that's the
actual name of the machine type, even if most of the C files use the sPAPR
name.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agopseries: Enable in-kernel H_LOGICAL_CI_{LOAD, STORE} implementations
David Gibson [Thu, 7 May 2015 05:33:59 +0000 (15:33 +1000)]
pseries: Enable in-kernel H_LOGICAL_CI_{LOAD, STORE} implementations

qemu currently implements the hypercalls H_LOGICAL_CI_LOAD and
H_LOGICAL_CI_STORE as PAPR extensions.  These are used by the SLOF firmware
for IO, because performing cache inhibited MMIO accesses with the MMU off
(real mode) is very awkward on POWER.

This approach breaks when SLOF needs to access IO devices implemented
within KVM instead of in qemu.  The simplest example would be virtio-blk
using an iothread, because the iothread / dataplane mechanism relies on
an in-kernel implementation of the virtio queue notification MMIO.

To fix this, an in-kernel implementation of these hypercalls has been made,
(kernel commit 99342cf "kvmppc: Implement H_LOGICAL_CI_{LOAD,STORE} in KVM"
however, the hypercalls still need to be enabled from qemu.  This performs
the necessary calls to do so.

It would be nice to provide some warning if we encounter a problematic
device with a kernel which doesn't support the new calls.  Unfortunately,
I can't see a way to detect this case which won't either warn in far too
many cases that will probably work, or which is horribly invasive.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agospapr: override default ram size to 512MB
Nikunj A Dadhania [Thu, 7 May 2015 05:33:58 +0000 (15:33 +1000)]
spapr: override default ram size to 512MB

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agomachine: add default_ram_size to machine class
Nikunj A Dadhania [Thu, 7 May 2015 05:33:57 +0000 (15:33 +1000)]
machine: add default_ram_size to machine class

Machines types can have different requirement for default ram
size. Introduce a member in the machine class and set the current
default_ram_size to 128MB.

For QEMUMachine types override the value during the registration of
the machine and for MachineClass introduce the generic class init
setting the default_ram_size.

Add helpers [K,M,G,T,P,E]_BYTE for better readability and easy usage

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agospapr_pci: emit hotplug add/remove events during hotplug
Tyrel Datwyler [Thu, 7 May 2015 05:33:56 +0000 (15:33 +1000)]
spapr_pci: emit hotplug add/remove events during hotplug

This uses extension of existing EPOW interrupt/event mechanism
to notify userspace tools like librtas/drmgr to handle
in-guest configuration/cleanup operations in response to
device_add/device_del.

Userspace tools that don't implement this extension will need
to be run manually in response/advance of device_add/device_del,
respectively.

Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agospapr_pci: enable basic hotplug operations
Michael Roth [Thu, 7 May 2015 05:33:55 +0000 (15:33 +1000)]
spapr_pci: enable basic hotplug operations

This enables hotplug of PCI devices to a PHB. Upon hotplug we
generate the OF-nodes required by PAPR specification and
IEEE 1275-1994 "PCI Bus Binding to Open Firmware" for the
device.

We associate the corresponding FDT for these nodes with the DRC
corresponding to the slot, which will be fetched via
ibm,configure-connector RTAS calls by the guest as described by PAPR
specification.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agopci: make pci_bar useable outside pci.c
Michael Roth [Thu, 7 May 2015 05:33:54 +0000 (15:33 +1000)]
pci: make pci_bar useable outside pci.c

We need to work with PCI BARs to generate OF properties
during PCI hotplug for sPAPR guests.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agospapr_pci: create DRConnectors for each PCI slot during PHB realize
Michael Roth [Thu, 7 May 2015 05:33:53 +0000 (15:33 +1000)]
spapr_pci: create DRConnectors for each PCI slot during PHB realize

These will be used to support hotplug/unplug of PCI devices to the PCI
bus associated with a particular PHB.

We also set up device-tree properties in each PHBs initial FDT to
describe the DRCs associated with them. This advertises to guests that
each PHB is DR-capable device with physical hotpluggable slots, each
managed by the corresponding DRC. This is necessary for allowing
hotplugging of devices to it later via bus rescan or guest rpaphp
hotplug module.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agospapr_pci: add dynamic-reconfiguration option for spapr-pci-host-bridge
Michael Roth [Thu, 7 May 2015 05:33:52 +0000 (15:33 +1000)]
spapr_pci: add dynamic-reconfiguration option for spapr-pci-host-bridge

This option enables/disables PCI hotplug for a particular PHB.

Also add machine compatibility code to disable it by default for machine
types prior to pseries-2.4.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
[agraf: move commas for compat fields]
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agospapr_drc: add spapr_drc_populate_dt()
Michael Roth [Thu, 7 May 2015 05:33:51 +0000 (15:33 +1000)]
spapr_drc: add spapr_drc_populate_dt()

This function handles generation of ibm,drc-* array device tree
properties to describe DRC topology to guests. This will by used
by the guest to direct RTAS calls to manage any dynamic resources
we associate with a particular DR Connector as part of
hotplug/unplug.

Since general management of boot-time device trees are handled
outside of sPAPRDRConnector, we insert these values blindly given
an FDT and offset. A mask of sPAPRDRConnector types is given to
instruct us on what types of connectors entries should be generated
for, since descriptions for different connectors may live in
different parts of the device tree.

Based on code originally written by Nathan Fontenot.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agospapr_events: event-scan RTAS interface
Tyrel Datwyler [Thu, 7 May 2015 05:33:50 +0000 (15:33 +1000)]
spapr_events: event-scan RTAS interface

We don't actually rely on this interface to surface hotplug events, and
instead rely on the similar-but-interrupt-driven check-exception RTAS
interface used for EPOW events. However, the existence of this interface
is needed to ensure guest kernels initialize the event-reporting
interfaces which will in turn be used by userspace tools to handle these
events, so we implement this interface here.

Since events surfaced by this call are mutually exclusive to those
surfaced via check-exception, we also update the RTAS event queue code
to accept a boolean to mark/filter for events accordingly.

Events of this sort are not currently generated by QEMU, but the interface
has been tested by surfacing hotplug events via event-scan in place
of check-exception.

Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agospapr_events: re-use EPOW event infrastructure for hotplug events
Nathan Fontenot [Thu, 7 May 2015 05:33:49 +0000 (15:33 +1000)]
spapr_events: re-use EPOW event infrastructure for hotplug events

This extends the data structures currently used to report EPOW events to
guests via the check-exception RTAS interfaces to also include event types
for hotplug/unplug events.

This is currently undocumented and being finalized for inclusion in PAPR
specification, but we implement this here as an extension for guest
userspace tools to implement (existing guest kernels simply log these
events via a sysfs interface that's read by rtas_errd, and current
versions of rtas_errd/powerpc-utils already support the use of this
mechanism for initiating hotplug operations).

We also add support for queues of pending RTAS events, since in the
case of hotplug there's chance for multiple events being in-flight
at any point in time.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agospapr_rtas: add ibm, configure-connector RTAS interface
Michael Roth [Thu, 7 May 2015 05:33:48 +0000 (15:33 +1000)]
spapr_rtas: add ibm, configure-connector RTAS interface

This interface is used to fetch an OF device-tree nodes that describes a
newly-attached device to guest. It is called multiple times to walk the
device-tree node and fetch individual properties into a 'workarea'/buffer
provided by the guest.

The device-tree is generated by QEMU and passed to an sPAPRDRConnector during
the initial hotplug operation, and the state of these RTAS calls is tracked by
the sPAPRDRConnector. When the last of these properties is successfully
fetched, we report as special return value to the guest and transition
the device to a 'configured' state on the QEMU/DRC side.

See docs/specs/ppc-spapr-hotplug.txt for a complete description of
this interface.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agospapr: add rtas_st_buffer_direct() helper
Michael Roth [Thu, 7 May 2015 05:33:47 +0000 (15:33 +1000)]
spapr: add rtas_st_buffer_direct() helper

This is similar to the existing rtas_st_buffer(), but for cases
where the guest is not expecting a length-encoded byte array.
Namely, for calls where a "work area" buffer is used to pass
around arbitrary fields/data.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agospapr_rtas: add get-sensor-state RTAS interface
Mike Day [Thu, 7 May 2015 05:33:46 +0000 (15:33 +1000)]
spapr_rtas: add get-sensor-state RTAS interface

This interface allows a guest to read various platform/device sensors.
initially, we only implement support necessary to support hotplug:
reading of the dr-entity-sense sensor, which communicates the state of
a hotplugged resource/device to the guest (EMPTY/PRESENT/UNUSABLE).

See docs/specs/ppc-spapr-hotplug.txt for a complete description of
this interface.

Signed-off-by: Mike Day <ncmike@ncultra.org>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agospapr_rtas: add set-indicator RTAS interface
Mike Day [Thu, 7 May 2015 05:33:45 +0000 (15:33 +1000)]
spapr_rtas: add set-indicator RTAS interface

This interface allows a guest to control various platform/device
sensors. Initially, we only implement support necessary to control
sensors that are required for hotplug: DR connector indicators/LEDs,
resource allocation state, and resource isolation state.

See docs/specs/ppc-spapr-hotplug.txt for a complete description of
this interface.

Signed-off-by: Mike Day <ncmike@ncultra.org>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agospapr_rtas: add get/set-power-level RTAS interfaces
Nathan Fontenot [Thu, 7 May 2015 05:33:44 +0000 (15:33 +1000)]
spapr_rtas: add get/set-power-level RTAS interfaces

These interfaces manage the power domains that guest devices are
assigned to and are used to power on/off devices. Currently we
only utilize 1 power domain, the 'live-insertion' domain, which
automates power management of plugged/unplugged devices, essentially
making these calls no-ops, but the RTAS interfaces are still required
by guest hotplug code and PAPR+.

See docs/specs/ppc-spapr-hotplug.txt for a complete description of
these interfaces.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agospapr_drc: initial implementation of sPAPRDRConnector device
Michael Roth [Thu, 7 May 2015 05:33:43 +0000 (15:33 +1000)]
spapr_drc: initial implementation of sPAPRDRConnector device

This device emulates a firmware abstraction used by pSeries guests to
manage hotplug/dynamic-reconfiguration of host-bridges, PCI devices,
memory, and CPUs. It is conceptually similar to an SHPC device,
complete with LED indicators to identify individual slots to physical
physical users and indicate when it is safe to remove a device. In
some cases it is also used to manage virtualized resources, such a
memory, CPUs, and physical-host bridges, which in the case of pSeries
guests are virtualized resources where the physical components are
managed by the host.

Guests communicate with these DR Connectors using RTAS calls,
generally by addressing the unique DRC index associated with a
particular connector for a particular resource. For introspection
purposes we expose this state initially as QOM properties, and
in subsequent patches will introduce the RTAS calls that make use of
it. This constitutes to the 'guest' interface.

On the QEMU side we provide an attach/detach interface to associate
or cleanup a DeviceState with a particular sPAPRDRConnector in
response to hotplug/unplug, respectively. This constitutes the
'physical' interface to the DR Connector.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agodocs: add sPAPR hotplug/dynamic-reconfiguration documentation
Michael Roth [Thu, 7 May 2015 05:33:42 +0000 (15:33 +1000)]
docs: add sPAPR hotplug/dynamic-reconfiguration documentation

This adds a general overview of hotplug/dynamic-reconfiguration
for sPAPR/pSeries guest.

As specified in PAPR+ v2.7.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agohw/ppc/spapr: Use error_report() instead of hw_error()
Thomas Huth [Thu, 7 May 2015 05:33:41 +0000 (15:33 +1000)]
hw/ppc/spapr: Use error_report() instead of hw_error()

hw_error() is designed for printing CPU-related error messages
(e.g. it also prints a full CPU register dump). For error messages
that are not directly related to CPU problems, a function like
error_report() should be used instead.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agohw/ppc/spapr: Fix error message when firmware could not be loaded
Thomas Huth [Thu, 7 May 2015 05:33:40 +0000 (15:33 +1000)]
hw/ppc/spapr: Fix error message when firmware could not be loaded

When specifying a non-existing file with the "-bios" parameter, QEMU
complained that it "could not find LPAR rtas". That's obviously a
copy-n-paste bug from the code which loads the spapr-rtas.bin, it
should complain about a missing firmware file instead.
Additionally the error message was printed with hw_error() - which
also dumps the whole CPU state. However, this does not make much
sense here since the CPU is not running yet and thus the registers
only contain zeroes. So let's use error_report() here instead.
And while we're at it, let's also bail out if the firmware file
had zero length.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agopseries: Add pseries-2.4 machine type
David Gibson [Thu, 7 May 2015 05:33:39 +0000 (15:33 +1000)]
pseries: Add pseries-2.4 machine type

Now that 2.4 development has opened, create a new pseries machine type
variant.  For now it is identical to the pseries-2.3 machine type, but
a number of new features are coming that will need to set backwards
compatibility options.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agohw/ppc/spapr_iommu: Fix the check for invalid upper bits in liobn
Thomas Huth [Thu, 7 May 2015 05:33:38 +0000 (15:33 +1000)]
hw/ppc/spapr_iommu: Fix the check for invalid upper bits in liobn

The check "liobn & 0xFFFFFFFF00000000ULL" in spapr_tce_find_by_liobn()
is completely useless since liobn is only declared as an uint32_t
parameter. Fix this by using target_ulong instead (this is what most
of the callers of this function are using, too).

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agospapr_iommu: Give unique QOM name to TCE table
Alexey Kardashevskiy [Thu, 7 May 2015 05:33:37 +0000 (15:33 +1000)]
spapr_iommu: Give unique QOM name to TCE table

Useful for debugging.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agospapr_pci: Rework device-tree rendering
Alexey Kardashevskiy [Thu, 7 May 2015 05:33:36 +0000 (15:33 +1000)]
spapr_pci: Rework device-tree rendering

This replaces object_child_foreach() and callback with existing
SPAPR_PCI_LIOBN() and spapr_tce_find_by_liobn() to make the code easier
to read.

This is a mechanical patch so no behaviour change is expected.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agospapr_iommu: Make spapr_tce_find_by_liobn() public
Alexey Kardashevskiy [Thu, 7 May 2015 05:33:35 +0000 (15:33 +1000)]
spapr_iommu: Make spapr_tce_find_by_liobn() public

At the moment spapr_tce_find_by_liobn() is used by H_PUT_TCE/...
handlers to find an IOMMU by LIOBN.

We are going to implement Dynamic DMA windows (DDW), new code
will go to a new file and we will use spapr_tce_find_by_liobn()
there too so let's make it public.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agospapr_pci: Make find_phb()/find_dev() public
Alexey Kardashevskiy [Thu, 7 May 2015 05:33:34 +0000 (15:33 +1000)]
spapr_pci: Make find_phb()/find_dev() public

This makes find_phb()/find_dev() public and changed its names
to spapr_pci_find_phb()/spapr_pci_find_dev() as they are going to
be used from other parts of QEMU such as VFIO DDW (dynamic DMA window)
or VFIO PCI error injection or VFIO EEH handling - in all these
cases there are RTAS calls which are addressed to BUID+config_addr
in IEEE1275 format.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agospapr_iommu: Add separate trace points for PCI DMA operations
Alexey Kardashevskiy [Thu, 7 May 2015 05:33:33 +0000 (15:33 +1000)]
spapr_iommu: Add separate trace points for PCI DMA operations

This is to reduce VIO noise while debugging PCI DMA.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agospapr_pci: Define default DMA window size as a macro
Alexey Kardashevskiy [Thu, 7 May 2015 05:33:32 +0000 (15:33 +1000)]
spapr_pci: Define default DMA window size as a macro

This gets rid of a magic constant describing the default DMA window size
for an emulated PHB.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agospapr_vio: Introduce a liobn number generating macros
Alexey Kardashevskiy [Thu, 7 May 2015 05:33:31 +0000 (15:33 +1000)]
spapr_vio: Introduce a liobn number generating macros

This introduces a macro which makes up a LIOBN from fixed prefix and
VIO device address (@reg property).

This is to keep LIOBN macros rendering consistent - the same macro for
PCI has been added by the previous patch.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agospapr_pci: Introduce a liobn number generating macros
Alexey Kardashevskiy [Thu, 7 May 2015 05:33:30 +0000 (15:33 +1000)]
spapr_pci: Introduce a liobn number generating macros

We are going to have multiple DMA windows per PHB and we want them to
migrate so we need a predictable way of assigning LIOBNs.

This introduces a macro which makes up a LIOBN from fixed prefix,
PHB index (unique PHB id) and window number.

This introduces a SPAPR_PCI_DMA_WINDOW_NUM() to know the window number
from LIOBN. It is used to distinguish the default 32bit windows from
dynamic windows and avoid picking default DMA window properties from
a wrong TCE table.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agospapr_iommu: Make H_PUT_TCE_INDIRECT endian-safe
Alexey Kardashevskiy [Thu, 7 May 2015 05:33:29 +0000 (15:33 +1000)]
spapr_iommu: Make H_PUT_TCE_INDIRECT endian-safe

PAPR is defined as big endian so TCEs need an adjustment so
does this patch.

This changes code to have ldq_be_phys() in one place.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agospapr_iommu: Disable in-kernel IOMMU tables for >4GB windows
Alexey Kardashevskiy [Thu, 7 May 2015 05:33:28 +0000 (15:33 +1000)]
spapr_iommu: Disable in-kernel IOMMU tables for >4GB windows

The existing KVM_CREATE_SPAPR_TCE ioctl only support 4G windows max as
the window size parameter to the kernel ioctl() is 32-bit so
there's no way of expressing a TCE window > 4GB.

We are going to add huge DMA windows support so this will create small
window and unexpectedly fail later.

This disables KVM_CREATE_SPAPR_TCE for windows bigger that 4GB.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agospapr_pci: Fix unsafe signed/unsigned comparisons
David Gibson [Thu, 19 Mar 2015 04:14:18 +0000 (15:14 +1100)]
spapr_pci: Fix unsafe signed/unsigned comparisons

spapr_pci.c contains a number of expressions of the form (uval == -1) or
(uval != -1), where 'uval' is an unsigned value.

This mostly works in practice, because as long as the width of uval is
greater or equal than that of (int), the -1 will be promoted to the
unsigned type, which is the expected outcome.

However, at least for the cases where uval is uint32_t, this would break
on platforms where sizeof(int) > 4 (and a few such do exist), because then
the uint32_t value would be promoted to the larger int type, and never be
equal to -1.

This patch fixes these errors.  The fixes for the (uint32_t) cases are
necessary as described above.  I've made similar fixes to (uint64_t) and
(hwaddr) cases.  Those are strictly theoretical, since I don't know of any
platforms where sizeof(int) > 8, but hey, it's not that hard so we might
as well be strictly C standard compliant.

Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agoconfigure: Check for libfdt version 1.4.0
Thomas Huth [Mon, 18 May 2015 10:59:49 +0000 (12:59 +0200)]
configure: Check for libfdt version 1.4.0

Some recent patches require a function from libfdt version 1.4.0,
so we should check for this version during the configure step
already. Unfortunately, there does not seem to be a proper #define
for the version number in the libfdt headers. So alternatively,
we check for the availability of the required function
fdt_get_property_by_offset() instead instead.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agodtc: Update dtc / libfdt submodule to version 1.4.0
Thomas Huth [Mon, 18 May 2015 10:59:48 +0000 (12:59 +0200)]
dtc: Update dtc / libfdt submodule to version 1.4.0

Since some recent patches require libfdt version 1.4.0,
let's update the dtc submodule to this version.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agomacio: Convert to realize()
Markus Armbruster [Tue, 17 Mar 2015 07:46:15 +0000 (08:46 +0100)]
macio: Convert to realize()

Convert device models "macio-oldworld" and "macio-newworld".

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
9 years agotarget-arm: Correct check for non-EL3
Edgar E. Iglesias [Fri, 29 May 2015 06:43:13 +0000 (16:43 +1000)]
target-arm: Correct check for non-EL3

This fixes a compile warning from clang 3.5 (the assertion
could never fire).

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 1432881807-18164-2-git-send-email-edgar.iglesias@gmail.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: John Snow <jsnow@redhat.com>
[PMM: added note in commit message that this is fixing a build warning]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-input-20150602-1' into staging
Peter Maydell [Tue, 2 Jun 2015 10:25:12 +0000 (11:25 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-input-20150602-1' into staging

virtio-input: two small fixups

# gpg: Signature made Tue Jun  2 09:32:51 2015 BST 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-input-20150602-1:
  virtio-input: make virtio devices follow usual naming convention
  virtio-input: const_le16 and const_le32 not build time constant

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agoMerge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
Peter Maydell [Tue, 2 Jun 2015 09:20:03 +0000 (10:20 +0100)]
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

pc build fix

My last pull breaks build on systems with iasl.
Fix this up.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
# gpg: Signature made Mon Jun  1 20:41:08 2015 BST 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:
  acpi: add missing ssdt

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agovirtio-input: make virtio devices follow usual naming convention
Gerd Hoffmann [Tue, 2 Jun 2015 08:31:29 +0000 (10:31 +0200)]
virtio-input: make virtio devices follow usual naming convention

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9 years agovirtio-input: const_le16 and const_le32 not build time constant
Michael Mueller [Mon, 1 Jun 2015 13:51:56 +0000 (15:51 +0200)]
virtio-input: const_le16 and const_le32 not build time constant

As the implementation of const_le16 and const_le32 is not build time constant
on big endian systems this need to be fixed.

  CC    hw/input/virtio-input-hid.o
hw/input/virtio-input-hid.c:340:13: error: initializer element is not constant
hw/input/virtio-input-hid.c:340:13: error: (near initialization for ‘virtio_keyboard_config[1].u.ids.bustype’)
...

Signed-off-by: Michael Mueller <mimu@linux.vnet.ibm.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9 years agoacpi: add missing ssdt
Michael S. Tsirkin [Mon, 1 Jun 2015 19:03:59 +0000 (21:03 +0200)]
acpi: add missing ssdt

commit 5cb18b3d7bff2a83275ee98af2a14eb9e21c93ab
    TPM2 ACPI table support

was missing a file, so build with iasl fails
(build without iasl works since it uses the generated
 hex files).

Reported-by: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agoMerge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
Peter Maydell [Mon, 1 Jun 2015 14:22:46 +0000 (15:22 +0100)]
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

pc, pci, tpm, virtio, vhost enhancements and fixes

A bunch of cleanups and fixes all over the place,
enhancements in TPM, virtio and vhost.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
# gpg: Signature made Mon Jun  1 13:19:48 2015 BST 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: (60 commits)
  vhost-user: add multi queue support
  virtio: make features 64bit wide
  qdev: add 64bit properties
  virtio-mmio: ioeventfd support
  hw/acpi/aml-build: Fix memory leak
  acpi: add aml_while() term
  acpi: add aml_increment() term
  acpi: add aml_shiftright() term
  acpi: add aml_shiftleft() term
  acpi: add aml_index() term
  acpi: add aml_lless() term
  acpi: add aml_add() term
  TPM2 ACPI table support
  tpm: Probe for connected TPM 1.2 or TPM 2
  Extend TPM TIS interface to support TPM 2
  Add stream ID to MSI write
  acpi: Simplify printing to dynamic string
  i386: drop FDC in pc-q35-2.4+ if neither it nor floppy drives are wanted
  i386/pc_q35: don't insist on board FDC if there's no default floppy
  i386/pc: '-drive if=floppy' should imply a board-default FDC
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agovhost-user: add multi queue support
Ouyang Changchun [Thu, 28 May 2015 01:23:06 +0000 (09:23 +0800)]
vhost-user: add multi queue support

Based on patch by Nikolay Nikolaev:
Vhost-user will implement the multi queue support in a similar way
to what vhost already has - a separate thread for each queue.
To enable the multi queue functionality - a new command line parameter
"queues" is introduced for the vhost-user netdev.

Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agovirtio: make features 64bit wide
Gerd Hoffmann [Mon, 1 Jun 2015 08:45:40 +0000 (10:45 +0200)]
virtio: make features 64bit wide

Make features 64bit wide everywhere.

On migration a full 64bit guest_features field is sent if one of the
high bits is set, in addition to the lower 32bit guest_features field
which must stay for compatibility reasons.  That way we send the lower
32 feature bits twice, but the code is simpler because we don't have
to split and compose the 64bit features into two 32bit fields.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agoqdev: add 64bit properties
Gerd Hoffmann [Mon, 1 Jun 2015 08:45:39 +0000 (10:45 +0200)]
qdev: add 64bit properties

Needed for virtio features which go from 32bit to 64bit with virtio 1.0

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agovirtio-mmio: ioeventfd support
Ying-Shiuan Pan [Tue, 12 May 2015 08:10:50 +0000 (11:10 +0300)]
virtio-mmio: ioeventfd support

set_host_notifier and set_guest_notifiers supported by virtio-mmio now.
Most code copied from virtio-pci.

This makes it possible to use vhost-net with virtio-mmio,
improving performance by about 30%.

The kvm-arm does not yet support irqfd, need to fix the hard-coded part after
kvm-arm gets irqfd support.

Signed-off-by: Ying-Shiuan Pan <yingshiuan.pan@gmail.com>
Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agohw/acpi/aml-build: Fix memory leak
Shannon Zhao [Mon, 25 May 2015 07:14:37 +0000 (15:14 +0800)]
hw/acpi/aml-build: Fix memory leak

Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
9 years agoacpi: add aml_while() term
Marcel Apfelbaum [Mon, 25 May 2015 15:33:46 +0000 (18:33 +0300)]
acpi: add aml_while() term

Add encoding for ACPI DefWhile Opcode.

Reviewed-by: Shannon Zhao <zhaoshenglong@huawei.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-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 agoacpi: add aml_increment() term
Marcel Apfelbaum [Mon, 25 May 2015 15:33:45 +0000 (18:33 +0300)]
acpi: add aml_increment() term

Add encoding for ACPI DefIncrement Opcode.

Reviewed-by: Shannon Zhao <zhaoshenglong@huawei.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-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 agoacpi: add aml_shiftright() term
Marcel Apfelbaum [Mon, 25 May 2015 15:33:44 +0000 (18:33 +0300)]
acpi: add aml_shiftright() term

Add encoding for ACPI DefShiftRight Opcode.

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Shannon Zhao <shannon.zhao@linaro.org>
9 years agoacpi: add aml_shiftleft() term
Marcel Apfelbaum [Mon, 25 May 2015 15:33:43 +0000 (18:33 +0300)]
acpi: add aml_shiftleft() term

Add encoding for ACPI DefShiftLeft Opcode.

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Shannon Zhao <shannon.zhao@linaro.org>
9 years agoacpi: add aml_index() term
Marcel Apfelbaum [Mon, 25 May 2015 15:33:42 +0000 (18:33 +0300)]
acpi: add aml_index() term

Add encoding for ACPI DefIndex Opcode.

Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Shannon Zhao <shannon.zhao@linaro.org>
9 years agoacpi: add aml_lless() term
Marcel Apfelbaum [Mon, 25 May 2015 15:33:41 +0000 (18:33 +0300)]
acpi: add aml_lless() term

Add encoding for ACPI DefLLess Opcode.

Reviewed-by: Shannon Zhao <zhaoshenglong@huawei.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-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 agoacpi: add aml_add() term
Marcel Apfelbaum [Mon, 25 May 2015 15:33:40 +0000 (18:33 +0300)]
acpi: add aml_add() term

Add encoding for ACPI DefAdd Opcode.

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Shannon Zhao <shannon.zhao@linaro.org>
9 years agoTPM2 ACPI table support
Stefan Berger [Tue, 26 May 2015 20:51:07 +0000 (16:51 -0400)]
TPM2 ACPI table support

Add a TPM2 ACPI table if a TPM 2 is used in the backend.
Also add an SSDT for the TPM 2.

Rename tpm_find() to tpm_get_version() and have this function
return the version of the TPM found, TPMVersion_Unspec if
no TPM is found. Use the version number to build version
specific ACPI tables.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.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/bkoppelmann/tags/pull-tricore-20150530' into...
Peter Maydell [Mon, 1 Jun 2015 10:29:37 +0000 (11:29 +0100)]
Merge remote-tracking branch 'remotes/bkoppelmann/tags/pull-tricore-20150530' into staging

TriCore bugfixes

# gpg: Signature made Sat May 30 15:50:49 2015 BST using RSA key ID 6B69CA14
# gpg: Good signature from "Bastian Koppelmann <kbastian@mail.uni-paderborn.de>"

* remotes/bkoppelmann/tags/pull-tricore-20150530:
  target-tricore: fix BOL_ST_H_LONGOFF using ld
  target-tricore: fix msub32_q producing the wrong overflow bit
  target-tricore: fix OPC2_32_RR_DVINIT_HU having write before use on the result

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agotpm: Probe for connected TPM 1.2 or TPM 2
Stefan Berger [Tue, 26 May 2015 20:51:06 +0000 (16:51 -0400)]
tpm: Probe for connected TPM 1.2 or TPM 2

In the TPM passthrough backend driver, modify the probing code so
that we can check whether a TPM 1.2 or TPM 2 is being used
and adapt the behavior of the TPM TIS accordingly.

Move the code that tested for a TPM 1.2 into tpm_utils.c
and extend it with test for probing for TPM 2. Have the
function return the version of TPM found.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agoExtend TPM TIS interface to support TPM 2
Stefan Berger [Tue, 26 May 2015 20:51:05 +0000 (16:51 -0400)]
Extend TPM TIS interface to support TPM 2

Following the recent upgrade to version 1.3, extend the TPM TIS
interface with capabilities introduced for support of a TPM 2.

TPM TIS for TPM 2 introduced the following extensions beyond the
TPM TIS 1.3 (used for TPM 1.2):

- A new 32bit interface Id register was introduced.
- New flags for the status (STS) register were defined.
- New flags for the capability flags were defined.

Support the above if a TPM TIS 1.3 for TPM 2 is used with a TPM 2
on the backend side. Support the old TPM TIS 1.3 configuration if a
TPM 1.2 is being used. A subsequent patch will then determine which
TPM version is being used in the backend.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agoAdd stream ID to MSI write
Pavel Fedin [Wed, 27 May 2015 12:59:59 +0000 (15:59 +0300)]
Add stream ID to MSI write

GICv3 ITS distinguishes between devices by using hardwired device IDs passed on the bus.
This patch implements passing these IDs in qemu.
SMMU is also known to use stream IDs, therefore this addition can also be useful for
implementing platforms with SMMU.

Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
 Changes from v1:
- Added bus number to the stream ID
- Added stream ID not only to MSI-X, but also to plain MSI. Some common code was made into
msi_send_message() function.
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agoacpi: Simplify printing to dynamic string
Markus Armbruster [Wed, 27 May 2015 17:55:55 +0000 (19:55 +0200)]
acpi: Simplify printing to dynamic string

build_append_namestringv() and aml_string() first calculate the
resulting string's length with vsnprintf(NULL, ...), then allocate,
then print for real.  Simply use g_strdup_vprintf() or g_vasprintf()
instead.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
9 years agoi386: drop FDC in pc-q35-2.4+ if neither it nor floppy drives are wanted
Laszlo Ersek [Thu, 28 May 2015 20:04:11 +0000 (22:04 +0200)]
i386: drop FDC in pc-q35-2.4+ if neither it nor floppy drives are wanted

It is Very annoying to carry forward an outdatEd coNtroller with a mOdern
Machine type.

Hence, let us not instantiate the FDC when all of the following apply:
- the machine type is pc-q35-2.4 or later,
- "-device isa-fdc" is not passed on the command line (nor in the config
  file),
- no "-drive if=floppy,..." is requested.

Cc: Markus Armbruster <armbru@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: John Snow <jsnow@redhat.com>
Cc: "Gabriel L. Somlo" <gsomlo@gmail.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-block@nongnu.org
Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
9 years agoi386/pc_q35: don't insist on board FDC if there's no default floppy
Laszlo Ersek [Thu, 28 May 2015 20:04:10 +0000 (22:04 +0200)]
i386/pc_q35: don't insist on board FDC if there's no default floppy

The "no_floppy = 1" machine class setting causes "default_floppy" in
main() to become zero. Consequently, default_drive() will not call
drive_add() and drive_new() for IF_FLOPPY, index=0, meaning that no
default floppy drive will be created for the virtual machine. In that
case, board code should also not insist on the creation of the
board-default FDC.

The board-default FDC will still be created if the user requests a floppy
drive with "-drive if=floppy".

Additionally, separate FDCs can be specified manually with "-device
isa-fdc". They allow the

  -device isa-fdc,driveA=...

syntax that is more flexible than the one required by the board-default
FDC:

  -global isa-fdc.driveA=...

This patch doesn't change the behavior observably, as all Q35 machine
types have "no_floppy = 0".

Cc: Markus Armbruster <armbru@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: John Snow <jsnow@redhat.com>
Cc: "Gabriel L. Somlo" <gsomlo@gmail.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-block@nongnu.org
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: Markus Armbruster <armbru@redhat.com>
9 years agoi386/pc: '-drive if=floppy' should imply a board-default FDC
Laszlo Ersek [Thu, 28 May 2015 20:04:09 +0000 (22:04 +0200)]
i386/pc: '-drive if=floppy' should imply a board-default FDC

Even if board code decides not to request the creation of the FDC (keyed
off board-level factors, to be determined later), we should create the FDC
nevertheless if the user passes '-drive if=floppy' on the command line.

Otherwise '-drive if=floppy' would break without explicit '-device
isa-fdc' on such boards.

Cc: Markus Armbruster <armbru@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: John Snow <jsnow@redhat.com>
Cc: "Gabriel L. Somlo" <gsomlo@gmail.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-block@nongnu.org
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: Markus Armbruster <armbru@redhat.com>
9 years agoi386/pc: pc_basic_device_init(): delegate FDC creation request
Laszlo Ersek [Thu, 28 May 2015 20:04:08 +0000 (22:04 +0200)]
i386/pc: pc_basic_device_init(): delegate FDC creation request

This patch introduces no observable change, but it allows the callers of
pc_basic_device_init(), ie. pc_init1() and pc_q35_init(), to request (or
not request) the creation of the FDC explicitly.

At the moment both callers pass constant create_fdctrl=true (hence no
observable change).

Assuming a board passes create_fdctrl=false, "floppy" will be NULL on
output, and (beyond the FDC not being created) that NULL will be passed on
to pc_cmos_init(). Luckily, pc_cmos_init() already handles that case.

Cc: Markus Armbruster <armbru@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: John Snow <jsnow@redhat.com>
Cc: "Gabriel L. Somlo" <gsomlo@gmail.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-block@nongnu.org
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: Markus Armbruster <armbru@redhat.com>
9 years agovirtio: increase the queue limit to 1024
Jason Wang [Fri, 29 May 2015 06:15:32 +0000 (14:15 +0800)]
virtio: increase the queue limit to 1024

Increase the queue limit to 1024. But virtio-ccw and s390-virtio won't
support this, this is done through failing device_plugged() for those
two transports if the number of virtqueues is greater than 64.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agovirtio: rename VIRTIO_PCI_QUEUE_MAX to VIRTIO_QUEUE_MAX
Jason Wang [Fri, 29 May 2015 06:15:31 +0000 (14:15 +0800)]
virtio: rename VIRTIO_PCI_QUEUE_MAX to VIRTIO_QUEUE_MAX

VIRTIO_PCI_QUEUE_MAX is not only used for pci, so rename it be generic.

Cc: Amit Shah <amit.shah@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agovirtio-s390: introduce virtio_s390_device_plugged()
Jason Wang [Fri, 29 May 2015 06:15:30 +0000 (14:15 +0800)]
virtio-s390: introduce virtio_s390_device_plugged()

This patch introduce a virtio-s390 specific device_plugged() function
and doing the number of virtqueue validation inside.

Cc: Alexander Graf <agraf@suse.de>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agovirtio-s390: introduce virito s390 queue limit
Jason Wang [Fri, 29 May 2015 06:15:29 +0000 (14:15 +0800)]
virtio-s390: introduce virito s390 queue limit

Cc: Alexander Graf <agraf@suse.de>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agovirtio-ccw: validate the number of queues against bus limitation
Jason Wang [Fri, 29 May 2015 06:15:28 +0000 (14:15 +0800)]
virtio-ccw: validate the number of queues against bus limitation

Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Alexander Graf <agraf@suse.de>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agovirtio-ccw: introduce ccw specific queue limit
Jason Wang [Fri, 29 May 2015 06:15:27 +0000 (14:15 +0800)]
virtio-ccw: introduce ccw specific queue limit

Cc: Alexander Graf <agraf@suse.de>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agovirtio: introduce virtio_get_num_queues()
Jason Wang [Fri, 29 May 2015 06:15:26 +0000 (14:15 +0800)]
virtio: introduce virtio_get_num_queues()

This patch introduces virtio_get_num_queues() which iterates the vqs
array and return the number of virtqueues used by device.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agovirtio: device_plugged() can fail
Jason Wang [Fri, 29 May 2015 06:15:25 +0000 (14:15 +0800)]
virtio: device_plugged() can fail

This patch passes error pointer to transport specific device_plugged()
callback. Through this way, device_plugged() can do some transport
specific check and fail. This will be uesd by following patches that
check the number of virtqueues against the transport limitation.

Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Alexander Graf <agraf@suse.de>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agovirtio-net: adding all queues in .realize()
Jason Wang [Fri, 29 May 2015 06:15:24 +0000 (14:15 +0800)]
virtio-net: adding all queues in .realize()

Instead of adding queues for multiqueue during feature set. This patch
did this in .realize(), this will help the following patches that
count the number of virtqueues used in .device_plugged() callback.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agovirtio: move VIRTIO_F_NOTIFY_ON_EMPTY into core
Cornelia Huck [Fri, 29 May 2015 09:29:40 +0000 (11:29 +0200)]
virtio: move VIRTIO_F_NOTIFY_ON_EMPTY into core

Nearly all transports have been offering VIRTIO_F_NOTIFY_ON_EMPTY,
s390-virtio being the exception. There's no reason why it shouldn't
offer it as well, though (handling is done in core anyway), so let's
move it to the common virtio features.

While we're changing it anyway, fix the indentation for the
DEFINE_VIRTIO_COMMON_FEATURES macro.

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 agovirtio-ccw: Don't advertise VIRTIO_F_BAD_FEATURE
Cornelia Huck [Fri, 29 May 2015 09:29:39 +0000 (11:29 +0200)]
virtio-ccw: Don't advertise VIRTIO_F_BAD_FEATURE

This was copied from virtio-pci, but it doesn't make much sense for
ccw, as it doesn't have to handle the broken implementations this bit
is supposed to deal with. Remove it.

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 agovirtio: move host_features
Cornelia Huck [Tue, 26 May 2015 14:34:47 +0000 (16:34 +0200)]
virtio: move host_features

Move host_features from the individual transport proxies into
the virtio device. Transports may continue to add feature bits
during device plugging.

This should it make easier to offer different sets of host features
for virtio-1/transitional support.

Tested-by: Shannon Zhao <shannon.zhao@linaro.org>
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 agopc: acpi: fix pvpanic for buggy guests
Radim Krčmář [Fri, 29 May 2015 19:57:32 +0000 (21:57 +0200)]
pc: acpi: fix pvpanic for buggy guests

In the old times, we always had pvpanic in ACPI and a _STA method told
the guest not to use it.  Automatic generation dropped the _STA method
as the specification says that missing _STA means enabled and working.
Some guests (Linux) had buggy drivers and this change made them unable
to utilize pvpanic.

A Linux patch is posted as well, but I think it's worth to make pvpanic
useable on old guests at the price of three lines and few bytes of SSDT.

The old _STA method was
  Method (_STA, 0, NotSerialized) {
      Store (PEST, Local0)
      If (LEqual (Local0, Zero)) {
          Return (Zero) }
      Else {
          Return (0x0F) }}

Igor pointed out that we don't need to use a method to return a constant
and that 0xB (don't show in UI) is the common definition now.

Also, the device used to be PEVT.  (PEVT as in "panic event"?)

Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: Generate init functions with a macro
Eduardo Habkost [Fri, 15 May 2015 17:19:01 +0000 (14:19 -0300)]
pc: Generate init functions with a macro

All pc-i440fx and pc-q35 init functions simply call the corresponding
compat function and then call the main init function. Use a macro to
generate that code.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopiix: Eliminate pc_init_pci()
Eduardo Habkost [Fri, 15 May 2015 17:19:00 +0000 (14:19 -0300)]
piix: Eliminate pc_init_pci()

The function is not needed anymore, we can simply call pc_init1()
directly.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopiix: Add kvmclock_enabled, pci_enabled globals
Eduardo Habkost [Fri, 15 May 2015 17:18:59 +0000 (14:18 -0300)]
piix: Add kvmclock_enabled, pci_enabled globals

This looks like a step backwards, but it will allow pc-0.1[0123] and
isapc to follow the same compat+init pattern used by the other
machine-types, allowing us to generate all init function using the same
macro later.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agomachine: Remove unused fields from QEMUMachine
Eduardo Habkost [Fri, 15 May 2015 17:18:58 +0000 (14:18 -0300)]
machine: Remove unused fields from QEMUMachine

This removes the following fields from QEMUMachine: family, alias,
reset, hot_add_cpu, units_per_default_bus, no_serial, no_parallel,
use_virtcon, use_sclp, no_floppy, no_cdrom, default_display,
compat_props, and hw_version.

The only users of those fields were already converted to use QOM and
MachineClass directly, so they are not needed anymore.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: Remove qemu_register_pc_machine() function
Eduardo Habkost [Fri, 15 May 2015 17:18:57 +0000 (14:18 -0300)]
pc: Remove qemu_register_pc_machine() function

The helper is not needed anymore, as the PC machine classes are
registered using QOM directly.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: Don't use QEMUMachine anymore
Eduardo Habkost [Fri, 15 May 2015 17:18:56 +0000 (14:18 -0300)]
pc: Don't use QEMUMachine anymore

Now that we have a DEFINE_PC_MACHINE helper macro that just requires an
initialization function, it is trivial to convert them to register a QOM
machine class directly, instead of using QEMUMachine.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: Move compat_props setting inside *_machine_options() functions
Eduardo Habkost [Fri, 15 May 2015 17:18:55 +0000 (14:18 -0300)]
pc: Move compat_props setting inside *_machine_options() functions

This will simplify the DEFINE_PC_MACHINE macro, and will help us to
implement reuse of PC_COMPAT_* macros through class_init function reuse,
in the future.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: Convert *_MACHINE_OPTIONS macros into functions
Eduardo Habkost [Fri, 15 May 2015 17:18:54 +0000 (14:18 -0300)]
pc: Convert *_MACHINE_OPTIONS macros into functions

By now the new functions will get QEMUMachine as argument, but they will
be later converted to initialize a MachineClass struct directly.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: Define machines using a DEFINE_PC_MACHINE macro
Eduardo Habkost [Fri, 15 May 2015 17:18:53 +0000 (14:18 -0300)]
pc: Define machines using a DEFINE_PC_MACHINE macro

This will automatically generate the existing QEMUMachine structs based
on the *_MACHINE_OPTIONS macros, and automatically add registration code
for them.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: Define MACHINE_OPTIONS macros consistently for all machines
Eduardo Habkost [Fri, 15 May 2015 17:18:52 +0000 (14:18 -0300)]
pc: Define MACHINE_OPTIONS macros consistently for all machines

Define a MACHINE_OPTIONS macro for each PC machine, and move every field
inside the QEMUMachine structs to the macros, except for name, init, and
compat_props.

This also ensures that all MACHINE_OPTIONS inherit the fields from the
next version, so their definitions carry only the changes that exist
between one version and the next one.

Comments about specific cases:

pc-*-2.1:

  Existing PC_*_2_1_MACHINE_OPTIONS macros were defined as:
      PC_*_MACHINE_OPTIONS,
      .default_machine_opts = "firmware=bios-256k.bin"

  PC_*_2_2_MACHINE_OPTIONS is:
      PC_*_2_3_MACHINE_OPTIONS
  which is expanded to:
      PC_*_MACHINE_OPTIONS,
      .default_machine_opts = "firmware=bios-256k.bin",
      .default_display = "std"

  The only difference between 2_1 and 2_2 is .default_display, that's why
  we didn't reuse PC_*_2_2_MACHINE_OPTIONS. The good news is that having
  multiple initializers for a field is allowed by C99, and the last
  initializer overrides the previous ones.

  So we can reuse the 2_2 macro in 2_1 and define PC_*_2_1_MACHINE_OPTIONS
  as:
      PC_*_2_2_MACHINE_OPTIONS,
      .default_display = NULL

pc-*-1.7:

  PC_*_1_7_MACHINE_OPTIONS was defined as:
      PC_*_MACHINE_OPTIONS

  PC_*_2_0_MACHINE_OPTIONS is defined as:
      PC_*_2_1_MACHINE_OPTIONS
  which is expanded to:
      PC_*_2_2_MACHINE_OPTIONS,
      .default_display = NULL
  which is expanded to:
      PC_*_2_3_MACHINE_OPTIONS,
      .default_display = NULL
  which is expanded to:
      PC_*_MACHINE_OPTIONS,
      .default_machine_opts = "firmware=bios-256k.bin",
      .default_display = "std",
      .default_display = NULL  /* overrides the previous line */

  So, the only difference between PC_*_1_7_MACHINE_OPTIONS and
  PC_*_2_0_MACHINE_OPTIONS is .default_machine_opts (as .default_display
  is not explicitly set by PC_*_MACHINE_OPTIONS so it is NULL).

  So we can keep the macro reuse pattern and define
  PC_*_2_0_MACHINE_OPTIONS as:
      PC_*_2_0_MACHINE_OPTIONS,
      .default_machine_opts = NULL

pc-*-2.4 (alias and is_default fields):

  Set alias and is_default fields inside the 2.4 MACHINE_OPTIONS macro,
  and clear it in the 2.3 macro (that reuses the 2.4 macro).

hw_machine:

  As all the machines older than v1.0 set hw_version explicitly, we can
  safely move the field to the MACHINE_OPTIONS macros without affecting
  the other versions that reuse them.

init function:

  Some machines had the init function set inside the MACHINE_OPTIONS
  macro. Move it to the QEMUMachine declaration, to keep it consistent
  with the other machines.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopiix: Define PC_COMPAT_0_10
Eduardo Habkost [Thu, 14 May 2015 18:53:10 +0000 (15:53 -0300)]
piix: Define PC_COMPAT_0_10

Move compat_props from pc-0.10 to the macro, to make it consistent with
the other machines.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopiix: Move pc-0.1[23] rombar compat props to PC_COMPAT_0_13
Eduardo Habkost [Thu, 14 May 2015 18:53:09 +0000 (15:53 -0300)]
piix: Move pc-0.1[23] rombar compat props to PC_COMPAT_0_13

The VGA and vmware-svga rombar compat properties were added by commit
281a26b15b4adcecb8604216738975abd754bea8, but only to pc-0.13 and
pc-0.12. This breaks the PC_COMPAT_* nesting pattern we currently
follow.

The new variables will now be inherited by pc-0.11 and older, but
pc-0.11 and pc-0.10 already have PCI.rombar=0 on compat_props, so they
shouldn't be affected at all.

Cc: Stefan Weil <sw@weilnetz.de>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopiix: Move pc-0.13 virtio-9p-pci compat to PC_COMPAT_0_13
Eduardo Habkost [Thu, 14 May 2015 18:53:08 +0000 (15:53 -0300)]
piix: Move pc-0.13 virtio-9p-pci compat to PC_COMPAT_0_13

The compat property was added by commit
9dbcca5aa13cb9ab40788ac4c56bc227d94ca920, and the pc-0.12 and older
machine-types were not changed because virtio-9p-pci was introduced on QEMU
0.13 (commit 9f10751365b26b13b8a9b67e0e90536ae3d282df). The only problem is
that this breaks the PC_COMPAT_* nesting pattern we currently use.

So, move the property to PC_COMPAT_0_13. This make pc-0.12 and older inherit
it, but that shouldn't be an issue as QEMU 0.12 didn't have virtio-9p-pci.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopiix: Move pc-0.11 drive version compat props to PC_COMPAT_0_11
Eduardo Habkost [Thu, 14 May 2015 18:53:07 +0000 (15:53 -0300)]
piix: Move pc-0.11 drive version compat props to PC_COMPAT_0_11

The current code setting ide-drive.ver and scsi-disk.ver on pc-0.11
breaks the PC_COMPAT_* nesting pattern we currently use.

As those variables are overwritten in pc-0.10 too, they can be inherited
by pc-0.10 with no side-effects at all.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopiix: Move pc-0.14 qxl compat properties to PC_COMPAT_0_14
Eduardo Habkost [Thu, 14 May 2015 18:53:06 +0000 (15:53 -0300)]
piix: Move pc-0.14 qxl compat properties to PC_COMPAT_0_14

Those properties were introduced by commit
3827cdb1c3aa17a792d1658161195b9d7173c26b. They were not duplicated into
pc-0.13 and older because 0.14 was the first QEMU version supporting
qxl. The only problem is that this breaks the PC_COMPAT_* nesting
pattern we currently use.

So, move the properties to PC_COMPAT_0_14. This makes pc-0.13 and older
inherit them, but that shouldn't be an issue as QEMU 0.13 didn't support
qxl.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agospapr: define SPAPR_COMPAT_2_3
Eduardo Habkost [Thu, 14 May 2015 18:53:05 +0000 (15:53 -0300)]
spapr: define SPAPR_COMPAT_2_3

Don't add the pseries-2.3 machine yet, but define the corresponding
SPAPR_COMPAT macro to make sure both pseries-2.2 and pseries-2.1 will
inherit HW_COMPAT_2_3.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agospapr: Use HW_COMPAT_* inside SPAPR_COMPAT_* macros
Eduardo Habkost [Thu, 14 May 2015 18:53:04 +0000 (15:53 -0300)]
spapr: Use HW_COMPAT_* inside SPAPR_COMPAT_* macros

SPAPR_COMPAT_2_1 will need to include both HW_COMPAT_2_2 and
HW_COMPAT_2_1, so include HW_COMPAT_2_1 inside SPAPR_COMPAT_2_1 and
HW_COMPAT_2_2 inside SPAPR_COMPAT_2_2.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: Define PC_COMPAT_2_[123] macros
Eduardo Habkost [Thu, 14 May 2015 18:53:03 +0000 (15:53 -0300)]
pc: Define PC_COMPAT_2_[123] macros

Once we start adding compat code for pc-2.3, the usage of HW_COMPAT_2_1
in pc-*-2.2 won't be enough, as it also has to include PC_COMPAT_2_3
inside it. To ensure that, define PC_COMPAT_2_3, PC_COMPAT_2_2, and
PC_COMPAT_2_1 macros.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agohw: Define empty HW_COMPAT_2_[23] macros
Eduardo Habkost [Thu, 14 May 2015 18:53:02 +0000 (15:53 -0300)]
hw: Define empty HW_COMPAT_2_[23] macros

Now we can make everything consistent and define the macros even if they
are still empty.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agospapr: Move commas inside SPAPR_COMPAT_* macros
Eduardo Habkost [Thu, 14 May 2015 18:53:01 +0000 (15:53 -0300)]
spapr: Move commas inside SPAPR_COMPAT_* macros

Changing the convention to include commas inside the macros will allow
macros containing empty lists to be defined and used without compilation
errors.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agopc: Move commas inside PC_COMPAT_* macros
Eduardo Habkost [Thu, 14 May 2015 18:53:00 +0000 (15:53 -0300)]
pc: Move commas inside PC_COMPAT_* macros

Changing the convention to include commas inside the macros will allow
macros containing empty lists to be defined and used without compilation
errors.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>