Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3177371rwi; Fri, 21 Oct 2022 12:37:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7XtGU0EwopYabwNX89E9swdNe1K6tmjY0w6D2RKC41dtlrcl6XquZ3I+c5iBlpLP3xn3G8 X-Received: by 2002:a17:907:970b:b0:78d:8d70:e4e8 with SMTP id jg11-20020a170907970b00b0078d8d70e4e8mr16414135ejc.614.1666381060222; Fri, 21 Oct 2022 12:37:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666381060; cv=none; d=google.com; s=arc-20160816; b=GP+2BVfqlKt+1SDwgtM6VUNsrbV4XmfdSHIgr0Bkp6wV8M4p7myflEsqv060hI7dOl 9iSPTHu5oyHTIyD6aGU/wOiXq4Y8WGClyEVY4ytODZcBHMODb9e11BpHcr/xaP8PFh3h 1LHslNWOH5CWUyx0KQqUXdmvc8NO15CIdM5Jbt/+v0q5oVjYlVS+LHbPYW52lmv0vdK7 u2CG0qa1ldQdZcCBrr/4tyx2n0Oko5oJRQ11sDWjE9w/Fe4ztXAHSG3Xb7AYkf71tbZh yoHqBDpaDv7W1hpR3NFV2bldAdlcp/uSxuf1dY6RRB6UuEpTw9WFBz2O6oowXmv4qsrE jdJw== 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=DwurrB7qdNkMpnWeG+ha/LhhiXkd7fDsKvUQoo9Dexw=; b=ADZV32Dk0WCMbrqmwmpM0UINYJuFIru0zc7+qY79EolhDNGLEsdE1JzNaJJ438L3Yj OAplVjEIjtJYrBavgMYxTCTjO7OPYbAJSjUiW7X/BM+CoOcB5eV4IFoJhd7KfwnWdlOY oyOWTfTvQ9u3ekGtsg/HESRGyaLY7bn/oW92s6ssQMz2q8fga0Tfc4lG+V5s+FGjtYnK a6kf0UCU6y77a8K23X1bYlt2G3YtG8LnbvpQbcyY4FxeO1DnImlh023t+Kbt5e2H9frY DBkDAnx9HU3DXAyLuuuzCM84dizkyaD5fTSKDvBRMVH5EeFzQjk1brR6iw8VbZCayQGS TfIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GBbpot0z; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j12-20020a05640211cc00b0045878af0adbsi20551181edw.393.2022.10.21.12.37.14; Fri, 21 Oct 2022 12:37:40 -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=@linaro.org header.s=google header.b=GBbpot0z; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230364AbiJUTN4 (ORCPT + 99 others); Fri, 21 Oct 2022 15:13:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230207AbiJUTNt (ORCPT ); Fri, 21 Oct 2022 15:13:49 -0400 Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 715D515A8E2 for ; Fri, 21 Oct 2022 12:13:48 -0700 (PDT) Received: by mail-io1-xd2e.google.com with SMTP id o65so3137933iof.4 for ; Fri, 21 Oct 2022 12:13:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DwurrB7qdNkMpnWeG+ha/LhhiXkd7fDsKvUQoo9Dexw=; b=GBbpot0zp4+XeMgKSqEiFGsGVvyxt8vtlPZJfrtB3MbianLPzdG3fvyx8gmq+A1eiK F4L/j1yYMM0+nGOKtHn7qj1X6GNE/ZvCE4wdz4VA0ZMaiVURkF1XxVzWHNlNW1FYAbDu iqcGFuF08cIhPA0Xm+QfUiQuLJZPb2SIYPwqoqoqHRUrI8zmt7mt41q8xOE2m25OfLBR rFPFHSnHzeSt7ap5bolW/T2ccHm85XACIHUehjyR1NntmJym1N/p6a1t2473aw9Z+H1W E1vfYvdxYpolHCIOCdZH6o9nhyDv13v4JL6306T+B2B+YITr3FZQvUp0bYzCR8vTOL5e Mp1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DwurrB7qdNkMpnWeG+ha/LhhiXkd7fDsKvUQoo9Dexw=; b=z2hDqDfdClHo7HV+eYlupi19dB65hhD9WBdK6f0f/XYCHkrz0V4I5du0GToPZ8JWt4 lco9owsSoX0MjsEblIT551rM+1agbk5r85lEvQFqtMXJRjiHwpTJCIOejXj05EQsXUH8 sL6qxSQy00Tg0jiOVP8Bc3j1xAwI7ITcyshkvMI5uQGN4DzgiSocjMrTM4yp3I1tvCIB AdAWrVdxUx78/Opdyy2rxAWcCD88C8vZpiOP5u4friVB1P4ICO1DLxqhTwuKXYUVNxWh O3HoFQWlGxYDW6U4Y6nqel29l4SB8T3NYxCxO2GQhjHWm1SyOfuG1e0Mt9cOSFpjFhOz brMA== X-Gm-Message-State: ACrzQf1sOn6KbokhdVyopqOOZa+TvgI/Xto9CXqw9GoAd9TJ8HnRBM2m IBQaO0/I/ENakAvobgajwUPFgA== X-Received: by 2002:a05:6638:4304:b0:343:5953:5fc8 with SMTP id bt4-20020a056638430400b0034359535fc8mr14970008jab.123.1666379627832; Fri, 21 Oct 2022 12:13:47 -0700 (PDT) Received: from presto.localdomain ([98.61.227.136]) by smtp.gmail.com with ESMTPSA id e3-20020a022103000000b00363c68aa348sm4439362jaa.72.2022.10.21.12.13.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:13:47 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@chromium.org, evgreen@chromium.org, andersson@kernel.org, quic_cpratapa@quicinc.com, quic_avuyyuru@quicinc.com, quic_jponduru@quicinc.com, quic_subashab@quicinc.com, elder@kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 2/7] net: ipa: remove two memory region checks Date: Fri, 21 Oct 2022 14:13:35 -0500 Message-Id: <20221021191340.4187935-3-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221021191340.4187935-1-elder@linaro.org> References: <20221021191340.4187935-1-elder@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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_PASS,URIBL_BLOCKED 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 There's no need to ensure table memory regions fit within the IPA-local memory range. And there's no need to ensure the modem header memory region is in range either. These are verified for all memory regions in ipa_mem_size_valid(), once we have settled on the size of IPA memory. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_cmd.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/drivers/net/ipa/ipa_cmd.c b/drivers/net/ipa/ipa_cmd.c index 26c3db9f52b18..e46e8f80b1743 100644 --- a/drivers/net/ipa/ipa_cmd.c +++ b/drivers/net/ipa/ipa_cmd.c @@ -197,16 +197,6 @@ bool ipa_cmd_table_valid(struct ipa *ipa, const struct ipa_mem *mem, bool route) return false; } - /* Entire memory range must fit within IPA-local memory */ - if (mem->offset > ipa->mem_size || - mem->size > ipa->mem_size - mem->offset) { - dev_err(dev, "%s table region out of range\n", table); - dev_err(dev, " (0x%04x + 0x%04x > 0x%04x)\n", - mem->offset, mem->size, ipa->mem_size); - - return false; - } - return true; } @@ -257,15 +247,6 @@ static bool ipa_cmd_header_valid(struct ipa *ipa) return false; } - /* Make sure the entire combined area fits in IPA memory */ - if (size > ipa->mem_size || offset > ipa->mem_size - size) { - dev_err(dev, "header table region out of range\n"); - dev_err(dev, " (0x%04x + 0x%04x > 0x%04x)\n", - offset, size, ipa->mem_size); - - return false; - } - return true; } -- 2.34.1