From 8d8ed454dbc284bedb6a7bb7dfa7b2ade166b23c Mon Sep 17 00:00:00 2001 From: Felix Held Date: Tue, 19 Sep 2023 18:06:00 +0200 Subject: cpu/x86/mtrr/debug: use MTRR_PHYS_MASK Instead adding 1 to the result of MTRR_PHYS_BASE(index) to get the variable MTRR's mask MSR number, use the MTRR_PHYS_MASK macro. Signed-off-by: Felix Held Change-Id: Ieecc57feb25afa83f3a53384e5a286f2e4e82093 Reviewed-on: https://review.coreboot.org/c/coreboot/+/78006 Tested-by: build bot (Jenkins) Reviewed-by: Matt DeVillier --- src/cpu/x86/mtrr/debug.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/cpu') diff --git a/src/cpu/x86/mtrr/debug.c b/src/cpu/x86/mtrr/debug.c index 0f20a32c1d..ffaa2a1bb2 100644 --- a/src/cpu/x86/mtrr/debug.c +++ b/src/cpu/x86/mtrr/debug.c @@ -98,12 +98,11 @@ static void display_mtrr_def_type(void) static void display_variable_mtrr(int index, uint64_t address_mask) { - const uint32_t msr_reg = MTRR_PHYS_BASE(index); uint64_t base_address; uint64_t length; uint64_t mask; - const msr_t msr_a = rdmsr(msr_reg); - const msr_t msr_m = rdmsr(msr_reg + 1); + const msr_t msr_a = rdmsr(MTRR_PHYS_BASE(index)); + const msr_t msr_m = rdmsr(MTRR_PHYS_MASK(index)); if (msr_m.raw & MTRR_PHYS_MASK_VALID) { base_address = (msr_a.raw & 0xfffffffffffff000ULL) -- cgit v1.2.3