heads
heads copied to clipboard
Linux x230 cleanup remix
Continuing #1116 on x230 linux config tuning.
- flash (minimal)
- legacy (reduced)
- maximized
As opposed to currently stored linux config, those are not stored in defconfig but full oldconfig format.
Rationale: As explained under https://github.com/osresearch/heads/pull/1116#issuecomment-1163207850 the reasoning is to facilitate linux kernel version bumps and for users to understand what changed between those directly from the configuration files.
Addition:
- MMC card reader
Removal:
- AMD related stuff
- Many network cards that were supported in kernel since last kernel version bump.
- CPU governers not linked to PERFORMANCE
- Random number generators not being TPM/Intel HW support
- DEBUG related stuff
This is based on top of #1178 which will hopefully be merged soon, after which this will be rebased.
The only relevant commit is WiP here, which will change until satisfaction of size comparison and functionality is met, not causing regression. Then those kernel configurations will be used to have kernel version bump, with clear differences this time.
Letting compile and then will :
- [x] test x230-flash (linux-x230-flash.config) to flash x230
- [x] test x230 functionalities (linux-x230-legacy.config)
- [x] boot from ISO
- [x] OEM ownership
- [x] Boot Qubes 4.1
- [x] No USB keyboard support
- [x] Sign /boot digests
- [x] Set TPM Disk Unlock Key
- [x] test x230-maximized_usb-kb for USB keyboard support
- [x] test x230-hotp-maximized (linux-x230-maximized.config)
- [x] test Fbwhiptail
- [x] run network-init-recovery to test network support
- [x] Boot Q4.1 install
If all above functions, do freespace comparison:
- [ ] x230
- [ ] x230-hotp-verification
- [ ] x230-hotp-maximized
Then
- [ ] Set PR to review.
- [ ] Attack #1123 so that all boards, even legacy boards, can support Qubes 4.1
- [ ] If fails, go back to #590 starting by #1121
- [ ] Bump kernel to newer version. Rinse. Repeat.
x230-hotp-maximized comparison (linux-x230-maximized.config linux configuration)
Name Offset Type Size Comp
cbfs master header 0x0 cbfs header 32 none
fallback/romstage 0x80 stage 85100 none
cpu_microcode_blob.bin 0x14d80 microcode 26624 none
fallback/ramstage 0x1b600 stage 97684 none
config 0x33400 raw 786 none
revision 0x33780 raw 691 none
fallback/dsdt.aml 0x33a80 raw 14615 none
vbt.bin 0x37400 raw 1433 LZMA (4281 decompressed)
cmos_layout.bin 0x37a00 cmos_layout 1884 none
fallback/postcar 0x381c0 stage 25816 none
fallback/payload 0x3e700 simple elf 7310279 none
(empty) 0x737300 null 4360856 none
bootblock 0xb5fdc0 bootblock 65536 none
New:
Name Offset Type Size Comp
cbfs master header 0x0 cbfs header 32 none
fallback/romstage 0x80 stage 85100 none
cpu_microcode_blob.bin 0x14d80 microcode 26624 none
fallback/ramstage 0x1b600 stage 97685 none
config 0x33400 raw 786 none
revision 0x33780 raw 691 none
fallback/dsdt.aml 0x33a80 raw 14615 none
vbt.bin 0x37400 raw 1433 LZMA (4281 decompressed)
cmos_layout.bin 0x37a00 cmos_layout 1884 none
fallback/postcar 0x381c0 stage 25816 none
fallback/payload 0x3e700 simple elf 6996935 none
(empty) 0x6eab00 null 4674200 none
bootblock 0xb5fdc0 bootblock 65536 none
New - old: 4674200 - 4360856 313344 free bytes gain from reducing linux-x230-maximized.config modules and features.
x230-hotp-verification comparison (linux-x230-legacy.config kernel configuration)
Name Offset Type Size Comp
cbfs master header 0x0 cbfs header 32 none
fallback/romstage 0x80 stage 85100 none
cpu_microcode_blob.bin 0x14d80 microcode 26624 none
fallback/ramstage 0x1b600 stage 97687 none
config 0x33400 raw 588 none
revision 0x336c0 raw 691 none
fallback/dsdt.aml 0x339c0 raw 14615 none
vbt.bin 0x37340 raw 1433 LZMA (4281 decompressed)
cmos_layout.bin 0x37940 cmos_layout 1884 none
fallback/postcar 0x38100 stage 25816 none
fallback/payload 0x3e640 simple elf 6851015 none
(empty) 0x6c7040 null 101720 none
bootblock 0x6dfdc0 bootblock 65536 none
New:
Name Offset Type Size Comp
cbfs master header 0x0 cbfs header 32 none
fallback/romstage 0x80 stage 85100 none
cpu_microcode_blob.bin 0x14d80 microcode 26624 none
fallback/ramstage 0x1b600 stage 97687 none
config 0x33400 raw 588 none
revision 0x336c0 raw 691 none
fallback/dsdt.aml 0x339c0 raw 14615 none
vbt.bin 0x37340 raw 1433 LZMA (4281 decompressed)
cmos_layout.bin 0x37940 cmos_layout 1884 none
fallback/postcar 0x38100 stage 25816 none
fallback/payload 0x3e640 simple elf 6537159 none
(empty) 0x67a640 null 415576 none
bootblock 0x6dfdc0 bootblock 65536 none
new - old gain: 415576 - 101720 = 313856 free space gain.
Some NOHZ: local_softirq_pending 80 from x230-flash when calling flash.sh script to flash x230-hotp-verification (linux-x230-flash.config needs review).
Might be related to CONFIG_PREEMPT being deactivated.
- [x] Readd CONFIG_PREEMPT_VOLUNTARY to test in all 3 Linux configs if resolves issue from x230-flash
Rechecking historical differences with https://www.kernelconfig.io/
Passed checklist. Nothing broke and we gained around 300k from the kernel cuts in 4.14.
Interesting enough, combined with #1121 we gained nearly 1mb!
x230-hotp-maximized comparison (linux-x230-maximized.config linux configuration)
Name Offset Type Size Comp
cbfs master header 0x0 cbfs header 32 none
fallback/romstage 0x80 stage 85100 none
cpu_microcode_blob.bin 0x14d80 microcode 26624 none
fallback/ramstage 0x1b600 stage 97684 none
config 0x33400 raw 786 none
revision 0x33780 raw 691 none
fallback/dsdt.aml 0x33a80 raw 14615 none
vbt.bin 0x37400 raw 1433 LZMA (4281 decompressed)
cmos_layout.bin 0x37a00 cmos_layout 1884 none
fallback/postcar 0x381c0 stage 25816 none
fallback/payload 0x3e700 simple elf 7310279 none
(empty) 0x737300 null 4360856 none
bootblock 0xb5fdc0 bootblock 65536 none
Local build
FMAP REGION: COREBOOT
Name Offset Type Size Comp
cbfs master header 0x0 cbfs header 32 none
fallback/romstage 0x80 stage 85100 none
cpu_microcode_blob.bin 0x14d80 microcode 26624 none
fallback/ramstage 0x1b600 stage 97716 none
config 0x33400 raw 791 none
revision 0x33780 raw 696 none
fallback/dsdt.aml 0x33a80 raw 14615 none
vbt.bin 0x37400 raw 1433 LZMA (4281 decompressed)
cmos_layout.bin 0x37a00 cmos_layout 1884 none
fallback/postcar 0x381c0 stage 25816 none
fallback/payload 0x3e700 simple elf 6522311 none
(empty) 0x676d00 null 5148824 none
bootblock 0xb5fdc0 bootblock 65536 none
We can see for x230-flash.config that some things were flatten out to be similar with legacy and maximized (less changes).
Continuing work under https://github.com/tlaurion/heads/tree/reassess_1184 will be forced push here when satisfactory.
A lot of things are build as modules, which are taking useless compile time since those modules are not packed under initrd.
For the moment, I will test x230-hotp-maximized to make sure there is no regression. No use of having either RETPOLINE, nor MEMBARRIER not anything of that sort under Heads, since everything is considered whiptail driven and when user does things from the unauthenticated recovery shell, we currently trust him to do the right thing under that volatile session which otherwise would change what is measured under Heads and/or would DOS the system (wiping disk is totally possible as of now).
Goal of the present work is just to build a comparative for the 3 linux configs under old 4.14 kernel, aiming to move to the same kernel used by librem boards (5.x), to both reduce CI compilation time (reuse common built stuff to economize build time) and to have merged efforts which happened under #1232, where comparing different versions is really difficult.
Goal now is to have reduced 4.14 versions to have baseline for #1121 final size gains comparisons prior of merge there, and finally merge this to go forward including NVMe support, BRTFS, LVM Thin etc, MMC card reader support which is frequently asked since avail on hardware, leading to generalize USB support to support Other Medium boot (boot from external MMC reader ISOs, external hard drive ISOs or secondary hard drive medias).
Included under #1381