Skip to content

Commit 7bbf6d1

Browse files
committed
accel/amdxdna: Block running under a hypervisor
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>
1 parent 2b973ca commit 7bbf6d1

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"
@@ -508,6 +509,11 @@ static int aie2_init(struct amdxdna_dev *xdna)
508509
unsigned long bars = 0;
509510
int i, nvec, ret;
510511

512+
if (!hypervisor_is_type(X86_HYPER_NATIVE)) {
513+
XDNA_ERR(xdna, "Running under hypervisor not supported");
514+
return -EINVAL;
515+
}
516+
511517
ndev = drmm_kzalloc(&xdna->ddev, sizeof(*ndev), GFP_KERNEL);
512518
if (!ndev)
513519
return -ENOMEM;

0 commit comments

Comments
 (0)