powerpc test in ubuntu_kernel_selftest failed on Cosmic P8/P9

Bug #1808318 reported by Po-Hsu Lin on 2018-12-13
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-kernel-tests
High
Po-Hsu Lin
linux (Ubuntu)
Undecided
Po-Hsu Lin
Cosmic
Undecided
Unassigned

Bug Description

== Justification ==
Commit b2d35fa5fc80 ("selftests: add headers_install to lib.mk")
introduced a requirement that Makefiles more than one level below the
selftests directory need to define top_srcdir, but it didn't update
any of the powerpc Makefiles.

This broke building all the powerpc selftests with eg:

  make[1]: Entering directory '/src/linux/tools/testing/selftests/powerpc'
  BUILD_TARGET=/src/linux/tools/testing/selftests/powerpc/alignment; mkdir -p $BUILD_TARGET; make OUTPUT=$BUILD_TARGET -k -C alignment all
  make[2]: Entering directory '/src/linux/tools/testing/selftests/powerpc/alignment'
  ../../lib.mk:20: ../../../../scripts/subarch.include: No such file or directory
  make[2]: *** No rule to make target '../../../../scripts/subarch.include'.
  make[2]: Failed to remake makefile '../../../../scripts/subarch.include'.
  Makefile:38: recipe for target 'alignment' failed

== Fix ==
7e0cf1c983b5 (selftests/powerpc: Fix Makefiles for headers_install change)
It can be cherry-picked for Cosmic. And it's already landed in Disco.

== Regression Potential ==
None, this just fixes the broken build issue for the test. Nothing else will be affected.

===
This test passed with 4.18.0-12 on the last cycle [1]
But failed with the proposed 4.18.0-13 this time.

Test failed to build because of a missing include file:
50. ../../lib.mk:20: ../../../../scripts/subarch.include: No such file or directory

Tried to reproduce this cycle with 4.18.0-12 first and this can be reproduced as well.

39. make: Entering directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/powerpc'
40. BUILD_TARGET=/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/powerpc/alignment; mkdir -p $BUILD_TARGET; make OUTPUT=$BUILD_TARGET -k -C alignment all
41. make[1]: Entering directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/powerpc/alignment'
42. gcc -std=gnu99 -O2 -Wall -Werror -DGIT_VERSION='"Ubuntu-4.18.0-12.13-0-g3d21f8e15-dirty"' -I/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/powerpc/include copy_unaligned.c ../harness.c ../utils.c copy_paste_unaligned_common.c -o /home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/powerpc/alignment/copy_unaligned
43. gcc -std=gnu99 -O2 -Wall -Werror -DGIT_VERSION='"Ubuntu-4.18.0-12.13-0-g3d21f8e15-dirty"' -I/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/powerpc/include copy_first_unaligned.c ../harness.c ../utils.c copy_paste_unaligned_common.c -o /home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/powerpc/alignment/copy_first_unaligned
44. gcc -std=gnu99 -O2 -Wall -Werror -DGIT_VERSION='"Ubuntu-4.18.0-12.13-0-g3d21f8e15-dirty"' -I/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/powerpc/include paste_unaligned.c ../harness.c ../utils.c copy_paste_unaligned_common.c -o /home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/powerpc/alignment/paste_unaligned
45. gcc -std=gnu99 -O2 -Wall -Werror -DGIT_VERSION='"Ubuntu-4.18.0-12.13-0-g3d21f8e15-dirty"' -I/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/powerpc/include paste_last_unaligned.c ../harness.c ../utils.c copy_paste_unaligned_common.c -o /home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/powerpc/alignment/paste_last_unaligned
46. gcc -std=gnu99 -O2 -Wall -Werror -DGIT_VERSION='"Ubuntu-4.18.0-12.13-0-g3d21f8e15-dirty"' -I/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/powerpc/include alignment_handler.c ../harness.c ../utils.c copy_paste_unaligned_common.c -o /home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/powerpc/alignment/alignment_handler
47. make[1]: Leaving directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/powerpc/alignment'
48. make: Leaving directory '/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/powerpc'
49. stderr:
50. ../../lib.mk:20: ../../../../scripts/subarch.include: No such file or directory
51. make[1]: *** No rule to make target '../../../../scripts/subarch.include'.
52. make[1]: Failed to remake makefile '../../../../scripts/subarch.include'.
53. make: *** [Makefile:38: alignment] Error 2

