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 3584FA034F for ; Wed, 10 Nov 2021 07:51:46 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 26A264014D; Wed, 10 Nov 2021 07:51:46 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2043.outbound.protection.outlook.com [40.107.236.43]) by mails.dpdk.org (Postfix) with ESMTP id A5F6440142 for ; Wed, 10 Nov 2021 07:51:44 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=acEpK4IlhnjrqOAk0W2kVWVqpbfCIoPklDpSPj544ZFP/hnS9IhaJztbcHbHhQ5g7X5mE66CskN/6NBBm5bWhvlJDpESF8ikoGRRVq0Q0CgA8FExlsbFfq0fbuhEb2bFV7IQ3k95uw1uB7tsBgbhTbGd5P+cNOTwd6UE0mnYDsGG6lJBTIwfTdNDGAtArO2XRU27PhTkW9HOetOnZzJd/6fQMvbCPdbsTGlan2mRmfRPnIfE9bSUnaFTwspX/dmqaxiWXsI0hEnaQHPwBBJ5ZhqRAEpIJPwilX8L2gHt9jKwLw/yH4NcOoJQJMTAXAaV+AHMJCmF2qmtPymuE8Bf2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aNMIB/Ur7Wpi0bO1/mT8BmGYF5kpcFpX//fiUczF1vs=; b=Q6fBUD63JtKMYgQ8S/1Suvy5Qw72B1w8xKRpzsl5z4BRh4OUswCsMtR/DWDxkTZsZA4JzQZ7tPCnYU+E08n09wDWhWqC6QH5OEphXHJhWzrGCCNJrF2q841q26Uwrf2idK7mBzD8xVjBnhjxo9fk7DagwNLjShrxpdYLDU3BTMwupDtb1Ns8ohRdYFKA1Xtt/3iayaslvEap6SASwTh2ld77ppy3UwwHlErNzO+a0phdzC4lnb0en5NHWgnvPVkNFJDdjqWbSeaHvQ6lKQreNhwd+0QWDwW6ksJ65lWxnkyndZnE/H1Ld2kXB1cEiYKwsMyHUOJ+wPj+rvON/ImSEA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aNMIB/Ur7Wpi0bO1/mT8BmGYF5kpcFpX//fiUczF1vs=; b=Abz1olbc9AHu1MgHBot4bpZFRFODvppjRBLZiEk1piR0RO2ACXptlpksEr1rtPtLonSH/SZ2JHy5Rc51KVtZwc9mR163HB1MFijnqdovgevGned+gtQaPgnl5qnNP4jjZDYdQc6cbIohmc0x1dBBsfdQqcj9G0lu6oiepj6S30DPDYM8gG/TUJ4SwxAIwZYuv02MKI+y1OL6ojr4ffplKEP57cXSZEmAFzakryp14erWdXkBQHKTTlW26rYLjbxefOzN/8Og9+pZ3Jz43/T7kPtBHHjAQ3sztK5Qmv/2lIg816M5V74ckD8DbGA8IL/yBeLFw0tJaqQe5WoDc6BoXQ== Received: from BN6PR11CA0062.namprd11.prod.outlook.com (2603:10b6:404:f7::24) by MWHPR1201MB0224.namprd12.prod.outlook.com (2603:10b6:301:55::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.15; Wed, 10 Nov 2021 06:51:42 +0000 Received: from BN8NAM11FT065.eop-nam11.prod.protection.outlook.com (2603:10b6:404:f7:cafe::ee) by BN6PR11CA0062.outlook.office365.com (2603:10b6:404:f7::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Wed, 10 Nov 2021 06:51:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT065.mail.protection.outlook.com (10.13.177.63) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:51:42 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 06:51:38 +0000 From: Xueming Li To: Stephen Hemminger CC: Luca Boccassi , Konstantin Ananyev , dpdk stable Date: Wed, 10 Nov 2021 14:30:56 +0800 Message-ID: <20211110063216.2744012-173-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6f0d3321-171f-465a-dc79-08d9a4168dad X-MS-TrafficTypeDiagnostic: MWHPR1201MB0224: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bbFD1s+qZbU8GM5nnqK2qks7UQbjn/YcLr+LfLgsxhvCFtFJr9Sa0C7iJnaSHOG5JrGnceVti7zlsJ5Wi00mkn6hNaciHZFT3W02lEgMqoThzhJRfeQGvGrTaDdYUqZseOWqFvk1KRu11YL+YhJbFacdanJiv+nwLISWdjk4qFDh7UDl6ZAV3j7Adgxra8VycwAsxjp4fmIwQTHs9Aw9dtxKzLLbLXMCsziLocGJgxxwUrh8Zi7K1kevJFscSHIZXaQH2BfEgmoBKMPf4Fir+KZWX4Nnzfm/q11chNC++DtAKiOVbZbbw88lOVA2lN6Rj2yM2xvzkYFpU27bOr8jIRNNxObng9cvytr2YWjyWoY0MlcfJxn47W18oMTrQ3aO8Iwg1MTxwfEq3U0AR6fAiS1Z2dpHXyLYZCVqNSGPQQXew6SrjDP3QCfsWz+cqeAE9dkRH8nvcabzyaswLEwZ9FWV2qBCzdLXpqWKXqIkBW+7fs7K9hzCDitOr9nFBWpQ5LYScTWgn/l0k5ek7gYv+ABzn0LoeGCbWsTeo2OC65Fz5juVN7Astb9rMHT8wOFPbuuThC7gKFnU0YFJV41rd1QsW3Fm57Izblh5gOempuDMea9XzWWbZLnV5A6lizm7uY4B2yPXva3emAdpwnk0iWa0Ts6fHJwZjcLwgrUQsj/j2sxMeX5rlwRg6AyG2kC5DD38GFhE7YTu1alRFO2FL0DZwp7Eshho2C+ma0eBjKI6s86xccJM8PMdiJK9OUv/hVZA1hraMInCkdX7XyAQtm+hk7njU+Ovdk8AnPiiyJ461olyDdQaP+jUH8AC5x4pdlvkaQ2Oif6IFl7zduhGJQ== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(26005)(508600001)(7696005)(1076003)(336012)(4326008)(2616005)(6916009)(83380400001)(16526019)(55016002)(8676002)(186003)(53546011)(70206006)(47076005)(86362001)(36860700001)(70586007)(316002)(6286002)(8936002)(82310400003)(426003)(356005)(6666004)(7636003)(2906002)(36756003)(966005)(4001150100001)(54906003)(5660300002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:51:42.1134 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6f0d3321-171f-465a-dc79-08d9a4168dad X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT065.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB0224 Subject: [dpdk-stable] patch 'bpf: allow self-xor operation' has been queued to stable release 20.11.4 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/12/21. 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/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/97c39312a0e8972648e22b616fe1b3cbdde54ede Thanks. Xueming Li --- >From 97c39312a0e8972648e22b616fe1b3cbdde54ede Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 20 Oct 2021 14:42:27 -0700 Subject: [PATCH] bpf: allow self-xor operation Cc: Xueming Li [ upstream commit 80da61198b6be66ab16964eb0944c79c0325c40e ] Some BPF programs may use XOR of a register with itself as a way to zero register in one instruction. The BPF filter converter generates this in the prolog to the generated code. The BPF validator would not allow this because the value of register was undefined. But after this operation it always zero. Fixes: 8021917293d0 ("bpf: add extra validation for input BPF program") Acked-by: Konstantin Ananyev Signed-off-by: Stephen Hemminger --- lib/librte_bpf/bpf_validate.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/librte_bpf/bpf_validate.c b/lib/librte_bpf/bpf_validate.c index 7b1291b382..853279fee5 100644 --- a/lib/librte_bpf/bpf_validate.c +++ b/lib/librte_bpf/bpf_validate.c @@ -661,8 +661,15 @@ eval_alu(struct bpf_verifier *bvf, const struct ebpf_insn *ins) op = BPF_OP(ins->code); + /* Allow self-xor as way to zero register */ + if (op == BPF_XOR && BPF_SRC(ins->code) == BPF_X && + ins->src_reg == ins->dst_reg) { + eval_fill_imm(&rs, UINT64_MAX, 0); + eval_fill_imm(rd, UINT64_MAX, 0); + } + err = eval_defined((op != EBPF_MOV) ? rd : NULL, - (op != BPF_NEG) ? &rs : NULL); + (op != BPF_NEG) ? &rs : NULL); if (err != NULL) return err; -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:09.576681326 +0800 +++ 0172-bpf-allow-self-xor-operation.patch 2021-11-10 14:17:01.984078497 +0800 @@ -1 +1 @@ -From 80da61198b6be66ab16964eb0944c79c0325c40e Mon Sep 17 00:00:00 2001 +From 97c39312a0e8972648e22b616fe1b3cbdde54ede Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 80da61198b6be66ab16964eb0944c79c0325c40e ] @@ -15 +17,0 @@ -Cc: stable@dpdk.org @@ -20 +22 @@ - lib/bpf/bpf_validate.c | 9 ++++++++- + lib/librte_bpf/bpf_validate.c | 9 ++++++++- @@ -23 +25 @@ -diff --git a/lib/bpf/bpf_validate.c b/lib/bpf/bpf_validate.c +diff --git a/lib/librte_bpf/bpf_validate.c b/lib/librte_bpf/bpf_validate.c @@ -25,2 +27,2 @@ ---- a/lib/bpf/bpf_validate.c -+++ b/lib/bpf/bpf_validate.c +--- a/lib/librte_bpf/bpf_validate.c ++++ b/lib/librte_bpf/bpf_validate.c