coreboot/src/cpu
Gabe Black 31529d6d96 x86: Minimize work done with the caches disabled in mtrr functions.
The code in src/cpu/x86/mtrr/mtrr.c disables caching in a few places when
changing mtrr settings. While I can't find anything that says that's actually
required, I can believe it's necessary. With that said, other code around the
wrmsr instructions which actually modify the settings should be able to run
with caching enabled with no ill effects.

This is particularly true for two calls to printk, one in the fixed mtrr code
and one in the variable, which could result in an arbitrary amount of work
being done without caching. When changing the implementation of the cbmem
console, these two printks caused a significant regression in boot performance
on link of about 70ms which is about 10% of total firmware boot time. When the
window where the cache is disabled is minimized, both this and the new
implementation were about 30ms faster than the original boot time.

For the variable MTRRs, we now store what we want to set the MSRs to and then
write them all at once at the end of commit_var_mtrrs(). This way we don't
have some set and some not, but we still minimize the time we spend with the
caches disabled.

BUG=None
TEST=Booted on link. Measured boot timing before and after this change, and
with and without the new cbmem implementation.
BRANCH=None

Change-Id: I5139b262bd2d13f79afd88e2e2c0f514fb3e27c9
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://chromium-review.googlesource.com/187811
Reviewed-by: Ronald Minnich <rminnich@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2014-02-27 00:50:17 +00:00
..
amd copy_and_run: drop boot_complete parameter 2013-05-10 11:55:19 -07:00
armltd qemu-armv7: Minimal changes to pass compiling qemu-v7 platform. 2014-02-14 15:30:03 +00:00
intel chromeos: provide stub functions for !CONFIG_VBOOT_VERIFY_FIRMWARE 2014-02-04 23:05:32 +00:00
via copy_and_run: drop boot_complete parameter 2013-05-10 11:55:19 -07:00
x86 x86: Minimize work done with the caches disabled in mtrr functions. 2014-02-27 00:50:17 +00:00
Kconfig armv8: add support for armv8 cpu 2014-01-07 02:48:47 +00:00
Makefile.inc armv7: Move Exynos from 'cpu' to 'soc'. 2013-10-01 08:16:46 +00:00