From patchwork Sat Oct 28 03:47:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cengiz Can X-Patchwork-Id: 1856464 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SHQWC1mwBz1yQ5 for ; Sat, 28 Oct 2023 14:48:55 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1qwaJS-0006pa-0K; Sat, 28 Oct 2023 03:48:38 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1qwaJ5-0006nO-6d for kernel-team@lists.ubuntu.com; Sat, 28 Oct 2023 03:48:15 +0000 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (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-0.canonical.com (Postfix) with ESMTPS id CC5203F6AE for ; Sat, 28 Oct 2023 03:48:14 +0000 (UTC) Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-3f41a04a297so20153075e9.3 for ; Fri, 27 Oct 2023 20:48:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698464893; x=1699069693; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xtPgSwccwChL/mxNH+DvNHJ78uJggLc86gZQFW5AEQ0=; b=hlCuYETj2JM5GVyxe2n2+8zNxpqpxTNGVZGDjrE0xah6NIq5OEdPQbV81jzHchxrMY 3Zllx4qR7mtvqHLvZsITQhsKQsz+IQEl2+tR3loLIn1xVs6tQwlyVPcLlAjV06HCHncS BwEdY7ReR1a2DQOQfv8THpqvxTzJ1HpQ01TgSip0lkQWWs+7KASXgUv1O8A14rjzMCsw 9DXNyFngPdKagpjhp8DKvOpDHEZIlboogg1SWNGnL6Ahyd0RzS31Mdwyg0+bTcP9Kr68 vDJh9dTpbpY5/ewVyCIdyw6bUp1IzKH8zSzUY9NaVXgNTQhtDx2mFcnYjNozpqT7HNFl THXA== X-Gm-Message-State: AOJu0YyPF6TDMTQS1l91SruPZ64B2yLfXfr+dR0d44vgtFRjC2+xcLWR L541zBZlVwwV0VQVLpLVImxIoi/UZpsStfwRsfP+acE7BNw6I0kqr5MxZShngD8OO05WaimxoFf 2iFg/ygRxDgHZ5OkqWuZixc7czap8870SgATigug4YVsRZVnKONd2vvQ= X-Received: by 2002:a05:600c:5251:b0:409:247b:b0ae with SMTP id fc17-20020a05600c525100b00409247bb0aemr3400967wmb.36.1698464893602; Fri, 27 Oct 2023 20:48:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEUFd2tvdKZMvl6Yzsp1HGx0j79hEY6MMlaSEDsrxZV/WicNHl0OrEdd+38gXXkMpbUhDlXwQ== X-Received: by 2002:a05:600c:5251:b0:409:247b:b0ae with SMTP id fc17-20020a05600c525100b00409247bb0aemr3400961wmb.36.1698464893087; Fri, 27 Oct 2023 20:48:13 -0700 (PDT) Received: from localhost (uk.sesame.canonical.com. [185.125.190.60]) by smtp.gmail.com with ESMTPSA id fc7-20020a05600c524700b00405391f485fsm3014832wmb.41.2023.10.27.20.48.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 20:48:12 -0700 (PDT) From: Cengiz Can To: kernel-team@lists.ubuntu.com Subject: [SRU Jammy 1/9] RDMA/irdma: Remove irdma_uk_mw_bind() Date: Sat, 28 Oct 2023 06:47:46 +0300 Message-Id: <20231028034754.887090-2-cengiz.can@canonical.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231028034754.887090-1-cengiz.can@canonical.com> References: <20231028034754.887090-1-cengiz.can@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Zhu Yanjun The function irdma_uk_mw_bind is not used. So remove it. Link: https://lore.kernel.org/r/20211011110128.4057-2-yanjun.zhu@linux.dev Signed-off-by: Zhu Yanjun Acked-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe (cherry picked from commit 0bed5dfa5af8304c99962aa713a9ecd67ee52cb8) CVE-2023-25775 [cengizcan: prerequisite commit] Signed-off-by: Cengiz Can --- drivers/infiniband/hw/irdma/uk.c | 57 ------------------------------ drivers/infiniband/hw/irdma/user.h | 4 +-- 2 files changed, 1 insertion(+), 60 deletions(-) diff --git a/drivers/infiniband/hw/irdma/uk.c b/drivers/infiniband/hw/irdma/uk.c index 4b00a9adbe3a..36d0a76cdfc9 100644 --- a/drivers/infiniband/hw/irdma/uk.c +++ b/drivers/infiniband/hw/irdma/uk.c @@ -869,63 +869,6 @@ irdma_uk_stag_local_invalidate(struct irdma_qp_uk *qp, return 0; } -/** - * irdma_uk_mw_bind - bind Memory Window - * @qp: hw qp ptr - * @info: post sq information - * @post_sq: flag to post sq - */ -enum irdma_status_code irdma_uk_mw_bind(struct irdma_qp_uk *qp, - struct irdma_post_sq_info *info, - bool post_sq) -{ - __le64 *wqe; - struct irdma_bind_window *op_info; - u64 hdr; - u32 wqe_idx; - bool local_fence = false; - - info->push_wqe = qp->push_db ? true : false; - op_info = &info->op.bind_window; - local_fence |= info->local_fence; - - wqe = irdma_qp_get_next_send_wqe(qp, &wqe_idx, IRDMA_QP_WQE_MIN_QUANTA, - 0, info); - if (!wqe) - return IRDMA_ERR_QP_TOOMANY_WRS_POSTED; - - irdma_clr_wqes(qp, wqe_idx); - - qp->wqe_ops.iw_set_mw_bind_wqe(wqe, op_info); - - hdr = FIELD_PREP(IRDMAQPSQ_OPCODE, IRDMA_OP_TYPE_BIND_MW) | - FIELD_PREP(IRDMAQPSQ_STAGRIGHTS, - ((op_info->ena_reads << 2) | (op_info->ena_writes << 3))) | - FIELD_PREP(IRDMAQPSQ_VABASEDTO, - (op_info->addressing_type == IRDMA_ADDR_TYPE_VA_BASED ? 1 : 0)) | - FIELD_PREP(IRDMAQPSQ_MEMWINDOWTYPE, - (op_info->mem_window_type_1 ? 1 : 0)) | - FIELD_PREP(IRDMAQPSQ_PUSHWQE, info->push_wqe) | - FIELD_PREP(IRDMAQPSQ_READFENCE, info->read_fence) | - FIELD_PREP(IRDMAQPSQ_LOCALFENCE, local_fence) | - FIELD_PREP(IRDMAQPSQ_SIGCOMPL, info->signaled) | - FIELD_PREP(IRDMAQPSQ_VALID, qp->swqe_polarity); - - dma_wmb(); /* make sure WQE is populated before valid bit is set */ - - set_64bit_val(wqe, 24, hdr); - - if (info->push_wqe) { - irdma_qp_push_wqe(qp, wqe, IRDMA_QP_WQE_MIN_QUANTA, wqe_idx, - post_sq); - } else { - if (post_sq) - irdma_uk_qp_post_wr(qp); - } - - return 0; -} - /** * irdma_uk_post_receive - post receive wqe * @qp: hw qp ptr diff --git a/drivers/infiniband/hw/irdma/user.h b/drivers/infiniband/hw/irdma/user.h index 7c3cb4288969..e38d878f8ba2 100644 --- a/drivers/infiniband/hw/irdma/user.h +++ b/drivers/infiniband/hw/irdma/user.h @@ -284,9 +284,7 @@ enum irdma_status_code irdma_uk_inline_rdma_write(struct irdma_qp_uk *qp, enum irdma_status_code irdma_uk_inline_send(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, bool post_sq); -enum irdma_status_code irdma_uk_mw_bind(struct irdma_qp_uk *qp, - struct irdma_post_sq_info *info, - bool post_sq); + enum irdma_status_code irdma_uk_post_nop(struct irdma_qp_uk *qp, u64 wr_id, bool signaled, bool post_sq); enum irdma_status_code irdma_uk_post_receive(struct irdma_qp_uk *qp,