Re: [PATCH v8 1/6] KVM: x86: Consolidate flags for __linearize()

From: Huang, Kai
Date: Wed May 10 2023 - 08:41:26 EST


On Wed, 2023-05-10 at 14:06 +0800, Binbin Wu wrote:
> Define a 32-bit parameter and consolidate the two bools into it.

Technically, per C standard I don't think you can "define" a parameter of a
function, but can only "declare".

>
> __linearize() has two bool parameters write and fetch. And new flag
> will be needed to support new feature (e.g. LAM needs a flag to skip
> address untag under some conditions).

Since this is the first patch to mention LAM in this series, it would be better
to use the full name Intel Linear Address Masking (LAM).

>
> No functional change intended.
>
> In the follow-up patches, the new parameter will be extended for LAM.

A duplicated sentence to me. Perhaps you can just remove it.

Some changelog material FYI:

Consolidate two bool parameters (write/fetch) of __linearize() into a 
'u32 flag' parameter to make the function be more concise and future
extendable, i.e. to support Intel Linear Address Masking (LAM), which 
allows high non-address bits of linear address to be used as metadata.

Define two flags to replace the two bools. A new flag will be added to
to support LAM to skip masking off metadata bits of linear address
under
some conditions.

No functional change intended.

>
> Signed-off-by: Binbin Wu <binbin.wu@xxxxxxxxxxxxxxx>

Anyway:

Acked-by: Kai Huang <kai.huang@xxxxxxxxx>