[1] http://10.246.72.4/test-results/4.18.0-12.13-generic/entei__4.18.0-12.13__2018-11-15_16-03-00/ubuntu_kernel_selftests/results/ubuntu_kernel_selftests.powerpc/debug/ubuntu_kernel_selftests.powerpc.DEBUG.html

ProblemType: Bug
DistroRelease: Ubuntu 18.10
Package: linux-image-4.18.0-12-generic 4.18.0-12.13
ProcVersionSignature: Ubuntu 4.18.0-12.13-generic 4.18.17
Uname: Linux 4.18.0-12-generic ppc64le
AlsaDevices:
 total 0
 crw-rw---- 1 root audio 116, 1 Dec 13 10:20 seq
 crw-rw---- 1 root audio 116, 33 Dec 13 10:20 timer
AplayDevices: Error: [Errno 2] No such file or directory: 'aplay': 'aplay'
ApportVersion: 2.20.10-0ubuntu13.1
Architecture: ppc64el
ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord': 'arecord'
AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1:
CurrentDmesg:
 [ 1446.852560] cfg80211: Loading compiled-in X.509 certificates for regulatory database
 [ 1446.855825] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
Date: Thu Dec 13 10:44:35 2018
IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig': 'iwconfig'
PciMultimedia:

ProcFB: 0 astdrmfb
ProcKernelCmdLine: root=UUID=6525e2fe-bc80-40f5-b02a-e96f41545ae3 ro console=hvc0
ProcLoadAvg: 0.48 0.57 0.47 1/1187 25045
ProcLocks:
 1: POSIX ADVISORY WRITE 1528 00:17:430 0 EOF
 2: FLOCK ADVISORY WRITE 3335 00:17:716 0 EOF
 3: POSIX ADVISORY WRITE 3336 00:17:695 0 EOF
ProcSwaps:
 Filename Type Size Used Priority
 /swap.img file 8388544 0 -2
ProcVersion: Linux version 4.18.0-12-generic (buildd@bos02-ppc64el-005) (gcc version 8.2.0 (Ubuntu 8.2.0-7ubuntu1)) #13-Ubuntu SMP Wed Nov 14 15:15:47 UTC 2018
RelatedPackageVersions:
 linux-restricted-modules-4.18.0-12-generic N/A
 linux-backports-modules-4.18.0-12-generic N/A
 linux-firmware 1.175.1
RfKill: Error: [Errno 2] No such file or directory: 'rfkill': 'rfkill'
SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
VarLogDump_list: total 0
cpu_cores: Number of cores present = 16
cpu_coreson: Number of cores online = 16
cpu_dscr: DSCR is 0
cpu_freq:
 min: 3.869 GHz (cpu 127)
 max: 3.869 GHz (cpu 1)
 avg: 3.869 GHz
cpu_runmode:
 Could not retrieve current diagnostics mode,
 No kernel interface to firmware
cpu_smt: SMT=8

Po-Hsu Lin (cypressyew) wrote :

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1808318

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Po-Hsu Lin (cypressyew) wrote :

This is from commit b2d35fa5fc80c27e
    +top_srcdir ?= ../../../..
    +include $(top_srcdir)/scripts/subarch.include

When trying to build this test, it will enter
/home/ubuntu/autotest/client/tmp/ubuntu_kernel_selftests/src/linux/tools/testing/selftests/powerpc/alignment

But the subarch.include is now 5 level up instead of 4, but just changing this is from "../../../.." to "../../../../.." is not enough, as it will try to build in the powerpc directory as well. The 5 level include will break it here.

