From: sashiko-bot@kernel.org
To: "Juergen Gross" <jgross@suse.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 21/32] agp/nvidia: Stop using 32-bit MSR interfaces
Date: Mon, 29 Jun 2026 06:25:23 +0000 [thread overview]
Message-ID: <20260629062527.B615C1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260629060526.3638272-22-jgross@suse.com>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but there is a memory leak of the ioremap virtual memory area on suspend/resume.
- [High] This problem wasn't introduced by this patch, but an ignored initialization error on resume leads to a guaranteed NULL pointer dereference in the hardware TLB flush path.
- [High] This problem wasn't introduced by this patch, but a missing break in a timeout loop causes a soft lockup if the hardware fails to complete a TLB flush.
--
commit 809ee345f7a00dcaa6e844219a8b666a3f9ffadb
Author: Juergen Gross <jgross@suse.com>
agp/nvidia: Stop using 32-bit MSR interfaces
This commit replaces the deprecated 32-bit MSR interfaces rdmsr() and wrmsr()
with their 64-bit equivalents in the NVIDIA AGP driver. This is part of a
planned removal of the 32-bit variants.
> diff --git a/drivers/char/agp/nvidia-agp.c b/drivers/char/agp/nvidia-agp.c
> index 4787391bb6b4f..3e760bc00afaa 100644
> --- a/drivers/char/agp/nvidia-agp.c
> +++ b/drivers/char/agp/nvidia-agp.c
[ ... ]
[Severity: High]
This isn't a bug introduced by this patch, but I noticed a potential memory
leak on suspend/resume.
Does this code leak the vmap area leading to vmalloc space exhaustion after
repeated suspend/resume cycles?
drivers/char/agp/nvidia-agp.c:nvidia_configure() {
...
/* map aperture */
apbase_phys = pci_resource_start(agp_bridge->dev, AGP_APERTURE_BAR);
nvidia_private.aperture =
(volatile u32 __iomem *) ioremap(apbase_phys, 33 * PAGE_SIZE);
...
}
Because the driver defines no suspend hook:
drivers/char/agp/nvidia-agp.c:
...
static DEFINE_SIMPLE_DEV_PM_OPS(agp_nvidia_pm_ops, NULL, agp_nvidia_resume);
...
The previous ioremap allocation is never unmapped via iounmap() when the
system suspends.
[Severity: High]
This is a pre-existing issue, but I spotted a potential NULL pointer
dereference in the hardware TLB flush path.
Could a failure in nvidia_configure() during resume lead to a kernel crash?
drivers/char/agp/nvidia-agp.c:agp_nvidia_resume() {
...
/* reconfigure AGP hardware again */
nvidia_configure();
return 0;
}
The return value of nvidia_configure() is ignored. If ioremap fails during
resume, nvidia_configure() returns -ENOMEM and nvidia_private.aperture
remains NULL.
Later, when nvidia_tlbflush() is called, it unconditionally dereferences
nvidia_private.aperture:
drivers/char/agp/nvidia-agp.c:nvidia_tlbflush() {
...
/* flush TLB entries */
for (i = 0; i < 32 + 1; i++)
temp = readl(nvidia_private.aperture+(i * PAGE_SIZE / sizeof(u32)));
...
}
[Severity: High]
This isn't a bug introduced by this patch, but the timeout loop in
nvidia_tlbflush() appears to be missing a break statement.
Can this cause a soft lockup if the hardware fails to complete a TLB flush?
drivers/char/agp/nvidia-agp.c:nvidia_tlbflush() {
...
end = jiffies + 3*HZ;
do {
pci_read_config_dword(nvidia_private.dev_1,
NVIDIA_1_WBC, &wbc_reg);
if (time_before_eq(end, jiffies)) {
printk(KERN_ERR PFX
"TLB flush took more than 3 seconds.\n");
}
} while (wbc_reg & nvidia_private.wbc_mask);
...
}
If the hardware enters an unexpected state and the timeout expires, the code
prints an error message but lacks a break statement to exit the loop, which
could trap the kernel in an infinite loop.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260629060526.3638272-1-jgross@suse.com?part=21
next prev parent reply other threads:[~2026-06-29 6:25 UTC|newest]
Thread overview: 113+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 6:04 [PATCH 00/32] x86/msr: Drop 32-bit MSR interfaces Juergen Gross
2026-06-29 6:04 ` Juergen Gross
2026-06-29 6:04 ` [PATCH 01/32] thermal/intel: Stop using " Juergen Gross
2026-07-02 9:31 ` Ingo Molnar
2026-07-02 11:18 ` Jürgen Groß
2026-07-03 11:22 ` [PATCH v2 " Juergen Gross
2026-06-29 6:04 ` [PATCH 02/32] powercap: " Juergen Gross
2026-06-29 11:25 ` Ingo Molnar
2026-06-29 11:33 ` Jürgen Groß
2026-06-29 12:31 ` Ingo Molnar
2026-06-29 12:52 ` Jürgen Groß
2026-06-29 6:04 ` [PATCH 03/32] edac: " Juergen Gross
2026-06-30 1:50 ` Zhuo, Qiuxu
2026-07-02 10:15 ` [tip: x86/msr] EDAC: " tip-bot2 for Juergen Gross
2026-06-29 6:04 ` [PATCH 04/32] acpi: " Juergen Gross
2026-06-30 12:30 ` Rafael J. Wysocki (Intel)
2026-06-30 12:42 ` Jürgen Groß
2026-07-02 9:17 ` Ingo Molnar
2026-07-02 11:33 ` Rafael J. Wysocki (Intel)
2026-07-04 8:26 ` Ingo Molnar
2026-06-29 6:04 ` [PATCH 05/32] x86/mtrr: " Juergen Gross
2026-06-29 11:33 ` Ingo Molnar
2026-06-29 11:41 ` Jürgen Groß
2026-06-29 12:27 ` Ingo Molnar
2026-06-29 13:04 ` Jürgen Groß
2026-07-02 9:15 ` Ingo Molnar
2026-07-03 11:23 ` [PATCH v2 " Juergen Gross
2026-06-29 6:04 ` [PATCH 06/32] x86/msr: Stop using 32-bit MSR interfaces in lib/msr-smp.c Juergen Gross
2026-07-02 10:16 ` [tip: x86/msr] " tip-bot2 for Juergen Gross
2026-06-29 6:04 ` [PATCH 07/32] x86/msr: Remove wrmsr_safe() Juergen Gross
2026-06-29 6:04 ` [PATCH 08/32] x86/mce: Stop using 32-bit MSR interfaces Juergen Gross
2026-07-02 10:16 ` [tip: x86/msr] " tip-bot2 for Juergen Gross
2026-07-03 10:55 ` [PATCH] x86/mce: Fix build warning after MSR-interface switch Juergen Gross
2026-06-29 6:05 ` [PATCH 09/32] KVM/x86: Stop using 32-bit MSR interfaces Juergen Gross
2026-06-29 6:05 ` [PATCH 10/32] x86/hygon: " Juergen Gross
2026-07-02 10:16 ` [tip: x86/msr] " tip-bot2 for Juergen Gross
2026-06-29 6:05 ` [PATCH 11/32] x86/pci: " Juergen Gross
2026-06-29 6:19 ` sashiko-bot
2026-07-02 10:16 ` [tip: x86/msr] " tip-bot2 for Juergen Gross
2026-07-02 10:25 ` sashiko-bot
2026-06-29 6:05 ` [PATCH 12/32] x86/amd: " Juergen Gross
2026-07-02 10:16 ` [tip: x86/msr] " tip-bot2 for Juergen Gross
2026-06-29 6:05 ` [PATCH 13/32] x86/featctl: " Juergen Gross
2026-07-02 9:39 ` Ingo Molnar
2026-07-02 11:19 ` Jürgen Groß
2026-07-03 11:24 ` [PATCH v2 " Juergen Gross
2026-06-29 6:05 ` [PATCH 14/32] x86/tsc: " Juergen Gross
2026-07-02 10:15 ` [tip: x86/msr] " tip-bot2 for Juergen Gross
2026-06-29 6:05 ` [PATCH 15/32] x86/msr: Remove rdmsr_safe() Juergen Gross
2026-06-29 6:05 ` [PATCH 16/32] cpufreq: Stop using 32-bit MSR interfaces Juergen Gross
2026-06-29 14:55 ` Zhongqiu Han
2026-06-30 6:38 ` Juergen Gross
2026-07-03 11:24 ` [PATCH v2 " Juergen Gross
2026-07-05 4:51 ` Zhongqiu Han
2026-06-29 6:05 ` [PATCH 17/32] x86/resctrl: " Juergen Gross
2026-07-01 16:49 ` Reinette Chatre
2026-07-02 10:15 ` [tip: x86/msr] " tip-bot2 for Juergen Gross
2026-06-29 6:05 ` [PATCH 18/32] x86/apic: " Juergen Gross
2026-07-02 10:15 ` [tip: x86/msr] " tip-bot2 for Juergen Gross
2026-06-29 6:05 ` [PATCH 19/32] x86/cpu: " Juergen Gross
2026-07-02 10:15 ` [tip: x86/msr] " tip-bot2 for Juergen Gross
2026-07-03 21:48 ` Borislav Petkov
2026-07-06 8:30 ` Juergen Gross
2026-06-29 6:05 ` [PATCH 20/32] drivers/ata: " Juergen Gross
2026-06-29 6:23 ` sashiko-bot
2026-06-29 7:28 ` Jürgen Groß
2026-07-03 11:25 ` [PATCH v2 " Juergen Gross
2026-06-29 6:05 ` [PATCH 21/32] agp/nvidia: " Juergen Gross
2026-06-29 6:25 ` sashiko-bot [this message]
2026-06-29 6:05 ` [PATCH 22/32] fbdev/geode: " Juergen Gross
2026-06-29 6:05 ` [PATCH 23/32] hw_random/via-rng: " Juergen Gross
2026-06-29 6:05 ` [PATCH 24/32] drivers/gpio: " Juergen Gross
2026-06-29 10:33 ` Bartosz Golaszewski
2026-07-01 8:13 ` Linus Walleij
2026-07-01 8:32 ` Juergen Gross
2026-06-29 6:05 ` [PATCH 25/32] drivers/misc: " Juergen Gross
2026-06-29 6:05 ` [PATCH 26/32] x86/msr: Remove wrmsr() Juergen Gross
2026-06-29 6:05 ` [PATCH 27/32] x86/hyperv: Stop using 32-bit MSR interfaces Juergen Gross
2026-07-03 9:39 ` [tip: x86/msr] " tip-bot2 for Juergen Gross
2026-06-29 6:05 ` [PATCH 28/32] x86/olpc: " Juergen Gross
2026-07-03 9:39 ` [tip: x86/msr] " tip-bot2 for Juergen Gross
2026-06-29 6:05 ` [PATCH 29/32] hwmon: " Juergen Gross
2026-06-29 6:25 ` sashiko-bot
2026-06-29 15:05 ` Guenter Roeck
2026-07-03 9:39 ` [tip: x86/msr] " tip-bot2 for Juergen Gross
2026-06-29 6:05 ` [PATCH 30/32] x86/msr: Remove rdmsr() Juergen Gross
2026-06-29 6:05 ` [PATCH 31/32] treewide: convert rdmsrq() from a macro to an inline function Juergen Gross
2026-06-29 6:05 ` Juergen Gross
2026-06-29 6:24 ` sashiko-bot
2026-06-29 6:05 ` [PATCH 32/32] x86/msr: Simplify some rdmsrq() use cases Juergen Gross
2026-06-29 6:52 ` [PATCH 00/32] x86/msr: Drop 32-bit MSR interfaces Arnd Bergmann
2026-06-29 6:52 ` Arnd Bergmann
2026-06-29 7:01 ` Jürgen Groß
2026-06-29 7:01 ` Jürgen Groß
2026-06-29 8:06 ` Arnd Bergmann
2026-06-29 8:06 ` Arnd Bergmann
2026-06-29 8:15 ` Jürgen Groß
2026-06-29 8:15 ` Jürgen Groß
2026-06-29 8:30 ` Jan Beulich
2026-06-29 8:38 ` Arnd Bergmann
2026-06-29 8:38 ` Arnd Bergmann
2026-06-30 20:06 ` H. Peter Anvin
2026-06-30 20:06 ` H. Peter Anvin
2026-06-29 11:19 ` Ingo Molnar
2026-06-29 11:19 ` Ingo Molnar
2026-06-30 18:59 ` Sean Christopherson
2026-06-30 18:59 ` Sean Christopherson
2026-07-01 8:33 ` Jürgen Groß
2026-07-01 8:33 ` Jürgen Groß
2026-07-02 10:07 ` Ingo Molnar
2026-07-02 10:07 ` Ingo Molnar
2026-07-02 11:03 ` Juergen Gross
2026-07-02 11:03 ` Juergen Gross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260629062527.B615C1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jgross@suse.com \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.