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

Enabling MSI_ROMHOLE_IN_CBFS causes cbsftool to explode, attempts to put in MRC CACHE region. #1145

Open
frantic-from-paranoiawf opened this issue Nov 22, 2024 · 4 comments

Comments

@frantic-from-paranoiawf

Component

Dasharo firmware

Device

MSI Pro Z790-P

Dasharo version

v0.9.2

Dasharo Tools Suite version

No response

Test case ID

No response

Brief summary

When disabling vboot in the coreboot config, Dasharo fails to compile a rom.

How reproducible

100%

How to reproduce

  1. Clone latest v0.9.2 tag
  2. Disable vboot inside .config
  3. Compile

Expected behavior

Rom successfully compiles without vboot, can be flashed and used.

Actual behavior

After running make -j32, an error gets returned, with the rom failing to build.

E: FMAP_SECTION_ROMHOLE_START not found in build/fmap_config.h
E: Got invalid line for key 'FMAP_SECTION_ROMHOLE_START'
E: FMAP_SECTION_ROMHOLE_SIZE not found in build/fmap_config.h
E: Got invalid line for key 'FMAP_SECTION_ROMHOLE_SIZE'
    WRITE      MSI ROMHOLE
E: Image is missing 'ROMHOLE' region
E: The image will be left unmodified.
make: *** [util/msi/Makefile.inc:35: build_complete] Error 1

Screenshots

No response

Additional context

I'm not running Docker, however, the dasharo branch compiles fine for me.

Solutions you've tried

No response

@miczyg1
Copy link
Contributor

miczyg1 commented Nov 26, 2024

@frantic-from-paranoiawf the fmap layout has to have a ROMHOLE region for the purpose of FlashBIOS feature.
See src/mainboard/msi/ms7e06/vboot-rwab.fmd:

	# ROMHOLE must be at flash offset 0x17c0000
	ROMHOLE(PRESERVE) 128K

Even building from dasharo branch ends up in the same error for me if I disable vboot (the aforementioned fmap layout is not selected by default if boot is not enabled, so it all boils down how you prepare .config):

    HOSTCC     Creating MSI ROMHOLE tool
    TOOL       Creating MSI ROMHOLE blob
E: FMAP_SECTION_ROMHOLE_START not found in build/fmap_config.h
E: Got invalid line for key 'FMAP_SECTION_ROMHOLE_START'
E: FMAP_SECTION_ROMHOLE_SIZE not found in build/fmap_config.h
E: Got invalid line for key 'FMAP_SECTION_ROMHOLE_SIZE'
    WRITE      MSI ROMHOLE
E: Image is missing 'ROMHOLE' region
E: The image will be left unmodified.
make: *** [util/msi/Makefile.inc:35: build_complete] Error 1

You may use the same layout file in your build without vboot. You will lose some space for RW_A and RW_B though. Otherwise, you will have to create a custom FMAP layout or simply select MSI_ROMHOLE_IN_CBFS ("Put the MSI ROMHOLE as CBFS file") option in Mainbaord menu.

@frantic-from-paranoiawf
Copy link
Author

frantic-from-paranoiawf commented Nov 26, 2024

@frantic-from-paranoiawf the fmap layout has to have a ROMHOLE region for the purpose of FlashBIOS feature. See src/mainboard/msi/ms7e06/vboot-rwab.fmd:

	# ROMHOLE must be at flash offset 0x17c0000
	ROMHOLE(PRESERVE) 128K

Even building from dasharo branch ends up in the same error for me if I disable vboot (the aforementioned fmap layout is not selected by default if boot is not enabled, so it all boils down how you prepare .config):

    HOSTCC     Creating MSI ROMHOLE tool
    TOOL       Creating MSI ROMHOLE blob
E: FMAP_SECTION_ROMHOLE_START not found in build/fmap_config.h
E: Got invalid line for key 'FMAP_SECTION_ROMHOLE_START'
E: FMAP_SECTION_ROMHOLE_SIZE not found in build/fmap_config.h
E: Got invalid line for key 'FMAP_SECTION_ROMHOLE_SIZE'
    WRITE      MSI ROMHOLE
E: Image is missing 'ROMHOLE' region
E: The image will be left unmodified.
make: *** [util/msi/Makefile.inc:35: build_complete] Error 1

You may use the same layout file in your build without vboot. You will lose some space for RW_A and RW_B though. Otherwise, you will have to create a custom FMAP layout or simply select MSI_ROMHOLE_IN_CBFS ("Put the MSI ROMHOLE as CBFS file") option in Mainbaord menu.

Thank you for replying, something obviously has changed within dasharo branch as well then. I unfortunately don't have a commit to reference, but it would compile fine with no other changes while vboot was disabled. Maybe some default Kconfig options were changed or something? I'm not sure.
I was able to find the build date of when I built the rom, so you can probably go back and select a random commit from the same day to test. Release Date: 11/04/2024 (04 November 2024).
I will try the MSI_ROMHOLE_IN_CBFS config option though.

@miczyg1
Copy link
Contributor

miczyg1 commented Nov 26, 2024

Thank you for replying, something obviously has changed within dasharo branch as well then. I unfortunately don't have a commit to reference, but it would compile fine with no other changes while vboot was disabled. Maybe some default Kconfig options were changed or something? I'm not sure.

All relevant parts are the same. It could be just one different step you did or did not do and you may not even be aware of it.

@frantic-from-paranoiawf
Copy link
Author

After some more testing with the ROMHOLE as a CBFS file, a new error was encountered.

cbfstool: util/cbfstool/cbfs_image.c:734: cbfs_add_entry: Assertion `!IS_HOST_SPACE_ADDRESS(content_offset)' failed.
make: *** [Makefile.mk:1235: build/coreboot.pre] Aborted

According to @miczyg1, because of a workaround for HEADS, it tries to put a CBFS file into the RW_MRC_CACHE region.
My current idea on how this could be improved is if we create two fmap files in Dasharo, one for a non-vboot rom, one for a vboot rom. We could make Kconfig automatically change this.

@frantic-from-paranoiawf frantic-from-paranoiawf changed the title Disabling vboot breaks compilation on MSI boards Enabling MSI_ROMHOLE_IN_CBFS causes cbsftool to explode, attempts to put in MRC CACHE region. Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants