[PATCH 4/7] x86: mtrr: Abort if requested size is not power of 2

Bin Meng bmeng.cn at gmail.com
Mon Aug 2 04:50:33 CEST 2021


On Mon, Aug 2, 2021 at 3:19 AM Simon Glass <sjg at chromium.org> wrote:
>
> On Sat, 31 Jul 2021 at 02:45, Bin Meng <bmeng.cn at gmail.com> wrote:
> >
> > The size parameter of mtrr_add_request() and mtrr_set_next_var()
> > shall be power of 2, otherwise the logic creates a mask that does
> > not meet the requirement of IA32_MTRR_PHYSMASK register.
> >
> > Programming such a mask value to IA32_MTRR_PHYSMASK generates #GP.
> >
> > Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
> > ---
> >
> >  arch/x86/cpu/mtrr.c         | 7 +++++++
> >  arch/x86/include/asm/mtrr.h | 7 ++++---
> >  2 files changed, 11 insertions(+), 3 deletions(-)
>
> Reviewed-by: Simon Glass <sjg at chromium.org>
> Tested on chromebook_coral, chromebook_samus, chromebook_link, minnowmax
> Tested-by: Simon Glass <sjg at chromium.org>

applied to u-boot-x86, thanks!


More information about the U-Boot mailing list