AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Zhigang Luo" <Zhigang.Luo@amd.com>, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 7/7] drm/amdgpu: keep the A+A VF VRAM base at the SRAT address
Date: Fri, 13 Nov 2026 15:29:25 +0000	[thread overview]
Message-ID: <sashiko-outbox-213090@kernel.org> (raw)
In-Reply-To: <20261113145702.323968-7-Zhigang.Luo@amd.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] drm/amdgpu: amdgpu_acpi_find_gpu_memory_in_srat() always
  returns -ENOENT
--

commit eababb17e2adcd526ed509506729f9c07f446351
Author: Zhigang Luo <Zhigang.Luo@amd.com>

drm/amdgpu: keep the A+A VF VRAM base at the SRAT address

This commit reads the ACPI SRAT entry in mmhub_v4_2_0_get_xgmi_info() on A+A
SPM VFs to set the framebuffer offset and single-node XGMI segment size from
the SRAT address and length.

> diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v4_2_0.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v4_2_0.c
> index 4495d52b4b07c..8593453445e38 100644
> --- a/drivers/gpu/drm/amd/amdgpu/mmhub_v4_2_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v4_2_0.c
> @@ -132,6 +132,27 @@ static int mmhub_v4_2_0_get_xgmi_info(struct amdgpu_device *adev)
>  	if (!adev->gmc.xgmi.connected_to_cpu)
>  		return 0;
>  
> +	/* The SRAT entry is the VF's whole VRAM. PF_LFB_REGION describes
> +	 * the physical GPU, not the VF, so report a single node. The
> +	 * length is the segment size; the address is the FB offset.
> +	 * aper_base is filled from those later.
> +	 */
> +	if (amdgpu_virt_vram_is_spm(adev)) {
> +		u64 fb_offset;
> +		int r;
> +
> +		r = amdgpu_acpi_find_gpu_memory_in_srat(adev, &fb_offset,
> +							&seg_size);
> +		if (r)
> +			return r;

[Severity: High]
Does calling amdgpu_acpi_find_gpu_memory_in_srat() here cause
mmhub_v4_2_0_get_xgmi_info() to always fail with -ENOENT on mainline builds?
The real implementation of amdgpu_acpi_find_gpu_memory_in_srat() is guarded
by HAVE_ACPI_SRAT_GENERIC_AFFINITY, which is never defined in the kernel
tree:

drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:
#ifdef HAVE_ACPI_SRAT_GENERIC_AFFINITY
...
int amdgpu_acpi_find_gpu_memory_in_srat(struct amdgpu_device *adev,
					uint64_t *base_addr, uint64_t *length)
{
...
}
#else
int amdgpu_acpi_find_gpu_memory_in_srat(struct amdgpu_device *adev,
					uint64_t *base_addr, uint64_t *length)
{
	if (!base_addr || !length)
		return -EINVAL;

	return -ENOENT;
}
#endif

Because only the #else stub is compiled, mmhub_v4_2_0_get_xgmi_info() returns
-ENOENT and aborts amdgpu_device_init() on all A+A SPM VFs.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261113145702.323968-1-Zhigang.Luo@amd.com?part=7

  reply	other threads:[~2026-11-13 15:29 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 14:56 [PATCH 1/7] Revert "drm/amdgpu: mark A+A VF VRAM mappings as system memory" Zhigang Luo
2026-11-13 14:56 ` [PATCH 2/7] Revert "drm/amdkfd: mark A+A VF VRAM PTEs " Zhigang Luo
2026-11-13 15:16   ` sashiko-bot
2026-11-13 14:56 ` [PATCH 3/7] Revert "drm/amdgpu: take the A+A VF GMC aperture from SRAT" Zhigang Luo
2026-11-13 15:20   ` sashiko-bot
2026-11-13 14:56 ` [PATCH 4/7] drm/amdgpu: set the A+A VF SYSTEM bit in the GFX 12.1 helpers Zhigang Luo
2026-11-13 15:20   ` sashiko-bot
2026-11-16  9:43   ` Christian König
2026-11-13 14:57 ` [PATCH 5/7] drm/amdgpu: fill the A+A VF PDB0 through get_vm_pde Zhigang Luo
2026-11-13 15:14   ` sashiko-bot
2026-11-16 16:12     ` Luo, Zhigang
2026-11-16  9:44   ` Christian König
2026-11-13 14:57 ` [PATCH 6/7] drm/amdgpu: align the sysvm GART start to 8GB Zhigang Luo
2026-11-13 15:05   ` sashiko-bot
2026-11-16 10:09   ` Christian König
2026-11-13 14:57 ` [PATCH 7/7] drm/amdgpu: keep the A+A VF VRAM base at the SRAT address Zhigang Luo
2026-11-13 15:29   ` sashiko-bot [this message]
2026-11-16 12:04   ` Christian König
2026-11-13 15:11 ` [PATCH 1/7] Revert "drm/amdgpu: mark A+A VF VRAM mappings as system memory" sashiko-bot

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=sashiko-outbox-213090@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Zhigang.Luo@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox