diff options
Diffstat (limited to 'src/arch/x86')
-rw-r--r-- | src/arch/x86/cpu_common.c | 7 | ||||
-rw-r--r-- | src/arch/x86/include/arch/cpu.h | 11 |
2 files changed, 16 insertions, 2 deletions
diff --git a/src/arch/x86/cpu_common.c b/src/arch/x86/cpu_common.c index e674afae30..af4e7b001d 100644 --- a/src/arch/x86/cpu_common.c +++ b/src/arch/x86/cpu_common.c @@ -49,8 +49,11 @@ int cpu_phys_address_size(void) if (!(cpu_have_cpuid())) return 32; - if (cpu_cpuid_extended_level() >= 0x80000008) - return cpuid_eax(0x80000008) & 0xff; + if (cpu_cpuid_extended_level() >= 0x80000008) { + int size = cpuid_eax(0x80000008) & 0xff; + size -= get_reserved_phys_addr_bits(); + return size; + } if (cpuid_edx(1) & (CPUID_FEATURE_PAE | CPUID_FEATURE_PSE36)) return 36; diff --git a/src/arch/x86/include/arch/cpu.h b/src/arch/x86/include/arch/cpu.h index 1355096abe..96cf23bb76 100644 --- a/src/arch/x86/include/arch/cpu.h +++ b/src/arch/x86/include/arch/cpu.h @@ -316,4 +316,15 @@ size_t get_cache_size(const struct cpu_cache_info *info); */ bool fill_cpu_cache_info(uint8_t level, struct cpu_cache_info *info); +#if CONFIG(CPU_INTEL_COMMON) +int get_reserved_phys_addr_bits(void); +#else +/* Default implementation */ +static inline int get_reserved_phys_addr_bits(void) +{ + /* Default implementation */ + return 0; +} +#endif + #endif /* ARCH_CPU_H */ |