Skip to content

Commit 457e77b

Browse files
author
Ben Skeggs
committed
drm/nouveau/bios: add more checks to PRAMIN image fetching
Prevents an attempt to access VRAM on an un-posted board, which, on a particular system with a GRID K1 installed, causes a MCE and chokes the entire system. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
1 parent 420b946 commit 457e77b

File tree

1 file changed

+11
-1
lines changed
  • drivers/gpu/drm/nouveau/core/subdev/bios

1 file changed

+11
-1
lines changed

drivers/gpu/drm/nouveau/core/subdev/bios/base.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,17 @@ nouveau_bios_shadow_pramin(struct nouveau_bios *bios)
9999
return;
100100
}
101101

102-
addr = (u64)(nv_rd32(bios, 0x619f04) & 0xffffff00) << 8;
102+
addr = nv_rd32(bios, 0x619f04);
103+
if (!(addr & 0x00000008)) {
104+
nv_debug(bios, "... not enabled\n");
105+
return;
106+
}
107+
if ( (addr & 0x00000003) != 1) {
108+
nv_debug(bios, "... not in vram\n");
109+
return;
110+
}
111+
112+
addr = (u64)(addr >> 8) << 8;
103113
if (!addr) {
104114
addr = (u64)nv_rd32(bios, 0x001700) << 16;
105115
addr += 0xf0000;

0 commit comments

Comments
 (0)