From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH -v2] kvm: Emulate MOVBE Date: Tue, 16 Apr 2013 13:36:00 +0200 Message-ID: <516D37A0.2070706@redhat.com> References: <20130409234602.GI5077@pd.tnic> <20130410112942.07dfc167@slackpad> <20130410100845.GB17919@redhat.com> <20130410123901.46b65169@slackpad> <20130410121639.GE17919@redhat.com> <20130411001815.GA17544@pd.tnic> <20130414084303.GE17919@redhat.com> <20130414210218.GF20547@pd.tnic> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Gleb Natapov , Andre Przywara , kvm@vger.kernel.org, =?UTF-8?B?SsO2cmcgUsO2ZGVs?= , "H. Peter Anvin" , x86-ml To: Borislav Petkov Return-path: Received: from mail-qa0-f47.google.com ([209.85.216.47]:50520 "EHLO mail-qa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754909Ab3DPLgN (ORCPT ); Tue, 16 Apr 2013 07:36:13 -0400 Received: by mail-qa0-f47.google.com with SMTP id bn16so1223390qab.13 for ; Tue, 16 Apr 2013 04:36:13 -0700 (PDT) In-Reply-To: <20130414210218.GF20547@pd.tnic> Sender: kvm-owner@vger.kernel.org List-ID: Il 14/04/2013 23:02, Borislav Petkov ha scritto: > *(u16 *)&ctxt->dst.val = swab16((u16)ctxt->src.val); > > movzwl 112(%rdi), %eax # ctxt_5(D)->src.D.27823.val, tmp82 > rolw $8, %ax #, tmp82 > movw %ax, 240(%rdi) # tmp82, MEM[(u16 *)ctxt_5(D) + 240B] I think this breaks the C aliasing rules. Using valptr is okay because it is a char. Paolo