Merge pull request #31465 from xypron/detect-virt

Detect virtualization on RISC-V
This commit is contained in:
Luca Boccassi
2024-02-23 20:50:51 +00:00
committed by GitHub

View File

@@ -98,7 +98,7 @@ static Virtualization detect_vm_cpuid(void) {
}
static Virtualization detect_vm_device_tree(void) {
#if defined(__arm__) || defined(__aarch64__) || defined(__powerpc__) || defined(__powerpc64__)
#if defined(__arm__) || defined(__aarch64__) || defined(__powerpc__) || defined(__powerpc64__) || defined(__riscv)
_cleanup_free_ char *hvtype = NULL;
int r;
@@ -155,7 +155,7 @@ static Virtualization detect_vm_device_tree(void) {
#endif
}
#if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || defined(__loongarch_lp64)
#if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || defined(__loongarch_lp64) || defined(__riscv)
static Virtualization detect_vm_dmi_vendor(void) {
static const char* const dmi_vendors[] = {
"/sys/class/dmi/id/product_name", /* Test this before sys_vendor to detect KVM over QEMU */