[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v8 15/15] xen: add new Xen cpuid node for max address width info
On very large hosts a guest needs to know whether it will have to handle frame numbers larger than 32 bits in order to select the appropriate grant interface version. Add a new Xen specific CPUID node to contain the maximum guest address width similar to the x86 CPUID node 0x80000008 containing the maximum physical address width. The maximum frame width needs to take memory hotplug into account. Signed-off-by: Juergen Gross <jgross@xxxxxxxx> --- xen/arch/x86/traps.c | 4 ++++ xen/include/public/arch-x86/cpuid.h | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 6091f239ce..7d1e0a872c 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -929,6 +929,10 @@ void cpuid_hypervisor_leaves(const struct vcpu *v, uint32_t leaf, res->b = v->vcpu_id; break; + case 5: /* Host specific parameters */ + res->a = generic_flsl(get_upper_mfn_bound() - 1) + PAGE_SHIFT; + break; + default: ASSERT_UNREACHABLE(); } diff --git a/xen/include/public/arch-x86/cpuid.h b/xen/include/public/arch-x86/cpuid.h index d709340f18..11eaa4ebfd 100644 --- a/xen/include/public/arch-x86/cpuid.h +++ b/xen/include/public/arch-x86/cpuid.h @@ -85,6 +85,15 @@ #define XEN_HVM_CPUID_IOMMU_MAPPINGS (1u << 2) #define XEN_HVM_CPUID_VCPU_ID_PRESENT (1u << 3) /* vcpu id is present in EBX */ -#define XEN_CPUID_MAX_NUM_LEAVES 4 +/* + * Leaf 6 (0x40000x05) + * Host specific parameters + * EAX: bits 0-7: max guest address width + */ + +/* Max. address width in bits taking memory hotplug into account. */ +#define XEN_CPUID_GUEST_ADDRESS_WIDTH_MASK (255u << 0) + +#define XEN_CPUID_MAX_NUM_LEAVES 5 #endif /* __XEN_PUBLIC_ARCH_X86_CPUID_H__ */ -- 2.12.3 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |