debuggers.hg
changeset 16762:a66bdc82d8fa
x86: Reserve a CPUID feature bit to advertise new
MMU_PT_UPDATE_PRESERVE_AD hypercall command.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
MMU_PT_UPDATE_PRESERVE_AD hypercall command.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Wed Jan 16 11:44:41 2008 +0000 (2008-01-16) |
parents | a407a8a51319 |
children | 847bc9b19c48 |
files | xen/arch/x86/traps.c xen/include/public/arch-x86/cpuid.h |
line diff
1.1 --- a/xen/arch/x86/traps.c Tue Jan 15 21:23:37 2008 +0000 1.2 +++ b/xen/arch/x86/traps.c Wed Jan 16 11:44:41 2008 +0000 1.3 @@ -62,6 +62,7 @@ 1.4 #include <asm/shared.h> 1.5 #include <asm/x86_emulate.h> 1.6 #include <asm/hvm/vpt.h> 1.7 +#include <public/arch-x86/cpuid.h> 1.8 1.9 /* 1.10 * opt_nmi: one of 'ignore', 'dom0', or 'fatal'. 1.11 @@ -610,10 +611,10 @@ int cpuid_hypervisor_leaves( 1.12 switch ( idx ) 1.13 { 1.14 case 0: 1.15 - *eax = 0x40000002; /* Largest leaf */ 1.16 - *ebx = 0x566e6558; /* Signature 1: "XenV" */ 1.17 - *ecx = 0x65584d4d; /* Signature 2: "MMXe" */ 1.18 - *edx = 0x4d4d566e; /* Signature 3: "nVMM" */ 1.19 + *eax = 0x40000002; /* Largest leaf */ 1.20 + *ebx = XEN_CPUID_SIGNATURE_EBX; 1.21 + *ecx = XEN_CPUID_SIGNATURE_ECX; 1.22 + *edx = XEN_CPUID_SIGNATURE_EDX; 1.23 break; 1.24 1.25 case 1: 1.26 @@ -628,6 +629,8 @@ int cpuid_hypervisor_leaves( 1.27 *ebx = 0x40000000; /* MSR base address */ 1.28 *ecx = 0; /* Features 1 */ 1.29 *edx = 0; /* Features 2 */ 1.30 + if ( !is_hvm_vcpu(current) ) 1.31 + *ecx |= XEN_CPUID_FEAT1_MMU_PT_UPDATE_PRESERVE_AD; 1.32 break; 1.33 1.34 default:
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/xen/include/public/arch-x86/cpuid.h Wed Jan 16 11:44:41 2008 +0000 2.3 @@ -0,0 +1,68 @@ 2.4 +/****************************************************************************** 2.5 + * arch-x86/cpuid.h 2.6 + * 2.7 + * CPUID interface to Xen. 2.8 + * 2.9 + * Permission is hereby granted, free of charge, to any person obtaining a copy 2.10 + * of this software and associated documentation files (the "Software"), to 2.11 + * deal in the Software without restriction, including without limitation the 2.12 + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 2.13 + * sell copies of the Software, and to permit persons to whom the Software is 2.14 + * furnished to do so, subject to the following conditions: 2.15 + * 2.16 + * The above copyright notice and this permission notice shall be included in 2.17 + * all copies or substantial portions of the Software. 2.18 + * 2.19 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 2.20 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 2.21 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 2.22 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 2.23 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 2.24 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 2.25 + * DEALINGS IN THE SOFTWARE. 2.26 + * 2.27 + * Copyright (c) 2007 Citrix Systems, Inc. 2.28 + * 2.29 + * Authors: 2.30 + * Keir Fraser <keir.fraser@citrix.com> 2.31 + */ 2.32 + 2.33 +#ifndef __XEN_PUBLIC_ARCH_X86_CPUID_H__ 2.34 +#define __XEN_PUBLIC_ARCH_X86_CPUID_H__ 2.35 + 2.36 +/* Xen identification leaves start at 0x40000000. */ 2.37 +#define XEN_CPUID_FIRST_LEAF 0x40000000 2.38 +#define XEN_CPUID_LEAF(i) (XEN_CPUID_FIRST_LEAF + (i)) 2.39 + 2.40 +/* 2.41 + * Leaf 1 (0x40000000) 2.42 + * EAX: Largest Xen-information leaf. All leaves up to an including @EAX 2.43 + * are supported by the Xen host. 2.44 + * EBX-EDX: "XenVMMXenVMM" signature, allowing positive identification 2.45 + * of a Xen host. 2.46 + */ 2.47 +#define XEN_CPUID_SIGNATURE_EBX 0x566e6558 /* "XenV" */ 2.48 +#define XEN_CPUID_SIGNATURE_ECX 0x65584d4d /* "MMXe" */ 2.49 +#define XEN_CPUID_SIGNATURE_EDX 0x4d4d566e /* "nVMM" */ 2.50 + 2.51 +/* 2.52 + * Leaf 2 (0x40000001) 2.53 + * EAX[31:16]: Xen major version. 2.54 + * EAX[15: 0]: Xen minor version. 2.55 + * EBX-EDX: Reserved (currently all zeroes). 2.56 + */ 2.57 + 2.58 +/* 2.59 + * Leaf 3 (0x40000002) 2.60 + * EAX: Number of hypercall transfer pages. This register is always guaranteed 2.61 + * to specify one hypercall page. 2.62 + * EBX: Base address of Xen-specific MSRs. 2.63 + * ECX: Features 1. Unused bits are set to zero. 2.64 + * EDX: Features 2. Unused bits are set to zero. 2.65 + */ 2.66 + 2.67 +/* Does the host support MMU_PT_UPDATE_PRESERVE_AD for this guest? */ 2.68 +#define _XEN_CPUID_FEAT1_MMU_PT_UPDATE_PRESERVE_AD 0 2.69 +#define XEN_CPUID_FEAT1_MMU_PT_UPDATE_PRESERVE_AD (1u<<0) 2.70 + 2.71 +#endif /* __XEN_PUBLIC_ARCH_X86_CPUID_H__ */