From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Cc: Juergen Gross <jgross@suse.com>, David Airlie <airlied@redhat.com>
Subject: [PATCH v2 05/13] agp/nvidia: Stop using 32-bit MSR interfaces
Date: Wed, 19 Aug 2026 12:23:06 +0200 [thread overview]
Message-ID: <20260819102314.1499258-6-jgross@suse.com> (raw)
In-Reply-To: <20260819102314.1499258-1-jgross@suse.com>
The 32-bit MSR interfaces rdmsr() and wrmsr() are planned to be
removed. Use the related 64-bit variants instead.
Signed-off-by: Juergen Gross <jgross@suse.com>
---
drivers/char/agp/nvidia-agp.c | 32 +++++++++++++++-----------------
1 file changed, 15 insertions(+), 17 deletions(-)
diff --git a/drivers/char/agp/nvidia-agp.c b/drivers/char/agp/nvidia-agp.c
index 4787391bb6b4..3e760bc00afa 100644
--- a/drivers/char/agp/nvidia-agp.c
+++ b/drivers/char/agp/nvidia-agp.c
@@ -65,22 +65,20 @@ static int nvidia_fetch_size(void)
static int nvidia_init_iorr(u32 base, u32 size)
{
- u32 base_hi, base_lo;
- u32 mask_hi, mask_lo;
- u32 sys_hi, sys_lo;
+ struct msr base_msr, mask_msr, sys_msr;
u32 iorr_addr, free_iorr_addr;
/* Find the iorr that is already used for the base */
/* If not found, determine the uppermost available iorr */
free_iorr_addr = AMD_K7_NUM_IORR;
for (iorr_addr = 0; iorr_addr < AMD_K7_NUM_IORR; iorr_addr++) {
- rdmsr(IORR_BASE0 + 2 * iorr_addr, base_lo, base_hi);
- rdmsr(IORR_MASK0 + 2 * iorr_addr, mask_lo, mask_hi);
+ rdmsrq(IORR_BASE0 + 2 * iorr_addr, base_msr.q);
+ rdmsrq(IORR_MASK0 + 2 * iorr_addr, mask_msr.q);
- if ((base_lo & 0xfffff000) == (base & 0xfffff000))
+ if ((base_msr.l & 0xfffff000) == (base & 0xfffff000))
break;
- if ((mask_lo & 0x00000800) == 0)
+ if ((mask_msr.l & 0x00000800) == 0)
free_iorr_addr = iorr_addr;
}
@@ -89,16 +87,16 @@ static int nvidia_init_iorr(u32 base, u32 size)
if (iorr_addr >= AMD_K7_NUM_IORR)
return -EINVAL;
}
- base_hi = 0x0;
- base_lo = (base & ~0xfff) | 0x18;
- mask_hi = 0xf;
- mask_lo = ((~(size - 1)) & 0xfffff000) | 0x800;
- wrmsr(IORR_BASE0 + 2 * iorr_addr, base_lo, base_hi);
- wrmsr(IORR_MASK0 + 2 * iorr_addr, mask_lo, mask_hi);
-
- rdmsr(SYSCFG, sys_lo, sys_hi);
- sys_lo |= 0x00100000;
- wrmsr(SYSCFG, sys_lo, sys_hi);
+ base_msr.h = 0x0;
+ base_msr.l = (base & ~0xfff) | 0x18;
+ mask_msr.h = 0xf;
+ mask_msr.l = ((~(size - 1)) & 0xfffff000) | 0x800;
+ wrmsrq(IORR_BASE0 + 2 * iorr_addr, base_msr.q);
+ wrmsrq(IORR_MASK0 + 2 * iorr_addr, mask_msr.q);
+
+ rdmsrq(SYSCFG, sys_msr.q);
+ sys_msr.l |= 0x00100000;
+ wrmsrq(SYSCFG, sys_msr.q);
return 0;
}
--
2.55.0
next prev parent reply other threads:[~2026-08-19 10:23 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-19 10:23 [PATCH v2 00/13] x86/msr: Drop 32-bit MSR interfaces Juergen Gross
2026-08-19 10:23 ` [PATCH v2 01/13] x86/cpu: Fix coding style violation Juergen Gross
2026-08-19 10:23 ` [PATCH v2 02/13] x86/msr: Remove wrmsr_safe() Juergen Gross
2026-08-19 10:23 ` [PATCH v2 03/13] x86/msr: Remove rdmsr_safe() Juergen Gross
2026-08-19 10:23 ` [PATCH v2 04/13] drivers/ata: Stop using 32-bit MSR interfaces Juergen Gross
2026-08-19 13:40 ` David Laight
2026-08-19 15:27 ` Jürgen Groß
2026-08-21 9:12 ` [PATCH v3 " Juergen Gross
2026-08-21 12:14 ` Niklas Cassel
2026-08-19 10:23 ` Juergen Gross [this message]
2026-08-19 10:23 ` [PATCH v2 06/13] fbdev/geode: " Juergen Gross
2026-08-19 10:23 ` [PATCH v2 07/13] hw_random/via-rng: " Juergen Gross
2026-08-19 10:23 ` [PATCH v2 08/13] drivers/gpio: " Juergen Gross
2026-08-19 10:23 ` [PATCH v2 09/13] drivers/misc: " Juergen Gross
2026-08-19 10:23 ` [PATCH v2 10/13] x86/msr: Remove wrmsr() Juergen Gross
2026-08-19 10:23 ` [PATCH v2 11/13] x86/msr: Remove rdmsr() Juergen Gross
2026-08-19 10:23 ` [PATCH v2 12/13] treewide: convert rdmsrq() from a macro to an inline function Juergen Gross
2026-08-20 6:06 ` Damien Le Moal
2026-08-21 4:13 ` Michael Kelley
2026-08-19 10:23 ` [PATCH v2 13/13] x86/msr: Simplify some rdmsrq() use cases Juergen Gross
2026-08-19 15:28 ` Sean Christopherson
2026-08-19 15:31 ` Jürgen Groß
2026-08-21 4:13 ` Michael Kelley
2026-08-21 10:57 ` [PATCH v3 " Juergen Gross
2026-08-19 14:40 ` [PATCH v2 00/13] x86/msr: Drop 32-bit MSR interfaces Dave Hansen
2026-08-19 15:21 ` Jürgen Groß
2026-08-19 15:33 ` Sean Christopherson
2026-08-20 5:27 ` Jürgen Groß
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=20260819102314.1499258-6-jgross@suse.com \
--to=jgross@suse.com \
--cc=airlied@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox