Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp955726pxb; Wed, 6 Apr 2022 05:15:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZmy3NnVRYASq2grqVV+kEisECnO+s8SNXo4Stlj65ZrnisaaLA7M+JXRhZrQp5y/Igw9U X-Received: by 2002:a05:6a00:1490:b0:4fb:1544:bc60 with SMTP id v16-20020a056a00149000b004fb1544bc60mr8612306pfu.73.1649247346794; Wed, 06 Apr 2022 05:15:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649247346; cv=none; d=google.com; s=arc-20160816; b=Q9UvEhGfWgszdRQQRARowy5JB2+153m7hzSZHWVG+yHHOyDFEXpfnJKXFIV22zYWuT QFbiS/ABS1MBbpb1CKu20+ASZhLNsiPIoWbHbDdlKbJluiYTyk0u4R7iM5rP4o07/Mgg LEK7dhn2igT29BZOUb4FqDx/GWJrw/TfoZ07MNz5sPvKF3wDLRX166IVA3VU6CseR5JQ 1twgZw8E+hQJaA+qVDEJ22m3NG3fiG4IoGa1mQ3JOAgNjpIHh/F2Su57+KG3uj19R8qZ gRqDCXUv0pPqWwFxSvKMLMn6Z5TX82KAsvmqsjceEhEyEABdNa8BJzO0iuepBHr9SKdu G9lw== 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=A4rj24jI/yUMyg0PeqD763DeKOQodwsJYuc20fV3sUw=; b=MvQsGvoYUoVE/zTo9Pul7p7lU8J1lWmje/qh4BxxQVMeBdIFTWIIy63PNo1/gA/X20 ntVUifXKaHK4ehq+KsCVADVm7FcWSJB3gtcbHKG+LqDhCZVyJ0Y9UtEJomA1cQRznvLf anV8j8mc+tZVnXymClTJYZ+2ISdZur6vvyPpJRK/6FBPo3lzoI/OjnIxegRP2AJXloO2 GP/4Oly+QxNuk4LMdHfleOr7nNyfhLAGPbF4N0cGa06bvnnQEbNiWZ4xrhrhkhuiLonA zmkaNUIoKoCwtLlC4hYCWpSsMkypGQyKZ2V+IMkGFvraBD6GHznf9vwdHk+bjAHxf1Ix MOKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=CD0Bl5S4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id n16-20020a170902e55000b00153b2d16516si2978433plf.286.2022.04.06.05.15.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:15:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=CD0Bl5S4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 006342F3D25; Wed, 6 Apr 2022 03:55:22 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1840024AbiDFBGy (ORCPT + 99 others); Tue, 5 Apr 2022 21:06:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1455471AbiDEQAE (ORCPT ); Tue, 5 Apr 2022 12:00:04 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0707B580DF for ; Tue, 5 Apr 2022 08:15:47 -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 90B3D1EC0502; Tue, 5 Apr 2022 17:15:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1649171742; 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=A4rj24jI/yUMyg0PeqD763DeKOQodwsJYuc20fV3sUw=; b=CD0Bl5S4CUevZqWeAW+t0LZQ3sYvhujWzzjaduwde9Va4TUFNZ4EB9b76qzGjsrqOkp/0/ 1teXwyV66I5PiUvgs/OxTkvOQwZaUPhdM+k6gcfs1n64tuSx+2eDFhzHJ1ib52/R1RehGZ KQZ32meI6r9mYnOmXzTG54DgGaMmrrQ= From: Borislav Petkov To: LKML Cc: David Airlie , Daniel Vetter , Alex Deucher , dri-devel@lists.freedesktop.org Subject: [PATCH 04/11] drm/r128: Fix undefined behavior due to shift overflowing the constant Date: Tue, 5 Apr 2022 17:15:10 +0200 Message-Id: <20220405151517.29753-5-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: drivers/gpu/drm/r128/r128_cce.c: In function ‘r128_do_init_cce’: drivers/gpu/drm/r128/r128_cce.c:417:2: error: case label does not reduce to an integer constant case R128_PM4_64BM_64VCBM_64INDBM: ^~~~ drivers/gpu/drm/r128/r128_cce.c:418:2: error: case label does not reduce to an integer constant case R128_PM4_64PIO_64VCPIO_64INDPIO: ^~~~ 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: David Airlie Cc: Daniel Vetter Cc: Alex Deucher Cc: dri-devel@lists.freedesktop.org --- drivers/gpu/drm/r128/r128_drv.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/r128/r128_drv.h b/drivers/gpu/drm/r128/r128_drv.h index 2e1bc01aa5c9..970e192b0d51 100644 --- a/drivers/gpu/drm/r128/r128_drv.h +++ b/drivers/gpu/drm/r128/r128_drv.h @@ -300,8 +300,8 @@ extern long r128_compat_ioctl(struct file *filp, unsigned int cmd, # define R128_PM4_64PIO_128INDBM (5 << 28) # define R128_PM4_64BM_128INDBM (6 << 28) # define R128_PM4_64PIO_64VCBM_64INDBM (7 << 28) -# define R128_PM4_64BM_64VCBM_64INDBM (8 << 28) -# define R128_PM4_64PIO_64VCPIO_64INDPIO (15 << 28) +# define R128_PM4_64BM_64VCBM_64INDBM (8U << 28) +# define R128_PM4_64PIO_64VCPIO_64INDPIO (15U << 28) # define R128_PM4_BUFFER_CNTL_NOUPDATE (1 << 27) #define R128_PM4_BUFFER_WM_CNTL 0x0708 -- 2.35.1