haswell: implement ramstage caching in SMM region
Cache the relocated ramstage into the SMM region. There is a reserved region within the final SMM region (TSEG). Use that space to cache the relocated ramstage program. That way, on S3 resume there is a copy that can be loaded quickly instead of accessing the flash. Caching the ramstage in the SMM space is also helpful in that it prevents the OS from tampering with the ramstage program. Change-Id: Ifa695ad1c350d5b504b14cc29d3e83c79b317a62 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/2806 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
committed by
Ronald G. Minnich
parent
de1f890186
commit
f7cdfe5b32
@@ -174,6 +174,23 @@ int setup_ap_init(struct bus *cpu_bus, int *max_cpus,
|
||||
int start_aps(struct bus *cpu_bus, int max_cpus);
|
||||
void release_aps_for_smm_relocation(int do_parallel_relocation);
|
||||
#endif
|
||||
|
||||
/* This structure is saved along with the relocated ramstage program in SMM
|
||||
* space. It is used to protect the integrity of the ramstage program on S3
|
||||
* resume by saving a copy of the relocated ramstage in SMM space with the
|
||||
* assumption that the SMM region cannot be altered from the OS. The magic
|
||||
* value just serves as a quick sanity check. */
|
||||
|
||||
#define RAMSTAGE_CACHE_MAGIC 0xf3c3a02a
|
||||
|
||||
struct ramstage_cache {
|
||||
uint32_t magic;
|
||||
uint32_t entry_point;
|
||||
uint32_t load_address;
|
||||
uint32_t size;
|
||||
char program[0];
|
||||
} __attribute__((packed));
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user