Re: [PATCH 3/7] x86, lib: Add WBNOINVD helper functions
From: Huang, Kai
Date: Thu Mar 13 2025 - 06:14:29 EST
On Wed, 2025-02-26 at 17:48 -0800, Sean Christopherson wrote:
> From: Kevin Loughlin <kevinloughlin@xxxxxxxxxx>
>
> In line with WBINVD usage, add WBONINVD helper functions. Fall back to
> WBINVD (via alternative()) if WBNOINVD isn't supported, as WBINVD provides
> a superset of functionality, just more slowly.
>
> Note, alternative() ensures compatibility with early boot code as needed.
>
> Signed-off-by: Kevin Loughlin <kevinloughlin@xxxxxxxxxx>
> Reviewed-by: Tom Lendacky <thomas.lendacky@xxxxxxx>
> [sean: massage changelog and comments, use ASM_WBNOINVD and _ASM_BYTES]
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
Reviewed-by: Kai Huang <kai.huang@xxxxxxxxx>
[...]
> static __always_inline void wbinvd(void)
> {
> - asm volatile("wbinvd": : :"memory");
> + asm volatile("wbinvd" : : : "memory");
> +}
>
Nit: this is not related, though.