Re: [PATCH v4 07/16] x86/mtrr: split generic_set_all()

From: Borislav Petkov
Date: Wed Oct 26 2022 - 08:12:15 EST


On Wed, Oct 26, 2022 at 01:43:52PM +0200, Juergen Gross wrote:
> The reason is "Prepare the support of PAT without needing MTRR support".
>
> DYM I should just remove the rest of the commit message?

I mean something like this:

"Disentangle MTRR init from PAT init.

Add a main cache_cpu_init() init routine which initializes MTRR and/or
PAT support depending on what has been detected on the system.

Leave the MTRR-specific initialization in a MTRR-specific init function
where the smp_changes_mask setting happens now with caches disabled.

This global mask update was done with caches enabled before probably
because atomic operations while running uncached might have been quite
expensive.

But since only systems with a broken BIOS should ever require to set any
bit in smp_changes_mask, hurting those devices with a penalty of a few
microseconds during boot shouldn't be a real issue."

A commit message should talk about why the change is done - not, what is
being done. The what is clear from the diff.

It is way more important to state why and the direction this is
taking and what the author's concerns were while doing it. Like the
bit about the smp_changes_mask - that is important.

The fact that generic_set_all() is gutted out and renamed to
mtrr_generic_set_state() - not so much and also visible.

:-)

Thx.

--
Regards/Gruss,
Boris.

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