Re: [PATCH v2 1/2] x86/cpu/intel: Fix MTRR verification for TME enabled platforms

From: Borislav Petkov
Date: Thu Sep 28 2023 - 11:03:57 EST


On Mon, Sep 25, 2023 at 05:00:45PM -0700, Compostella, Jeremy wrote:
> On TME enabled platform, BIOS publishes MTRR taking into account Total
> Memory Encryption (TME) reserved bits.
>
> generic_get_mtrr() performs a sanity check of the MTRRs relying on the
> `phys_hi_rsvd' variable which is set using the cpuinfo_x86 structure
> `x86_phys_bits' field. But at the time the generic_get_mtrr()
> function is ran the `x86_phys_bits' has not been updated by
> detect_tme() when TME is enabled.
>
> Since the x86_phys_bits does not reflect yet the real maximal physical
> address size yet generic_get_mtrr() complains by logging the following
> messages.
>
> mtrr: your BIOS has configured an incorrect mask, fixing it.
> mtrr: your BIOS has configured an incorrect mask, fixing it.
> [...]
>
> For `x86_phys_bits' to be updated before generic_get_mtrr() runs, this
> patch moves the detect_tme() call from init_intel() to

Avoid having "This patch" or "This commit" in the commit message. It is
tautologically useless.

Also, do

$ git grep 'This patch' Documentation/process

for more details.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette