From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2908AC433DF for ; Mon, 12 Oct 2020 17:18:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D971D2076C for ; Mon, 12 Oct 2020 17:18:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404063AbgJLRSA (ORCPT ); Mon, 12 Oct 2020 13:18:00 -0400 Received: from smtprelay0103.hostedemail.com ([216.40.44.103]:51126 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2403845AbgJLRSA (ORCPT ); Mon, 12 Oct 2020 13:18:00 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay06.hostedemail.com (Postfix) with ESMTP id 301F11822451E; Mon, 12 Oct 2020 17:17:59 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: waste17_2c18500271fc X-Filterd-Recvd-Size: 3769 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf13.hostedemail.com (Postfix) with ESMTPA; Mon, 12 Oct 2020 17:17:57 +0000 (UTC) Message-ID: <5590cd3df8b28cdd077230dda8c99e80436bdcf3.camel@perches.com> Subject: Re: [PATCH -v4] checkpatch: Check for .byte-spelled insn opcodes documentation on x86 From: Joe Perches To: Borislav Petkov Cc: Andrew Morton , X86 ML , Andy Whitcroft , LKML , Peter Zijlstra Date: Mon, 12 Oct 2020 10:17:56 -0700 In-Reply-To: <20201012171544.GH22829@zn.tnic> References: <20201009161423.14583-1-bp@alien8.de> <20201010105421.GA24674@zn.tnic> <4147e49c0b1251343181b5580d946c2273247927.camel@perches.com> <20201010161112.GC24674@zn.tnic> <20201012142148.GA22829@zn.tnic> <20201012171544.GH22829@zn.tnic> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.4-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > > > 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 > > Signed-off-by: Borislav Petkov > > Signed-off-by: Joe Perches > > --- > > > > 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 " 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.