Comment 0 for bug 1911376

Revision history for this message
Fred Kimmy (kongzizaixian) wrote : [ssbs-0118] backport SSB bug (arm64: cpufeature: Detect SSBS and advertise to userspace)

[Bug Description]
ubuntu 18.04.1 fail to enable this SSBS function, this sys log will call trace as follow:

[ 0.662089] Call trace:
[ 0.662870] setup_elf_hwcaps+0xb8/0xd4
[ 0.664023] setup_cpu_features+0x60/0xf8
[ 0.665216] smp_cpus_done+0x34/0xa8
[ 0.666547] smp_init+0x120/0x138
[ 0.667555] kernel_init_freeable+0xf4/0x260
[ 0.668860] kernel_init+0x18/0x110
[ 0.670025] ret_from_fork+0x10/0x18

[Steps to Reproduce]
1) boot this system
2) uname -a
Ubuntu 4.15.0-99.100-generic 4.15.18

[Actual Results]
 boot error:
[ 0.662089] Call trace:
[ 0.662870] setup_elf_hwcaps+0xb8/0xd4
[ 0.664023] setup_cpu_features+0x60/0xf8
[ 0.665216] smp_cpus_done+0x34/0xa8
[ 0.666547] smp_init+0x120/0x138
[ 0.667555] kernel_init_freeable+0xf4/0x260
[ 0.668860] kernel_init+0x18/0x110
[ 0.670025] ret_from_fork+0x10/0x18

[Expected Results]
no error

[Reproducibility]
NA

[Additional information]
(Firmware version, kernel version, affected hardware, etc. if required):
arm64: cpufeature: Detect SSBS and advertise to userspace

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d71be2b6c0e19180b5f80a6d42039cc074a693a2

backport this following code into "static const struct arm64_cpu_capabilities arm64_elf_hwcaps[]" which will be error.

1274 #ifdef CONFIG_ARM64_SSBD
1275 {
1276 .desc = "Speculative Store Bypassing Safe (SSBS)",
1277 .capability = ARM64_SSBS,
1278 .type = ARM64_CPUCAP_WEAK_LOCAL_CPU_FEATURE,
1279 .matches = has_cpuid_feature,
1280 .sys_reg = SYS_ID_AA64PFR1_EL1,
1281 .field_pos = ID_AA64PFR1_SSBS_SHIFT,
1282 .sign = FTR_UNSIGNED,
1283 .min_field_value = ID_AA64PFR1_SSBS_PSTATE_ONLY,
1284 .cpu_enable = cpu_enable_ssbs,
1285 },

[Resolution]

Can you backport aboving code into "static const struct arm64_cpu_capabilities arm64_features[] = {"?