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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 12F6EC433F5 for ; Fri, 24 Sep 2021 00:57:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E602961214 for ; Fri, 24 Sep 2021 00:57:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243710AbhIXA7U (ORCPT ); Thu, 23 Sep 2021 20:59:20 -0400 Received: from mga09.intel.com ([134.134.136.24]:32524 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243693AbhIXA7T (ORCPT ); Thu, 23 Sep 2021 20:59:19 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10116"; a="224004327" X-IronPort-AV: E=Sophos;i="5.85,318,1624345200"; d="scan'208";a="224004327" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2021 17:57:47 -0700 X-IronPort-AV: E=Sophos;i="5.85,318,1624345200"; d="scan'208";a="514332940" Received: from otcwcpicx3.sc.intel.com ([172.25.55.73]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2021 17:57:46 -0700 Date: Fri, 24 Sep 2021 00:57:40 +0000 From: Fenghua Yu To: Josh Poimboeuf Cc: Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Andy Lutomirski , Dave Hansen , Tony Luck , Lu Baolu , Joerg Roedel , Dave Jiang , Jacob Jun Pan , Ashok Raj , Ravi V Shankar , iommu@lists.linux-foundation.org, x86 , linux-kernel Subject: Re: [PATCH 7/8] tools/objtool: Check for use of the ENQCMD instruction in the kernel Message-ID: References: <20210920192349.2602141-1-fenghua.yu@intel.com> <20210920192349.2602141-8-fenghua.yu@intel.com> <20210922210343.GU4323@worktop.programming.kicks-ass.net> <20210924005540.kunsfif7hdta6dlp@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210924005540.kunsfif7hdta6dlp@treble> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Josh, On Thu, Sep 23, 2021 at 05:55:40PM -0700, Josh Poimboeuf wrote: > On Thu, Sep 23, 2021 at 03:26:14PM +0000, Fenghua Yu wrote: > > > > + } else if (op2 == 0x38 && op3 == 0xf8) { > > > > + if (insn.prefixes.nbytes == 1 && > > > > + insn.prefixes.bytes[0] == 0xf2) { > > > > + /* ENQCMD cannot be used in the kernel. */ > > > > + WARN("ENQCMD instruction at %s:%lx", sec->name, > > > > + offset); > > > > + > > > > + return -1; > > > > + } > > > > > > The only concern here is if we want it to be fatal or not. But otherwise > > > this seems to be all that's required. > > > > objtool doesn't fail kernel build on this fatal warning. > > > > Returning -1 here stops checking the rest of the file and won't report any > > further warnings unless this ENQCMD warning is fixed. Not returning -1 > > continues checking the rest of the file and may report more warnings. > > Seems that's the only difference b/w them. > > > > Should I keep this "return -1" or not? Please advice. > > I'd say remove the "return -1" since it's not a fatal-type analysis > error and there's nothing to prevent objtool from analyzing the rest of > the file. Sure. It does make sense to remove "return -1". I will remove it. Thanks. -Fenghua