* [PATCH stable-only] virtio-net: fix build on m68k and sparc64
@ 2014-01-15 8:26 Michael S. Tsirkin
2014-01-15 8:36 ` Geert Uytterhoeven
0 siblings, 1 reply; 5+ messages in thread
From: Michael S. Tsirkin @ 2014-01-15 8:26 UTC (permalink / raw)
To: linux-kernel
Cc: netdev, virtualization, Greg Kroah-Hartman, David Miller,
Guenter Roeck
As a result of backporting a bugfix, virtio_net started passing void *
to page_address, assuming that it will get silently converted to struct
page *. But this does not happen on architectures where page_address is
a macro, the result is build failure as the macro tries to dereference
void*.
Fix by reordering code slightly, so we always pass
struct page * to page_address.
Reported-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
David, Greg asked that this be put in stable ASAP to avoid
next release being broken.
I still didn't Cc stable directly as I know you prefer to do this
yourself.
Sorry about creating this mess, could you help fast-path it there please?
Thanks!
drivers/net/virtio_net.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index b8665588..c8d5ee1 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -330,9 +330,9 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,
void *buf,
unsigned int len)
{
- struct skb_vnet_hdr *hdr = page_address(buf);
- int num_buf = hdr->mhdr.num_buffers;
struct page *page = buf;
+ struct skb_vnet_hdr *hdr = page_address(page);
+ int num_buf = hdr->mhdr.num_buffers;
struct sk_buff *skb = page_to_skb(rq, page, len);
int i;
--
MST
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH stable-only] virtio-net: fix build on m68k and sparc64
2014-01-15 8:26 [PATCH stable-only] virtio-net: fix build on m68k and sparc64 Michael S. Tsirkin
@ 2014-01-15 8:36 ` Geert Uytterhoeven
2014-01-15 8:46 ` Michael S. Tsirkin
0 siblings, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2014-01-15 8:36 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
virtualization, Greg Kroah-Hartman, David Miller, Guenter Roeck
On Wed, Jan 15, 2014 at 9:26 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
> As a result of backporting a bugfix, virtio_net started passing void *
> to page_address, assuming that it will get silently converted to struct
> page *. But this does not happen on architectures where page_address is
> a macro, the result is build failure as the macro tries to dereference
> void*.
>
> Fix by reordering code slightly, so we always pass
> struct page * to page_address.
Thanks for the clue! I was just investigating a similar failure in -next.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH stable-only] virtio-net: fix build on m68k and sparc64
2014-01-15 8:36 ` Geert Uytterhoeven
@ 2014-01-15 8:46 ` Michael S. Tsirkin
2014-01-15 9:01 ` Geert Uytterhoeven
0 siblings, 1 reply; 5+ messages in thread
From: Michael S. Tsirkin @ 2014-01-15 8:46 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
virtualization, Greg Kroah-Hartman, David Miller, Guenter Roeck
On Wed, Jan 15, 2014 at 09:36:13AM +0100, Geert Uytterhoeven wrote:
> On Wed, Jan 15, 2014 at 9:26 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
> > As a result of backporting a bugfix, virtio_net started passing void *
> > to page_address, assuming that it will get silently converted to struct
> > page *. But this does not happen on architectures where page_address is
> > a macro, the result is build failure as the macro tries to dereference
> > void*.
> >
> > Fix by reordering code slightly, so we always pass
> > struct page * to page_address.
>
> Thanks for the clue! I was just investigating a similar failure in -next.
>
> Gr{oetje,eeting}s,
>
> Geert
You don't mean linux-next? And not in virtio-net? I don't see page_address
being used on void * anywhere there.
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH stable-only] virtio-net: fix build on m68k and sparc64
2014-01-15 8:46 ` Michael S. Tsirkin
@ 2014-01-15 9:01 ` Geert Uytterhoeven
2014-01-15 9:15 ` Michael S. Tsirkin
0 siblings, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2014-01-15 9:01 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
virtualization, Greg Kroah-Hartman, David Miller, Guenter Roeck
On Wed, Jan 15, 2014 at 9:46 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
> On Wed, Jan 15, 2014 at 09:36:13AM +0100, Geert Uytterhoeven wrote:
>> On Wed, Jan 15, 2014 at 9:26 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
>> > As a result of backporting a bugfix, virtio_net started passing void *
>> > to page_address, assuming that it will get silently converted to struct
>> > page *. But this does not happen on architectures where page_address is
>> > a macro, the result is build failure as the macro tries to dereference
>> > void*.
>> >
>> > Fix by reordering code slightly, so we always pass
>> > struct page * to page_address.
>>
>> Thanks for the clue! I was just investigating a similar failure in -next.
>>
>> Gr{oetje,eeting}s,
>>
>> Geert
>
> You don't mean linux-next? And not in virtio-net? I don't see page_address
> being used on void * anywhere there.
http://kisskb.ellerman.id.au/kisskb/buildresult/10469287/
I'm making {,set}page_address() static inline to fix this.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH stable-only] virtio-net: fix build on m68k and sparc64
2014-01-15 9:01 ` Geert Uytterhoeven
@ 2014-01-15 9:15 ` Michael S. Tsirkin
0 siblings, 0 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2014-01-15 9:15 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
virtualization, Greg Kroah-Hartman, David Miller, Guenter Roeck
On Wed, Jan 15, 2014 at 10:01:49AM +0100, Geert Uytterhoeven wrote:
> On Wed, Jan 15, 2014 at 9:46 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
> > On Wed, Jan 15, 2014 at 09:36:13AM +0100, Geert Uytterhoeven wrote:
> >> On Wed, Jan 15, 2014 at 9:26 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
> >> > As a result of backporting a bugfix, virtio_net started passing void *
> >> > to page_address, assuming that it will get silently converted to struct
> >> > page *. But this does not happen on architectures where page_address is
> >> > a macro, the result is build failure as the macro tries to dereference
> >> > void*.
> >> >
> >> > Fix by reordering code slightly, so we always pass
> >> > struct page * to page_address.
> >>
> >> Thanks for the clue! I was just investigating a similar failure in -next.
> >>
> >> Gr{oetje,eeting}s,
> >>
> >> Geert
> >
> > You don't mean linux-next? And not in virtio-net? I don't see page_address
> > being used on void * anywhere there.
>
> http://kisskb.ellerman.id.au/kisskb/buildresult/10469287/
Wew, so it's not my fault :)
> I'm making {,set}page_address() static inline to fix this.
Yes, I don't see why it has to be a macro.
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-01-15 9:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-15 8:26 [PATCH stable-only] virtio-net: fix build on m68k and sparc64 Michael S. Tsirkin
2014-01-15 8:36 ` Geert Uytterhoeven
2014-01-15 8:46 ` Michael S. Tsirkin
2014-01-15 9:01 ` Geert Uytterhoeven
2014-01-15 9:15 ` Michael S. Tsirkin
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).