diff mbox series

[ACT] UBUNTU: SAUCE: ubuntu_kernel_selftests: disable CPU hotplug on Azure

Message ID 20210701081803.19655-1-krzysztof.kozlowski@canonical.com
State New
Headers show
Series [ACT] UBUNTU: SAUCE: ubuntu_kernel_selftests: disable CPU hotplug on Azure | expand

Commit Message

Krzysztof Kozlowski July 1, 2021, 8:18 a.m. UTC
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@canonical.com>
---
 ubuntu_kernel_selftests/ubuntu_kernel_selftests.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Po-Hsu Lin July 5, 2021, 7:25 a.m. UTC | #1
Acked-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Applied and pushed.

Thanks
Sam
diff mbox series

Patch

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