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>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADnq5_PG1Am4OGkfKo9o9cfnvSdzwRFeYudbvw220+P1AHO4xA@mail.gmail.com>
Date: Thu, 31 Jul 2025 15:38:13 -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 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.

Alex

> +                   info->read_mmr_reg.count == 1) {
> +                       /* Return cached value of mmGB_ADDR_CONFIG */
> +                       regs[0] = adev->gfx.config.gb_addr_config;
> +
> +                       n = copy_to_user(out, regs, min(size, alloc_size));
> +                       kfree(regs);
> +                       return n ? -EFAULT : 0;
> +               }
> +
>                 ret = pm_runtime_get_sync(dev->dev);
>                 if (ret < 0) {
>                         pm_runtime_put_autosuspend(dev->dev);
>
> --
> 2.50.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