[ACT][PATCH] UBUNTU: SAUCE: ubuntu_kernel_selftests: disable CPU hotplug on Azure
Krzysztof Kozlowski
krzysztof.kozlowski at canonical.com
Thu Jul 1 08:18:03 UTC 2021
Microsoft Hyper-V with Linux guests does not support CPU hotplug, even
if enabled in kernel configuration. Quoting Ubuntu bug report from
June 2018: "While Hyper-V may present all potential CPUs via ACPI MADT,
CPU add/remove is not supported.". [1]
Skip the CPU hotplug test on Azure instances because it fails on some of
configs, e.g. Bionic/azure:
pid 28041's current affinity mask: 3
pid 28041's new affinity mask: 1
CPU online/offline summary:
present_cpus = 0-1 present_max = 1
Cpus in online state: 0-1
Cpus in offline state: 0
Limited scope test: one hotplug cpu
(leaves cpu in the original state):
online to offline to online: cpu 1
not ok 1..1 selftests: cpu-on-off-test.sh [FAIL]
./cpu-on-off-test.sh: line 94: echo: write error: Device or resource busy
offline_cpu_expect_success 1: unexpected fail
[1] https://bugs.launchpad.net/ubuntu/+source/linux-azure/+bug/1776293
BugLink: https://bugs.launchpad.net/bugs/1923114
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski at canonical.com>
---
ubuntu_kernel_selftests/ubuntu_kernel_selftests.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/ubuntu_kernel_selftests/ubuntu_kernel_selftests.py b/ubuntu_kernel_selftests/ubuntu_kernel_selftests.py
index fac506f03f6b..af9a6211fc22 100644
--- a/ubuntu_kernel_selftests/ubuntu_kernel_selftests.py
+++ b/ubuntu_kernel_selftests/ubuntu_kernel_selftests.py
@@ -155,6 +155,18 @@ class ubuntu_kernel_selftests(test.test):
cmd = 'cp %s/cpu-on-off-test.sh %s' % (self.bindir, fn)
utils.system(cmd)
+ #
+ # cpu hotplug test might fail on Azure instances because Hyper-V
+ # does not allow it.
+ #
+ if self.flavour in ['azure', 'azure-fips']:
+ print("Disabling CPU hotplug test")
+ fn = 'linux/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh'
+ mk = 'linux/tools/testing/selftests/cpu-hotplug/Makefile'
+ if os.path.exists(fn):
+ cmd = 'sed -i "s/ cpu-on-off-test.sh//" ' + mk
+ utils.system(cmd)
+
#
# Disable new ftrace tests that don't work reliably across
# architectures because of various symbols being checked
--
2.27.0
More information about the kernel-team
mailing list