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=-16.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 E27F4C433C1 for ; Wed, 24 Mar 2021 13:44:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 975FE619FE for ; Wed, 24 Mar 2021 13:44:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235467AbhCXNnj (ORCPT ); Wed, 24 Mar 2021 09:43:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:48904 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234574AbhCXNnX (ORCPT ); Wed, 24 Mar 2021 09:43:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7C1F0619D3; Wed, 24 Mar 2021 13:43:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616593402; bh=MPmffnqKet7GibAYfcAT0zGmqL6ykoNK5Vgadj8rBEU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=c8s9kISPwKESwNkKfNNuk+ZAgCh6b9krH72tFqb0KOLos12GWAN6SNXdmQJGYpAjp CjPhxvpVuFZcYyqQkFsWj1h4WHRcdSo9KgQR/cvLfRGeGXVa3X/guVRgOC1slfQM3C FGm7VAWslEveGhilOphGs8fgMfq8VUPA8BHYcJDs/LB6sWD8BB7gfyT8r26Hmliliw E8Qs/K5sgoepoB9FVEk+KVHqSIey4x6h+g1rtpTgD6YgDvlYHWp3oCR74Rw1cSFkF9 bWaeHJwJxkBEeXpixC3qPKOAesvoPzlau7fTZM/2csCnUY71fMa6ZtxasaDs7wZiQL E/NWKG3zkBY0Q== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 64A5D40647; Wed, 24 Mar 2021 10:43:20 -0300 (-03) Date: Wed, 24 Mar 2021 10:43:20 -0300 From: Arnaldo Carvalho de Melo To: Borislav Petkov , Ian Rogers Cc: Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , X86 ML , Masami Hiramatsu , LKML , Stephane Eranian Subject: Re: [PATCH v3 04/21] x86/insn: Add an insn_decode() API Message-ID: References: <20210304174237.31945-1-bp@alien8.de> <20210304174237.31945-5-bp@alien8.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, Mar 16, 2021 at 06:14:54PM -0700, Ian Rogers escreveu: > On Thu, Mar 4, 2021 at 9:56 AM Borislav Petkov wrote: > > From: Borislav Petkov > > > > Users of the instruction decoder should use this to decode instruction > > bytes. For that, have insn*() helpers return an int value to denote > > success/failure. When there's an error fetching the next insn byte and > > the insn falls short, return -ENODATA to denote that. > > > > While at it, make insn_get_opcode() more stricter as to whether what has > > seen so far is a valid insn and if not. > > > > Copy linux/kconfig.h for the tools-version of the decoder so that it can > > use IS_ENABLED(). > > > > Also, cast the INSN_MODE_KERN dummy define value to (enum insn_mode) > > for tools use of the decoder because perf tool builds with -Werror and > > errors out with -Werror=sign-compare otherwise. > > > > Signed-off-by: Borislav Petkov > > Acked-by: Masami Hiramatsu > > +++ b/tools/arch/x86/lib/insn.c > > @@ -11,10 +11,13 @@ > > #else > > #include > > #endif > > -#include "../include/asm/inat.h" /* __ignore_sync_check__ */ > > -#include "../include/asm/insn.h" /* __ignore_sync_check__ */ > > +#include /*__ignore_sync_check__ */ > > +#include /* __ignore_sync_check__ */ > > Hi, this change is breaking non-x86 builds of perf for me in > tip.git/master. The reason being that non-x86 builds compile the > intel-pt-decoder, which includes this file, but don't have their > include paths set to find tools/arch/x86. I think we want to keep the > relative paths. Borislav, was this addressed? Ian? - Arnaldo