Skip to content

Commit 5ee9aeb

Browse files
committed
Merge branch 'master' into deploy
2 parents 9c775c5 + f67b730 commit 5ee9aeb

File tree

156 files changed

+1958
-773
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+1958
-773
lines changed

README.md

+69
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,72 @@ $ make rebuild-image@ppc64le@ubuntu
149149

150150
Note that the build mounts the source tree read-only, so nothing it does can
151151
affect your source tree.
152+
153+
Bisecting the kernel vs a selftest
154+
----------------------------------
155+
156+
Build the selftests using a version of the test that's known good. Usually
157+
there's no reason to rebuild the tests on every kernel revision.
158+
159+
These examples are run from the kernel directory, not the ci-scripts directory.
160+
It can be done either way, but it's more natural to run from the kernel
161+
directory when bisectting the kernel. This assumes Linux is in `~/linux` and
162+
these scripts are in `~/ci-scripts`, adapt as appropriate.
163+
164+
```
165+
$ cd ~/linux
166+
```
167+
168+
```
169+
$ make SRC=$PWD -C ~/ci-scripts/build QUIET=1 JFACTOR=$(nproc) ppctests@ppc64le@[email protected] INSTALL=1
170+
```
171+
172+
:rotating_light: Using an old Ubuntu image uses an older libc, which is more
173+
likely to be present on the guest root filesystem. Another option is to build
174+
the selftests statically.
175+
176+
Tar up the selftests into the current directory, the qemu scripts will detect them:
177+
178+
```
179+
$ tar -czf selftests.tar.gz -C $HOME/ci-scripts/build/output/selftests_powerpc@ppc64le@[email protected]/ install
180+
```
181+
182+
```
183+
$ ~/ci-scripts/scripts/boot/qemu-pseries+kvm --callback "run_selftests(powerpc/mm:wild_bctr)"
184+
...
185+
INFO: Running 'qemu-system-ppc64 -nographic -vga none -M pseries -smp 8 -m 4G -accel kvm ...
186+
...
187+
/ # INFO: Running individual selftests powerpc/mm:wild_bctr
188+
/var/tmp/selftests/run_kselftest.sh -t powerpc/mm:wild_bctr
189+
[ 2.783761][ T201] kselftest: Running tests in powerpc
190+
TAP version 13
191+
1..1
192+
# timeout set to 300
193+
# selftests: powerpc/mm: wild_bctr
194+
# test: wild_bctr
195+
# tags: git_version:v6.8-rc6-2555-gfe559db
196+
# Everything is OK in here.
197+
...
198+
# success: wild_bctr
199+
ok 1 selftests: powerpc/mm: wild_bctr
200+
/ # poweroff
201+
/ # Stopping network: [ 3.104385][ T274] ip (274) used greatest stack depth: 10912 bytes left
202+
OK
203+
Saving random seed: OK
204+
Stopping klogd: OK
205+
Stopping syslogd: OK
206+
umount: devtmpfs busy - remounted read-only
207+
umount: can't unmount /: Invalid argument
208+
The system is going down NOW!
209+
Sent SIGTERM to all processes
210+
Sent SIGKILL to all processes
211+
Requesting system poweroff
212+
[ 5.152672][ T293] reboot: Power down
213+
INFO: Test completed OK
214+
```
215+
216+
More than one selftest can be run by passing multiple arguments to
217+
`run_selftests` or by passing multiple `--callback` options.
218+
219+
From there the bisection can either be run by hand, or fully automated by
220+
creating a script to build the kernel and run the qemu test.

build/allcross/Dockerfile

+2-6
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ RUN apt-get -q -y update && \
3838
libc-dev \
3939
libelf-dev \
4040
libfuse-dev \
41-
liblz4-tool \
41+
lz4 \
4242
libssl-dev \
4343
lzop \
4444
make \
@@ -52,11 +52,7 @@ RUN apt-get -q -y update && \
5252
xz-utils && \
5353
rm -rf /var/lib/apt/lists/* /tmp/packages.sh /var/cache/* /var/log/dpkg.log
5454

55-
ARG uid
56-
ARG gid
57-
58-
RUN groupadd --gid $gid linuxppc
59-
RUN useradd --uid $uid --gid $gid linuxppc
55+
RUN useradd linuxppc
6056
USER linuxppc
6157

6258
COPY scripts/container-build.sh /bin/container-build.sh

build/docs/Dockerfile

+1-5
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ RUN apt-get -q -y update && \
2929
&& \
3030
rm -rf /var/lib/apt/lists/* /var/cache/* /var/log/dpkg.log
3131

32-
ARG uid
33-
ARG gid
34-
35-
RUN groupadd --gid $gid linuxppc
36-
RUN useradd --uid $uid --gid $gid linuxppc
32+
RUN useradd linuxppc
3733
USER linuxppc
3834

3935
COPY scripts/container-build.sh /bin/container-build.sh

build/fedora/Dockerfile

+1-5
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,7 @@ RUN dnf -y install --setopt=install_weak_deps=False \
4141
COPY fedora/make-links.sh /tmp/make-links.sh
4242
RUN /tmp/make-links.sh ${compiler_version} && rm /tmp/make-links.sh
4343

44-
ARG uid
45-
ARG gid
46-
47-
RUN groupadd --gid $gid linuxppc
48-
RUN useradd --uid $uid --gid $gid linuxppc
44+
RUN useradd linuxppc
4945
USER linuxppc
5046

5147
COPY scripts/container-build.sh /bin/container-build.sh

build/korg/Dockerfile

+1-6
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,7 @@ RUN curl -sSL $base_url/$tar_file > $tar_file && \
5151
COPY korg/make-links.sh /tmp/make-links.sh
5252
RUN /tmp/make-links.sh ${compiler_version} && rm /tmp/make-links.sh
5353

54-
ARG uid
55-
ARG gid
56-
57-
RUN userdel -r ubuntu || true
58-
RUN groupadd --gid $gid linuxppc
59-
RUN useradd --uid $uid --gid $gid linuxppc
54+
RUN useradd linuxppc
6055
USER linuxppc
6156

6257
COPY scripts/container-build.sh /bin/container-build.sh

build/scripts/container-build.sh

+1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ if [[ "$1" == "kernel" ]]; then
124124
rc=$?
125125
if [[ $rc -eq 0 ]]; then
126126
tar -cjf /output/modules.tar.bz2 -C $mod_path lib
127+
tar -czf /output/modules.tar.gz -C $mod_path lib
127128
fi
128129
else
129130
echo "## Modules not configured"

build/scripts/image.sh

-10
Original file line numberDiff line numberDiff line change
@@ -117,23 +117,13 @@ if [[ -n "$https_proxy" ]]; then
117117
cmd+="--build-arg https_proxy=$https_proxy "
118118
fi
119119

120-
if [[ -z "$UID" ]]; then
121-
UID=$(id -u)
122-
fi
123-
124-
if [[ -z "$GID" ]]; then
125-
GID=$(id -g)
126-
fi
127-
128120
if [[ "$distro" == "korg" ]]; then
129121
cmd+="--build-arg compiler_version=$version "
130122
arch=$(uname -m)
131123
cmd+="--build-arg base_url=https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/${arch}/${version}/ "
132124
cmd+="--build-arg tar_file=${arch}-gcc-${version}-nolibc-powerpc64-linux.tar.xz "
133125
fi
134126

135-
cmd+="--build-arg uid=$UID "
136-
cmd+="--build-arg gid=$GID "
137127
cmd+="--build-arg from=$from "
138128
cmd+="--build-arg apt_mirror=$APT_MIRROR "
139129
cmd+="-t $image ."

build/scripts/prune.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ case "$task" in
2727
mkdir -p "artifacts"
2828
for path in .config vmlinux System.map arch/powerpc/boot/zImage include/config/kernel.release \
2929
arch/powerpc/kernel/asm-offsets.s arch/powerpc/boot/uImage modules.tar.bz2 \
30-
sparse.log log.txt
30+
modules.tar.gz sparse.log log.txt
3131
do
3232
if [[ -e "$path" ]]; then
3333
mv "$path" artifacts/

build/ubuntu/Dockerfile

+3-7
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ ARG apt_mirror
88
ENV apt_mirror=${apt_mirror}
99
RUN [ -n "$apt_mirror" ] && sed -i -e "s|ports.ubuntu.com|$apt_mirror|" /etc/apt/sources.list || true
1010

11-
# Deal with Ubuntu 21.10 repos moving to old-releases (ppc64le only)
12-
RUN if echo "$from" | grep -q ".*ubuntu:21.10"; then sed -i -e "s|ports.ubuntu.com/ubuntu-ports|old-releases.ubuntu.com/ubuntu|" /etc/apt/sources.list; fi
11+
# Deal with Ubuntu 21/22.10 repos moving to old-releases (ppc64le only)
12+
RUN if echo "$from" | grep -q ".*ubuntu:2[12]\.10"; then sed -i -e "s|ports.ubuntu.com/ubuntu-ports|old-releases.ubuntu.com/ubuntu|" /etc/apt/sources.list; fi
1313

1414
RUN apt-get -q -y update && \
1515
DEBIAN_FRONTEND=noninteractive \
@@ -52,11 +52,7 @@ RUN apt-get -q -y update && \
5252
COPY ubuntu/make-links.sh /tmp/make-links.sh
5353
RUN /tmp/make-links.sh ${compiler_version} && rm /tmp/make-links.sh
5454

55-
ARG uid
56-
ARG gid
57-
58-
RUN groupadd --gid $gid linuxppc
59-
RUN useradd --uid $uid --gid $gid linuxppc
55+
RUN useradd linuxppc
6056
USER linuxppc
6157

6258
COPY scripts/container-build.sh /bin/container-build.sh

build/ubuntu/packages.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ if [[ "$machine" == "ppc64le" ]]; then
2020
PACKAGES+=" libhugetlbfs-dev"
2121
PACKAGES+=" libmnl-dev"
2222
PACKAGES+=" libmount-dev"
23-
PACKAGES+=" liburing-dev"
23+
if [[ "$major" -gt 20 ]]; then
24+
PACKAGES+=" liburing-dev"
25+
fi
2426

2527
# For the x86_64 container
2628
if [[ "$major" -ge 21 ]]; then

etc/configs.py

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Shared config fragments etc.
2+
3+
guest_configs = [
4+
'arch/powerpc/configs/guest.config',
5+
'netconsole-n',
6+
'ibmveth', # For PowerVM LPARs
7+
'kuap',
8+
'criu', # For seccomp tests
9+
'user-ns', # For seccomp tests
10+
'lkdtm', # Because it's useful
11+
'ptdump', # Because it's useful
12+
'strict-rwx', # Get some test coverage
13+
'kfence',
14+
'srr-debug',
15+
'irq-soft-mask-debug',
16+
'printk-index',
17+
'debug-atomic-sleep',
18+
'secure-boot',
19+
'debug-vm',
20+
'btrfs-y', # Needed for F39
21+
'vfat-y', # Needed for F39
22+
'zram', # Needed for F39
23+
]
24+
25+
guest_configs_4k = guest_configs + ['4k-pages']
26+
guest_configs_maxsmp = guest_configs + ['nr-cpus-8192']
27+
28+
legacy_guest_configs = [
29+
'arch/powerpc/configs/guest.config',
30+
'netconsole-n',
31+
'ibmveth', # For PowerVM LPARs
32+
'ibmehea', # Needed for Power7
33+
'strict-rwx-off', # Bloats image too much for netboot to work w/128MB RMA
34+
'nr-cpus-64', # Shrink kernel size
35+
'ftrace-n', # Shrink kernel size
36+
]
37+
38+
pmac32_configs = [
39+
'pmaczilog',
40+
'devtmpfs',
41+
'debugfs',
42+
'ptdump',
43+
'debug-atomic-sleep',
44+
'cgroups-y',
45+
'arch/powerpc/configs/guest.config',
46+
]
47+
48+
g5_configs = [
49+
'pmaczilog',
50+
'debugfs',
51+
'ptdump',
52+
'pstore',
53+
'kvm-pr-y',
54+
'agp-uninorth-y',
55+
]
56+
57+
cell_configs = [
58+
'cell',
59+
'lockdep-y',
60+
'debug-atomic-sleep',
61+
'xmon-non-default',
62+
]
63+
64+
powernv_configs = [
65+
'tools/testing/selftests/ftrace/config',
66+
'tools/testing/selftests/bpf/config',
67+
'criu', # needed for selftests-seccomp
68+
'igb', # Needed on some machines
69+
'xfs-y', # Needed on some machines
70+
'bridge-y', # Needed on some machines
71+
'ahci-y', # Needed on some machines
72+
'i40e-y', # Needed on some machines
73+
'kvm-pr-m',
74+
'strict-rwx',
75+
'debug-atomic-sleep',
76+
'selftests',
77+
'pci-iov',
78+
'page-poisoning-y',
79+
'srr-debug', # Get some test coverage
80+
'livepatch',
81+
'secure-boot',
82+
'zram',
83+
'ptdump',
84+
'amdgpu-y',
85+
'drm-aspeed-y', # Aspeed DRM driver for /dev/fb0 on powernv machines
86+
'fb-y', # Enable frame buffer for /dev/fb0 & alignment test
87+
'xmon-non-default', # Better oopses in logs
88+
'xmon-rw',
89+
'selinux', # Avoid selinux relabeling on Fedora machines
90+
'vfio-y', # Test coverage of VFIO
91+
'cgroups-y', # So podman can run
92+
'gup-test-y', # Enable selftest
93+
]
94+
95+
powernv_lockdep_configs = powernv_configs + ['lockdep-y']
96+
97+
corenet64_configs = [
98+
'debug-info-n',
99+
'ppc64e-qemu',
100+
'arch/powerpc/configs/guest.config',
101+
]

etc/configs/64k-pages.config

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CONFIG_PPC_4K_PAGES=n
2+
CONFIG_PPC_64K_PAGES=y

etc/configs/agp-uninorth-y.config

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CONFIG_AGP_UNINORTH=y
2+
CONFIG_AGP=y

etc/configs/btf-n.config

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_DEBUG_INFO_BTF=n

etc/configs/btrfs-y.config

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_BTRFS_FS=y

etc/configs/cgroups-y.config

+9
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
11
CONFIG_CGROUPS=y
2+
CONFIG_BLK_CGROUP=y
3+
CONFIG_CGROUP_PIDS=y
4+
CONFIG_CGROUP_RDMA=y
5+
CONFIG_CGROUP_HUGETLB=y
6+
CONFIG_CGROUP_MISC=y
7+
CONFIG_CGROUP_DEBUG=y
8+
CONFIG_NET_CLS_CGROUP=y
9+
CONFIG_CGROUP_NET_PRIO=y
10+
CONFIG_CGROUP_NET_CLASSID=y

etc/configs/gcc-plugins-n.config

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_GCC_PLUGINS=n

etc/configs/gup-test-y.config

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_GUP_TEST=y

etc/configs/i40e-y.config

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_I40E=y

etc/configs/nr-cpus-8192.config

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_NR_CPUS=8192

etc/configs/strict-rwx.config

-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
CONFIG_CRASH_DUMP=n
2-
CONFIG_RELOCATABLE=n
31
CONFIG_STRICT_KERNEL_RWX=y
42
CONFIG_STRICT_MODULE_RWX=y

etc/configs/vfat-y.config

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_VFAT_FS=y

etc/configs/vfio-y.config

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CONFIG_VFIO=y
2+
CONFIG_VFIO_GROUP=y
3+
CONFIG_VFIO_CONTAINER=y
4+
CONFIG_VFIO_IOMMU_SPAPR_TCE=y
5+
CONFIG_VFIO_PCI_CORE=y
6+
CONFIG_VFIO_PCI_MMAP=y
7+
CONFIG_VFIO_PCI_INTX=y
8+
CONFIG_VFIO_PCI=y

etc/configs/zram.config

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
CONFIG_ZRAM=y
22
CONFIG_ZSMALLOC=y
3+
CONFIG_CRYPTO_LZO=y

etc/defaults.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
QEMU_VERSION = '9.0.2'
2+
3+
DEFAULT_OLD_IMAGE = '[email protected]'
4+
DEFAULT_NEW_IMAGE = 'fedora'
5+
DEFAULT_IMAGES = [DEFAULT_OLD_IMAGE, DEFAULT_NEW_IMAGE]
6+
7+
CLANG_IMAGES = ['fedora', 'ubuntu']
8+
SPARSE_IMAGES = ['fedora', 'ubuntu']

0 commit comments

Comments
 (0)