From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [v4] libxc: Expose the 1GB pages cpuid flag to guest Date: Fri, 28 Nov 2014 11:50:43 +0000 Message-ID: <1417175443.23604.18.camel@citrix.com> References: <1417171925-10102-1-git-send-email-liang.z.li@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1417171925-10102-1-git-send-email-liang.z.li@intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Liang Li Cc: wei.liu2@citrix.com, stefano.stabellini@eu.citrix.com, tim@xen.org, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, JBeulich@suse.com, andrew.cooper3@citrix.com, yang.z.zhang@intel.com List-Id: xen-devel@lists.xenproject.org On Fri, 2014-11-28 at 18:52 +0800, Liang Li wrote: > If hardware support the 1GB pages, expose the feature to guest by > default. Users don't have to use a 'cpuid= ' option in config fil > e to turn it on. > > If guest use shadow mode, the 1GB pages feature will be hidden from > guest, this is done in the function hvm_cpuid(). So the change is > okay for shadow mode case. > > Signed-off-by: Liang Li > Signed-off-by: Yang Zhang FTR although this is strictly speaking a toolstack patch I think the main ack required should be from the x86 hypervisor guys... > --- > tools/libxc/xc_cpuid_x86.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c > index a18b1ff..c97f91a 100644 > --- a/tools/libxc/xc_cpuid_x86.c > +++ b/tools/libxc/xc_cpuid_x86.c > @@ -109,6 +109,7 @@ static void amd_xc_cpuid_policy( > regs[3] &= (0x0183f3ff | /* features shared with 0x00000001:EDX */ > bitmaskof(X86_FEATURE_NX) | > bitmaskof(X86_FEATURE_LM) | > + bitmaskof(X86_FEATURE_PAGE1GB) | > bitmaskof(X86_FEATURE_SYSCALL) | > bitmaskof(X86_FEATURE_MP) | > bitmaskof(X86_FEATURE_MMXEXT) | > @@ -192,6 +193,7 @@ static void intel_xc_cpuid_policy( > bitmaskof(X86_FEATURE_ABM)); > regs[3] &= (bitmaskof(X86_FEATURE_NX) | > bitmaskof(X86_FEATURE_LM) | > + bitmaskof(X86_FEATURE_PAGE1GB) | > bitmaskof(X86_FEATURE_SYSCALL) | > bitmaskof(X86_FEATURE_RDTSCP)); > break; > @@ -386,6 +388,7 @@ static void xc_cpuid_hvm_policy( > clear_bit(X86_FEATURE_LM, regs[3]); > clear_bit(X86_FEATURE_NX, regs[3]); > clear_bit(X86_FEATURE_PSE36, regs[3]); > + clear_bit(X86_FEATURE_PAGE1GB, regs[3]); > } > break; >