lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CADnq5_MpUcifxeBtfk6Q5bd6rjFusRCVvOBOguq0mP6ejG0fuA@mail.gmail.com>
Date: Fri, 1 Aug 2025 11:27:00 -0400
From: Alex Deucher <alexdeucher@...il.com>
To: Philipp Zabel <philipp.zabel@...il.com>
Cc: Alex Deucher <alexander.deucher@....com>, 
	Christian König <christian.koenig@....com>, 
	David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>, amd-gfx@...ts.freedesktop.org, 
	dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org, 
	Philipp Zabel <p.zabel@...gutronix.de>
Subject: Re: [PATCH RFC 5/6] drm/amdgpu: don't wake up the GPU for
 mmGB_ADDR_CONFIG register read

On Fri, Aug 1, 2025 at 2:11 AM Philipp Zabel <philipp.zabel@...il.com> wrote:
>
> On Thu, Jul 31, 2025 at 9:38 PM Alex Deucher <alexdeucher@...il.com> wrote:
>>
>> On Thu, Jul 31, 2025 at 3:33 AM Philipp Zabel <philipp.zabel@...il.com> wrote:
>> >
>> > Don't wake the GPU if libdrm queries the mmGB_ADDR_CONFIG register
>> > value during amdgpu_query_gpu_info_init(). Instead, return the already
>> > cached value adev->gfx.config.gb_addr_config.
>> >
>> > Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2295
>> > Signed-off-by: Philipp Zabel <philipp.zabel@...il.com>
>> > ---
>> >  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 10 ++++++++++
>> >  1 file changed, 10 insertions(+)
>> >
>> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
>> > index fe1347a4075c4..ed4d7d72f2065 100644
>> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
>> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
>> > @@ -883,6 +883,16 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
>> >
>> >                 alloc_size = info->read_mmr_reg.count * sizeof(*regs);
>> >
>> > +               if (info->read_mmr_reg.dword_offset == 0x263e &&
>>
>> I think the offset of this register varies across chip families.
>> You'll need some way to determine what the offset is for each family.
>
>
> Thank you. This workaround was specifically intended for the following call in libdrm [1]:
>
>         r = amdgpu_read_mm_registers(dev, 0x263e, 1, 0xffffffff, 0,
>                                              &dev->info.gb_addr_cfg);
>
> [1] https://gitlab.freedesktop.org/mesa/libdrm/-/blob/9ea8a8e93d542fe61d82716d1a721e8d1d257405/amdgpu/amdgpu_gpu_info.c#L215-216
>
> which also seem to hard-code the dword_offset?
>
> The same is now copied into Mesa [2] as:
>
>    r = ac_drm_read_mm_registers(dev, 0x263e, 1, 0xffffffff, 0, &info->gb_addr_cfg);
>
> [2] https://gitlab.freedesktop.org/mesa/mesa/-/blob/c64c6a0c31f9cb1339bc700d236932171f7444a3/src/amd/common/ac_linux_drm.c#L722

Nevermind, it's at the same absolute offset on all chips right now.
The relative offsets are just different.

Alex

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