lkml.org 
[lkml]   [2022]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 11/39] x86/ibt,kvm: Add ENDBR to fastops
On Thu, Feb 24, 2022 at 04:54:04PM -0800, Kees Cook wrote:
> On Thu, Feb 24, 2022 at 03:51:49PM +0100, Peter Zijlstra wrote:
> >
> > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > ---
> > arch/x86/kvm/emulate.c | 6 ++++--
> > 1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > --- a/arch/x86/kvm/emulate.c
> > +++ b/arch/x86/kvm/emulate.c
> > @@ -189,7 +189,7 @@
> > #define X16(x...) X8(x), X8(x)
> >
> > #define NR_FASTOP (ilog2(sizeof(ulong)) + 1)
> > -#define FASTOP_SIZE 8
> > +#define FASTOP_SIZE (8 * (1 + HAS_KERNEL_IBT))
>
> Err, is this right? FASTOP_SIZE is used both as a size and an alignment.
> But the ENDBR instruction is 4 bytes? Commit log maybe needed to
> describe this.

Note how that comes out as 8*1 or 8*2, iow 8 or 16. Does that clarify?
That is, 8+4 being 12 is ovbiuosly a fail for alignment.

\
 
 \ /
  Last update: 2022-02-25 11:26    [W:0.142 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site