From: "Jan Beulich" Subject: Re: [PATCH v3 2/3] x86/HVM: fix ID handling of x2APIC emulation Date: Fri, 12 Sep 2014 15:49:29 +0100 Message-ID: <541324190200007800034903@mail.emea.novell.com> References: <5413077902000078000347F7@mail.emea.novell.com> <541308E10200007800034806@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XSSAF-00086z-SL for xen-devel@lists.xenproject.org; Fri, 12 Sep 2014 14:49:31 +0000 In-Reply-To: <541308E10200007800034806@mail.emea.novell.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Ian Campbell , Ian Jackson , Keir Fraser , Stefano Stabellini , Tim Deegan List-Id: xen-devel@lists.xenproject.org >>> On 12.09.14 at 14:53, wrote: > - properly change ID when switching into x2APIC mode (instead of > mimicking necessary behavior in hvm_x2apic_msr_read()) > - correctly (meaningfully) set LDR (so far it ended up being 1 on all > vCPU-s) > - even if we don't support more than 128 vCPU-s in a HVM guest for now, > we should properly handle IDs as 32-bit values (i.e. not ignore the > top 24 bits) > - with that, properly do cluster ID and bit mask check in > vlapic_match_logical_addr() > - slightly adjust other parameter types of vlapic_match_dest() and > vlapic_lowest_prio() (and related local variable ones) > > Signed-off-by: Jan Beulich > --- > v2: Some changes broken out to separate patch. Correct ID and > LDR after domain restore (if necessary); as stated previously the > only compatibility problem this creates is when migrating a VM _to_ > an unfixed (i.e. old) hypervisor, a scenario which supposedly isn't > supported. This post-migration fixup involves introducing > arch_domain_unpause(), needed here to fix up state after all > intended state setting was done (any suggestion as to how else to > accomplish this is very welcome). Oops - just realized the quoted portion below needs a wider Cc list. Jan > --- a/xen/include/asm-arm/domain.h > +++ b/xen/include/asm-arm/domain.h > @@ -241,6 +241,8 @@ struct arch_vcpu > void vcpu_show_execution_state(struct vcpu *); > void vcpu_show_registers(const struct vcpu *); > > +#define arch_domain_unpause(d) ((void)(d)) > + > #endif /* __ASM_DOMAIN_H__ */ > > /* > --- a/xen/common/domain.c > +++ b/xen/common/domain.c > @@ -949,8 +949,11 @@ void domain_unpause(struct domain *d) > struct vcpu *v; > > if ( atomic_dec_and_test(&d->pause_count) ) > + { > + arch_domain_unpause(d); > for_each_vcpu( d, v ) > vcpu_wake(v); > + } > } > > int __domain_pause_by_systemcontroller(struct domain *d,