Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1669149iob; Thu, 19 May 2022 11:32:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwi2f+W22DI2sjtYY7rF3D750qEmSFhd0vxK6XSQXgGDKJoxnoYb4a9Invb/YbER/LvmWO X-Received: by 2002:a05:6402:2713:b0:427:d414:3bf6 with SMTP id y19-20020a056402271300b00427d4143bf6mr6898850edd.180.1652985153474; Thu, 19 May 2022 11:32:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652985153; cv=none; d=google.com; s=arc-20160816; b=qEYU9TfhUCTSPXwjxgOOaD8dq10gGp6GtQR5M00W9gcRJZoAWAuyouC2cL7N9OItF5 7db+X+cU1v6Q58EVtd4AEzrb58PYrckTtXf6LVBKN+AlMCytbBRoAyPtGo0lshFwixT2 EFNg8AXqA/3Ca/lm2uF2zgJIHKm0h5nUtO2WuXVltI3o+oK7yJjkf6iPv1iWZNN1XQFU 0BIggF9dKrjt5etuoC/Y3r2ctZ61VM5GN1sHSM9mLplMQXdGpt6kXfv+ZYSE18v7H7gy cv9ZLhbIow1u+uzbzr+JNO4skPtm7kZIh4XA13NbXwVtrjCgbdXxmJrgL1jeaVBP/6OB 46tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=G6YuboORwpMKH3kgsyEnDpX5q6QVLrgo6p9d80QaHps=; b=m8+fqaQEWgnaSjAOLEoTBGsG3y0Ax0zCIAiLS3KKGE5SHCOFC3HWLjZntC2VpcE/F+ p06IL0FLL1IZZWe2QStKhCWfyGgeYQ8+YdmOqL09sjwilDJGOStr6FB8J2QDlwaxo/67 rbMkhedXiTXGmqzOW9ZG004gJ9MdiaVjFS9q502nimVsDG0+73cfhEihLsCUvY5TkkbH 7NyAOz8wgRbU9Lh4HPXfcnhjXfzRMNjwAHTvEfVi0GHUeL8dAwEWNOUTw3lgQjXU3QsB MLuuI1+kAZ1iIFc12Xmkp3gEGqSqe/LVaWXh8rTAEi0Pm9umNDTb2xz4DmZbJm5ramMV 5anQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=YYNlshkU; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id vw6-20020a170907058600b006df76385d22si5267020ejb.450.2022.05.19.11.32.05; Thu, 19 May 2022 11:32:33 -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=@ffwll.ch header.s=google header.b=YYNlshkU; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238321AbiESNFV (ORCPT + 99 others); Thu, 19 May 2022 09:05:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238401AbiESNFP (ORCPT ); Thu, 19 May 2022 09:05:15 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34FFA67D2D for ; Thu, 19 May 2022 06:05:13 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id gi33so1345430ejc.3 for ; Thu, 19 May 2022 06:05:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=G6YuboORwpMKH3kgsyEnDpX5q6QVLrgo6p9d80QaHps=; b=YYNlshkULZlPppbaPR9vg+3EosYT54w3fmA/4GYTKYu9YiGQqfWQ7gED6aDJlEqzFs Og/0BsuIk9qG4mm9Vo+XjvvQU+gFRVxnL8uCtLTBZ9jRBSV2UqIlDbSG7dcLfEmqUK/Q b3fHfRY6zuCp1MZEM3Av1VGeSKj7DqF0v/BT0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to; bh=G6YuboORwpMKH3kgsyEnDpX5q6QVLrgo6p9d80QaHps=; b=KKujMPnoV0U38TScHLBWip8ZJ6gDS6QkQ6zn+2Ws139dW483ffbVN6fe3XI0xmpKoY ZM/cVptjzvtdBc2I1DzMidqBWm93N/3C0shx0ifmP07FWuLp0mpn3SS7h0skmprVo8WL tDd0ivUknktYolGwFdWhPNAVH+42orl2VIkjMltI9zLBPVbux28N2b8uAyaxF7LtJNRF dtftbMMxgTCmIVLb/HeChznmXAX5M4JqWdnBYL6eiP/K1hGnrN9xaeouZe14DeH2gWPJ wnJByP3nLurcmSEQsD3oTeNJwvxZHB3MiawwdgrAeLHBBUJAudLKx3+KV+6lfWSQJ9GI +bgQ== X-Gm-Message-State: AOAM531qdq3V37Vw05TJElUzhjjjxsqK+wqhH5ti0SYVxzlbx6zQeQqR yN+3/nQhvTvSmz1YuW+K/htEcw== X-Received: by 2002:a17:906:c113:b0:6f8:faee:2f22 with SMTP id do19-20020a170906c11300b006f8faee2f22mr4145202ejc.447.1652965511208; Thu, 19 May 2022 06:05:11 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id c62-20020a509fc4000000b0042aae3f282esm2842868edf.65.2022.05.19.06.05.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 May 2022 06:05:10 -0700 (PDT) Date: Thu, 19 May 2022 15:05:08 +0200 From: Daniel Vetter To: Randy Dunlap Cc: Borislav Petkov , LKML , David Airlie , Daniel Vetter , Alex Deucher , dri-devel@lists.freedesktop.org Subject: Re: [PATCH 04/11] drm/r128: Fix undefined behavior due to shift overflowing the constant Message-ID: Mail-Followup-To: Randy Dunlap , Borislav Petkov , LKML , David Airlie , Alex Deucher , dri-devel@lists.freedesktop.org References: <20220405151517.29753-1-bp@alien8.de> <20220405151517.29753-5-bp@alien8.de> <04ff7802-c87a-2ea2-156e-c437446bc072@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <04ff7802-c87a-2ea2-156e-c437446bc072@infradead.org> X-Operating-System: Linux phenom 5.10.0-8-amd64 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,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 Mon, Apr 25, 2022 at 11:46:53AM -0700, Randy Dunlap wrote: > > > On 4/5/22 08:15, Borislav Petkov wrote: > > 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 > > Reviewed-by: Randy Dunlap Pushed to drm-misc-next, thanks for patch&review. -Daniel > > Thanks. > > > --- > > 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 > > -- > ~Randy -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch