[SRU B][PATCH] UBUNTU: SAUCE: Move SSBS snippet from arm64_elf_hwcaps to arm64_features

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[SRU B][PATCH] UBUNTU: SAUCE: Move SSBS snippet from arm64_elf_hwcaps to arm64_features

Ike Panhc
BugLink: https://launchpad.net/bugs/1911376

The SSBS snippet in arch/arm64/kernel/cpufeature.c shall be in
arm64_features not in arm64_elf_hwcaps. It seems when we backport
patch d71be2b6c0e1 ("arm64: cpufeature: Detect SSBS and advertise
to userspace") and put it in wrong place.

This problem does not affect ubuntu-focal kernel.

Signed-off-by: Ike Panhc <[hidden email]>
---
 arch/arm64/kernel/cpufeature.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index 63d44403d781..cbc61d9240a9 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -1194,6 +1194,19 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
  .cpu_enable = cpu_clear_disr,
  },
 #endif /* CONFIG_ARM64_RAS_EXTN */
+#ifdef CONFIG_ARM64_SSBD
+ {
+ .desc = "Speculative Store Bypassing Safe (SSBS)",
+ .capability = ARM64_SSBS,
+ .type = ARM64_CPUCAP_WEAK_LOCAL_CPU_FEATURE,
+ .matches = has_cpuid_feature,
+ .sys_reg = SYS_ID_AA64PFR1_EL1,
+ .field_pos = ID_AA64PFR1_SSBS_SHIFT,
+ .sign = FTR_UNSIGNED,
+ .min_field_value = ID_AA64PFR1_SSBS_PSTATE_ONLY,
+ .cpu_enable = cpu_enable_ssbs,
+ },
+#endif
  {},
 };
 
@@ -1252,19 +1265,6 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = {
  HWCAP_CAP(SYS_ID_AA64PFR1_EL1, ID_AA64PFR1_SSBS_SHIFT, FTR_UNSIGNED, ID_AA64PFR1_SSBS_PSTATE_INSNS, CAP_HWCAP, HWCAP_SSBS),
 #ifdef CONFIG_ARM64_SVE
  HWCAP_CAP(SYS_ID_AA64PFR0_EL1, ID_AA64PFR0_SVE_SHIFT, FTR_UNSIGNED, ID_AA64PFR0_SVE, CAP_HWCAP, HWCAP_SVE),
-#endif
-#ifdef CONFIG_ARM64_SSBD
- {
- .desc = "Speculative Store Bypassing Safe (SSBS)",
- .capability = ARM64_SSBS,
- .type = ARM64_CPUCAP_WEAK_LOCAL_CPU_FEATURE,
- .matches = has_cpuid_feature,
- .sys_reg = SYS_ID_AA64PFR1_EL1,
- .field_pos = ID_AA64PFR1_SSBS_SHIFT,
- .sign = FTR_UNSIGNED,
- .min_field_value = ID_AA64PFR1_SSBS_PSTATE_ONLY,
- .cpu_enable = cpu_enable_ssbs,
- },
 #endif
  {},
 };
--
2.25.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [SRU B][PATCH] UBUNTU: SAUCE: Move SSBS snippet from arm64_elf_hwcaps to arm64_features

Thadeu Lima de Souza Cascardo-3
On Fri, Jan 22, 2021 at 01:29:25PM +0800, Ike Panhc wrote:

> BugLink: https://launchpad.net/bugs/1911376
>
> The SSBS snippet in arch/arm64/kernel/cpufeature.c shall be in
> arm64_features not in arm64_elf_hwcaps. It seems when we backport
> patch d71be2b6c0e1 ("arm64: cpufeature: Detect SSBS and advertise
> to userspace") and put it in wrong place.
>
> This problem does not affect ubuntu-focal kernel.
>
> Signed-off-by: Ike Panhc <[hidden email]>
> ---
>  arch/arm64/kernel/cpufeature.c | 26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
> index 63d44403d781..cbc61d9240a9 100644
> --- a/arch/arm64/kernel/cpufeature.c
> +++ b/arch/arm64/kernel/cpufeature.c
> @@ -1194,6 +1194,19 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
>   .cpu_enable = cpu_clear_disr,
>   },
>  #endif /* CONFIG_ARM64_RAS_EXTN */
> +#ifdef CONFIG_ARM64_SSBD
> + {
> + .desc = "Speculative Store Bypassing Safe (SSBS)",
> + .capability = ARM64_SSBS,
> + .type = ARM64_CPUCAP_WEAK_LOCAL_CPU_FEATURE,
> + .matches = has_cpuid_feature,
> + .sys_reg = SYS_ID_AA64PFR1_EL1,
> + .field_pos = ID_AA64PFR1_SSBS_SHIFT,
> + .sign = FTR_UNSIGNED,
> + .min_field_value = ID_AA64PFR1_SSBS_PSTATE_ONLY,
> + .cpu_enable = cpu_enable_ssbs,
> + },
> +#endif
>   {},
>  };
>  
> @@ -1252,19 +1265,6 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = {
>   HWCAP_CAP(SYS_ID_AA64PFR1_EL1, ID_AA64PFR1_SSBS_SHIFT, FTR_UNSIGNED, ID_AA64PFR1_SSBS_PSTATE_INSNS, CAP_HWCAP, HWCAP_SSBS),
>  #ifdef CONFIG_ARM64_SVE
>   HWCAP_CAP(SYS_ID_AA64PFR0_EL1, ID_AA64PFR0_SVE_SHIFT, FTR_UNSIGNED, ID_AA64PFR0_SVE, CAP_HWCAP, HWCAP_SVE),
> -#endif
> -#ifdef CONFIG_ARM64_SSBD
> - {
> - .desc = "Speculative Store Bypassing Safe (SSBS)",
> - .capability = ARM64_SSBS,
> - .type = ARM64_CPUCAP_WEAK_LOCAL_CPU_FEATURE,
> - .matches = has_cpuid_feature,
> - .sys_reg = SYS_ID_AA64PFR1_EL1,
> - .field_pos = ID_AA64PFR1_SSBS_SHIFT,
> - .sign = FTR_UNSIGNED,
> - .min_field_value = ID_AA64PFR1_SSBS_PSTATE_ONLY,
> - .cpu_enable = cpu_enable_ssbs,
> - },
>  #endif
>   {},
>  };
> --
> 2.25.1

Thanks for catching this. Indeed, our backport was wrong, and applying this fix
makes it closer to 4.14.217.

Acked-by: Thadeu Lima de Souza Cascardo <[hidden email]>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [SRU B][PATCH] UBUNTU: SAUCE: Move SSBS snippet from arm64_elf_hwcaps to arm64_features

Stefan Bader-2
In reply to this post by Ike Panhc
On 22.01.21 06:29, Ike Panhc wrote:

> BugLink: https://launchpad.net/bugs/1911376
>
> The SSBS snippet in arch/arm64/kernel/cpufeature.c shall be in
> arm64_features not in arm64_elf_hwcaps. It seems when we backport
> patch d71be2b6c0e1 ("arm64: cpufeature: Detect SSBS and advertise
> to userspace") and put it in wrong place.
>
> This problem does not affect ubuntu-focal kernel.
>
> Signed-off-by: Ike Panhc <[hidden email]>
Acked-by: Stefan Bader <[hidden email]>

> ---
>  arch/arm64/kernel/cpufeature.c | 26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
> index 63d44403d781..cbc61d9240a9 100644
> --- a/arch/arm64/kernel/cpufeature.c
> +++ b/arch/arm64/kernel/cpufeature.c
> @@ -1194,6 +1194,19 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
>   .cpu_enable = cpu_clear_disr,
>   },
>  #endif /* CONFIG_ARM64_RAS_EXTN */
> +#ifdef CONFIG_ARM64_SSBD
> + {
> + .desc = "Speculative Store Bypassing Safe (SSBS)",
> + .capability = ARM64_SSBS,
> + .type = ARM64_CPUCAP_WEAK_LOCAL_CPU_FEATURE,
> + .matches = has_cpuid_feature,
> + .sys_reg = SYS_ID_AA64PFR1_EL1,
> + .field_pos = ID_AA64PFR1_SSBS_SHIFT,
> + .sign = FTR_UNSIGNED,
> + .min_field_value = ID_AA64PFR1_SSBS_PSTATE_ONLY,
> + .cpu_enable = cpu_enable_ssbs,
> + },
> +#endif
>   {},
>  };
>  
> @@ -1252,19 +1265,6 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = {
>   HWCAP_CAP(SYS_ID_AA64PFR1_EL1, ID_AA64PFR1_SSBS_SHIFT, FTR_UNSIGNED, ID_AA64PFR1_SSBS_PSTATE_INSNS, CAP_HWCAP, HWCAP_SSBS),
>  #ifdef CONFIG_ARM64_SVE
>   HWCAP_CAP(SYS_ID_AA64PFR0_EL1, ID_AA64PFR0_SVE_SHIFT, FTR_UNSIGNED, ID_AA64PFR0_SVE, CAP_HWCAP, HWCAP_SVE),
> -#endif
> -#ifdef CONFIG_ARM64_SSBD
> - {
> - .desc = "Speculative Store Bypassing Safe (SSBS)",
> - .capability = ARM64_SSBS,
> - .type = ARM64_CPUCAP_WEAK_LOCAL_CPU_FEATURE,
> - .matches = has_cpuid_feature,
> - .sys_reg = SYS_ID_AA64PFR1_EL1,
> - .field_pos = ID_AA64PFR1_SSBS_SHIFT,
> - .sign = FTR_UNSIGNED,
> - .min_field_value = ID_AA64PFR1_SSBS_PSTATE_ONLY,
> - .cpu_enable = cpu_enable_ssbs,
> - },
>  #endif
>   {},
>  };
>


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

