All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>, davidkiarie4@gmail.com
Subject: Re: [Qemu-devel] [PULL v3 0/6] virtio,pci: fixes and updates
Date: Fri, 16 Sep 2016 21:53:33 +0300	[thread overview]
Message-ID: <20160916215220-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CAFEAcA-e8ShetJXNyBsQ+s-_MK5tmB11N_2rXygPO1+j+v+FUw@mail.gmail.com>

On Fri, Sep 16, 2016 at 11:57:54AM +0100, Peter Maydell wrote:
> On 15 September 2016 at 21:38, Michael S. Tsirkin <mst@redhat.com> wrote:
> > The following changes since commit d1eb8f2acba579830cf3798c3c15ce51be852c56:
> >
> >   fpu: add mechanism to check for invalid long double formats (2016-09-15 12:43:18 +0100)
> >
> > are available in the git repository at:
> >
> >   git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
> >
> > for you to fetch changes up to a5a43875b352810d29dc27e7b0fb602eb7ef2d31:
> >
> >   MAINTAINERS: add virtio-* tests (2016-09-15 23:37:16 +0300)
> >
> > ----------------------------------------------------------------
> > virtio,pci: fixes and updates
> >
> > AMD IOMMU emulation
> > virtio feature negotiation rework
> >
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> >
> > ----------------------------------------------------------------
> 
> Fails to build on ppc64be, still:
> /home/pm215/qemu/hw/i386/amd_iommu.c:245:5: error: expected ‘,’, ‘;’
> or ‘}’ before ‘uint32_t’
>      uint32_t reserved_3:29;
>      ^
> /home/pm215/qemu/hw/i386/amd_iommu.c: In function ‘amdvi_complete_ppr’:
> /home/pm215/qemu/hw/i386/amd_iommu.c:588:62: error: ‘CMDCompletePPR’
> has no member named ‘reserved_3’
>      if (pprcomp->reserved_1 || pprcomp->reserved_2 || pprcomp->reserved_3 ||
>                                                               ^
> /home/pm215/qemu/hw/i386/amd_iommu.c:589:16: error: ‘CMDCompletePPR’
> has no member named ‘reserved_4’
>          pprcomp->reserved_4 || pprcomp->reserved_5) {
>                 ^
> /home/pm215/qemu/hw/i386/amd_iommu.c:589:39: error: ‘CMDCompletePPR’
> has no member named ‘reserved_5’
>          pprcomp->reserved_4 || pprcomp->reserved_5) {
>                                        ^
> 
> Missing semicolon, again, line 237.
> 
> In fact looking at this code it just looks broken. Structures
> like this:
> 
> typedef struct QEMU_PACKED {
> #ifdef HOST_WORDS_BIGENDIAN
>     uint64_t type:4;          /* command type        */
>     uint64_t reserved_1:44;
>     uint64_t devid:16;        /* related devid       */
> #else
>     uint64_t devid:16;
>     uint64_t reserved_1:44;
>     uint64_t type:4;
> #endif /* __BIG_ENDIAN_BITFIELD */
>     uint64_t reserved_2;
> } CMDInvalIntrTable;
> 
> seem to be trying to represent bit layouts in memory using
> bitfields, but this is just not portable. It's not sufficient
> to have a "bigendian vs littleendian" set of ifdefs.
> 
> The portable way to do this is to write the code to use
> bitwise logical operations (and functions like extract64
> and deposit64) to manipulate things. As a bonus you get rid
> of all these host-specific #ifdefs that are tripping you
> up now.
> 
> It would be nice if C bitfields worked the way this code
> wants them to, but they don't, alas.
> 
> thanks
> -- PMM

I agree, I wanted to rework this in tree but maybe best to fix it first.
I dropped all this code from tree for now.

-- 
MST

      reply	other threads:[~2016-09-16 18:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-15 20:38 [Qemu-devel] [PULL v3 0/6] virtio,pci: fixes and updates Michael S. Tsirkin
2016-09-15 20:38 ` [Qemu-devel] [PULL v3 1/6] virtio-bus: Plug devices after features are negotiated Michael S. Tsirkin
2016-09-15 20:38 ` [Qemu-devel] [PULL v3 2/6] hw/pci: Prepare for AMD IOMMU Michael S. Tsirkin
2016-09-15 20:38 ` [Qemu-devel] [PULL v3 3/6] hw/i386/trace-events: Add AMD IOMMU trace events Michael S. Tsirkin
2016-09-15 20:38 ` [Qemu-devel] [PULL v3 4/6] hw/i386: Introduce AMD IOMMU Michael S. Tsirkin
2016-09-15 20:38 ` [Qemu-devel] [PULL v3 5/6] hw/i386: AMD IOMMU IVRS table Michael S. Tsirkin
2016-09-15 20:38 ` [Qemu-devel] [PULL v3 6/6] MAINTAINERS: add virtio-* tests Michael S. Tsirkin
2016-09-15 20:40   ` Andreas Färber
2016-09-16 10:57 ` [Qemu-devel] [PULL v3 0/6] virtio,pci: fixes and updates Peter Maydell
2016-09-16 18:53   ` Michael S. Tsirkin [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=20160916215220-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=davidkiarie4@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.