Re: [PATCH v3 1/2] x86, lib: Add WBNOINVD helper functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 21, 2025 at 4:32 PM Dave Hansen <dave.hansen@xxxxxxxxx> 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!





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux