From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH v15 05/19] pvh prep: Introduce pv guest type and has_hvm_container macros Date: Tue, 12 Nov 2013 15:12:53 +0000 Message-ID: <52824575.60108@eu.citrix.com> References: <1384181841-22739-1-git-send-email-george.dunlap@eu.citrix.com> <1384181841-22739-6-git-send-email-george.dunlap@eu.citrix.com> <52823C87020000780010259F@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VgFeY-00072F-IN for xen-devel@lists.xenproject.org; Tue, 12 Nov 2013 15:13:18 +0000 In-Reply-To: <52823C87020000780010259F@nat28.tlf.novell.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: Jan Beulich Cc: xen-devel , Keir Fraser , Tim Deegan List-Id: xen-devel@lists.xenproject.org On 11/12/2013 01:34 PM, Jan Beulich wrote: >>>> On 11.11.13 at 15:57, George Dunlap wrote: >> --- a/xen/arch/x86/acpi/suspend.c >> +++ b/xen/arch/x86/acpi/suspend.c >> @@ -85,7 +85,7 @@ void restore_rest_processor_state(void) >> BUG(); >> >> /* Maybe load the debug registers. */ >> - BUG_ON(is_hvm_vcpu(curr)); >> + BUG_ON(!is_pv_vcpu(curr)); >> if ( !is_idle_vcpu(curr) && curr->arch.debugreg[7] ) >> { >> write_debugreg(0, curr->arch.debugreg[0]); > > This is certainly fine for now, but I guess in the long run (i.e. when > supporting Dom0) this will need changing from BUG_ON() to > integrating the condition with the if(). Yes -- the BUG_ON() was to make sure someone thinks carefully about what the right thing is to do here. I suppose there should have been a fixme here as well, however. > >> @@ -1246,8 +1246,7 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c) >> bool_t compat = is_pv_32on64_domain(v->domain); >> #define c(fld) (!compat ? (c.nat->fld) : (c.cmp->fld)) >> >> - if ( is_hvm_vcpu(v) ) >> - memset(c.nat, 0, sizeof(*c.nat)); >> + memset(c.nat, 0, sizeof(*c.nat)); > > Removing the conditional is both dangerous and unmotivated: > Dangerous because you now assume that the space allocated is > always covering the (larger) native size (this currently happens to > be that way in the only caller, but isn't guaranteed). And > unmotivated because switching just the conditional (as done > throughout the rest of the patch) would have sufficed here. Indeed, I can't think of why I didn't change it to "!is_pv_vcpu()" here. -George