APPPLIED: [SRU B][PATCH] UBUNTU: SAUCE: Move SSBS snippet from arm64_elf_hwcaps to arm64_features

William Breathitt Gray
In reply to this post by Ike Panhc
On Fri, Jan 22, 2021 at 01:29:25PM +0800, Ike Panhc wrote:

> BugLink: https://launchpad.net/bugs/1911376
>
> The SSBS snippet in arch/arm64/kernel/cpufeature.c shall be in
> arm64_features not in arm64_elf_hwcaps. It seems when we backport
> patch d71be2b6c0e1 ("arm64: cpufeature: Detect SSBS and advertise
> to userspace") and put it in wrong place.
>
> This problem does not affect ubuntu-focal kernel.
>
> Signed-off-by: Ike Panhc <[hidden email]>
> ---
>  arch/arm64/kernel/cpufeature.c | 26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
> index 63d44403d781..cbc61d9240a9 100644
> --- a/arch/arm64/kernel/cpufeature.c
> +++ b/arch/arm64/kernel/cpufeature.c
> @@ -1194,6 +1194,19 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
>   .cpu_enable = cpu_clear_disr,
>   },
>  #endif /* CONFIG_ARM64_RAS_EXTN */
> +#ifdef CONFIG_ARM64_SSBD
> + {
> + .desc = "Speculative Store Bypassing Safe (SSBS)",
> + .capability = ARM64_SSBS,
> + .type = ARM64_CPUCAP_WEAK_LOCAL_CPU_FEATURE,
> + .matches = has_cpuid_feature,
> + .sys_reg = SYS_ID_AA64PFR1_EL1,
> + .field_pos = ID_AA64PFR1_SSBS_SHIFT,
> + .sign = FTR_UNSIGNED,
> + .min_field_value = ID_AA64PFR1_SSBS_PSTATE_ONLY,
> + .cpu_enable = cpu_enable_ssbs,
> + },
> +#endif
>   {},
>  };
>  
> @@ -1252,19 +1265,6 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = {
>   HWCAP_CAP(SYS_ID_AA64PFR1_EL1, ID_AA64PFR1_SSBS_SHIFT, FTR_UNSIGNED, ID_AA64PFR1_SSBS_PSTATE_INSNS, CAP_HWCAP, HWCAP_SSBS),
>  #ifdef CONFIG_ARM64_SVE
>   HWCAP_CAP(SYS_ID_AA64PFR0_EL1, ID_AA64PFR0_SVE_SHIFT, FTR_UNSIGNED, ID_AA64PFR0_SVE, CAP_HWCAP, HWCAP_SVE),
> -#endif
> -#ifdef CONFIG_ARM64_SSBD
> - {
> - .desc = "Speculative Store Bypassing Safe (SSBS)",
> - .capability = ARM64_SSBS,
> - .type = ARM64_CPUCAP_WEAK_LOCAL_CPU_FEATURE,
> - .matches = has_cpuid_feature,
> - .sys_reg = SYS_ID_AA64PFR1_EL1,
> - .field_pos = ID_AA64PFR1_SSBS_SHIFT,
> - .sign = FTR_UNSIGNED,
> - .min_field_value = ID_AA64PFR1_SSBS_PSTATE_ONLY,
> - .cpu_enable = cpu_enable_ssbs,
> - },
>  #endif
>   {},
>  };
> --
> 2.25.1
>
>
> --
> kernel-team mailing list
> [hidden email]
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Applied to bionic:linux/master-next.

William Breathitt Gray <[hidden email]>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (849 bytes) Download Attachment