From patchwork Tue Apr 5 15:15:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 12801729 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 88E41C433EF for ; Tue, 5 Apr 2022 15:17:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SqsL4WZxJKN2+Pn4AjjETsJKZp54FqwaAKcqeEkY2fY=; b=Z/UXxIjR3z7xLJ QzLfqto9UJAX5Fq0mYTRApJOGTET5gAFlBukk8OplHzf5u8W/3Z26hRpz2XW0c27XawFWb5T0OfXd ttEem5pUj4AiK3U0N5OOFSCFZFS3l22jQlr/R77PHJUOxnQjuxPWrfm1MBc/XeXIDa6f6tuVJMjBv GmH4UW09JGBJpRPSraKg/DckXaTfOLH8ScGQile6GIQJGpZkLKAhOSt7wwwp3bpfJtW6zMOLUlgyj jpNX7bhe0fPLef6siXA+lkcq5IJGY4ExZbqQM/CLhGFB0ccIsGiz513YPMZZD63Ks9UjSZ1qMUyfN th9QPesWrlfOwhzenvDw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nbkup-001eT5-4i; Tue, 05 Apr 2022 15:16:19 +0000 Received: from mail.skyhub.de ([5.9.137.197]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nbkul-001eQX-Ef for linux-arm-kernel@lists.infradead.org; Tue, 05 Apr 2022 15:16:17 +0000 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220405_081615_685231_44C7420C X-CRM114-Status: GOOD ( 12.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 Acked-by: Will Deacon --- 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