Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1378953rwl; Wed, 12 Apr 2023 11:53:22 -0700 (PDT) X-Google-Smtp-Source: AKy350Yed2Brn2WynaG48VqyGka4cP0FnIjd9sX/TzKOuI7Mb7r+/RR+N8l73IXFiaWprmjpbfr7 X-Received: by 2002:a17:906:95d7:b0:94a:a556:c570 with SMTP id n23-20020a17090695d700b0094aa556c570mr2855403ejy.66.1681325602250; Wed, 12 Apr 2023 11:53:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681325602; cv=none; d=google.com; s=arc-20160816; b=rLrX9WlUJywNui47+wtDuvLiTwDdi1kRGKUPYD5YHYEM3c/31wolVV+Z1yWK9SFp6i W9zF+6bamj9hRV4vpRcnXF8Q62eZeV1DAKw8P5jJEvhN0iINgrCXEi20Lcys+nxcCDBk 1dFGf+uYGOjhgkW0zmegdvEdeprHdfG6Myktg6+m13mnVmoHlKc1EN830R7dPuKPB+GP dx+aMo5fHKZBzi/lyzV2utRVh7qitM4QxsqTl9mkoBLrgY+g4ZEACmqj800RpmqjgjKM HRMf2B/CfQjgIeORomWb0P+kZsxIlU2geKEOpr//f1hTKAetgFOtPcRFoybELp5Eq+Wj gwZw== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=CbuRkiMykD92eGamnRgPdOjOB7wldjx/vp/fclRkHbw=; b=BeaxRNkuIXbnd/idXMRZqHPNT6VsS+yPBsFaI/4R0QiLpF9rrCd5w9j6n5mxwLg7jP niNAGmkSC9yI/5NAJFCik97jynnbJmCAKovkIrfUnDAUyVlHkHviMAJJrWHnWaARNW1q VMqBuIt4mIU+ntjom7Wy6QKpiFr2NqYc3gCLRjVAGISXOVAqOjsn4pf6D5IvuPVCccck sdF4uCuJbOWMr+v29WgGAjQePWli7xM+ql3GLk/da4j5O1+bLFNkupyIvckSVa0AoNTy Add7lvsXBnYSYoyFHD8/iuHfm6ohtUiEao0jlgbOw/kAX12JT8xRUwQoEwRZ58O29+8G q5kQ== ARC-Authentication-Results: i=1; mx.google.com; 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 z17-20020a170906271100b008e0363188e3si14159231ejc.953.2023.04.12.11.52.57; Wed, 12 Apr 2023 11:53:22 -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; 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 S229762AbjDLSvI (ORCPT + 99 others); Wed, 12 Apr 2023 14:51:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229799AbjDLSvH (ORCPT ); Wed, 12 Apr 2023 14:51:07 -0400 Received: from relay01.th.seeweb.it (relay01.th.seeweb.it [5.144.164.162]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C60459D3 for ; Wed, 12 Apr 2023 11:50:55 -0700 (PDT) Received: from SoMainline.org (94-211-6-86.cable.dynamic.v4.ziggo.nl [94.211.6.86]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r1.th.seeweb.it (Postfix) with ESMTPSA id BFAD320251; Wed, 12 Apr 2023 20:50:53 +0200 (CEST) Date: Wed, 12 Apr 2023 20:50:51 +0200 From: Marijn Suijten To: Abhinav Kumar Cc: Dmitry Baryshkov , Kuogee Hsieh , freedreno@lists.freedesktop.org, quic_sbillaka@quicinc.com, airlied@gmail.com, andersson@kernel.org, robdclark@gmail.com, dri-devel@lists.freedesktop.org, dianders@chromium.org, vkoul@kernel.org, agross@kernel.org, daniel@ffwll.ch, linux-arm-msm@vger.kernel.org, swboyd@chromium.org, sean@poorly.run, linux-kernel@vger.kernel.org Subject: Re: [Freedreno] [PATCH] drm/msm/dpu: add DSC range checking during resource reservation Message-ID: References: <1681247380-1607-1-git-send-email-quic_khsieh@quicinc.com> <96416911-bca3-b007-b036-1c4463e83aaa@quicinc.com> <24c5aa23-9b3c-787c-10aa-e9d5ad91512b@linaro.org> <49479b93-b364-d882-7a77-08223a94ed36@quicinc.com> <8310d7ce-7ac0-05a6-b95a-c18a498f7644@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8310d7ce-7ac0-05a6-b95a-c18a498f7644@quicinc.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 2023-04-12 10:48:18, Abhinav Kumar wrote: [..] > > The only way to trigger this newly introduced range check is by omitting > > the DSC_x constants and manually writing e.g. an out-of-range value 10 > > here, or setting DSC_NONE. This is only allowed for interfaces. > > > > Correct, its just working on an implicit understanding that the indices > in the catalog .. this sentence appears to be incomplete: what did you want to say? .. > which might still be right stick to the RM limits. > > Thats why this is not bad to have. What do you mean by "RM limits"? We have constants in the kernel that both define the maximum number of blocks in these arrays and a predefined set of ids that block can have. These are all used in constant structs in the catalog, so there's nothing "software" or SoC-specific limiting about this (except what is available in the arrays). [..] > I think kuogee just added this to keep it consistent with other checks > present in the RM. So I didnt see any harm with that. Yep, that's the only reason > If he did see an issue, i will let him report that here. If so an out-of-bounds constant was hardcoded in dpu_hw_catalog.c. > Otherwise, I dont want to spend more time discussing this bounds check > when other blocks already have it. I'll whip up a patch to clear out the extraneous lookup (assuming there is no other reason/dependency for it to be there...) and can follow that up with removing these range checks of known-good values in `const struct` fields. - Marijn