accel/amdxdna: Block running under a hypervisor

SVA support is required, which isn't configured by hypervisor
solutions.

Closes: https://github.com/QubesOS/qubes-issues/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>
This commit is contained in:
Mario Limonciello (AMD)
2025-12-12 23:44:47 -06:00
parent 2b973ca48f
commit 7bbf6d15e9

View File

@@ -17,6 +17,7 @@
#include <linux/iopoll.h> #include <linux/iopoll.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/xarray.h> #include <linux/xarray.h>
#include <asm/hypervisor.h>
#include "aie2_msg_priv.h" #include "aie2_msg_priv.h"
#include "aie2_pci.h" #include "aie2_pci.h"
@@ -508,6 +509,11 @@ static int aie2_init(struct amdxdna_dev *xdna)
unsigned long bars = 0; unsigned long bars = 0;
int i, nvec, ret; int i, nvec, ret;
if (!hypervisor_is_type(X86_HYPER_NATIVE)) {
XDNA_ERR(xdna, "Running under hypervisor not supported");
return -EINVAL;
}
ndev = drmm_kzalloc(&xdna->ddev, sizeof(*ndev), GFP_KERNEL); ndev = drmm_kzalloc(&xdna->ddev, sizeof(*ndev), GFP_KERNEL);
if (!ndev) if (!ndev)
return -ENOMEM; return -ENOMEM;