[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5590cd3df8b28cdd077230dda8c99e80436bdcf3.camel@perches.com>
Date: Mon, 12 Oct 2020 10:17:56 -0700
From: Joe Perches <joe@...ches.com>
To: Borislav Petkov <bp@...en8.de>
Cc: Andrew Morton <akpm@...ux-foundation.org>, X86 ML <x86@...nel.org>,
Andy Whitcroft <apw@...onical.com>,
LKML <linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH -v4] checkpatch: Check for .byte-spelled insn opcodes
documentation on x86
On Mon, 2020-10-12 at 19:15 +0200, Borislav Petkov wrote:
> On Mon, Oct 12, 2020 at 10:09:44AM -0700, Joe Perches wrote:
> > From: Borislav Petkov <bp@...e.de>
> >
> > Instruction opcode bytes spelled using the gas directive .byte should
> > carry a comment above them stating which binutils version has added
> > support for the instruction mnemonic so that they can be replaced with
> > the mnemonic when that binutils version is equal or less than the
> > minimum-supported version by the kernel.
> >
> > Add a check for that.
> >
> > Requested-by: Peter Zijlstra <peterz@...radead.org>
> > Signed-off-by: Borislav Petkov <bp@...e.de>
> > Signed-off-by: Joe Perches <joe@...ches.com>
> > ---
> >
> > v4: trivial neatening of $Hex_byte and adding a mechanism to
> > only emit the message once per patched file (Joe)
> >
> > scripts/checkpatch.pl | 18 ++++++++++++++++++
> > 1 file changed, 18 insertions(+)
>
> ./scripts/checkpatch.pl /tmp/test
> Global symbol "$rawline" requires explicit package name (did you forget to declare "my $rawline"?) at ./scripts/checkpatch.pl line 6943.
> Global symbol "$herecurr" requires explicit package name (did you forget to declare "my $herecurr"?) at ./scripts/checkpatch.pl line 6948.
> Execution of ./scripts/checkpatch.pl aborted due to compilation errors.
>
> No workie.
Workie here. This is against -next.
$ ./scripts/checkpatch.pl -f arch/x86/include/asm/smap.h
WARNING: Please consider documenting which binutils version supports these .byte-spelled insn opcodes by adding "binutils version <num>" in a comment above them
#16: FILE: arch/x86/include/asm/smap.h:16:
+#define __ASM_CLAC ".byte 0x0f,0x01,0xca"
WARNING: Prefer using '"%s...", __func__' to using 'smap_save', this function's name, in a string
#60: FILE: arch/x86/include/asm/smap.h:60:
+ asm volatile ("# smap_save\n\t"
WARNING: Prefer using '"%s...", __func__' to using 'smap_restore', this function's name, in a string
#71: FILE: arch/x86/include/asm/smap.h:71:
+ asm volatile ("# smap_restore\n\t"
total: 0 errors, 3 warnings, 99 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
arch/x86/include/asm/smap.h has style problems, please review.
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
Powered by blists - more mailing lists