coreboot/src
Gabe Black 7756fe70eb 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.

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>
(cherry picked from commit 31529d6d96)
Signed-off-by: Isaac Christensen <isaac.christensen@se-eng.com>
Reviewed-on: http://review.coreboot.org/6952
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
2014-09-24 22:49:45 +02:00
..
arch arm: add missing gc-sections for ramstage 2014-09-24 17:34:35 +02:00
console arm: Remove CAR_MIGRATE Kconfig and associated cruft 2014-09-15 17:38:28 +02:00
cpu x86: Minimize work done with the caches disabled in mtrr functions. 2014-09-24 22:49:45 +02:00
device pnp: Allow setting of misc register 0xf4 in device tree 2014-09-17 17:34:16 +02:00
drivers spi: add Kconfig variable for dual-output read enable 2014-09-17 19:56:16 +02:00
ec chrome ec: Add support for limiting charger current 2014-09-19 21:38:34 +02:00
include Add check_member macro to allow clean and easy struct offset checking 2014-09-22 18:42:20 +02:00
lib rmodule: Fix rmodule.ld for 64-bit 2014-09-23 22:27:10 +02:00
mainboard big: Create a nyan_big mainboard which is a copy of nyan. 2014-09-24 17:41:44 +02:00
northbridge northbridge/intel/i945/Kconfig: Select VGA 2014-09-24 07:58:25 +02:00
soc baytrail: add 80c microcode for C0 parts 2014-09-24 17:42:13 +02:00
southbridge haswell: Move to per-device ACPI 2014-09-22 20:06:13 +02:00
superio pnp: Allow setting of misc register 0xf4 in device tree 2014-09-17 17:34:16 +02:00
vendorcode tpm: Clean up I2C TPM driver 2014-09-10 19:37:49 +02:00
Kconfig coreboot arm64: Add support for arm64 into coreboot framework 2014-09-23 18:10:32 +02:00