From: "Michael S. Tsirkin" <mst@redhat.com>
To: kbuild test robot <fengguang.wu@intel.com>
Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org,
linux@lists.openrisc.net, jonas@southpole.se,
Philip Li <philip.li@intel.com>
Subject: Re: drivers/vhost/vhost.c:718:3: error: call to '__compiletime_assert_718' declared with attribute error: BUILD_BUG_ON failed: __alignof__ *vq->avail > VRING_AVAIL_ALIGN_SIZE
Date: Sun, 6 Mar 2016 10:37:07 +0200 [thread overview]
Message-ID: <20160306083707.GA29096@redhat.com> (raw)
In-Reply-To: <201602280711.3TTbALEV%fengguang.wu@intel.com>
I keep seeing these errors. Any openrisc/gcc/kbuild people
interested in looking into this?
On Sun, Feb 28, 2016 at 07:15:14AM +0800, kbuild test robot wrote:
> Hi Michael,
>
> FYI, the error/warning still remains.
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 691429e13dfaf5b0994b07cc166db41bd608ee3d
> commit: 5d9a07b0de512b77bf28d2401e5fe3351f00a240 vhost: relax used address alignment
> date: 1 year, 2 months ago
> config: openrisc-allmodconfig (attached as .config)
> reproduce:
> wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> git checkout 5d9a07b0de512b77bf28d2401e5fe3351f00a240
> # save the attached .config to linux build tree
> make.cross ARCH=openrisc
>
> All errors (new ones prefixed by >>):
>
> drivers/vhost/vhost.c: In function 'vhost_vring_ioctl':
> >> drivers/vhost/vhost.c:718:3: error: call to '__compiletime_assert_718' declared with attribute error: BUILD_BUG_ON failed: __alignof__ *vq->avail > VRING_AVAIL_ALIGN_SIZE
>
> vim +/__compiletime_assert_718 +718 drivers/vhost/vhost.c
>
> 712 (u64)(unsigned long)a.avail_user_addr != a.avail_user_addr) {
> 713 r = -EFAULT;
> 714 break;
> 715 }
> 716
> 717 /* Make sure it's safe to cast pointers to vring types. */
> > 718 BUILD_BUG_ON(__alignof__ *vq->avail > VRING_AVAIL_ALIGN_SIZE);
> 719 BUILD_BUG_ON(__alignof__ *vq->used > VRING_USED_ALIGN_SIZE);
> 720 if ((a.avail_user_addr & (VRING_AVAIL_ALIGN_SIZE - 1)) ||
> 721 (a.used_user_addr & (VRING_USED_ALIGN_SIZE - 1)) ||
>
> ---
> 0-DAY kernel test infrastructure Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all Intel Corporation
I still think it's a bug in the openrisc compiler used.
struct vring_avail {
unsigned short flags;
unsigned short idx;
};
struct vring_avail *x;
int main(int argc, char **argv)
{
footest();
if (__alignof__(*x) == 1)
foo1();
else if (__alignof__(*x) == 2)
foo2();
else if (__alignof__(*x) == 4)
foo4();
else if (__alignof__(*x) == 8)
foo8();
else
fooother();
return 0;
}
when compiled with the openrisc compiler from kernel.org this calls foo4
and it really should call foo2, since the openrisc manual says:
16.1.2
Aggregates and Unions
Aggregates (structures and arrays) and unions assume the alignment of
their most
strictly aligned element.
and alignment for unsigned short is 2.
--
MST
next prev parent reply other threads:[~2016-03-06 8:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-27 23:15 kbuild test robot
2016-02-28 9:03 ` Michael S. Tsirkin
2016-03-06 8:37 ` Michael S. Tsirkin [this message]
2016-03-10 0:49 ` [kbuild-all] " Fengguang Wu
2016-03-13 14:57 ` Michael S. Tsirkin
2016-03-14 1:41 ` Fengguang Wu
2016-03-06 3:35 kbuild test robot
2016-03-13 2:49 kbuild test robot
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=20160306083707.GA29096@redhat.com \
--to=mst@redhat.com \
--cc=fengguang.wu@intel.com \
--cc=jonas@southpole.se \
--cc=kbuild-all@01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@lists.openrisc.net \
--cc=philip.li@intel.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
Powered by JetHome