From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH 2 of 2 V4] x86/HVM: fixed _hvm_hw_fix_cpu() Date: Thu, 24 Jan 2013 13:00:41 +0000 Message-ID: References: <20130124121201.GD18850@ocelot.phlegethon.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130124121201.GD18850@ocelot.phlegethon.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tim Deegan , Razvan Cojocaru Cc: xen-devel@lists.xensource.com, JBeulich@suse.com List-Id: xen-devel@lists.xenproject.org On 24/01/2013 12:12, "Tim Deegan" wrote: > At 17:46 +0200 on 23 Jan (1358963209), Razvan Cojocaru wrote: >> Prevent the compiler from re-ordering the reads and writes. >> Suggested by Jan Beulich. >> >> Signed-off-by: Razvan Cojocaru > > Acked-by: Tim Deegan Acked-by: Keir Fraser >> diff -r 3a9979cf50f3 -r 550e437674c7 xen/include/public/arch-x86/hvm/save.h >> --- a/xen/include/public/arch-x86/hvm/save.h Wed Jan 23 17:27:20 2013 +0200 >> +++ b/xen/include/public/arch-x86/hvm/save.h Wed Jan 23 17:44:20 2013 +0200 >> @@ -269,15 +269,20 @@ struct hvm_hw_cpu_compat { >> }; >> >> static inline int _hvm_hw_fix_cpu(void *h) { >> - struct hvm_hw_cpu *new=h; >> - struct hvm_hw_cpu_compat *old=h; >> + >> + union hvm_hw_cpu_union { >> + struct hvm_hw_cpu nat; >> + struct hvm_hw_cpu_compat cmp; >> + }; >> + >> + union hvm_hw_cpu_union *ucpu = (union hvm_hw_cpu_union *)h;; >> >> /* If we copy from the end backwards, we should >> * be able to do the modification in-place */ >> - new->error_code=old->error_code; >> - new->pending_event=old->pending_event; >> - new->tsc=old->tsc; >> - new->msr_tsc_aux=0; >> + ucpu->nat.error_code = ucpu->cmp.error_code; >> + ucpu->nat.pending_event = ucpu->cmp.pending_event; >> + ucpu->nat.tsc = ucpu->cmp.tsc; >> + ucpu->nat.msr_tsc_aux = 0; >> >> return 0; >> } >> >> _______________________________________________ >> Xen-devel mailing list >> Xen-devel@lists.xen.org >> http://lists.xen.org/xen-devel > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel