Xen Test Framework
cpuid.h
Go to the documentation of this file.
1/*
2 * Xen x86 public cpuid interface
3 */
4
5#ifndef XEN_PUBLIC_ARCH_X86_CPUID_H
6#define XEN_PUBLIC_ARCH_X86_CPUID_H
7
8/*
9 * For compatibility with other hypervisor interfaces, the Xen cpuid leaves
10 * can be found at the first otherwise unused 0x100 aligned boundary starting
11 * from 0x40000000.
12 *
13 * e.g If viridian extensions are enabled for an HVM domain, the Xen cpuid
14 * leaves will start at 0x40000100
15 */
16
17#define XEN_CPUID_FIRST_LEAF 0x40000000
18
19/*
20 * Leaf 1 (0x40000x00)
21 * EAX: Largest Xen-information leaf. All leaves up to an including @EAX
22 * are supported by the Xen host.
23 * EBX-EDX: "XenVMMXenVMM" signature, allowing positive identification
24 * of a Xen host.
25 */
26#define XEN_CPUID_SIGNATURE_EBX 0x566e6558 /* "XenV" */
27#define XEN_CPUID_SIGNATURE_ECX 0x65584d4d /* "MMXe" */
28#define XEN_CPUID_SIGNATURE_EDX 0x4d4d566e /* "nVMM" */
29
30/*
31 * Leaf 3 (0x40000x02)
32 * EAX: Number of hypercall transfer pages. This register is always guaranteed
33 * to specify one hypercall page.
34 * EBX: Base address of Xen-specific MSRs.
35 * ECX: Features 1. Unused bits are set to zero.
36 * EDX: Features 2. Unused bits are set to zero.
37 */
38
39/*
40 * Leaf 5 (0x40000x04)
41 * HVM-specific features
42 * Sub-leaf 0: EAX: Features
43 * Sub-leaf 0: EBX: vcpu id (iff EAX has XEN_HVM_CPUID_VCPU_ID_PRESENT flag)
44 * Sub-leaf 0: ECX: domain id (iff EAX has XEN_HVM_CPUID_DOMID_PRESENT flag)
45 */
46#define XEN_HVM_CPUID_VCPU_ID_PRESENT (1u << 3) /* vcpu id is present in EBX */
47#define XEN_HVM_CPUID_DOMID_PRESENT (1u << 4) /* domid is present in ECX */
48
49#endif /* XEN_PUBLIC_ARCH_X86_CPUID_H */
50
51/*
52 * Local variables:
53 * mode: C
54 * c-file-style: "BSD"
55 * c-basic-offset: 4
56 * tab-width: 4
57 * indent-tabs-mode: nil
58 * End:
59 */