Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp976064pxb; Wed, 6 Apr 2022 05:49:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9/cvcB/OcfWJUA7JJl9RnMjemR2Qac4iXD1fI0aClSnClskiCMwLbPmxBvYJnrL4S5U6K X-Received: by 2002:a17:90b:1e04:b0:1ca:bc37:d132 with SMTP id pg4-20020a17090b1e0400b001cabc37d132mr9791684pjb.84.1649249396024; Wed, 06 Apr 2022 05:49:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649249396; cv=none; d=google.com; s=arc-20160816; b=m9Z2mzmBejFBAF6+sQdliK/K2cKsvMDKyUtkZafiQSo6WA9/PfQPz+r/egAKaACLTS /JvL5kxJX1L+YeCWxMWbVf3th6pkYQNOdRm4Ml6JPvahqYdsIBMgxbRPtGazU7Ld50RN q/2lAe3SNA54WMqPRQu8kWO8NetRgAxh+oxeDO+lpctMa3WJBbo8S9+OMTOMmsrlp2vQ 69KEOoi1uEv/gJsT/dirnKhngQphK4thlKqCDNimKtTCkTjTR8W46ypUXgUOUwzsbzJp 1VkqRWD7FeFucl73GZ8Sk83R4zHcfxatsi7rRX1nCRvjr7HhBew/kFBoiwDMpQA2id5j OPmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4tr84NTQHEVuCywsiBPVN/ZgxSPZfV76FAoYjErddKo=; b=pnQpT/Km9hgUrwVrO3ZVhjHJn9gYqf9FTE8XapxESBnGdG5uWxlhYMszFwssy9/2wF DneHjpmu9R1KZA4O7FhH4bFmwhH2Khikxuez7LXh9EeNAsAYVhNwiLdT2VmKmOea3CSO 6XO8NCguPYUdnGPql1GrKEhpa1Y2l4987QlV/pgD5jX4PEJbwuueFmc/8lDDbnyLXiQr z6r6xcEULQ4SaK/Zfmzyd/vPvHDTDjorLZ0TNmzsil0Z7NBaZfcvz/K94pWIQ5W+liS/ Smd9UbRiujbkiDEznlSN+YOh+8WmHigmt0a21pLSB+kmwY7XVDYdbR8y2S1MS4j7OHvY AF4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=ZeEwKEPk; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id j15-20020aa7800f000000b004fa849f7ed6si14160646pfi.243.2022.04.06.05.49.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:49:56 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=ZeEwKEPk; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C6DDD272AF4; Wed, 6 Apr 2022 02:35:48 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359182AbiDEUQp (ORCPT + 99 others); Tue, 5 Apr 2022 16:16:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1455519AbiDEQAH (ORCPT ); Tue, 5 Apr 2022 12:00:07 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CF45654BB for ; Tue, 5 Apr 2022 08:16:11 -0700 (PDT) Received: from zn.tnic (p2e55dff8.dip0.t-ipconnect.de [46.85.223.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 58DD71EC053B; Tue, 5 Apr 2022 17:16:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1649171766; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4tr84NTQHEVuCywsiBPVN/ZgxSPZfV76FAoYjErddKo=; b=ZeEwKEPkD2xV8vTQ2kgR1hJj+cKHQBPxdfHQa/fxk7Lk57dnBWf16LBnynNZCM1upb5N/E vA90w0EzlwDNEQHP2d1H/zfk3tJ6TJrcj42DFwnjEbOfcHJnTwCcZFP2y/ifMTwrmEgtdm OKhleqSUJLwtl1eHRnZJa3xABrZxXpo= From: Borislav Petkov To: LKML Cc: Frank Li , Will Deacon , Mark Rutland , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org Subject: [PATCH 09/11] perf/imx_ddr: Fix undefined behavior due to shift overflowing the constant Date: Tue, 5 Apr 2022 17:15:15 +0200 Message-Id: <20220405151517.29753-10-bp@alien8.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405151517.29753-1-bp@alien8.de> References: <20220405151517.29753-1-bp@alien8.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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) #define EVENT_CYCLES_ID 0 #define EVENT_CYCLES_COUNTER 0 -- 2.35.1