lkml.org 
[lkml]   [2022]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 05/29] x86: Base IBT bits
    On Fri, Feb 18, 2022 at 08:49:45PM +0000, Andrew Cooper wrote:
    > On 18/02/2022 16:49, Peter Zijlstra wrote:
    > > +/*
    > > + * A bit convoluted, but matches both endbr32 and endbr64 without
    > > + * having either as literal in the text.
    > > + */
    > > +static inline bool is_endbr(const void *addr)
    > > +{
    > > + unsigned int val = ~*(unsigned int *)addr;
    > > + val |= 0x01000000U;
    > > + return val == ~0xfa1e0ff3;
    > > +}
    >
    > At this point, I feel I've earned an "I told you so". :)

    Ha! I actually have a note to double-check this. But yes, I'll stuff
    that piece of asm in so I can forget about it.

    \
     
     \ /
      Last update: 2022-02-18 22:28    [W:4.245 / U:0.564 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site