mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiqian Chen <Jiqian.Chen@amd.com>
To: "Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Xinhui Pan" <Xinhui.Pan@amd.com>
Cc: <amd-gfx@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
	Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>,
	Huang Rui <ray.huang@amd.com>, Jiqian Chen <Jiqian.Chen@amd.com>
Subject: [PATCH 1/2] drm/amdgpu: set passthrough mode for xen pvh/hvm
Date: Tue, 5 Nov 2024 14:05:30 +0800	[thread overview]
Message-ID: <20241105060531.3503788-2-Jiqian.Chen@amd.com> (raw)
In-Reply-To: <20241105060531.3503788-1-Jiqian.Chen@amd.com>

From: Huang Rui <ray.huang@amd.com>

There is an second stage translation between the guest machine address
and host machine address in Xen PVH/HVM. The PCI bar address in the xen
guest kernel are not translated at the second stage on Xen PVH/HVM, so
it's not the real physical address that hardware would like to know, so
we need to set passthrough mode for Xen PVH/HVM as well.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
index b6397d3229e1..0836fb77b263 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
@@ -764,7 +764,8 @@ void amdgpu_detect_virtualization(struct amdgpu_device *adev)
 
 	if (!reg) {
 		/* passthrough mode exclus sriov mod */
-		if (is_virtual_machine() && !xen_initial_domain())
+		if (is_virtual_machine() &&
+		    !(xen_initial_domain() && xen_pv_domain()))
 			adev->virt.caps |= AMDGPU_PASSTHROUGH_MODE;
 	}
 
-- 
2.34.1


  reply	other threads:[~2024-11-05  6:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-05  6:05 [PATCH 0/2] Fix some issues when using amdgpu on XEN PVH dom0 Jiqian Chen
2024-11-05  6:05 ` Jiqian Chen [this message]
2024-11-13  8:13   ` [PATCH 1/2] drm/amdgpu: set passthrough mode for xen pvh/hvm Chen, Jiqian
2024-11-05  6:05 ` [PATCH 2/2] drm/amdgpu: Bypass resizing bars for PVH dom0 Jiqian Chen
2024-11-05 11:58   ` kernel test robot
2024-11-05 13:42   ` Christian König
2024-11-06  3:20     ` Chen, Jiqian
     [not found]       ` <228fa4cd-1e2d-40f6-8c63-15a9d6f90a04@amd.com>
2024-11-07  2:17         ` Chen, Jiqian
2024-11-05 16:49   ` kernel test robot

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=20241105060531.3503788-2-Jiqian.Chen@amd.com \
    --to=jiqian.chen@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pierre-eric.pelloux-prayer@amd.com \
    --cc=ray.huang@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

all inboxes | Powered by JetHome®