[Skiboot] [PATCH] cpufeatures: Add tm-suspend-hypervisor-assist and tm-suspend-xer-so-bug node

Stewart Smith stewart at linux.ibm.com
Mon Apr 8 14:16:54 AEST 2019


Stewart Smith <stewart at linux.ibm.com> writes:

> tm-suspend-hypervisor-assist for P9 >=DD2.2
> And a tm-suspend-xer-so-bug node for P9 DD2.2 only.
>
> I also treat P9P as P9 DD2.3 and add a unit test for the cpufeatures
> infrastructure.
>
> Fixes: https://github.com/open-power/skiboot/issues/233
> Suggested-by: Paul Mackerras <paulus at ozlabs.org>
> Signed-off-by: Stewart Smith <stewart at linux.ibm.com>
> ---
>  core/cpufeatures.c          |  56 ++++++++++++-
>  core/test/Makefile.check    |   1 +
>  core/test/run-cpufeatures.c | 155 ++++++++++++++++++++++++++++++++++++
>  3 files changed, 209 insertions(+), 3 deletions(-)
>  create mode 100644 core/test/run-cpufeatures.c
>
> diff --git a/core/cpufeatures.c b/core/cpufeatures.c
> index 070419d9cfb7..530dc77f73c4 100644
> --- a/core/cpufeatures.c
> +++ b/core/cpufeatures.c
> @@ -1,4 +1,4 @@
> -/* Copyright 2017-2018 IBM Corp.
> +/* Copyright 2017-2019 IBM Corp.
>   *
>   * Licensed under the Apache License, Version 2.0 (the "License");
>   * you may not use this file except in compliance with the License.
> @@ -56,8 +56,12 @@
>  #define CPU_P8_DD1	(1U << 0)
>  #define CPU_P8_DD2	(1U << 1)
>  #define CPU_P9_DD1	(1U << 2)
> -#define CPU_P9_DD2	(1U << 3)
> +#define CPU_P9_DD2_0_1	(1U << 3) // 2.01 or 2.1
>  #define CPU_P9P		(1U << 4)
> +#define CPU_P9_DD2_2    (1U << 5)
> +#define CPU_P9_DD2_3    (1U << 6)
> +
> +#define CPU_P9_DD2      (CPU_P9_DD2_0_1|CPU_P9_DD2_2|CPU_P9_DD2_3|CPU_P9P)
>  
>  #define CPU_P8		(CPU_P8_DD1|CPU_P8_DD2)
>  #define CPU_P9		(CPU_P9_DD1|CPU_P9_DD2|CPU_P9P)
> @@ -721,6 +725,39 @@ static const struct cpu_feature cpu_features_table[] = {
>  	HV_NONE, OS_NONE,
>  	-1, -1, -1,
>  	NULL, },
> +
> +	/*
> +	 * Due to hardware bugs in POWER9, the hypervisor needs to assist
> +	 * guests.
> +	 *
> +	 * Presence of this feature indicates presence of the bug.
> +	 *
> +	 * See linux kernel commit 4bb3c7a0208f
> +	 * and linux Documentation/powerpc/transactional_memory.txt
> +	 */
> +	{ "tm-suspend-hypervisor-assist",
> +	CPU_P9_DD2_2|CPU_P9_DD2_3|CPU_P9P,
> +	ISA_V3_0B, USABLE_HV|USABLE_OS,

After chatting with Nick quickly on Slack, he suggests dropping the
USABLE_OS.

Another option raised was to also use `errata-` as a prefix for
these. Thoughts from the gallery?

-- 
Stewart Smith
OPAL Architect, IBM.



More information about the Skiboot mailing list