From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.197 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796002407; b=hifmtCdGI3xoq3n7BMOJ66GKkZAAY5M+yMxdOHE6igv7KuiVy87hY6E9VAyhcLDgS12u pRwLnHnwM2j5FmZQFx+fAFV0fltk0IAhkxQ4ti6nZGXDg1k96b59LxbbdS6YyZIllIi7i +Lm3vMWDxCbVCuq0N1wRjVJFf6jIr8aGIxD+kc9wbcGy5uAt0C+2AhSJ4Vm+rC4j/cqw/ COEoN9LWDx55CEA638cMcPOc5dcaT2bgcoLN8oT86LOVcE2qGUXjuxqESj4Wo8BjZCfXF p3ilEl6co+zXhug3mXsGO4WaOunD66AzO5SXji23PfUdo8K1n8G34/+hM/Gn40a2VTw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796002407; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Received:Date:In-Reply-To:Mime-Version: References:X-Mailer:Message-ID:Subject:From:To:Cc:Content-Type; bh=/in6sTmdfXhpqv4ittDFmgtHm6oGvIkrxlilRB0l2iA=; b=BEcyalX9dxQt78cIxDKCBQ2WZz+3FaBPNI197c+qP/Q4ZY/lri0fHa/KFjOdzOydLemm 2v3d0EKt6WiHwoGza746b8YIUhn6vI7nN6XbuL/4Duc0+W3R5YqQSQC/cm65A6S9w/ge6 HigMnVVEx3pKyiAwSyTeqSMNtBmmKkIUat4sAQB/KIC3dDSx4I9tp/FdAPyFHhwbwpIyt 1GJoeCbn/DxD67j2EueD4vLWGqMXFwN95+L5+JzRI4pV2xrggNrxr7faLAdShfHbxrmSU LTULdGfqGiTmLfYMVw95OktpgxqGABjYPxaZ9QdwY+lNhRVWRCTOYinTejlUtZFmAXA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--jmoroni.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=qP76rd3i; arc=none smtp.remote-ip=209.85.128.197 Received: from mail-yw1-f197.google.com (mail-yw1-f197.google.com [209.85.128.197]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 699D8606A31C for ; Mon, 30 Nov 2026 01:33:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 699D8606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jmoroni.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=qP76rd3i Received: by mail-yw1-f197.google.com with SMTP id 00721157ae682-8b4bfc0b441so125899777b3.2 for ; Sun, 29 Nov 2026 17:33:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796002406; x=1796607206; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=/in6sTmdfXhpqv4ittDFmgtHm6oGvIkrxlilRB0l2iA=; b=qP76rd3iufQqupGbRDLz0ki+O4CoYBIbJrj6HqvqfjIgzgcAXa2IGa2Xipx91FxK3N K3vsO1gd77L5dCcg4YmsvrKyMC5RakbjmqTE9oAaAiZwXMoGV2YC7EPtcYeXq2WxEpuz uQGKSyWJHbGxuj5m5eEYTk1kOvZsgWYG6bp02fJ4vYWsOKafYawB0Mzuip1Q9zwqFXi8 QjDINHA6xhoLz7qoRB8UA37Ii65U9eFEQXpNZfE55Khw/puY+llRV2FcaCzsMuvptW56 lhtg821KSrn6sSXmcfOecnfVEfvL0TODVlongRXD4ofxAOc0T/QIEoLako0ru8qlKys9 C9Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796002406; x=1796607206; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=/in6sTmdfXhpqv4ittDFmgtHm6oGvIkrxlilRB0l2iA=; b=yLplATKDKBkRa7+HDwt2a+2kK7u36T1shFBMGxsy+YiTrMv8rj+S2mRhy/IvmV+vWH KwLYjgXbfeIXxHvIxzFTY3m7Yhe1bgM6O9j3jvbbYC8BqXo5I28cB13paTJv67I/GGwl XrQPbQkRDB6QUTH7Fm4gU8e5+tIRHhozhsOizalNE9Ol8SyuAcDiNcb1X8AK9Fx4xvrh PYfIbVJ1gTmEoqzvtycZZpSTlggzISXozYFVSboiomGnkTqRRVRHaJQY6Jycgcj2EheS Uc9qE6s5jOljCCmBku4wyXDOybWeindrIgFt0GF+9vg8VCTQSuWqXDqUMlyfY64TmcXz ba8Q== X-Gm-Message-State: APuU4Z8EDIoXzrg5Glq1ZCsydIHt/m+mehdi7S/Q3NpAm89X+ynjkq6L rAvLV+cMrIrngKej35gvBaGNvzV8ZWRWLPNEXjDxvMdzwxon1XPpRC9+iPdRAs8NyGVPEwsoQjY bG5oFTUcdHA== X-Received: from ywbnj15.prod.google.com ([2002:a05:690c:8e0f:b0:8b4:cd81:b089]) (user=jmoroni job=prod-delivery.src-stubby-dispatcher) by 2002:a05:690c:63c6:b0:8b4:cc9d:967d with SMTP id 00721157ae682-8b520513e7fmr132890357b3.59.1796002406221; Sun, 29 Nov 2026 17:33:26 -0800 (PST) Date: Mon, 30 Nov 2026 01:33:02 +0000 In-Reply-To: <20261130013307.2848330-1-jmoroni@google.com> X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 References: <20261130013307.2848330-1-jmoroni@google.com> X-Mailer: git-send-email 2.56.1.839.g22a8290db9-goog Message-ID: <20261130013307.2848330-4-jmoroni@google.com> Subject: [PATCH rdma-next 3/8] RDMA/irdma: Reject a PBL backed CQ shadow area From: Jacob Moroni To: tatyana.e.nikolova@intel.com, jgg@ziepe.ca, leon@kernel.org Cc: linux-rdma@vger.kernel.org, jdz@google.com, Jacob Moroni Content-Type: text/plain; charset="UTF-8" On devices with IRDMA_FEATURE_CQ_RESIZE, the CQ shadow area is a separate user registration. irdma_setup_umode_cq() takes its DMA address from cq_pbl.addr, which is a union with the PBLE index and only holds an address if the registration is not PBL backed. rdma-core registers the shadow area as a single page, which never uses a PBL. However, a user can register it with more than one page of non-contiguous memory, which then causes the PBLE index to be given to the HW instead of the DMA address that the HW expects. The hardware cannot take the shadow area through a PBL, so fix this by rejecting such a registration. Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs") Signed-off-by: Jacob Moroni --- drivers/infiniband/hw/irdma/verbs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c index 9a673669b72a..93328b0abcbd 100644 --- a/drivers/infiniband/hw/irdma/verbs.c +++ b/drivers/infiniband/hw/irdma/verbs.c @@ -2938,6 +2938,8 @@ static int irdma_setup_umode_cq(struct irdma_device *iwdev, return -EPROTO; } cqmr_shadow = &iwcq->iwpbl_shadow->cq_mr; + if (iwcq->iwpbl_shadow->pbl_allocated) + return -EINVAL; info->shadow_area_pa = cqmr_shadow->cq_pbl.addr; } else { info->shadow_area_pa = cqmr->shadow; -- 2.56.1.839.g22a8290db9-goog