From patchwork Fri Oct 21 19:13:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 6949 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp864420wrr; Fri, 21 Oct 2022 12:19:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM66Kfu8asxBgUgNuMBIVi4mKYHjpD7ZFM7Di2sHXOfUgoGJyfZI06tmrLUIBHGdJy2FZ7zR X-Received: by 2002:aa7:de9a:0:b0:44d:8191:44c5 with SMTP id j26-20020aa7de9a000000b0044d819144c5mr18535165edv.232.1666379943304; Fri, 21 Oct 2022 12:19:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666379943; cv=none; d=google.com; s=arc-20160816; b=si2Mm7/izChOrp5webeKO92RxHLjegd6Ujn9lFgpHaRDBBkKT8xbujle2hEDJ//vPZ OknvbvuUxZTZg8Rud1tvjTlw9W9g7/35U5LWE1W/q6pmWC4XTpWXIKMdo345++RhljS1 cSN8mxqE8Guju5Oy7qEb2hdMX5b186licmUkfkqkwEV4cOxrvL9nbrO2rE/pomrijdAM enhckaUXsWmLnGoHLpTgY0o/HXD0UvI9h6mdXFGYenG7AYJQmu3tgaODqbCUTd1bNIgn yMmMyks06sjZv63/h1791U+Z/c4RiqUyKnFyMtAjxx1Bo82wzWOcmYPpcVgaFcTLP1Mu zXFw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds1-20020a170907724100b00757bd7f53dcsi18988996ejc.14.2022.10.21.12.18.38; Fri, 21 Oct 2022 12:19:03 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747326015267391390?= X-GMAIL-MSGID: =?utf-8?q?1747326015267391390?= 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; }