From: Paolo Bonzini <pbonzini@redhat.com>
To: Nick Desaulniers <nick.desaulniers@gmail.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Ingo Molnar" <mingo@redhat.com>,
"H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: x86: remove ignored type attribute
Date: Tue, 27 Jun 2017 16:31:33 +0200 [thread overview]
Message-ID: <f68af80a-42d4-347e-373c-1328074bf313@redhat.com> (raw)
In-Reply-To: <20170623044120.6296-1-nick.desaulniers@gmail.com>
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 <nick.desaulniers@gmail.com>
> ---
> 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
next prev parent reply other threads:[~2017-06-27 14:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-23 4:41 [PATCH] KVM: x86: remove ignored type attribute Nick Desaulniers
2017-06-27 14:31 ` Paolo Bonzini [this message]
2017-06-28 2:37 ` [PATCH v2] " Nick Desaulniers
2017-06-28 2:44 ` Nick Desaulniers
2017-06-30 10:46 ` Paolo Bonzini
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=f68af80a-42d4-347e-373c-1328074bf313@redhat.com \
--to=pbonzini@redhat.com \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=nick.desaulniers@gmail.com \
--cc=rkrcmar@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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).