From 1ed5d98cbb2273e75674d050fb48e3c3422a3877 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Tue, 22 Sep 2026 23:41:13 -0400 Subject: kernel: widen PCFG mirror watch to link-cap aliases (debug helper) Logs changes to NV_PMC_BOOT_1 (0x4), the low PCFG alias, the BAR0 PCFG block (0x880000/0x880080/0x880084/0x880088/0x88008c) and the VF-window aliases. Observed during a CUDA run: the guest never writes any of them, so the link-cap values we pre-set (0x103 / 0x01030000) are not clobbered. Reads are not observable through the mmap'd BAR0. --- kernel/gsp_emulation.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'kernel') diff --git a/kernel/gsp_emulation.c b/kernel/gsp_emulation.c index 969d4fd..833ce42 100644 --- a/kernel/gsp_emulation.c +++ b/kernel/gsp_emulation.c @@ -305,15 +305,24 @@ static void gsp_emu_poll_boot(struct gsp_emu_context *ctx) } } - /* Temporary: watch the PCFG link-caps mirror for guest writes */ + /* Temporary: watch PCFG / link-cap mirror offsets for guest writes */ { - static u32 last_linkcap; - u32 v = gsp_emu_shadow_read32(ctx, 0x88084); + static const u32 watch[] = { + 0x000004, 0x000084, 0x880000, 0x880004, 0x880080, + 0x880084, 0x880088, 0x88008c, 0xb80084, 0xb88084, + 0xc08084, + }; + static u32 last[ARRAY_SIZE(watch)]; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(watch); i++) { + u32 v = gsp_emu_shadow_read32(ctx, watch[i]); - if (v != last_linkcap) { - nv_vgpu_info(ctx->vgpu, "GSP-BOOT: PCFG[0x88084] = 0x%x (was 0x%x)", - v, last_linkcap); - last_linkcap = v; + if (v != last[i]) { + nv_vgpu_info(ctx->vgpu, "GSP-BOOT: PCFG[0x%x] = 0x%x (was 0x%x)", + watch[i], v, last[i]); + last[i] = v; + } } } -- cgit v1.2.3