Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752397AbdF0Oc1 (ORCPT ); Tue, 27 Jun 2017 10:32:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37144 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753172AbdF0Obj (ORCPT ); Tue, 27 Jun 2017 10:31:39 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 87E5842BC9 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 87E5842BC9 Subject: Re: [PATCH] KVM: x86: remove ignored type attribute To: Nick Desaulniers Cc: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20170623044120.6296-1-nick.desaulniers@gmail.com> From: Paolo Bonzini Message-ID: Date: Tue, 27 Jun 2017 16:31:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20170623044120.6296-1-nick.desaulniers@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 27 Jun 2017 14:31:38 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1129 Lines: 32 On 23/06/2017 06:41, Nick Desaulniers wrote: > The macro insn_fetch marks the 'type' argument as having a specified > alignment. Type attributes can only be applied to structs, unions, or > enums, but insn_fetch is only ever invoked with integral types, so Clang > produces 19 -Wignored-attributes warnings for this source file. > > Signed-off-by: Nick Desaulniers > --- > arch/x86/kvm/emulate.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c > index 7611c034bf95..409081977e59 100644 > --- a/arch/x86/kvm/emulate.c > +++ b/arch/x86/kvm/emulate.c > @@ -900,7 +900,7 @@ static __always_inline int do_insn_fetch_bytes(struct x86_emulate_ctxt *ctxt, > if (rc != X86EMUL_CONTINUE) \ > goto done; \ > ctxt->_eip += sizeof(_type); \ > - _x = *(_type __aligned(1) *) ctxt->fetch.ptr; \ > + _x = *(_type *) ctxt->fetch.ptr; \ > ctxt->fetch.ptr += sizeof(_type); \ > _x; \ > }) > Can you make a patch that uses memcpy instead? Both GCC and clang will compile it to a simple load. Paolo