Excessive size of kernel modules on RISC-V - modules unstripped

Bug #1964335 reported by Heinrich Schuchardt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux-riscv (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

The size of kernel modules on RISC-V indicates that there is a build problem:

kernel/drivers/ata/sata_mv.ko
amd64: 81713 bytes
arm64: 85505 bytes
riscv64: 601417 bytes

objdump -h shows that there is no section beyond 0xc6fc in the riscv64 file.
The size of the sections matches what we see on the other architectures.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Modules appear to be unstripped. Debugging why that it is so:

$ file ./lib/modules/5.15.0-1004-generic/kernel/fs/btrfs/btrfs.ko
./lib/modules/5.15.0-1004-generic/kernel/fs/btrfs/btrfs.ko: ELF 64-bit LSB relocatable, UCB RISC-V, version 1 (SYSV), BuildID[sha1]=6c48292f27241752d4993a6854e9eee38ab3b503, not stripped

$ du ./lib/modules/5.15.0-1004-generic/kernel/fs/btrfs/btrfs.ko
16968 ./lib/modules/5.15.0-1004-generic/kernel/fs/btrfs/btrfs.ko

$ riscv64-linux-gnu-strip ./lib/modules/5.15.0-1004-generic/kernel/fs/btrfs/btrfs.ko

$ file ./lib/modules/5.15.0-1004-generic/kernel/fs/btrfs/btrfs.ko
./lib/modules/5.15.0-1004-generic/kernel/fs/btrfs/btrfs.ko: ELF 64-bit LSB relocatable, UCB RISC-V, version 1 (SYSV), BuildID[sha1]=6c48292f27241752d4993a6854e9eee38ab3b503, stripped

$ du ./lib/modules/5.15.0-1004-generic/kernel/fs/btrfs/btrfs.ko
1384 ./lib/modules/5.15.0-1004-generic/kernel/fs/btrfs/btrfs.ko

summary: - Excessive size of kernel modules on RISC-V
+ Excessive size of kernel modules on RISC-V - modules unstripped
Revision history for this message
Heinrich Schuchardt (xypron) wrote :

If I compile Linux v5.15.26 with RISC-V defconfig + CONFIG_SATA_MV=y,
I get a drivers/ata/sata_mv.ko with 103960 bytes.

With additionally CONFIG_MODULE_SIG=y after make modules_install: 104673 bytes.

So the problems seems not to exist in upstream.

Changed in linux-riscv (Ubuntu):
status: New → Confirmed
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

we are investing things further.
it seems like debug symbol stripping is fine.
but the input .ko are huge, and much larger than on other arches, for currently unknown reason.

Changed in linux-riscv (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Heinrich Schuchardt (xypron) wrote :

Cf. [PATCH] UBUNTU: SAUCE: scripts/Makefile.modinst discard-locals from modules
 (https://lists.ubuntu.com/archives/kernel-team/2022-March/128534.html)

Revision history for this message
Heinrich Schuchardt (xypron) wrote :

Cf. "Why is .symtab so huge on riscv?" #1036 (https://github.com/riscv-collab/riscv-gnu-toolchain/issues/1036)

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (69.4 KiB)

This bug was fixed in the package linux-riscv - 5.15.0-1005.5

---------------
linux-riscv (5.15.0-1005.5) jammy; urgency=medium

  * jammy/linux-riscv: 5.15.0-1005.5 -proposed tracker (LP: #1965783)

  * Packaging resync (LP: #1786013)
    - [Packaging] resync getabis

  * dependency on crda obsolete according to Debian (LP: #1958918)
    - [Packaging] switch dependency from crda to wireless-regdb

  * Excessive size of kernel modules on RISC-V - modules unstripped
    (LP: #1964335)
    - SAUCE: scripts/Makefile.modinst discard-locals from modules

  * Cherrypick features and fixes from v5.17 for sifive dtbs (LP: #1962010)
    - riscv: dts: sifive: use only generic JEDEC SPI NOR flash compatible
    - riscv: dts: sifive: fix Unleashed board compatible
    - Revert "SiFive HiFive Unleashed: Add PWM LEDs (D1, D2, D3, D4)"
    - riscv: dts: sifive: drop duplicated nodes and properties in sifive
    - riscv: dts: sifive: add missing compatible for plic
    - riscv: dts: sifive unmatched: Name gpio lines
    - riscv: dts: sifive unmatched: Expose the board ID eeprom
    - riscv: dts: sifive unmatched: Expose the PMIC sub-functions
    - Revert "riscv: sifive: unmatched: update for 16GB rev3"
    - riscv: dts: sifive unmatched: Fix regulator for board rev3
    - riscv: dts: sifive unmatched: Link the tmp451 with its power supply
    - riscv: dts: sifive: Group tuples in interrupt properties
    - riscv: dts: sifive: Group tuples in register properties
    - riscv: dts: sifive: fu540-c000: Drop bogus soc node compatible values
    - riscv: dts: sifive: fu540-c000: Fix PLIC node
    - riscv: dts: sifive unmatched: Add gpio poweroff

  * riscv: backport support for SiFive Unmatched (LP: #1910965)
    - SiFive HiFive Unleashed: Add PWM LEDs (D1, D2, D3, D4)

  * Miscellaneous Ubuntu changes
    - [Config] update configs and annotations after rebase

  * Miscellaneous upstream changes
    - RISC-V: Use SBI SRST extension when available

  [ Ubuntu: 5.15.0-23.23 ]

  * jammy/linux: 5.15.0-23.23 -proposed tracker (LP: #1964573)
  * Packaging resync (LP: #1786013)
    - [Packaging] resync dkms-build{,--nvidia-N} from LRMv5
    - debian/dkms-versions -- update from kernel-versions (main/master)
  * [22.04 FEAT] KVM: Enable GISA support for Secure Execution guests
    (LP: #1959977)
    - KVM: s390: pv: make use of ultravisor AIV support
  * intel_iommu breaks Intel IPU6 camera: isys port open ready failed -16
    (LP: #1958004)
    - SAUCE: iommu: intel-ipu: use IOMMU passthrough mode for Intel IPUs
  * CVE-2022-23960
    - ARM: report Spectre v2 status through sysfs
    - ARM: early traps initialisation
    - ARM: use LOADADDR() to get load address of sections
    - ARM: Spectre-BHB workaround
    - ARM: include unprivileged BPF status in Spectre V2 reporting
    - arm64: Add Neoverse-N2, Cortex-A710 CPU part definition
    - arm64: Add HWCAP for self-synchronising virtual counter
    - arm64: Add Cortex-X2 CPU part definition
    - arm64: add ID_AA64ISAR2_EL1 sys register
    - arm64: cpufeature: add HWCAP for FEAT_AFP
    - arm64: cpufeature: add HWCAP for FEAT_RPRES
    - arm64: entry.S: Add ventry overflow sanity checks
    - arm64: spectre: Rename s...

Changed in linux-riscv (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the linux-nezha-5.17/5.17.0-1001.1 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-jammy' to 'verification-done-jammy'. If the problem still exists, change the tag 'verification-needed-jammy' to 'verification-failed-jammy'.

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-jammy
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

verified that linux-nezha-5.17/5.17.0-1001.1 has small .ko modules.

tags: added: verification-done-jammy
removed: verification-needed-jammy
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

and allwinner; and starfive.

Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the linux-starfive/6.2.0-1002.2 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-lunar' to 'verification-done-lunar'. If the problem still exists, change the tag 'verification-needed-lunar' to 'verification-failed-lunar'.

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: kernel-spammed-lunar-linux-starfive verification-needed-lunar
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.