/******************************************************************************1* arch-x86/cpuid.h2*3* CPUID interface to Xen.4*5* Permission is hereby granted, free of charge, to any person obtaining a copy6* of this software and associated documentation files (the "Software"), to7* deal in the Software without restriction, including without limitation the8* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or9* sell copies of the Software, and to permit persons to whom the Software is10* furnished to do so, subject to the following conditions:11*12* The above copyright notice and this permission notice shall be included in13* all copies or substantial portions of the Software.14*15* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR16* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,17* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE18* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER19* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING20* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER21* DEALINGS IN THE SOFTWARE.22*23* Copyright (c) 2007 Citrix Systems, Inc.24*25* Authors:26* Keir Fraser <[email protected]>27*/2829#ifndef __XEN_PUBLIC_ARCH_X86_CPUID_H__30#define __XEN_PUBLIC_ARCH_X86_CPUID_H__3132/*33* For compatibility with other hypervisor interfaces, the Xen cpuid leaves34* can be found at the first otherwise unused 0x100 aligned boundary starting35* from 0x40000000.36*37* e.g If viridian extensions are enabled for an HVM domain, the Xen cpuid38* leaves will start at 0x4000010039*/4041#define XEN_CPUID_FIRST_LEAF 0x4000000042#define XEN_CPUID_LEAF(i) (XEN_CPUID_FIRST_LEAF + (i))4344/*45* Leaf 1 (0x40000x00)46* EAX: Largest Xen-information leaf. All leaves up to an including @EAX47* are supported by the Xen host.48* EBX-EDX: "XenVMMXenVMM" signature, allowing positive identification49* of a Xen host.50*/51#define XEN_CPUID_SIGNATURE_EBX 0x566e6558 /* "XenV" */52#define XEN_CPUID_SIGNATURE_ECX 0x65584d4d /* "MMXe" */53#define XEN_CPUID_SIGNATURE_EDX 0x4d4d566e /* "nVMM" */5455/*56* Leaf 2 (0x40000x01)57* EAX[31:16]: Xen major version.58* EAX[15: 0]: Xen minor version.59* EBX-EDX: Reserved (currently all zeroes).60*/6162/*63* Leaf 3 (0x40000x02)64* EAX: Number of hypercall transfer pages. This register is always guaranteed65* to specify one hypercall page.66* EBX: Base address of Xen-specific MSRs.67* ECX: Features 1. Unused bits are set to zero.68* EDX: Features 2. Unused bits are set to zero.69*/7071/* Does the host support MMU_PT_UPDATE_PRESERVE_AD for this guest? */72#define _XEN_CPUID_FEAT1_MMU_PT_UPDATE_PRESERVE_AD 073#define XEN_CPUID_FEAT1_MMU_PT_UPDATE_PRESERVE_AD (1u<<0)7475/*76* Leaf 4 (0x40000x03)77* Sub-leaf 0: EAX: bit 0: emulated tsc78* bit 1: host tsc is known to be reliable79* bit 2: RDTSCP instruction available80* EBX: tsc_mode: 0=default (emulate if necessary), 1=emulate,81* 2=no emulation, 3=no emulation + TSC_AUX support82* ECX: guest tsc frequency in kHz83* EDX: guest tsc incarnation (migration count)84* Sub-leaf 1: EAX: tsc offset low part85* EBX: tsc offset high part86* ECX: multiplicator for tsc->ns conversion87* EDX: shift amount for tsc->ns conversion88* Sub-leaf 2: EAX: host tsc frequency in kHz89*/9091/*92* Leaf 5 (0x40000x04)93* HVM-specific features94* Sub-leaf 0: EAX: Features95* Sub-leaf 0: EBX: vcpu id (iff EAX has XEN_HVM_CPUID_VCPU_ID_PRESENT flag)96* Sub-leaf 0: ECX: domain id (iff EAX has XEN_HVM_CPUID_DOMID_PRESENT flag)97*/98#define XEN_HVM_CPUID_APIC_ACCESS_VIRT (1u << 0) /* Virtualized APIC registers */99#define XEN_HVM_CPUID_X2APIC_VIRT (1u << 1) /* Virtualized x2APIC accesses */100/* Memory mapped from other domains has valid IOMMU entries */101#define XEN_HVM_CPUID_IOMMU_MAPPINGS (1u << 2)102#define XEN_HVM_CPUID_VCPU_ID_PRESENT (1u << 3) /* vcpu id is present in EBX */103#define XEN_HVM_CPUID_DOMID_PRESENT (1u << 4) /* domid is present in ECX */104105/*106* Leaf 6 (0x40000x05)107* PV-specific parameters108* Sub-leaf 0: EAX: max available sub-leaf109* Sub-leaf 0: EBX: bits 0-7: max machine address width110*/111112/* Max. address width in bits taking memory hotplug into account. */113#define XEN_CPUID_MACHINE_ADDRESS_WIDTH_MASK (0xffu << 0)114115#define XEN_CPUID_MAX_NUM_LEAVES 5116117#endif /* __XEN_PUBLIC_ARCH_X86_CPUID_H__ */118119120