Po-Hsu Lin (cypressyew) wrote :

Hmm, it looks like this patch landed in 4.18.0-12

I wonder why it's not failing in the previous cycle with 4.18.0-12

phlin@tangerine:~/ubuntu-cosmic/tools/testing/selftests$ git tag --contains aa435326c92082700fdb89e767b90b9735e78d94
Ubuntu-4.18.0-12.13
Ubuntu-4.18.0-13.14
Ubuntu-raspi2-4.18.0-1007.9
Ubuntu-raspi2-4.18.0-1008.10

Po-Hsu Lin (cypressyew) wrote :

The following patch can fix this build issue:

diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index 0a8e75886..afd384ed8 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -16,7 +16,7 @@ TEST_GEN_PROGS := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS))
 TEST_GEN_PROGS_EXTENDED := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS_EXTENDED))
 TEST_GEN_FILES := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_FILES))

-top_srcdir ?= ../../../..
+top_srcdir ?= $(abspath $(dir $(lastword $(MAKEFILE_LIST)))/../../..)
 include $(top_srcdir)/scripts/subarch.include
 ARCH ?= $(SUBARCH)

Po-Hsu Lin (cypressyew) wrote :

For comment #5,
I know why it's not failing in the previous cycle.

We clone the kernel source tree with master branch, not the master-next branch with -proposed kernel.

Therefore in 4.18.0-12, the branch we use for testing is 4.18.0-11, and it does not include this patch.

But now with 4.18.0-13, we're using 4.18.0-12 for the test, that's how it gets this confusing result.

Po-Hsu Lin (cypressyew) wrote :

After reading the kernel selftest document, I think this should be fixed from out tool

https://www.kernel.org/doc/html/v4.16/dev-tools/kselftest.html

We're running a subtest with:
   sudo make -C linux/tools/testing/selftests/$SUBTEST all run_tests

Base on the document, it should be:
   sudo make -C tools/testing/selftests TARGETS=$SUBTEST run_tests

Changed in ubuntu-kernel-tests:
status: New → In Progress
assignee: nobody → Po-Hsu Lin (cypressyew)
importance: Undecided → High
Changed in linux (Ubuntu):
status: Incomplete → Invalid
Po-Hsu Lin (cypressyew) wrote :

Tried the command:
    sudo make -C linux/tools/testing/selftests TARGETS=powerpc run_tests
With the upstream linux tree, it works.

But it's not working with the current Cosmic tree, re-open the linux task and starting the bisect process.

Changed in linux (Ubuntu):
status: Invalid → Confirmed
Po-Hsu Lin (cypressyew) wrote :

Fix found in the upstream tree: 7e0cf1c983b5b24426d130fd949a055d520acc9a

Changed in linux (Ubuntu):
assignee: nobody → Po-Hsu Lin (cypressyew)
status: Confirmed → In Progress
Po-Hsu Lin (cypressyew) on 2018-12-14
description: updated
Po-Hsu Lin (cypressyew) on 2018-12-14
description: updated
description: updated
Changed in linux (Ubuntu Cosmic):
status: New → In Progress
Changed in linux (Ubuntu):
status: In Progress → Invalid
Changed in linux (Ubuntu Cosmic):
status: In Progress → Fix Committed
Brad Figg (brad-figg) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-cosmic' to 'verification-done-cosmic'. If the problem still exists, change the tag 'verification-needed-cosmic' to 'verification-failed-cosmic'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-cosmic
Po-Hsu Lin (cypressyew) wrote :

This build issue has gone (but another issue occurred: Programs crashed during test execution) will file another bug.

tags: added: verification-done-cosmic
removed: verification-needed-cosmic
Changed in ubuntu-kernel-tests:
status: In Progress → Fix Released
Launchpad Janitor (janitor) wrote :
Download full text (56.3 KiB)

This bug was fixed in the package linux - 4.18.0-14.15

