Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3492582pxb; Tue, 19 Apr 2022 03:57:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/4Ix4Reg/Lvu/jI4u5N7xe62UEmdzhQR0hukJevHYCdAGY0s2JYylcV0P91EIDco87oDt X-Received: by 2002:a65:6b8e:0:b0:39d:6760:1cd5 with SMTP id d14-20020a656b8e000000b0039d67601cd5mr14171788pgw.379.1650365864772; Tue, 19 Apr 2022 03:57:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650365864; cv=none; d=google.com; s=arc-20160816; b=0WcUUVL2M17x5XPJXMadaf+bzVUP400VmnXpALgC/J1aYrtDAqLnEzYuhP82Xquuqg in98VoTy4qvOY9l1qJoBCvyANaky+Wvfdak72UfqMhl2vbXT6TrMUsTJkgbj2YUMQPdt FEtGb86ZMB+ays2T2NfcSuyDlgi2S86dpFGvGYmj15Nn7S7yTfWaSnIkUTJdmenb3anj pDqp7qFpxdJJ0ufwAWG3oSLx5VT+QgvRDBXqu8Dn3yvEApHLnTYw7pIs2VldMk/Vc61E wMbHGnPZ4C4vot4eJijdAw0UnVj8F9dpeLDhc0zl3x4swUNGTBMB1OqBWxqhWJ5svsC2 XKmg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=o1UAZIC7MvBMQWEcXnz57x9lRt0IbWn97zYIvd0XBQw=; b=UDKRsAFF4hbEZORym467TEy5hWVx+X+vzbOQV5Kd9yTkuLcZ8vYSDXu+oH+M/eRaMO d4tWx8biMAV8HVxtOr3d7AhQq6wfUcY4nFx6B27hXDuxlrPDyUhJyr2+SLbC5siLw/ES 1RkmIVgdUNh3+SONn9rVrxutvDlJDKNBHWYL04QReMPXM4GBq/RsKcYvjHK+PzgbCUr8 qH8I/I7cLgjJManJjtA3RsviU6hcmAhKfLAH1wH+4CfN3U3up+qGZP/K3A89nz6ryluN uPE7G1SbOVlwwvEsQMCVCj2a/coTDBSqXDa0xhLdvLaRYgX8DwwgA7vbeC1ZrbnYpuwl obdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qCaJDJDx; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x27-20020aa7941b000000b00505b770f007si10512390pfo.249.2022.04.19.03.57.26; Tue, 19 Apr 2022 03:57:44 -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=@linuxfoundation.org header.s=korg header.b=qCaJDJDx; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234101AbiDRMlU (ORCPT + 99 others); Mon, 18 Apr 2022 08:41:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239423AbiDRMdB (ORCPT ); Mon, 18 Apr 2022 08:33:01 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1431F26AE8; Mon, 18 Apr 2022 05:24:37 -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 ams.source.kernel.org (Postfix) with ESMTPS id 7C793B80ED1; Mon, 18 Apr 2022 12:24:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 890CAC385A7; Mon, 18 Apr 2022 12:24:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650284674; bh=0w5fkYWRq9t9bwKn/65Gjp/8xhsgA6n0+Ym3YnpIS4k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qCaJDJDxcx/0llfwk1UEpDzrWxxeX058mpXVz6M87fOGPKmvTz9jamBq1dEhGrJL9 Yig9OhL2F5Zr5WJJa1lza9pIqx9et67/2uVHk71xNAH1u5jCv1JAeE632fOYenuSIO fVW4IMjEdrvnaTU3IVkvL+G18u39h5/4ipa36lkw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Borislav Petkov , Frank Li , Will Deacon , Mark Rutland , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org, Sasha Levin Subject: [PATCH 5.17 174/219] perf/imx_ddr: Fix undefined behavior due to shift overflowing the constant Date: Mon, 18 Apr 2022 14:12:23 +0200 Message-Id: <20220418121211.748966891@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121203.462784814@linuxfoundation.org> References: <20220418121203.462784814@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 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 From: Borislav Petkov [ Upstream commit d02b4dd84e1a90f7f1444d027c0289bf355b0d5a ] 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 Acked-by: Will Deacon Link: https://lore.kernel.org/r/20220405151517.29753-10-bp@alien8.de Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- 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