blob: 6997cff60cceab3cc264f158b5fe02ca3bc2de6c [file] [log] [blame]
Kevin O'Connore7cc7642009-10-04 10:05:16 -04001#ifndef __PV_H
2#define __PV_H
3
4#include "util.h"
5
6/* This CPUID returns the signature 'KVMKVMKVM' in ebx, ecx, and edx. It
7 * should be used to determine that a VM is running under KVM.
8 */
9#define KVM_CPUID_SIGNATURE 0x40000000
10
11static inline int kvm_para_available(void)
12{
13 unsigned int eax, ebx, ecx, edx;
14 char signature[13];
15
16 cpuid(KVM_CPUID_SIGNATURE, &eax, &ebx, &ecx, &edx);
17 memcpy(signature + 0, &ebx, 4);
18 memcpy(signature + 4, &ecx, 4);
19 memcpy(signature + 8, &edx, 4);
20 signature[12] = 0;
21
22 if (strcmp(signature, "KVMKVMKVM") == 0)
23 return 1;
24
25 return 0;
26}
27
28#define QEMU_CFG_SIGNATURE 0x00
29#define QEMU_CFG_ID 0x01
30#define QEMU_CFG_UUID 0x02
31#define QEMU_CFG_NUMA 0x0d
32#define QEMU_CFG_BOOT_MENU 0x0e
33#define QEMU_CFG_MAX_CPUS 0x0f
34#define QEMU_CFG_ARCH_LOCAL 0x8000
35#define QEMU_CFG_ACPI_TABLES (QEMU_CFG_ARCH_LOCAL + 0)
36#define QEMU_CFG_SMBIOS_ENTRIES (QEMU_CFG_ARCH_LOCAL + 1)
37
38extern int qemu_cfg_present;
39
40void qemu_cfg_port_probe(void);
41int qemu_cfg_show_boot_menu(void);
42void qemu_cfg_get_uuid(u8 *uuid);
43
44#endif