linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	X86 ML <x86@kernel.org>, Andy Whitcroft <apw@canonical.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH -v4] checkpatch: Check for .byte-spelled insn opcodes documentation on x86
Date: Mon, 12 Oct 2020 10:17:56 -0700	[thread overview]
Message-ID: <5590cd3df8b28cdd077230dda8c99e80436bdcf3.camel@perches.com> (raw)
In-Reply-To: <20201012171544.GH22829@zn.tnic>

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@suse.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@infradead.org>
> > Signed-off-by: Borislav Petkov <bp@suse.de>
> > Signed-off-by: Joe Perches <joe@perches.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.



  reply	other threads:[~2020-10-12 17:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-09 16:14 [PATCH] checkpatch: Check for .byte-spelled insn opcodes documentation on x86 Borislav Petkov
2020-10-09 18:01 ` Joe Perches
2020-10-10 10:54   ` Borislav Petkov
2020-10-10 10:55     ` [PATCH -v2] " Borislav Petkov
2020-10-10 15:27     ` [PATCH] " Joe Perches
2020-10-10 16:11       ` Borislav Petkov
2020-10-10 16:47         ` Joe Perches
2020-10-12 14:21           ` Borislav Petkov
2020-10-12 14:23             ` [PATCH -v3] " Borislav Petkov
2020-10-12 15:04               ` Joe Perches
2020-10-12 15:02             ` [PATCH] " Joe Perches
2020-10-12 17:09             ` [PATCH -v4] " Joe Perches
2020-10-12 17:15               ` Borislav Petkov
2020-10-12 17:17                 ` Joe Perches [this message]
2020-10-12 17:31                   ` Borislav Petkov
2020-10-12 17:40                     ` Joe Perches
2020-10-12 17:55                       ` Borislav Petkov
2020-10-12 18:03                         ` Joe Perches
2020-10-10 15:38     ` [PATCH] " Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5590cd3df8b28cdd077230dda8c99e80436bdcf3.camel@perches.com \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).