qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH 2/6] scripts/update-linux-headers: Handle __aligned_u64
Date: Fri, 25 May 2018 07:55:21 -0700	[thread overview]
Message-ID: <d37b2ff8-bb7e-bc2a-c9b8-133854c05d99@linaro.org> (raw)
In-Reply-To: <20180525132755.21839-3-peter.maydell@linaro.org>

On 05/25/2018 06:27 AM, Peter Maydell wrote:
> We'll currently replace any 'u64' with a 'uint64_t' including when
> it's embedded in an '__aligned_u64', creating a '__aligned_uint64_t'
> which doesn't exist. We need to instead expand out the kernel's
> definition of __aligned_u64:
>    #define __aligned_u64 __u64 __attribute__((aligned(8)))
> before we convert the __u64 to uint64_t.

Wow.  I did not believe that would work.  I expected that you'd need to define
a typedef, or somehow sort the attribute after the identifier to which it applies.

However

typedef unsigned long uint64_t;
uint64_t __attribute__((aligned(16))) a;
struct bar { uint64_t __attribute__((aligned(16))) foo; } b;

produces the expected alignments with both gcc(8) and clang(6).

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~

  reply	other threads:[~2018-05-25 14:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-25 13:27 [Qemu-devel] [PATCH 0/6] Update Linux headers to 4.17-rc6 Peter Maydell
2018-05-25 13:27 ` [Qemu-devel] [PATCH 1/6] virtio-gpu-3d: Define VIRTIO_GPU_CAPSET_VIRGL2 elsewhere Peter Maydell
2018-05-25 13:27 ` [Qemu-devel] [PATCH 2/6] scripts/update-linux-headers: Handle __aligned_u64 Peter Maydell
2018-05-25 14:55   ` Richard Henderson [this message]
2018-05-25 14:59     ` Peter Maydell
2018-05-25 13:27 ` [Qemu-devel] [PATCH 3/6] scripts/update-linux-headers: Handle kernel license no longer being one file Peter Maydell
2018-05-25 14:58   ` Richard Henderson
2018-05-25 13:27 ` [Qemu-devel] [PATCH 4/6] target/i386/kvm.c: Handle renaming of KVM_HINTS_DEDICATED Peter Maydell
2018-05-25 14:17   ` Paolo Bonzini
2018-05-25 13:27 ` [Qemu-devel] [PATCH 5/6] Update Linux headers to 4.17-rc6 Peter Maydell
2018-05-25 13:27 ` [Qemu-devel] [PATCH 6/6] target/i386/kvm.c: Remove compatibility shim for KVM_HINTS_REALTIME Peter Maydell
2018-05-25 13:35 ` [Qemu-devel] [PATCH 0/6] Update Linux headers to 4.17-rc6 no-reply
2018-05-25 14:00 ` Michael S. Tsirkin
2018-05-28  7:38   ` 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=d37b2ff8-bb7e-bc2a-c9b8-133854c05d99@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=alex.williamson@redhat.com \
    --cc=mst@redhat.com \
    --cc=patches@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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).