x86/mtrr: Print address ranges inclusive to be more consistent

The printed address ranges in the tree (resource allocator and even
some MTRR code) usually shows the range inclusive (meaning from start
address to the real end address of the range). Though there is still
some code in the MTRR context which prints the ranges with an exclusive
end. This patch aligns the printing of ranges in the MTRR code to be
consistent among the tree so that the shown end addresses are now
inclusive.

Change-Id: I0ca292f9cf272564cb5ef1c4ea38f5c483605c94
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/63541
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Christian Walter <christian.walter@9elements.com>
This commit is contained in:
Werner Zeh
2022-04-11 08:35:06 +02:00
committed by Felix Held
parent a46056fa9a
commit eaf11c9445
2 changed files with 4 additions and 4 deletions

View File

@@ -60,7 +60,7 @@ static void postcar_var_mtrr_set(const struct var_mtrr_context *ctx,
struct postcar_frame *pcf = ctx->arg; struct postcar_frame *pcf = ctx->arg;
printk(BIOS_DEBUG, "MTRR Range: Start=%lx End=%lx (Size %zx)\n", printk(BIOS_DEBUG, "MTRR Range: Start=%lx End=%lx (Size %zx)\n",
addr, addr + size, size); addr, addr + size - 1, size);
stack_push(pcf, mask.hi); stack_push(pcf, mask.hi);
stack_push(pcf, mask.lo); stack_push(pcf, mask.lo);

View File

@@ -154,7 +154,7 @@ static void print_physical_address_space(const struct memranges *addr_space,
memranges_each_entry(r, addr_space) memranges_each_entry(r, addr_space)
printk(BIOS_DEBUG, printk(BIOS_DEBUG,
"0x%016llx - 0x%016llx size 0x%08llx type %ld\n", "0x%016llx - 0x%016llx size 0x%08llx type %ld\n",
range_entry_base(r), range_entry_end(r), range_entry_base(r), range_entry_end(r) - 1,
range_entry_size(r), range_entry_tag(r)); range_entry_size(r), range_entry_tag(r));
} }
@@ -272,7 +272,7 @@ static void calc_fixed_mtrrs(void)
type = range_entry_tag(r); type = range_entry_tag(r);
printk(MTRR_VERBOSE_LEVEL, printk(MTRR_VERBOSE_LEVEL,
"MTRR addr 0x%x-0x%x set to %d type @ %d\n", "MTRR addr 0x%x-0x%x set to %d type @ %d\n",
begin, begin + desc->step, type, type_index); begin, begin + desc->step - 1, type, type_index);
if (type == MTRR_TYPE_WRBACK) if (type == MTRR_TYPE_WRBACK)
type |= MTRR_FIXED_WRBACK_BITS; type |= MTRR_FIXED_WRBACK_BITS;
fixed_mtrr_types[type_index] = type; fixed_mtrr_types[type_index] = type;
@@ -905,7 +905,7 @@ void mtrr_use_temp_range(uintptr_t begin, size_t size, int type)
if (commit_var_mtrrs(&sol) < 0) if (commit_var_mtrrs(&sol) < 0)
printk(BIOS_WARNING, "Unable to insert temporary MTRR range: 0x%016llx - 0x%016llx size 0x%08llx type %d\n", printk(BIOS_WARNING, "Unable to insert temporary MTRR range: 0x%016llx - 0x%016llx size 0x%08llx type %d\n",
(long long)begin, (long long)begin + size, (long long)begin, (long long)begin + size - 1,
(long long)size, type); (long long)size, type);
else else
need_restore_mtrr(); need_restore_mtrr();