From c82e48d7e4266d2333c78bf7f841e749beec40b8 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Tue, 17 Apr 2018 11:45:32 -0600 Subject: cpu/x86: add paging_set_default_pat() function Add paging_set_default_pat() which sets up the PAT MSR according to util/x86/x86_page_tables.go. Using page attribute types require a matching of the PAT values with the page table entries. This function is just providing the default PAT MSR value to match against the utility. BUG=b:72728953 Change-Id: I7ed34a3565647ffc359ff102d3f6a59fbc93cc22 Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/25715 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh Reviewed-by: Justin TerAvest --- src/include/cpu/x86/pae.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/include/cpu') diff --git a/src/include/cpu/x86/pae.h b/src/include/cpu/x86/pae.h index 5bbfdf3aca..96999bb0a8 100644 --- a/src/include/cpu/x86/pae.h +++ b/src/include/cpu/x86/pae.h @@ -14,8 +14,18 @@ void paging_disable_pae(void); /* Set/Clear NXE bit in IA32_EFER MSR */ void paging_set_nxe(int enable); +#define PAT_UC 0 +#define PAT_WC 1 +#define PAT_WT 4 +#define PAT_WP 5 +#define PAT_WB 6 +#define PAT_UC_MINUS 7 +#define PAT_ENCODE(type, idx) (((uint64_t)PAT_ ## type) << 8*(idx)) + /* Set PAT MSR */ void paging_set_pat(uint64_t pat); +/* Set coreboot default PAT value. */ +void paging_set_default_pat(void); #define MAPPING_ERROR ((void *)0xffffffffUL) void *map_2M_page(unsigned long page); -- cgit v1.2.3