Re: [PATCH 3/7] x86, lib: Add WBNOINVD helper functions

Huang, Kai
2025-03-13T10:14:17Z

On Wed, 2025-02-26 at 17:48 -0800, Sean Christopherson wrote:
> From: Kevin Loughlin <kevinloughlin@google.com>
>
> 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@google.com>
> Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
> [sean: massage changelog and comments, use ASM_WBNOINVD and _ASM_BYTES]
> Signed-off-by: Sean Christopherson <seanjc@google.com>

Reviewed-by: Kai Huang <kai.huang@intel.com>

[...]

> static __always_inline void wbinvd(void)
> {
> - asm volatile("wbinvd": : :"memory");
> + asm volatile("wbinvd" : : : "memory");
> +}
>

Nit: this is not related, though.