[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGdbjmL=+L-sQioucz6yh_1jrtDCOz1fPxXDU2eZ_HRQkbFugg@mail.gmail.com>
Date: Tue, 21 Jan 2025 17:14:16 -0800
From: Kevin Loughlin <kevinloughlin@...gle.com>
To: Dave Hansen <dave.hansen@...el.com>
Cc: linux-kernel@...r.kernel.org, tglx@...utronix.de, mingo@...hat.com,
bp@...en8.de, dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com,
seanjc@...gle.com, pbonzini@...hat.com, kirill.shutemov@...ux.intel.com,
kai.huang@...el.com, ubizjak@...il.com, jgross@...e.com, kvm@...r.kernel.org,
thomas.lendacky@....com, pgonda@...gle.com, sidtelang@...gle.com,
mizhang@...gle.com, rientjes@...gle.com, manalinandan@...gle.com,
szy0127@...u.edu.cn
Subject: Re: [PATCH v3 1/2] x86, lib: Add WBNOINVD helper functions
On Tue, Jan 21, 2025 at 4:32 PM Dave Hansen <dave.hansen@...el.com> wrote:
>
> On 1/21/25 16:13, Kevin Loughlin wrote:
> > +static __always_inline void wbnoinvd(void)
> > +{
> > + alternative("wbinvd", "wbnoinvd", X86_FEATURE_WBNOINVD);
> > }
>
> Could we please comment this a _bit_?
>
> /*
> * Cheaper version of wbinvd(). Call when caches
> * need to be written back but not invalidated.
> */
> static __always_inline void wbnoinvd(void)
> {
> /*
> * Use the compatible but more destructuve "invalidate"
> * variant when no-invalidate is unavailable:
> */
> alternative("wbinvd", "wbnoinvd", X86_FEATURE_WBNOINVD);
> }
>
> Sure, folks can read the instruction reference, but it doesn't give you
> much of the story of why you should use one over the other or why it's
> OK to call one when you ask for the other.
Yeah, good point. Incoming in v4; thanks!
Powered by blists - more mailing lists