[Qemu-devel] [PATCH 0/6] spapr: Add optional capabilities

David Gibson posted 6 patches 7 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20171218092024.21645-1-david@gibson.dropbear.id.au
Test checkpatch passed
Test docker passed
Test ppc passed
Test s390x passed
hw/ppc/Makefile.objs   |   2 +-
hw/ppc/spapr.c         |  47 +++++--
hw/ppc/spapr_caps.c    | 342 +++++++++++++++++++++++++++++++++++++++++++++++++
include/hw/ppc/spapr.h |  46 +++++++
target/ppc/kvm.c       |  27 +---
target/ppc/kvm_ppc.h   |   2 -
6 files changed, 429 insertions(+), 37 deletions(-)
create mode 100644 hw/ppc/spapr_caps.c
[Qemu-devel] [PATCH 0/6] spapr: Add optional capabilities
Posted by David Gibson 7 years, 10 months ago
This series is a first draft to add the notion of optional
capabilities to the "pseries" machine type.  A default set of
capabilities is selected based on the machine type version and
selected cpu model, but this can be overridden with machine
parameters.

The purpose of this is to get rid of a number of places where we
implicitly decide what features to advertise to the guest based on
capabilities of the host.  This is bad, because it means it's
difficult to be certain if machines started at different ends of a
migration really match from the guest's point of view.

By giving the user explicit control of these optional features, then
validating that the chosen ones can be supplied on the host we make
behaviour more predictable.

The more specific motivation for this is that POWER9 has bugs in its
hardware transactional memory (HTM) implementation making it unsafe to
migrate POWER8 guests to POWER9 if they use HTM.

Changes since RFC:
 - Two preliminary patches not really related split off and already
   merged.
 - Assorted minor fixes based on review notes
 - Change defaults to disable HTM on pseries-2.12 machine type

David Gibson (6):
  spapr: Capabilities infrastructure
  spapr: Treat Hardware Transactional Memory (HTM) as an optional
    capability
  spapr: Validate capabilities on migration
  target/ppc: Clean up probing of VMX, VSX and DFP availability on KVM
  spapr: Handle VMX/VSX presence as an spapr capability flag
  spapr: Handle Decimal Floating Point (DFP) as an optional capability

 hw/ppc/Makefile.objs   |   2 +-
 hw/ppc/spapr.c         |  47 +++++--
 hw/ppc/spapr_caps.c    | 342 +++++++++++++++++++++++++++++++++++++++++++++++++
 include/hw/ppc/spapr.h |  46 +++++++
 target/ppc/kvm.c       |  27 +---
 target/ppc/kvm_ppc.h   |   2 -
 6 files changed, 429 insertions(+), 37 deletions(-)
 create mode 100644 hw/ppc/spapr_caps.c

-- 
2.14.3


Re: [Qemu-devel] [PATCH 0/6] spapr: Add optional capabilities
Posted by David Gibson 7 years, 10 months ago
On Mon, Dec 18, 2017 at 08:20:18PM +1100, David Gibson wrote:
> This series is a first draft to add the notion of optional
> capabilities to the "pseries" machine type.  A default set of
> capabilities is selected based on the machine type version and
> selected cpu model, but this can be overridden with machine
> parameters.
> 
> The purpose of this is to get rid of a number of places where we
> implicitly decide what features to advertise to the guest based on
> capabilities of the host.  This is bad, because it means it's
> difficult to be certain if machines started at different ends of a
> migration really match from the guest's point of view.
> 
> By giving the user explicit control of these optional features, then
> validating that the chosen ones can be supplied on the host we make
> behaviour more predictable.
> 
> The more specific motivation for this is that POWER9 has bugs in its
> hardware transactional memory (HTM) implementation making it unsafe to
> migrate POWER8 guests to POWER9 if they use HTM.

I've fixed the user-after-free bug Greg pointed out and merged this
into ppc-for-2.12.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
Re: [Qemu-devel] [PATCH 0/6] spapr: Add optional capabilities
Posted by Benjamin Herrenschmidt 7 years, 10 months ago
On Mon, 2017-12-18 at 20:20 +1100, David Gibson wrote:
> This series is a first draft to add the notion of optional
> capabilities to the "pseries" machine type.  A default set of
> capabilities is selected based on the machine type version and
> selected cpu model, but this can be overridden with machine
> parameters.
> 
> The purpose of this is to get rid of a number of places where we
> implicitly decide what features to advertise to the guest based on
> capabilities of the host.  This is bad, because it means it's
> difficult to be certain if machines started at different ends of a
> migration really match from the guest's point of view.
> 
> By giving the user explicit control of these optional features, then
> validating that the chosen ones can be supplied on the host we make
> behaviour more predictable.
> 
> The more specific motivation for this is that POWER9 has bugs in its
> hardware transactional memory (HTM) implementation making it unsafe to
> migrate POWER8 guests to POWER9 if they use HTM

It might be worthwhile mentioning that we do plan to support TM and
migration from P8 for KVM guests at some point. Working on it ... there
are some SW workarounds involved in KVM to make it possible.

> Changes since RFC:
>  - Two preliminary patches not really related split off and already
>    merged.
>  - Assorted minor fixes based on review notes
>  - Change defaults to disable HTM on pseries-2.12 machine type
> 
> David Gibson (6):
>   spapr: Capabilities infrastructure
>   spapr: Treat Hardware Transactional Memory (HTM) as an optional
>     capability
>   spapr: Validate capabilities on migration
>   target/ppc: Clean up probing of VMX, VSX and DFP availability on KVM
>   spapr: Handle VMX/VSX presence as an spapr capability flag
>   spapr: Handle Decimal Floating Point (DFP) as an optional capability
> 
>  hw/ppc/Makefile.objs   |   2 +-
>  hw/ppc/spapr.c         |  47 +++++--
>  hw/ppc/spapr_caps.c    | 342 +++++++++++++++++++++++++++++++++++++++++++++++++
>  include/hw/ppc/spapr.h |  46 +++++++
>  target/ppc/kvm.c       |  27 +---
>  target/ppc/kvm_ppc.h   |   2 -
>  6 files changed, 429 insertions(+), 37 deletions(-)
>  create mode 100644 hw/ppc/spapr_caps.c
>