From: Tim Deegan Subject: Re: [PATCH] Allow PV superpages to work with live migration Date: Tue, 18 May 2010 15:32:05 +0100 Message-ID: <20100518143205.GH4164@whitby.uk.xensource.com> References: <201005171410.47235.dcm@mccr.org> <20100518123553.GG4164@whitby.uk.xensource.com> <201005180920.18349.dcm@mccr.org> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Return-path: Content-Disposition: inline In-Reply-To: <201005180920.18349.dcm@mccr.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Dave McCracken Cc: Jeremy Fitzhardinge , Xen Developers List , Keir Fraser List-Id: xen-devel@lists.xenproject.org At 15:20 +0100 on 18 May (1274196018), Dave McCracken wrote: > On Tuesday, May 18, 2010, Tim Deegan wrote: > > It rather overshoots. :) This enables PSE even for HVM guests which > > have explicitly disabled it. I think you want > > > > return (is_hvm_vcpu(v) ? (GUEST_PAGING_LEVELS != 2 > > || !hvm_paging_enabled(v) > > || (v->arch.hvm_vcpu.guest_cr[4] & > > X86_CR4_PSE)) : opt_allow_hugepage); > > I'm confused. As far as I know, opt_allow_hugeage only affects PV guests. All > I did in the macro was add a test for it. I didn't touch any of the HVM > logic. Are you saying the HVM logic is wrong or that opt_allow_hugepage > affects HVM guests in some fashion? It would affect them after your change: + return (opt_allow_hugepage || + (is_hvm_vcpu(v) && + (GUEST_PAGING_LEVELS != 2 + || !hvm_paging_enabled(v) + || (v->arch.hvm_vcpu.guest_cr[4] & X86_CR4_PSE)))); This makes the whole predicate true _even_for_hvm_guests_ whenever opt_allow_hugepage is true. It should not be true for HVM guests that have disabled PSE, regardless of the setting of opt_allow_hugepage. Cheers, Tim. -- Tim Deegan Principal Software Engineer, XenServer Engineering Citrix Systems UK Ltd. (Company #02937203, SL9 0BG)