---------------
linux (4.18.0-14.15) cosmic; urgency=medium

  * linux: 4.18.0-14.15 -proposed tracker (LP: #1811406)

  * CPU hard lockup with rigorous writes to NVMe drive (LP: #1810998)
    - blk-wbt: Avoid lock contention and thundering herd issue in wbt_wait
    - blk-wbt: move disable check into get_limit()
    - blk-wbt: use wq_has_sleeper() for wq active check
    - blk-wbt: fix has-sleeper queueing check
    - blk-wbt: abstract out end IO completion handler
    - blk-wbt: improve waking of tasks

  * To reduce the Realtek USB cardreader power consumption (LP: #1811337)
    - mmc: core: Introduce MMC_CAP_SYNC_RUNTIME_PM
    - mmc: rtsx_usb_sdmmc: Don't runtime resume the device while changing led
    - mmc: rtsx_usb_sdmmc: Re-work runtime PM support
    - mmc: rtsx_usb_sdmmc: Re-work card detection/removal support
    - memstick: rtsx_usb_ms: Add missing pm_runtime_disable() in probe function
    - misc: rtsx_usb: Use USB remote wakeup signaling for card insertion detection
    - memstick: Prevent memstick host from getting runtime suspended during card
      detection
    - memstick: rtsx_usb_ms: Use ms_dev() helper
    - memstick: rtsx_usb_ms: Support runtime power management

  * Support non-strict iommu mode on arm64 (LP: #1806488)
    - iommu/io-pgtable-arm: Fix race handling in split_blk_unmap()
    - iommu/arm-smmu-v3: Implement flush_iotlb_all hook
    - iommu/dma: Add support for non-strict mode
    - iommu: Add "iommu.strict" command line option
    - iommu/io-pgtable-arm: Add support for non-strict mode
    - iommu/arm-smmu-v3: Add support for non-strict mode
    - iommu/io-pgtable-arm-v7s: Add support for non-strict mode
    - iommu/arm-smmu: Support non-strict mode

  * [Regression] crashkernel fails on HiSilicon D05 (LP: #1806766)
    - efi: honour memory reservations passed via a linux specific config table
    - efi/arm: libstub: add a root memreserve config table
    - efi: add API to reserve memory persistently across kexec reboot
    - irqchip/gic-v3-its: Change initialization ordering for LPIs
    - irqchip/gic-v3-its: Simplify LPI_PENDBASE_SZ usage
    - irqchip/gic-v3-its: Split property table clearing from allocation
    - irqchip/gic-v3-its: Move pending table allocation to init time
    - irqchip/gic-v3-its: Keep track of property table's PA and VA
    - irqchip/gic-v3-its: Allow use of pre-programmed LPI tables
    - irqchip/gic-v3-its: Use pre-programmed redistributor tables with kdump
      kernels
    - irqchip/gic-v3-its: Check that all RDs have the same property table
    - irqchip/gic-v3-its: Register LPI tables with EFI config table
    - irqchip/gic-v3-its: Allow use of LPI tables in reserved memory
    - arm64: memblock: don't permit memblock resizing until linear mapping is up
    - efi/arm: Defer persistent reservations until after paging_init()
    - efi: Permit calling efi_mem_reserve_persistent() from atomic context
    - efi: Prevent GICv3 WARN() by mapping the memreserve table before first use

  * ELAN900C:00 04F3:2844 touchscreen doesn't work (LP: #1811335)
    - pinctrl: cannonlake: Fix community ordering for H variant
    - pinctrl: c...

Changed in linux (Ubuntu Cosmic):
status: Fix Committed → Fix Released
Brad Figg (brad-figg) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-bionic' to 'verification-done-bionic'. If the problem still exists, change the tag 'verification-needed-bionic' to 'verification-failed-bionic'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-bionic
Andy Whitcroft (apw) wrote :

This bug was erroneously marked for verification in bionic; verification is not required and verification-needed-bionic is being removed.

tags: added: kernel-fixup-verification-needed-bionic verification-done-bionic
removed: verification-needed-bionic
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers