From: Keir Fraser <keir.xen@gmail.com>
To: Tim Deegan <tim@xen.org>, Razvan Cojocaru <rzvncj@gmail.com>
Cc: xen-devel@lists.xensource.com, JBeulich@suse.com
Subject: Re: [PATCH 2 of 2 V4] x86/HVM: fixed _hvm_hw_fix_cpu()
Date: Thu, 24 Jan 2013 13:00:41 +0000 [thread overview]
Message-ID: <CD26E0F9.4A40D%keir.xen@gmail.com> (raw)
In-Reply-To: <20130124121201.GD18850@ocelot.phlegethon.org>
On 24/01/2013 12:12, "Tim Deegan" <tim@xen.org> 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 <rzvncj@gmail.com>
>
> Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Keir Fraser <keir@xen.org>
>> 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
prev parent reply other threads:[~2013-01-24 13:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-23 15:46 [PATCH 1 of 2 V4] libxc, libxenstore: make the headers C++-friendlier Razvan Cojocaru
2013-01-23 15:46 ` [PATCH 2 of 2 V4] x86/HVM: fixed _hvm_hw_fix_cpu() Razvan Cojocaru
2013-01-24 12:12 ` Tim Deegan
2013-01-24 13:00 ` Keir Fraser [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CD26E0F9.4A40D%keir.xen@gmail.com \
--to=keir.xen@gmail.com \
--cc=JBeulich@suse.com \
--cc=rzvncj@gmail.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).