From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796380636; b=JYR25mavUUR9vP9m+32GKlBxKspwr4J29bq6AKJzP/R1kd9p1NcTYiyCRPwEdm4dv0Gp NTgS2IP4s0H9h33XsNB+OxSb90NmlSWyJ9ICJL8QXoK1CNwoodyiOKVCtbf8a6Bh+2Dl0 oxZSdGaoU4pn5etmIzePyXlgeRBg7vbkh2AIb7k8pzkoAzwTotXD3IkrYnxeJIinktdWg wOqDnHTIaeT+NiUw3wYI2KNR72wy0LhK4RZanFnGprK8e2JwVTG+kz6PKoyVG8pl3gq0m 5IyyXgklsvW/52K1jEJ+RODFG1Kj1/7GfA9UmiMyhlHJ9dKAyg9HXSSoVQ8sdvLf+8Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380636; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=6UTFhxOYqA5364addxlWtw4Hyr6FCcD4W4ZrnR0mz0E=; b=FSw34zYTnuFUjOMG4DxYI+YoLR57n6EjGe4F5LZrshM/Lnixb5fIx51wL9U1TdwYRODQ ifFzzSN7ww8+PCOTbsbDh1XVHwJxCgSTgrZ4w10tIzaXJra34xZkjpShq/rurBv7ltkLR Pc3wX9uQaaMow3asM1WXm74HMBVjSxGNGE+HDxieZ5XJWqfwItCjeAKYbQ544MxcFQsPB 7l7vytB/LWc/+sF4jWzPM4UzVTcQYpf7xuPpzQrhjb0N3aRX4yyOKUmnC02NE1JpabTx6 9V+RRKyDhRJJznmLgZ7kmhovl0e/7BtWNtRqmTCkvXw4cHnJtRVBafoveRXa9yrUq+A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=M11IpJCX; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8632D606A684; Fri, 4 Dec 2026 10:37:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=M11IpJCX Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05B301F00931; Fri, 4 Dec 2026 10:37:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380636; bh=6UTFhxOYqA5364addxlWtw4Hyr6FCcD4W4ZrnR0mz0E=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=M11IpJCX/39zEWSYGNcLxkngEwJ933h+Rfq0aF6ETIi/lH+JGzX2yLm/asL+OzEXK 0/YsDYPwTCTa8afIIKHF159MjNS++LRqRYkUs41C6Gryh86PE8OKgiwqti2FTykGty 5iEoE+8fagVHshVlUfF+gyYG6GLsDCiWXjNE25qQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mohamed Ahmed , Thomas Andersen , Dave Airlie Subject: [PATCH 7.3 353/742] drm/nouveau/instmem: map only the part of BAR2 that is used Date: Fri, 4 Dec 2026 19:03:37 +0900 Message-ID: <20261204100644.449784148@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mohamed Ahmed commit 7488ee210542b918b9c5749a29fd1502c49a0665 upstream. The io_mapping covers the whole BAR2 resource. With GSP-RM and with NvBar2Halve the BAR2 address space covers only its lower half. The driver maps nothing in the upper half, and a mapping that already exists there would give the io_mapping its type. Size the io_mapping to the BAR2 address space. The range does not change where BAR2 is not halved. Fixes: 34e27b90552a ("nouveau/instmem: use iomapping interface for instmem handling") Cc: stable@vger.kernel.org Signed-off-by: Mohamed Ahmed Tested-by: Thomas Andersen Reviewed-by: Dave Airlie Signed-off-by: Dave Airlie Link: https://patch.msgid.link/20261117214352.337961-4-mohamedahmedegypt2001@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) --- a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c @@ -191,16 +191,17 @@ nv50_instobj_map(struct nvkm_memory *mem } static bool -check_io_mapping(struct nv50_instmem *imem) +check_io_mapping(struct nv50_instmem *imem, struct nvkm_vmm *vmm) { struct nvkm_device *device = imem->base.subdev.device; if (imem->iomap.size) return true; + /* Map the part of BAR2 that its address space covers. */ return io_mapping_init_wc(&imem->iomap, device->func->resource_addr(device, NVKM_BAR2_INST), - device->func->resource_size(device, NVKM_BAR2_INST)) != NULL; + vmm->limit - vmm->start) != NULL; } static void @@ -293,10 +294,10 @@ nv50_instobj_boot(struct nvkm_memory *me } /* - * boot is only called on BAR2, if we can't remap the complete - * BAR it's unlikely things are functioning well. + * boot is only called on BAR2. If we can't map it, it's unlikely + * things are functioning well. */ - if (check_io_mapping(iobj->imem)) + if (check_io_mapping(iobj->imem, vmm)) nv50_instobj_kmap(iobj, vmm); nvkm_instmem_boot(imem); mutex_unlock(&imem->mutex);