Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A4D6F606A31C for ; Sun, 29 Nov 2026 16:50:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=bvByVOO/ Received: from kara.freedesktop.org (unknown [131.252.210.166]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8D3B010EC3B; Sun, 29 Nov 2026 16:50:06 +0000 (UTC) Received: from kara.freedesktop.org (localhost [127.0.0.1]) by kara.freedesktop.org (Postfix) with ESMTP id 72A754047C; Sun, 29 Nov 2026 16:50:01 +0000 (UTC) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=lists.freedesktop.org; s=20240201; t=1795971001; b=wBkPgCjQCrTCjWpBJ1PiqGour0fxv+EWo2t7vMBUZUv7J9tvSeZEsh7cY89AvuYP9BPeV oOY83m+zeriHqF9nJvGIljGH9hJoMMeDnbT2TCve8Ndv92uVQfrHVQx35F2bsav7asEFSkD cBQetRbx9EdV4diO0BJCHpjyVM+mlcCKXob9JCC33w0Il3kO/WYETUeTB948+l7QAEpNHCQ o4mzqJvBbPr/6aL/RfH9qIPR41RvGwc2zGcysGHuUOHT37AUIFUijBCJbh/PayRBgDNTR7/ T15wHK7rFijxIvHj6fLTKCvukqwpsOv1REd33pRtiqx+02ywxnegBRtjzh7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.freedesktop.org; s=20240201; t=1795971001; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=OeroTpmPcSqFFMvyzq2WzTdUU7P346l1wizb/BldsoU=; b=lLhT0Rhph/blPrqOqfi8sa7fg0uutQYTDId03nXOi9r+Ozi0gIFTdoifvw3gpuoXIdNaY xauExvULyNE0xEEwXP+p6QcCyt100WKPvz25h8eUPwSfRrAYkj6qNStTKNmhdmo2daN8Q/y jWUyer0ur4mbjFHgP3E1V/1pWNxsUcahvgdgHq3PW7MlNzgBv2g78Vv4kqRrQTg4FzZdaWK HZaYHBL5zTGY3Io92zl1BH76xJl8p/Cy8HNHBp5zw/ogPOH++84ECZMOXgoxFKAtllDIblM 3ywPWOUjy2WBWnwdB0bHaFQdv1ifNxwRJpKC0FrWDyDQNAjWgRmE0ax7LoaQ== ARC-Authentication-Results: i=1; mail.freedesktop.org; dkim=pass header.d=gmail.com; arc=none; dmarc=pass header.from=gmail.com policy.dmarc=quarantine Authentication-Results: mail.freedesktop.org; dkim=pass header.d=gmail.com; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=gmail.com policy.dmarc=quarantine Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by kara.freedesktop.org (Postfix) with ESMTPS id 12C6B4015C for ; Sun, 29 Nov 2026 10:52:40 +0000 (UTC) Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) by gabe.freedesktop.org (Postfix) with ESMTPS id 02B5E10E22C for ; Sun, 29 Nov 2026 10:52:34 +0000 (UTC) Received: by mail-qv1-f52.google.com with SMTP id 6a1803df08f44-92130d3ee15so86321856d6.3 for ; Sun, 29 Nov 2026 02:52:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1795949554; x=1796554354; darn=lists.freedesktop.org; h=mime-version:content-transfer-encoding:content-type:message-id:date :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=OeroTpmPcSqFFMvyzq2WzTdUU7P346l1wizb/BldsoU=; b=bvByVOO/uU+UEcgMzaJMZhLCwbnJqJ/sPWbPieIE1I1LiZCKI3sh06Zmw1HTtrtLX/ PQ/Csp8fTLAKw7G0NTqzz8zBS9K0HvHNP/hYJvIcA24lhBoKfs/AMzGlyHHxDmozr/zM 11l5n3cBQWDuqAPZPMelEoFhr2msCYYTtX0ckSWudDs5LVi0ENWIUgjiYuhVly/H+V1m 9jZm6lX3OdrARJuJ6zbE5p47EwMjVMQe6ndnUjs0KpLdDSKIi/9XKccglrRIUxci0uLk Z9ibmdIDcL3gHLdyGZ/Lb72ggfU8g55I9Hw5NpP8AHC8a6Dt4W8e0sKE9daSgs8GDmqM +CRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795949554; x=1796554354; h=mime-version:content-transfer-encoding:content-type:message-id:date :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=OeroTpmPcSqFFMvyzq2WzTdUU7P346l1wizb/BldsoU=; b=JCXhnO0hXP5EJs77pWgxjErzAsE16rT8C7DiU8E22Vc/bTWc4q7Q2IIX10UU1ikynp 7IyWpr/dCn0qMbt+d982Gj8d0UstFcYiIcWb0W1JICF9l5XwLF00vYCWmlpLAbA7oqny Qqk+4TMpIWb9hynTbqJF/vtWVVhkYZfbQJBfQB8Eh5WBuMoDoPZ9BhkkMSo1M1ni2j/P 3/FLwwBbvUhFUW76CNkagWAkteNPl8vtvpLS3wM4NlS0R8yk05QXqesyVt74PBmx4N3D yj5LUKodhjmdSq4G+Xo//5NJa0/ayHVXzF2pBmVPsziwm114fyTeFgk8jLor19rjhKqS bn8w== X-Gm-Message-State: APuU4Z+BAFG9qfppTStvxkP4bgyfrj1TgLx5sX35E+B+UDH2zhkkD4yC 3Tm5/1o+rACy02ilOSB7Axi1y/E+OJdmNjmHS3w3XdnKT3jKSZKFF3jO X-Gm-Gg: AZFdTZdx7Pceu/xNXmNxB97KuM8vdZ5ECrX0Dym7OK788seOq7wSj1T018KhuMSmE98 fjOxkUy63Gg9gKt7A2un83vQfRZkPZp3YN4Eh1dVJ3NmwsLs5z5o6b2MTEEANNuYeSqY+uNUed/ A/OQ3R2mUuPON/IUfwwF5RDMG98+Fk91uxmflLnxlGx6So8A/ocLot6pbnkp2XuFp1OAkKEFWI7 0OXrpvPPlNj7CRMLuyWEwsnDZdknVZnMTBd14iOAe2tNkq2c+21tQ02tM7E/nzcgAGRD4g8iL1O Lt1q5hqQviKCiYqW3v4NAW1EAREbQIYrOI+zTvUdeWzi1GijByjGKsDFcxpvcqQx4Hm5ypRtLQR BTPXneq1Ti5kCbTIO8WohbKulir/86d7p8fY9Tv3KOXdPGEroTiDPDh174G9YhiBcdQGdEtDKfN qpXyyW5JQ7Rum086Guuq6cjpRFrJwvezKiFlcLC9CFWAsI833xDMuUIVBthJkDLYlSRWi6IrPML cV/SJmt8qjRUi/hiq3WRob8jh07bNxtM1I40VI8B0eLNM5NtmV8qhemzXroBPMNfWgqoIR1g1jv ECdfHr70ruGq9nGhO+92eZiJwZlI5Ju510+2B7py1K2fHZegcl5ZNLhySK2u8jesUdwtO2iz/+M WYYO5CBweOvi8pTLtomIUGhWXd/pBQ46kAM2C1RG9uSSocLVZkQ== X-Received: by 2002:a05:6214:5085:b0:921:6cde:6f19 with SMTP id 6a1803df08f44-9216cde7125mr315186946d6.20.1795949553701; Sun, 29 Nov 2026 02:52:33 -0800 (PST) Received: from zeppelin-x.local (dhcp-9-244-177-183.gobrightspeed.net. [9.244.177.183]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-921349b081csm262767336d6.7.2026.11.29.02.52.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2026 02:52:33 -0800 (PST) From: Felipe Infante de Castro To: Lyude Paul , Danilo Krummrich Subject: [BUG] drm/nouveau: headless un-POSTed GP104 skips DEVINIT (nvkm_devinit_disable returns 0) and wraps VRAM heap in gp102_ram_new() Date: Sun, 29 Nov 2026 05:52:32 -0500 Message-ID: <179594955210.39675.16344785212874947048@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Archived-By: MIME-Version: 1.0 X-MailFrom: felipe.infante.de.castro@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation Message-ID-Hash: 2L4MLQ4NJJEOCT4JEN7EOKXJ3KAHEEJJ X-Message-ID-Hash: 2L4MLQ4NJJEOCT4JEN7EOKXJ3KAHEEJJ X-Mailman-Approved-At: Sun, 29 Nov 2026 16:49:59 +0000 CC: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org X-Mailman-Version: 3.3.10 Precedence: list List-Id: Nouveau development list Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Hi Lyude, Danilo, and Nouveau developers, While testing an actively cooled, display-less NVIDIA Tesla P4 (GP104, PCI 10de:1bb3) behind a USB4 PCIe tunnel on an arm64 Snapdragon X Elite host (Linux v7.3.6, no x86 BIOS / UEFI GOP POST), we hit two interacting defects in nvkm that leave GDDR5 uninitialized and wrap the VRAM heap calculation. 1. nvkm_devinit_disable() unconditionally returns 0, defeating gf100_devinit_preinit()'s display-disabled guard In drivers/gpu/drm/nouveau/nvkm/subdev/devinit/base.c: u64 nvkm_devinit_disable(struct nvkm_devinit *init) { if (init && init->func->disable) init->func->disable(init); return 0; } In drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c: if (base->post) { u64 disable = nvkm_devinit_disable(base); if (!(disable & (1ULL << NVKM_ENGINE_DISP))) { if (nvkm_rdvgac(device, 0, 0x00) || nvkm_rdvgac(device, 0, 0x1a)) { base->post = false; } } } Because nvkm_devinit_disable() always returns 0, the display-disabled check !(disable & (1ULL << NVKM_ENGINE_DISP)) is always true even after gm107_devinit_disable() calls nvkm_subdev_disable(device, NVKM_ENGINE_DISP, 0). On our un-POSTed Tesla P4 (clean BAR0 baseline, D0, bus mastering off, zero PCIe/AER errors): - BAR0+0x000000 = 0x134000a1 (GP104) - BAR0+0x02240c = 0x00000000 (bit 1 clear -> base->post starts true) - BAR0+0x021c04 = 0x00000001 (bit 0 set -> display engine fused off) - BAR0+0x100ce0 = 0x00000000 (gp102_fb_vidmem_size() returns 0) We ran an isolated, decision-only diagnostic module executing stock gf100_devinit_preinit() + gm107_devinit_disable() + the indexed VGA reads (returning before VGA unlock, firmware upload, FB init, or bus mastering): - nvkm_devinit_disable() read fuses 0x0 / 0x1, disabled DISP, and returned 0. - nvkm_rdvgac(device, 0, 0x00) returned 0x13 from the absent display block. - gf100_devinit_preinit() flipped base->post to false, skipping VBIOS DEVINIT and leaving GDDR5 uninitialized ("fb: 0 MiB GDDR5"). 2. Unsigned underflow in gp102_ram_new() when VRAM size < 1.25 MiB In drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgp102.c: const u32 rsvd_head = ( 256 * 1024); /* vga memory */ const u32 rsvd_tail = (1024 * 1024); /* vbios etc */ u64 size = fb->func->vidmem.size(fb); ... return nvkm_mm_init(&(*pram)->vram, NVKM_RAM_MM_NORMAL, rsvd_head >> NVKM_RAM_MM_SHIFT, (size - rsvd_head - rsvd_tail) >> NVKM_RAM_MM_SHIFT, 1); When gp102_fb_vidmem_size() returns 0 (or any value smaller than rsvd_head + rsvd_tail + one NVKM_RAM_MM_SHIFT page), the unsigned subtraction wraps (or yields 0 pages at the exact boundary). On a stock Nouveau probe of this card, Nouveau logged "fb: 0 MiB GDDR5" and the host reset during probe (no pstore/journal backtrace captured, so we do not claim the wrap itself was the sole cause of the reset). On the same card and slot, NVIDIA R580.196.11 initialized the card (7.5 GiB NVML) and completed 6,127 verified CUDA launches over 90 seconds. Suggested fix directions: - In gf100_devinit_preinit() / nvkm_devinit_disable(): check whether NVKM_ENGINE_DISP was actually disabled (e.g. via nvkm_subdev_disabled() / device->disable_mask) instead of relying on nvkm_devinit_disable()'s constant 0 return, so headless GPUs skip the VGA CRTC heuristic. - In gp102_ram_new(): reject size < rsvd_head + rsvd_tail + (1ULL << NVKM_RAM_MM_SHIFT) with -EINVAL and an nvkm_error() before calling nvkm_ram_new_(). Scope note: we have not yet tested a forced-POST (nouveau.config=NvForcePost=1) probe on this card, so we cannot confirm whether gm200_devinit_post() brings up GDDR5 once base->post stays true. Full write-up and register readbacks: https://github.com/fidecastro/surface-laptop-7-15in-facts/blob/main/upstream-reports/nouveau-gp104-headless-post.md Happy to run targeted diagnostic checks or test patches on this card if helpful. Best regards, Felipe Infante de Castro Signed-off-by: Felipe Infante de Castro