From: Mario Limonciello <superm1@kernel.org>
To: Lizhi Hou <lizhi.hou@amd.com>,
ogabbay@kernel.org, quic_jhugo@quicinc.com,
dri-devel@lists.freedesktop.org, karol.wachowski@linux.intel.com
Cc: linux-kernel@vger.kernel.org, max.zhen@amd.com, sonal.santan@amd.com
Subject: Re: [PATCH V1] accel/amdxdna: Require carveout when PASID and force_iova are disabled
Date: Thu, 4 Jun 2026 14:56:27 -0500 [thread overview]
Message-ID: <abe9dd4c-194d-46c3-b074-941698c3236d@kernel.org> (raw)
In-Reply-To: <20260604195459.2423279-1-lizhi.hou@amd.com>
On 6/4/26 14:54, Lizhi Hou wrote:
> When both PASID and force_iova are disabled, carveout memory should be
> used. Reject buffer allocations that cannot use carveout memory in this
> configuration and return an error.
>
> Fixes: 3cc5d7a59519 ("accel/amdxdna: Add carveout memory support for non-IOMMU systems")
> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
> ---
> drivers/accel/amdxdna/amdxdna_pci_drv.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/accel/amdxdna/amdxdna_pci_drv.c b/drivers/accel/amdxdna/amdxdna_pci_drv.c
> index c677293c1ae7..1f066ed8d236 100644
> --- a/drivers/accel/amdxdna/amdxdna_pci_drv.c
> +++ b/drivers/accel/amdxdna/amdxdna_pci_drv.c
> @@ -120,8 +120,14 @@ static int amdxdna_drm_open(struct drm_device *ddev, struct drm_file *filp)
>
> if (!amdxdna_iova_on(xdna)) {
> /* No need to fail open since user may use pa + carveout later. */
> - if (amdxdna_sva_init(client))
> + if (amdxdna_sva_init(client)) {
> XDNA_WARN(xdna, "PASID not available for pid %d", client->pid);
> + if (!amdxdna_use_carveout(xdna)) {
> + XDNA_ERR(xdna, "PASID unavailable and carveout not configured");
> + kfree(client);
> + return -EINVAL;
> + }
> + }
> }
> mmgrab(client->mm);
> init_srcu_struct(&client->hwctx_srcu);
next prev parent reply other threads:[~2026-06-04 19:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-04 19:54 [PATCH V1] accel/amdxdna: Require carveout when PASID and force_iova are disabled Lizhi Hou
2026-06-04 19:56 ` Mario Limonciello [this message]
2026-06-05 16:22 ` Lizhi Hou
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=abe9dd4c-194d-46c3-b074-941698c3236d@kernel.org \
--to=superm1@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=karol.wachowski@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizhi.hou@amd.com \
--cc=max.zhen@amd.com \
--cc=ogabbay@kernel.org \
--cc=quic_jhugo@quicinc.com \
--cc=sonal.santan@amd.com \
/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