Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp890317pxb; Wed, 27 Oct 2021 14:33:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyog+NTbeT/j4dnBUKY5MJUjucETQshGyHPdQvu9wkQ3AUAGV/NeSHJXolUh+9wpqKVEImv X-Received: by 2002:a17:90a:cb10:: with SMTP id z16mr8413471pjt.61.1635370399581; Wed, 27 Oct 2021 14:33:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635370399; cv=none; d=google.com; s=arc-20160816; b=ks3QkQVrh37TibUUitcRp2dbsfkiyEZ99TTMmnQAne7D3Np8vypVXxrlIamrk99SIJ Moa2xQ3PkMxXmFjC6vcQyqVviUnIdqkTCBIvPqDMBZLmp2EMOz7kVWREAxCI5X19J3yM ou/GtZrielRHc4jfxsKdpzKqvFcSIjuDgcy9e2gGfxLqp/Iq/Wj+C66y+wazpcGAsQAE DCNuqH0YY108fEFbDqwZipqDMioK9DgxmtYyQhxQTUQ17bipplsUVbL6m/1oSsslMpuW dC+56aMch7jrDgZ9nwDhejKHH2gYJ2qIr9GFBDmPSc+PLi1nvHQoEzPYZ/5tFbonK4ti N53w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=gs4owRNMfGwuZL4P9U2yLZzGPPLsk6h0y30VNILkFTA=; b=ZKsv1MUp60qo5BGCutv15BeYG8GvYazO126a0+bmSA93HJdWEEQSkyYetWt5K5tGem 19vYqski3/W+hrxiujZ8wVnSUoipQ12Fue9Nc+NA0XUsnOKaDYW10Eg0E8g6tsT6mb2d Im2B3nK08MFElEDqgPxgV6Y5gbRLqAEXv3IAyv0KTXkY7IxS7hyNPNXIsoVhEz3CS+jq E+JQ3gKt2Sh9hm/NOWPy7Rf6CBa/WhybjW4EsKTZOVx+8QoHt8sBlHYRIEzSxvcaWFEy 2LHHM5qlj72qIgX+b4l8Ukfx5Yjy4Lod6Gvc17qNZYle5iN3ve91SCetoT2QKvcvW1hW fK2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s+Jg5mZj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x13si1434653plg.93.2021.10.27.14.33.07; Wed, 27 Oct 2021 14:33:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s+Jg5mZj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243761AbhJ0UCZ (ORCPT + 97 others); Wed, 27 Oct 2021 16:02:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:51296 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231203AbhJ0UCZ (ORCPT ); Wed, 27 Oct 2021 16:02:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 11CF960FC0; Wed, 27 Oct 2021 19:59:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635364799; bh=95aqk1aRn7tZ9u+3WCvanSfI4O5EsROtAUHFrGE9ue8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=s+Jg5mZjmNH9pMl1Xcx93PC0SAt/BKDR+KEhTThVkOY1EsNwnnRX2NzGZr8twQvfh rxHmdMIpRKHc2XwDojDeCoAun6jOMnaT4vplhEbwRhINdsAPqvTFhzMjeUNaGxdE1k eB/nnsbnrBxlW4r4TIwylDGGXg8ej9hUCmyMkth2W5SIMf1eHVeBGBdchNQaObhIeO v7m3XoTp1/OqUyMoVi6d/9a4gakhGBwhf9wUmgmAksYyJCSNIwGTV7zbkIIQAD+2gD GQqk9BwGLtlb4a0cYo/VXxFgOV14Lvdq7VWCo27gTvuIAI3CqWNcAzIFbEZaQNV3qz xR5wtZHGQLFBg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 21A8A410A1; Wed, 27 Oct 2021 16:59:53 -0300 (-03) Date: Wed, 27 Oct 2021 16:59:53 -0300 From: Arnaldo Carvalho de Melo To: Mark Wielaard Cc: Jiri Olsa , Sukadev Bhattiprolu , lkml , Peter Zijlstra , Ingo Molnar , Mark Rutland , Namhyung Kim , Alexander Shishkin , Michael Petlan , Ian Rogers , linux-perf-users@vger.kernel.org Subject: Re: [PATCH] perf tools: Fix compilation on powerpc Message-ID: References: <20210928195253.1267023-1-jolsa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, Sep 28, 2021 at 10:39:05PM +0200, Mark Wielaard escreveu: > Hi, > > On Tue, Sep 28, 2021 at 09:52:53PM +0200, Jiri Olsa wrote: > > Got following build fail on powerpc: > > > > CC arch/powerpc/util/skip-callchain-idx.o > > In function ‘check_return_reg’, > > inlined from ‘check_return_addr’ at arch/powerpc/util/skip-callchain-idx.c:213:7, > > inlined from ‘arch_skip_callchain_idx’ at arch/powerpc/util/skip-callchain-idx.c:265:7: > > arch/powerpc/util/skip-callchain-idx.c:54:18: error: ‘dwarf_frame_register’ accessing 96 bytes \ > > in a region of size 64 [-Werror=stringop-overflow=] > > 54 | result = dwarf_frame_register(frame, ra_regno, ops_mem, &ops, &nops); > > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > arch/powerpc/util/skip-callchain-idx.c: In function ‘arch_skip_callchain_idx’: > > arch/powerpc/util/skip-callchain-idx.c:54:18: note: referencing argument 3 of type ‘Dwarf_Op *’ > > In file included from /usr/include/elfutils/libdwfl.h:32, > > from arch/powerpc/util/skip-callchain-idx.c:10: > > /usr/include/elfutils/libdw.h:1069:12: note: in a call to function ‘dwarf_frame_register’ > > 1069 | extern int dwarf_frame_register (Dwarf_Frame *frame, int regno, > > | ^~~~~~~~~~~~~~~~~~~~ > > cc1: all warnings being treated as errors > > > > The dwarf_frame_register args changed with [1], > > Updating ops_mem accordingly. > > > > [1] https://sourceware.org/git/?p=elfutils.git;a=commit;h=5621fe5443da23112170235dd5cac161e5c75e65 > > The warning (new with GCC11) and the fix are correct. I'm taking this as an Acked-by, ok? - Arnaldo > The code probably worked fine before because the next var on the stack > was the dummy Dwarf_Op which would have been as if the ops_mem[2] was > actually ops_mem[3] already. You don't need the dummy var now and > Dwarf_Op *ops doesn't need to be initialized (the dwarf_frame_register > will initialize it). > > Note that [1] didn't change the args of the dwarf_frame_register, but > did fix a similar bug in one of the elfutils own tests (and updated > the comment on the function to hopefully be more clear). > > Cheers, > > Mark > > > Cc: Mark Wielaard > > Cc: Sukadev Bhattiprolu > > Signed-off-by: Jiri Olsa > > --- > > tools/perf/arch/powerpc/util/skip-callchain-idx.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/tools/perf/arch/powerpc/util/skip-callchain-idx.c b/tools/perf/arch/powerpc/util/skip-callchain-idx.c > > index 3018a054526a..20cd6244863b 100644 > > --- a/tools/perf/arch/powerpc/util/skip-callchain-idx.c > > +++ b/tools/perf/arch/powerpc/util/skip-callchain-idx.c > > @@ -45,7 +45,7 @@ static const Dwfl_Callbacks offline_callbacks = { > > */ > > static int check_return_reg(int ra_regno, Dwarf_Frame *frame) > > { > > - Dwarf_Op ops_mem[2]; > > + Dwarf_Op ops_mem[3]; > > Dwarf_Op dummy; > > Dwarf_Op *ops = &dummy; > > size_t nops; > > -- > > 2.31.1 > > -- - Arnaldo