Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux x230 cleanup remix #1184

Closed
wants to merge 1 commit into from

Conversation

tlaurion
Copy link
Collaborator

@tlaurion tlaurion commented Jun 23, 2022

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 #1116 (comment) 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.

@tlaurion tlaurion marked this pull request as draft June 23, 2022 19:09
@tlaurion tlaurion force-pushed the linux-x230_cleanup_remix branch 3 times, most recently from 129f9f0 to 7eb3c24 Compare June 23, 2022 20:03
@tlaurion
Copy link
Collaborator Author

tlaurion commented Jun 23, 2022

Letting compile and then will :

  • test x230-flash (linux-x230-flash.config) to flash x230
  • test x230 functionalities (linux-x230-legacy.config)
    • boot from ISO
    • OEM ownership
    • Boot Qubes 4.1
    • No USB keyboard support
    • Sign /boot digests
    • Set TPM Disk Unlock Key
  • test x230-maximized_usb-kb for USB keyboard support
  • test x230-hotp-maximized (linux-x230-maximized.config)
    • test Fbwhiptail
    • run network-init-recovery to test network support
    • Boot Q4.1 install

If all above functions, do freespace comparison:

  • x230
  • x230-hotp-verification
  • x230-hotp-maximized

Then

@tlaurion
Copy link
Collaborator Author

tlaurion commented Jun 24, 2022

x230-hotp-maximized comparison (linux-x230-maximized.config linux configuration)

Master:

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.

@tlaurion
Copy link
Collaborator Author

x230-hotp-verification comparison (linux-x230-legacy.config kernel configuration)

Master:

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.

@tlaurion
Copy link
Collaborator Author

tlaurion commented Jun 24, 2022

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.

  • Readd CONFIG_PREEMPT_VOLUNTARY to test in all 3 Linux configs if resolves issue from x230-flash

@tlaurion
Copy link
Collaborator Author

Rechecking historical differences with https://www.kernelconfig.io/

@tlaurion tlaurion force-pushed the linux-x230_cleanup_remix branch 2 times, most recently from 952d2eb to 620bf98 Compare June 29, 2022 15:44
This is aimed to ease kernel version bump, having a whole picture of config changes between boards and kernel version defaults as opposed to current savedefconfig stored format
@tlaurion
Copy link
Collaborator Author

tlaurion commented Jun 30, 2022

Passed checklist. Nothing broke and we gained around 300k from the kernel cuts in 4.14.

@tlaurion
Copy link
Collaborator Author

tlaurion commented Jul 1, 2022

Interesting enough, combined with #1121 we gained nearly 1mb!

x230-hotp-maximized comparison (linux-x230-maximized.config linux configuration)

Master:

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

@tlaurion
Copy link
Collaborator Author

tlaurion commented Jul 1, 2022

We can see for x230-flash.config that some things were flatten out to be similar with legacy and maximized (less changes).

@tlaurion
Copy link
Collaborator Author

tlaurion commented Nov 18, 2022

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).

@tlaurion
Copy link
Collaborator Author

Included under #1381

@tlaurion tlaurion closed this Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant