Project

General

Profile

Actions

Bug #25

closed

Alignments greater than fmap size fail on x86

Added by Patrick Georgi almost 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
01/20/2016
Due date:
% Done:

0%

Estimated time:
Affected versions:
Needs backport to:
Affected hardware:
Affected OS:

Description

Because fmap comes before CBFS on x86 (for architectural reasons), CBFS is offset by the fmap size.

Since cbfstool handles alignment relative to CBFS start (and not flash start), having an alignment of 0x1000 bytes with an fmap of 0x100 bytes leads to a placement at n*0x1000 + 0x100, which normally isn't the intent of the alignment request.

cbfstool needs to calculate alignments relative to the flash image, not CBFS start.

Actions #1

Updated by Aaron Durbin almost 9 years ago

I'd just make the FMAP region 4KiB sized and aligned. I'm not aware of any alignments on files that would be larger than 4KiB.

Actions #2

Updated by Patrick Georgi almost 9 years ago

mrc cache (in a non-cros configuration) is 64kb aligned. Not sure if that's actually needed, but that also depends on the flash chip that is used.

Actions #3

Updated by Aaron Durbin almost 9 years ago

mrc cache shouldn't be added to cbfs. It should reside in an fmap region. Writing into the cbfs area is really not an appropriate action in my opinion. i.e. we don't have all the logic/smarts as cbfstool for such operations.

Actions #4

Updated by Patrick Georgi almost 9 years ago

Right now, it resides in CBFS (for non-cros) and that works in shipping products.

We should change that, now that there's fmap in upstream, but the more general question remains what the alignment is supposed to represent, and alignment relative to flash addresses still looks like a smart idea to me: We don't typically have the requirement that files need to be aligned in special ways relative to CBFS, alignment is an issue only because some external actors need certain access patterns.

Actions #5

Updated by Aaron Durbin almost 9 years ago

Yes, but for simplicity all CBFS regions should start at 4KiB alignment, etc. I don't see the point of bending over backwards for things that shouldn't be done which require an extreme alignment. Those requirements stem from a single board's flash setup, etc.

Actions #6

Updated by Werner Zeh almost 9 years ago

I have tried to address this issue in this patch: https://review.coreboot.org/#/c/13417

Actions #7

Updated by Patrick Georgi almost 9 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF