This defconfig enables edk2 UEFI shell and grub2 riscv64-efi boot
of a Linux Kernel.
Signed-off-by: Julien Olivain <ju.o@free.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Since Qemu 6.0.0, a warning appear in the log if a short-form boolean
option is used. This was fixed by Romain for the main cmdline description
(see 04afe86cd7 ("board/qemu/arm-vexpress-tz: use enable=on")) but was
not updated in the alternate cmdlines for when using a dual console or
a GDB debug setup.
By the way, fix description mentioning qemu-system-arm command line option
-S that is an uppercase S, not a lower case s.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
When testing the virt machine with EDK2, the buildroot 6.1 kernel
will not boot as it has no base ACPI support. Whilst you can run
qemu with the -no-acpi option, it would help if basic ACPI support
was there as otherwise there is no output from the kernel post the
ACPI BIOS initialisation.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Bump qemu_arm_ebbr_defconfig and qemu_aarch64_ebbr_defconfig in sync:
- Bump Linux to v6.4.3
- Bump U-Boot to 2023.07.02
- Bump TF-A to v2.9
While at it, tune the documentation:
- Increase the amount of memory in the example commands to help run the
largest OS distributions.
- Update the link to the IR Guide to point at the latest version.
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
The issue seems to be fixed. I checked qemu and linux git repositories
but can not find any information when this is starting to work.
System gets successfully an IP, no further testing was done.
Tested with Qemu 8.0.3 and Linux 6.1.x.
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Use full relative pathes for rootfs and kernel, like in other
readme's.
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
The m68k Linux kernel build is broken with binutils >= 2.41 with:
arch/m68k/fpsp040/skeleton.S: Assembler messages:
arch/m68k/fpsp040/skeleton.S:502: Error: junk at end of line, first unrecognized character is `#'
arch/m68k/fpsp040/skeleton.S:508: Error: junk at end of line, first unrecognized character is `#'
This commit adds a backport from the upstream Linux kernel which fixes
this issue. Many thanks to Romain Naour for the issue investigation
and the identification of the kernel commit fixing this.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
The ppc-mpc8544ds is the only qemu configuration that requires a kernel patch:
board/qemu/ppc-mpc8544ds/patches/linux/0001-powerpc-Fix-mcpu-options-for-SPE-only-compiler.patch
But this patch doesn't apply after a backport between v6.1.20 and v6.1.21
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=da0beae2449376326086e9f57468fd2b64736d2a
So the patch 0001-powerpc-Fix-mcpu-options-for-SPE-only-compiler.patch doesn't
seem required anymore.
Welcome to Buildroot
buildroot login: root
# uname -a
Linux buildroot 6.1.28 #1 Wed May 24 09:08:27 UTC 2023 ppc GNU/Linux
# cat /proc/cpuinfo
processor : 0
cpu : e500v2
clock : 400.000000MHz
revision : 3.0 (pvr 8021 0030)
bogomips : 800.00
timebase : 400000000
platform : MPC8544 DS
model : MPC8544DS
Memory : 128 MB
Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/4306895282https://bugs.busybox.net/show_bug.cgi?id=15581
Signed-off-by: Romain Naour <romain.naour@smile.fr>
Cc: Jan-Benedict Glaw <jbglaw@lug-owl.de>
Cc: Sebastian Weyer <sebastian.weyer@smile.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
The QEMU board's post-image script will glob through various
`readme.txt` files for an appropriate command line to use. Recent linter
changes [1] prevents this from happening, and results in the following
build error:
>>> Executing post-image script board/qemu/post-image.sh
sed: can't read board/qemu/*/readme.txt: No such file or directory
Reverting part of the shellcheck fixes for the README file arguments and
marking a linter exception.
[1]: b32d7c99c6
Signed-off-by: James Knight <james.d.knight@live.com>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>
[yann.morin.1998@free.fr: also reinstate plural to the variable name]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Last-minute changes to d9b244d8a3 (board/qemu: define start qemu
script outside of post-image script) were not tested before being
pushed, so they introduced a bug.
As Arnout put it:
[...] multiple expressions need a -e to interpret them as
expressions (now they're interpreted as file names).
Fixes: d9b244d8a3
Reported-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: James Knight <james.d.knight@live.com>
Provides the ability to use a host system's QEMU. While a Buildroot
generated QEMU should work for most cases, a developer may wish to use
the system's QEMU for options which may not have been configured in the
Buildroot's QEMU build (e.g. configuring a different display mode).
Signed-off-by: James Knight <james.d.knight@live.com>
[yann.morin.1998@free.fr:
- use false/true instead of 0/1
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Provides the ability to forward command line options directly to QEMU.
When invoking `start-qemu.sh`, users can forward arguments by adding a
double dash (`--`) into the argument set, and any trailing arguments
will be forwarded into QEMU. For example, `start-qemu.sh -- --help`.
The original implementation supported a "serial-only" command line
argument to help run in a non-graphical mode for some use cases. These
changes try to promote a newly added `--serial-only` argument to drive
this mode; that being said, a `serial-only` argument will still be
accepted for backwards compatibility.
Signed-off-by: James Knight <james.d.knight@live.com>
[yann.morin.1998@free.fr:
- drop the warning: unknown options cause 'exit 1' already, and any
leftover is explicitly for qemu.
- use false/true instead of 0/1
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
The following moves the definition of the QEMU board's `start-qemu.sh`
helper script from being inlined in the post-image script into its own
file. This should, in theory, make it easier to maintain the script in
the future.
Signed-off-by: James Knight <james.d.knight@live.com>
[yann.morin.1998@free.fr:
- don't sub-shell in the script
- merge all 3 sed calls into one
- create dest file with the sed, don't cp first
- also substitute HOST_DIR
- fix shellcheck
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
The kernel config board/qemu/aarch64-sbsa/linux.config has never been in
use by qemu_aarch64_sbsa_defconfig, neither via
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE, nor via
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES.
test_edk2.py is using the kernel config
board/qemu/aarch64-sbsa/linux.config. However, storing a kernel config
that is not used by qemu_aarch64_sbsa_defconfig, in a directory that is
"owned" by qemu_aarch64_sbsa_defconfig, is bound to cause confusion.
Therefore, move the config file to a new subdirectory:
support/testing/tests/boot/test_edk2/
This is similar to how e.g. test_grub.py has a subdirectory:
support/testing/tests/boot/test_grub/
where it keeps the kernel config that is only used by test_grub.py.
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
ARM SBBR (Server Base Boot Requirements) defines SPCR (Serial Port
Console Redirection Table) as a mandatory ACPI table that specifies
the configuration of a serial console.
In the linux kernel, ARM developers have decided that consoles defined
by SPCR are always enabled when existing, see e.g.:
https://lore.kernel.org/linux-serial/20200430161438.17640-1-alpernebiyasak@gmail.com/T/
Specifying console=ttyAMA0 (which is a serial console) is thus
redundant for an ARM SBSA board. (It also blindly assumes that
the serial console is on ttyAMA0, which might not be true.)
Drop the explicit console=ttyAMA0 on the kernel command line,
such that the kernel can pick up the default console defined
by SPCR.
This is similar to how it is currently done for
board/aarch64-efi/grub.cfg.
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Specifying /dev/sda2 is ambigious, and when booting my arm64 machine
this tries to mount the second partition of my ATA drive, instead of
the second partition of the USB-stick, simply because the ATA driver
is probed earlier than the USB controller driver.
To solve this problem, use PARTLABEL=root to specify the root filesystem.
This is similar to how it is currently done for board/aarch64-efi/grub.cfg
and board/qemu/aarch64-ebbr/grub.cfg.
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
- Bump Linux kernel version to 6.1.12.
- Bump U-Boot version to 2023.01 and rename config fragment to make it
clearer that it is not a complete config file.
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
- Bump Linux kernel version to 6.1.12.
- Bump U-Boot version to 2023.01 and follow CONFIG_SYS_TEXT_BASE renaming.
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Add a defconfig to build a 32b ARMv7-A U-Boot based firmware implementing
the subset of UEFI defined by EBBR[1], as well as a Linux OS disk image
booting with UEFI, to run on Qemu.
The generated firmware binary can also be used to install or run another OS
supporting the EBBR specification.
[1]: https://github.com/ARM-software/ebbr
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Add a defconfig to build an AArch64 U-Boot based firmware implementing the
subset of UEFI defined by EBBR[1], as well as a Linux OS disk image booting
with UEFI, to run on Qemu.
The generated firmware binary can also be used to install or run another OS
supporting the EBBR specification.
We do not have Linux 5.19 headers at the moment therefore we rely on 5.17
in the defconfig.
[1]: https://github.com/ARM-software/ebbr
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Reviewed-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This uses a newer firmware implementation that is much faster at
booting. It is supported as of Qemu 7.0.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit changes to use partition-type-uuid = U instead of
c12a7328-f81f-11d2-ba4b-00a0c93ec93b where relevant for the EFI System
Partition.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Add RISC-V 64-bit nommu defconfig for QEMU virt machine with MMU
disabled.
Unlike qemu_riscv64_virt, qemu_riscv64_nommu_virt does not use OpenSBI,
since the kernel is running in machine mode (M-mode).
After the build is complete, you can start QEMU using the launcher
script:
$ output/images/start-qemu.sh
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Since commit [1], the MMU support is mandatory for MMU-capable ARM
cores. This includes the arm926t ARM core used the
qemu_arm_versatile_nommu configuration.
From [2]
"I don't think supporting ARMv5 noMMU makes much sense, as
explained in the commit log. Supporting ARMv7-M definitely makes
sense, but not ARMv5 noMMU."
Remove this defconfig.
Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/2477067386
[1] 8c925613dc
[2] http://lists.busybox.net/pipermail/buildroot/2022-May/643064.html
Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
The Linux config already enabled drm-virtio for graphics output, but not the
corresponding virtio-input / evdev drivers for input or the compatibility fb
option.
Enable them so keyboard/mouse input works and /dev/fb0 is provided.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Since Qemu 6.0.0 [1], a warning appear in the log if a short-form
boolean option is used.
[1] https://git.qemu.org/?p=qemu.git;a=commitdiff;h=ccd3b3b8112b670fdccf8a392b8419b173ffccb4
Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Etienne Carriere <etienne.carriere@linaro.org>
Cc: Dick Olsson <hi@senzilla.io>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
The Bamboo board is an evaluation board for PowerPC 440EP CPUs.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
PowerNV is the platform using the OPAL [1] firmware on OpenPOWER
systems. OPAL first loads a kernel and an initramfs image based on
buildroot including a second boot loader petitboot [2]. The latter
does device discovery and kexecs a new Linux image from disk or
network.
QEMU implements PowerNV machines [3] for the POWER8, POWER9 and
Power10 processors which are used for dev and tests. POWER8 images
being compatible with POWER9 and Power10, simply add a single
qemu_ppc64le_powernv8 board for all.
The QEMU script boots directly from a nvme disk because it is simple
enough but a real system would boot from a ramfs first.
[1] https://github.com/open-power/skiboot/blob/master/doc/overview.rst
[2] https://github.com/open-power/petitboot/
[3] https://qemu.readthedocs.io/en/latest/system/ppc/powernv.html
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This platform has its own kernel defconfig in Buildroot, but we cannot
get quick idea about how much it diverged from the in-kernel defconfig.
Let's use the upstream arch/arm/config/versatile_defconfig as a base,
and maintain the diff as a merge-config fragment. The same .config is
still generated based on the 5.10.7 kernel.
The diff is quite big, but this is a good start-point for cleanups.
Follow-up works can drop diff lines unless we find a good reason for
divergence.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
[Arnout: rename linux-nommu.config to linux-nommu.fragment]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
This platform has its own kernel defconfig in Buildroot, but we cannot
get quick idea about how much it diverged from the in-kernel defconfig.
Let's use the upstream arch/arm/config/versatile_defconfig as a base,
and maintain the diff as a merge-config fragment. The same .config is
still generated (based on the 5.10.7 kernel).
The diff is quite big, but this is a good start-point for cleanups.
Follow-up works can drop diff lines unless we find a good reason for
divergence.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
[Arnout: rename linux.config to linux.fragment]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Add a virtio-net-pci device with a user mode host network backend
Cc: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Add a virtio-net-pci device with a user mode host network backend
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Genimage 15 deprecated the gpt option and now prints a warning when it is
used:
INFO: hdimage(sdcard.img): The option 'gpt' is deprecated. Use 'partition-table-type' instead
So change the genimage configuration files to use that instead.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Beatify this genimage .cfg file to have consistency with all genimage .cfg
files in Buildroot.
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Enable the runtime testing by adding the tag in the readme.txt
Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Dick Olsson <hi@senzilla.io>
Reviewed-by: Dick Olsson <hi@senzilla.io>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cortex-a53 is not a vaild CPU supported by the SBSA reference machine
[0], so qemu fails to boot in our current defconfig:
qemu-system-aarch64: sbsa-ref: CPU type other than the built-in cortex-a57 not supported
Use ARM cortex-a57 which is the CPU that SBSA was meant to emulate [1]
[0] https://git.qemu.org/?p=qemu.git;a=commitdiff;h=4f335a6381f83beb5d6ac0d3993514379454a99d
[1] https://git.qemu.org/?p=qemu.git;a=commitdiff;h=64580903c2b3aee08d74d64e6248a313b246cb69
Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Dick Olsson <hi@senzilla.io>
Reviewed-by: Dick Olsson <hi@senzilla.io>
[yann.morin.1998@free.fr: update the commit log with info from Dick]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Rebase patch versatile-nommu.patch on top of v5.15.
Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Increase vfat partition size for qemu-aarch64-sbsa since it now
requires more than 32M. See "Disk full" [1].
[1] https://gitlab.com/kubu93/buildroot/-/jobs/1745752049
Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
A following patch will switch to the kernel 5.15 for all qemu
defconfigs but the IDE support (used by mips malta) has been
removed from the Linux kernel since 5.14 release [1].
Enable the SCSI support and update the kernel command line.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b7fb14d3ac63117e0e8beabe75f4ea52051fbe3a
Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
The BLK_DEV_IDE_PMAC driver has been removed from the kernel, so use the
libata replacement PATA_MACIO. This requires enabling ATA and BLK_DEV_SD
for the disk to show up, and changing the command line to use /dev/sda.
YENTA depends on PCCARD, so enable it.
The UART does not show up in /dev without DEVTMPFS.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
We are going to remove the gcc fork for csky since it doesn't build
with the latest compilers (gcc 8, 10, 11 tested) [1].
Removing theses defconfigs and the csky gcc fork has become unavoidable
since the Buildroot Docker image used by the gitlab CI will switch soon
to Debian bullseye soon [2].
The cksy gcc fork based on gcc 6 has not been updated since it has been
added to Buildroot [3]. Since then, csky has been added to binutils and
gcc but using the latest upstream version (binutils 2.37 and gcc 11) is
not yet possible due to build issue with glibc 2.34 [4].
Moreover, qemu_csky defconfigs was to be used with the csky qemu fork
(based on Qemu 3.x) added by commit [5] and removed by commit [6].
Since then it's not possible to do a runtime test with theses
defconfigs.
Theses defconfigs can be added back later if the csky toolchain support
is fixed and csky supported by upstream Qemu.
[1] http://lists.busybox.net/pipermail/buildroot/2021-August/621504.html
[2] 71b8322712
[3] 7873a5bd5e
[4] http://lists.busybox.net/pipermail/buildroot/2021-October/624596.html
[5] f816e5b276
[6] 58af9a70cc
Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Guo Ren <ren_guo@c-sky.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Asked-by: Guo Ren <guoren@kernel.org>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
The startup.nsh file is useless to boot EFI payloads. We just need to
follow the naming detection specified in the UEFI spec.
The EFI payload need to be placed in the boot/efi folder in the EFI partition
and follow the architecture naming as described below:
32bit : bootia32.efi
x64 : bootx64.efi
aarch32 : bootarm.efi
aarch64 : bootaa64.efi
This naming is already right in the packages involved (systemd, grub2,
gummiboot), therefore we just need to drop the generation of the
startup.nsh file.
The usage of the startup.nsh in genimage is also dropped to avoid errors in
the image generation.
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Tested-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
This patch adds runtime testing of the OCI archive created by the
sloci scripting. It launches a containerd instance, imports, and
runs the OCI container.
The existing QEMU AARCH64 kernel config was extended to enable common
options used by a container runtime (cgroup and overlayfs).
Signed-off-by: Matthew Weber <matthew.weber@collins.com>
[Arnout: adapt file name which is arm64 now; add to DEVELOPERS]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
gcc-11 warns about what appears to be an out-of-range array access but
stop the build due to -Werror added to cflags:
arch/sparc/kernel/mdesc.c: In function 'mdesc_node_by_name':
arch/sparc/kernel/mdesc.c:647:22: error: 'strcmp' reading 1 or more bytes from a region of size 0 [-Werror=stringop-overread]
647 | if (!strcmp(names + ep[ret].name_offset, name))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/sparc/kernel/mdesc.c:77:33: note: at offset 16 into source object 'mdesc' of size 16
77 | struct mdesc_hdr mdesc;
| ^~~~~
arch/sparc/kernel/mdesc.c: In function 'mdesc_get_property':
arch/sparc/kernel/mdesc.c:692:22: error: 'strcmp' reading 1 or more bytes from a region of size 0 [-Werror=stringop-overread]
692 | if (!strcmp(names + ep->name_offset, name)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/sparc/kernel/mdesc.c:77:33: note: at offset 16 into source object 'mdesc' of size 16
77 | struct mdesc_hdr mdesc;
| ^~~~~
arch/sparc/kernel/mdesc.c: In function 'mdesc_next_arc':
arch/sparc/kernel/mdesc.c:719:21: error: 'strcmp' reading 1 or more bytes from a region of size 0 [-Werror=stringop-overread]
719 | if (strcmp(names + ep->name_offset, arc_type))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/sparc/kernel/mdesc.c:77:33: note: at offset 16 into source object 'mdesc' of size 16
77 | struct mdesc_hdr mdesc;
| ^~~~~
cc1: all warnings being treated as errors
The issue was initially reported to gcc [1] where it was analized.
As suggested, change the struct mdesc_elem * accesses from the end
of mdesc to those from the beginning of the data array.
Update the prototype of node_block(), name_block() and data_block()
since the code really seems to want to do is to compute the address
somewhere into the chunk pointed to by hp.
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100262
Upstream status: Pending
https://www.spinics.net/lists/sparclinux/msg26385.html
Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>