Received: by 2002:a05:6a10:144:0:0:0:0 with SMTP id 4csp382200pxw; Fri, 8 Apr 2022 09:49:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeY4l6FpoKL9a2TXh9W9WwrSQlrUuULABFlQ4BZxTXWsp9AwZqgtOnjj4DiwZ9gOjkfbn9 X-Received: by 2002:a05:6402:332:b0:41c:d2d0:d7c3 with SMTP id q18-20020a056402033200b0041cd2d0d7c3mr20709649edw.296.1649436585304; Fri, 08 Apr 2022 09:49:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649436585; cv=none; d=google.com; s=arc-20160816; b=iYPTpfhee5utWwKZZ2BGSFsAA5IBq2zHMqMgRCFItfZgIao/Ki3CVo6tbPJUdp2PE0 7co/diDaXk8pdIXt+TwWwxhiabi9LRSNiR1fFSnjrLSKUmaRaSkFlQSWwTN6de+v/4ZE tl6zMxIQ6WS89VCdD4ELvPuopV/ZS4amnqjEDEkpZVCZav+Iy9oasf0OPxScVN5WQMGV +EzXUo4cwv/6PyE0HsFRb69VBN+uS1TxQAkBfBtgQ3QtOhyri10/scEcHVoSMZce7blK Vla2cp/pbbHR7+00lRQQrEDVe87YrLY7GrrfsjPeU9KYbPZDtkV9zKOKJOpFrNY1OwkY e0Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=+AviiqK2tDDLhuQmd90dBFC7FZoQjRQ6jHaKaDN1vOo=; b=IFY3sUVOysHGj3bAaOZAWEXeR+cKY0u8sDRvQxZ+MmHpdUDrwgBnfVM5KdXDF18el3 BSgulrv6xYr5IKBtaeB61OXQNHoYQgusgiR/2OUI3sxFb+L2MAhJjJhRACDCGVbWfhXT Jii/PXRqGWdp1V/C166+v247kPrnxI4xQ7iv96mKUxo9EMLuXDgw+o4ul/YBFxo6X9uP VJ82OotBrXzrtykWm812ZCvgam6xfpzr4A60NA9CgcofiFrNrXcIEOFWv83yBNtKBfiL MApEKeWiBzfFZ1CGCZrORcnnrfTexbGd11VyDskHBYX2o/SWlrFLlRR+cFT41xQjz8uk 3p6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GBc7cW1m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y14-20020aa7d50e000000b00419443b6298si1085601edq.530.2022.04.08.09.49.19; Fri, 08 Apr 2022 09:49:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GBc7cW1m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233106AbiDHKtw (ORCPT + 99 others); Fri, 8 Apr 2022 06:49:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230136AbiDHKtu (ORCPT ); Fri, 8 Apr 2022 06:49:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A8D12F8FEE for ; Fri, 8 Apr 2022 03:47:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C8EE161F09 for ; Fri, 8 Apr 2022 10:47:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31603C385A1; Fri, 8 Apr 2022 10:47:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649414866; bh=vBQnm40TlruffgZ0FkFkFQiFjmj1QTzKebBa5p5lGDc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GBc7cW1mDB2GSilE/AeCOrQkDD8LOEXSayvXjKPv+3hTg5sPJTRn77tt7+m9wV3o/ 6OVt79xXXGKq5fJhdZoTevyrp7dQE7/He6Jc3urZQGYLMogfg6Sw8Yn8yajidngRtD ELtQUouJtKpukFr9qXO/bMdjAe5PXrkXMIFqiOUfV/u8c5JpSllPIfCoiMJiC2gs7w K2002zVNHJi8nv03CrgbZSgUYyI4Y9+Xh+uNUNhAXMk7Sp0RFBbab2ySOTfFccbLvl 6I7BekEmk5Fr+BHguldC2lKTtjar00+CfFhIHh5LRzMIQ3atDFCH235nidP94IQ3CO YsRLjFiok52Cw== Date: Fri, 8 Apr 2022 11:47:40 +0100 From: Will Deacon To: Borislav Petkov Cc: LKML , Frank Li , Mark Rutland , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 09/11] perf/imx_ddr: Fix undefined behavior due to shift overflowing the constant Message-ID: <20220408104739.GA27564@willie-the-truck> References: <20220405151517.29753-1-bp@alien8.de> <20220405151517.29753-10-bp@alien8.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220405151517.29753-10-bp@alien8.de> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 05, 2022 at 05:15:15PM +0200, Borislav Petkov wrote: > From: Borislav Petkov > > Fix: > > In file included from :0:0: > In function ‘ddr_perf_counter_enable’, > inlined from ‘ddr_perf_irq_handler’ at drivers/perf/fsl_imx8_ddr_perf.c:651:2: > ././include/linux/compiler_types.h:352:38: error: call to ‘__compiletime_assert_729’ \ > declared with attribute error: FIELD_PREP: mask is not constant > _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) > ... > > See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory > details as to why it triggers with older gccs only. > > Signed-off-by: Borislav Petkov > Cc: Frank Li > Cc: Will Deacon > Cc: Mark Rutland > Cc: Shawn Guo > Cc: Sascha Hauer > Cc: Pengutronix Kernel Team > Cc: Fabio Estevam > Cc: NXP Linux Team > Cc: linux-arm-kernel@lists.infradead.org > --- > drivers/perf/fsl_imx8_ddr_perf.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/perf/fsl_imx8_ddr_perf.c b/drivers/perf/fsl_imx8_ddr_perf.c > index 94ebc1ecace7..b1b2a55de77f 100644 > --- a/drivers/perf/fsl_imx8_ddr_perf.c > +++ b/drivers/perf/fsl_imx8_ddr_perf.c > @@ -29,7 +29,7 @@ > #define CNTL_OVER_MASK 0xFFFFFFFE > > #define CNTL_CSV_SHIFT 24 > -#define CNTL_CSV_MASK (0xFF << CNTL_CSV_SHIFT) > +#define CNTL_CSV_MASK (0xFFU << CNTL_CSV_SHIFT) Acked-by: Will Deacon (let me know if you'd prefer for me to queue this directly) Will