Skip to content

Commit 6a2049b

Browse files
superm1gregkh
authored andcommitted
accel/amdxdna: Block running under a hypervisor
[ Upstream commit 7bbf6d1 ] SVA support is required, which isn't configured by hypervisor solutions. Closes: QubesOS/qubes-issues#10275 Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4656 Reviewed-by: Lizhi Hou <lizhi.hou@amd.com> Link: https://patch.msgid.link/20251213054513.87925-1-superm1@kernel.org Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent a70fd48 commit 6a2049b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/accel/amdxdna/aie2_pci.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <linux/iopoll.h>
1818
#include <linux/pci.h>
1919
#include <linux/xarray.h>
20+
#include <asm/hypervisor.h>
2021

2122
#include "aie2_msg_priv.h"
2223
#include "aie2_pci.h"
@@ -486,6 +487,11 @@ static int aie2_init(struct amdxdna_dev *xdna)
486487
unsigned long bars = 0;
487488
int i, nvec, ret;
488489

490+
if (!hypervisor_is_type(X86_HYPER_NATIVE)) {
491+
XDNA_ERR(xdna, "Running under hypervisor not supported");
492+
return -EINVAL;
493+
}
494+
489495
ndev = drmm_kzalloc(&xdna->ddev, sizeof(*ndev), GFP_KERNEL);
490496
if (!ndev)
491497
return -ENOMEM;

0 commit comments

Comments
 (0)