Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+6
+6
drivers/accel/amdxdna/aie2_pci.c
··· 17 17 #include <linux/iopoll.h> 18 18 #include <linux/pci.h> 19 19 #include <linux/xarray.h> 20 + #include <asm/hypervisor.h> 20 21 21 22 #include "aie2_msg_priv.h" 22 23 #include "aie2_pci.h" ··· 508 507 const struct firmware *fw; 509 508 unsigned long bars = 0; 510 509 int i, nvec, ret; 510 + 511 + if (!hypervisor_is_type(X86_HYPER_NATIVE)) { 512 + XDNA_ERR(xdna, "Running under hypervisor not supported"); 513 + return -EINVAL; 514 + } 511 515 512 516 ndev = drmm_kzalloc(&xdna->ddev, sizeof(*ndev), GFP_KERNEL); 513 517 if (!ndev)