From: "Christian König" <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: wentalou <Wentao.Lou-5C7GfCeVMHo@public.gmane.org>,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH] drm/amdgpu: sriov put csa below AMDGPU_GMC_HOLE
Date: Wed, 23 Jan 2019 11:16:03 +0100 [thread overview]
Message-ID: <a36ecaad-d22a-3890-c7fd-5bb3797ca20a@gmail.com> (raw)
In-Reply-To: <1548154169-2650-1-git-send-email-Wentao.Lou-5C7GfCeVMHo@public.gmane.org>
I think it would be better to restrict max_pfn in general under SRIOV.
When the higher address space doesn't work for the CSA it will probably
cause problems elsewhere as well.
Christian.
Am 22.01.19 um 11:49 schrieb wentalou:
> since vm_size enlarged to 0x40000 GB,
> sriov need to put csa below AMDGPU_GMC_HOLE.
> or amdgpu_vm_alloc_pts would receive saddr among AMDGPU_GMC_HOLE,
> and result in a range fault interrupt IIRC.
>
> Change-Id: I405a25a01d949f3130889b346f71bedad8ebcae7
> Signed-off-by: Wenta Lou <Wentao.Lou@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c | 6 ++++--
> drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 6 ++++--
> 2 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c
> index dd3bd01..7a93c36 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c
> @@ -26,8 +26,10 @@
>
> uint64_t amdgpu_csa_vaddr(struct amdgpu_device *adev)
> {
> - uint64_t addr = min(adev->vm_manager.max_pfn << AMDGPU_GPU_PAGE_SHIFT,
> - AMDGPU_GMC_HOLE_START);
> + uint64_t addr = adev->vm_manager.max_pfn << AMDGPU_GPU_PAGE_SHIFT;
> + /* sriov put csa below AMDGPU_GMC_HOLE */
> + if (amdgpu_sriov_vf(adev))
> + addr = min(addr, AMDGPU_GMC_HOLE_START);
>
> addr -= AMDGPU_VA_RESERVED_SIZE;
> addr = amdgpu_gmc_sign_extend(addr);
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> index f87f717..cf9ec28 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> @@ -707,8 +707,10 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
> vm_size = min(vm_size, 1ULL << 40);
>
> dev_info.virtual_address_offset = AMDGPU_VA_RESERVED_SIZE;
> - dev_info.virtual_address_max =
> - min(vm_size, AMDGPU_GMC_HOLE_START);
> + if (amdgpu_sriov_vf(adev))
> + dev_info.virtual_address_max = min(vm_size, AMDGPU_GMC_HOLE_START - AMDGPU_VA_RESERVED_SIZE);
> + else
> + dev_info.virtual_address_max = min(vm_size, AMDGPU_GMC_HOLE_START);
>
> if (vm_size > AMDGPU_GMC_HOLE_START) {
> dev_info.high_va_offset = AMDGPU_GMC_HOLE_END;
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
prev parent reply other threads:[~2019-01-23 10:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-22 10:49 [PATCH] drm/amdgpu: sriov put csa below AMDGPU_GMC_HOLE wentalou
[not found] ` <1548154169-2650-1-git-send-email-Wentao.Lou-5C7GfCeVMHo@public.gmane.org>
2019-01-23 10:16 ` Christian König [this message]
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=a36ecaad-d22a-3890-c7fd-5bb3797ca20a@gmail.com \
--to=ckoenig.leichtzumerken-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=Wentao.Lou-5C7GfCeVMHo@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=christian.koenig-5C7GfCeVMHo@public.gmane.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