From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 11E66A0C41 for ; Tue, 30 Nov 2021 17:39:08 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C3EB410F7; Tue, 30 Nov 2021 17:39:08 +0100 (CET) Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by mails.dpdk.org (Postfix) with ESMTP id C8698410F7 for ; Tue, 30 Nov 2021 17:39:06 +0100 (CET) Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id A7E3E3FFE1 for ; Tue, 30 Nov 2021 16:39:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638290346; bh=/wQmtXrFXptjYJ4CYE0WWGH+aCslFcfNwbpD4mzZ3Uo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=u6kINHqLsGJou1X0RlzccMrsGNAzVBS/vraVrHnzmUNvrP9j2B/TOBvZMx2McbgvE JRDFerYC7Wz1Wjj1Rth5evVHzVbNPKdErGiAQn258m6pHLt149c2Yl3j9I011KD69L aDBDZZfaIo7tge73paEgiVEJTSmP358RpbTPSJsDT/tZonudZwVFTaLFkWdrg2kfuP ZSLfch5j4VqiZTuS3m3/gGZS2Yy+3cI7s89NUfS8LEW8m0WKVOwNY0DC3qVs2d61fr Px4HWrRBhnKSaFUBK9ohZGgk1FMC4Hrc0Rgw3b9PW4JObWYnBC1jsW89/whxH172/w p+PaVdc7geSGA== Received: by mail-ed1-f69.google.com with SMTP id k7-20020aa7c387000000b003e7ed87fb31so17576443edq.3 for ; Tue, 30 Nov 2021 08:39:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/wQmtXrFXptjYJ4CYE0WWGH+aCslFcfNwbpD4mzZ3Uo=; b=SoW2CdkVzO2oN93QpphVHMspuJzpvgqC5SS3gPi7k0Hnp0nMeORdiEBEuufZ7l1fil CGZzcYqXHSwWYofLi6FE5ZwCFFtIqW15cGWLY3o0sBCGnqDDXAP8XIIu5rKW2eKwjtRA nMDJm3C7jXedGIp6gDgHgBm+pGqcjW1oPM4fAs1McSNnN7igONlzWxd7BbbtY8k8frj9 n3e5f9witNL14Cpy40R+xbLreVm1Coq2VClmgbd4vu0IrCFxk9vJgnCMXmFrKRXl8bZ9 NPfhnLjNr5sBNUnwvq7zTH5Ka/q2wSde2XDCzki41ywwwPW4suqffzbt5d8iHwz89tKn yI5A== X-Gm-Message-State: AOAM532wETQi4Z2uSf2El1oTmd5FFAo+RfsKB99oXIzsHpYJ+yGk9vjZ nTriywBkGlIlflMXHTcd8Vt1m/oy2o7oqBPBj4tOlk6VR9SC+80VDwiU/QDH/rISvUz2je5cVv5 amjS4sCCLs7TpEys/2u8We+tx X-Received: by 2002:a17:907:60cf:: with SMTP id hv15mr144906ejc.561.1638290346352; Tue, 30 Nov 2021 08:39:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJwJ2AXS5XnAXylkhORVZSzNuwcsBJir4LVr2INv55JMju8ugIV4WJgklmw17aT0Ac5pR2vRaw== X-Received: by 2002:a17:907:60cf:: with SMTP id hv15mr144886ejc.561.1638290346208; Tue, 30 Nov 2021 08:39:06 -0800 (PST) Received: from localhost.localdomain ([2001:67c:1560:8007::aac:c4ad]) by smtp.gmail.com with ESMTPSA id v13sm9034212ejo.36.2021.11.30.08.39.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 08:39:05 -0800 (PST) From: christian.ehrhardt@canonical.com To: Gagandeep Singh Cc: Nipun Gupta , Hemant Agrawal , dpdk stable Subject: patch 'common/dpaax: fix physical address conversion' has been queued to stable release 19.11.11 Date: Tue, 30 Nov 2021 17:34:20 +0100 Message-Id: <20211130163605.2460997-56-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> References: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 19.11.11 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before December 10th 2021. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/7440bbb9450bdd51eff05de14fc18f430eade6f8 Thanks. Christian Ehrhardt --- >From 7440bbb9450bdd51eff05de14fc18f430eade6f8 Mon Sep 17 00:00:00 2001 From: Gagandeep Singh Date: Wed, 6 Oct 2021 22:31:31 +0530 Subject: [PATCH] common/dpaax: fix physical address conversion [ upstream commit c5e6bc12a319d4500d931ca84d4227e4d7495956 ] If some of the VA entries of table are somehow not populated and are NULL, it can add offset to NULL and return the invalid VA in PA to VA conversion. In this patch, adding a check if the VA entry has valid address only then add offset and return VA. Fixes: 2f3d633aa593 ("common/dpaax: add library for PA/VA translation table") Signed-off-by: Gagandeep Singh Signed-off-by: Nipun Gupta Acked-by: Hemant Agrawal --- drivers/common/dpaax/dpaax_iova_table.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/common/dpaax/dpaax_iova_table.h b/drivers/common/dpaax/dpaax_iova_table.h index fef97f6dde..599f5b842b 100644 --- a/drivers/common/dpaax/dpaax_iova_table.h +++ b/drivers/common/dpaax/dpaax_iova_table.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018 NXP + * Copyright 2018-2021 NXP */ #ifndef _DPAAX_IOVA_TABLE_H_ @@ -97,6 +97,12 @@ dpaax_iova_table_get_va(phys_addr_t paddr) { /* paddr > entry->start && paddr <= entry->(start+len) */ index = (paddr_align - entry[i].start)/DPAAX_MEM_SPLIT; + /* paddr is within range, but no vaddr entry ever written + * at index + */ + if ((void *)(uintptr_t)entry[i].pages[index] == NULL) + return NULL; + vaddr = (void *)((uintptr_t)entry[i].pages[index] + offset); break; } while (1); -- 2.34.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-30 16:50:09.291226713 +0100 +++ 0056-common-dpaax-fix-physical-address-conversion.patch 2021-11-30 16:50:05.706872913 +0100 @@ -1 +1 @@ -From c5e6bc12a319d4500d931ca84d4227e4d7495956 Mon Sep 17 00:00:00 2001 +From 7440bbb9450bdd51eff05de14fc18f430eade6f8 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit c5e6bc12a319d4500d931ca84d4227e4d7495956 ] + @@ -14 +15,0 @@ -Cc: stable@dpdk.org @@ -24 +25 @@ -index 230fba8ba0..b1f2300c52 100644 +index fef97f6dde..599f5b842b 100644 @@ -34 +35 @@ -@@ -101,6 +101,12 @@ dpaax_iova_table_get_va(phys_addr_t paddr) { +@@ -97,6 +97,12 @@ dpaax_iova_table_get_va(phys_addr_t paddr) {