On Mon, May 11, 2026 at 11:26:56AM +0200, Cédric Le Goater wrote:
> On 5/10/26 22:19, Michael S. Tsirkin wrote:
> > On Sun, May 10, 2026 at 10:08:49PM +0200, Cédric Le Goater wrote:
> > > On 5/7/26 11:23, Song Gao wrote:
> > > > diff --git a/include/standard-headers/linux/virtio_ring.h 
> > > > b/include/standard-headers/linux/virtio_ring.h
> > > > index 22f6eb8ca7..7baf1968a3 100644
> > > > --- a/include/standard-headers/linux/virtio_ring.h
> > > > +++ b/include/standard-headers/linux/virtio_ring.h
> > > > @@ -31,7 +31,6 @@
> > > >     * SUCH DAMAGE.
> > > >     *
> > > >     * Copyright Rusty Russell IBM Corporation 2007. */
> > > > -#include <stdint.h>
> > > >    #include "standard-headers/linux/types.h"
> > > >    #include "standard-headers/linux/virtio_types.h"
> > > > @@ -200,7 +199,7 @@ static inline void vring_init(struct vring *vr, 
> > > > unsigned int num, void *p,
> > > >         vr->num = num;
> > > >         vr->desc = p;
> > > >         vr->avail = (struct vring_avail *)((char *)p + num * 
> > > > sizeof(struct vring_desc));
> > > > -       vr->used = (void *)(((uintptr_t)&vr->avail->ring[num] + 
> > > > sizeof(__virtio16)
> > > > +       vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + 
> > > > sizeof(__virtio16)
> > > >                 + align-1) & ~(align - 1));
> > > >    }
> > > 
> > > The kernel commit 3c4629b68dbe ("virtio: uapi: avoid usage of
> > > libc types") changed this virtio header and this breaks the
> > > build on Windows :
> > > 
> > >    https://gitlab.com/legoater/qemu/-/jobs/14297040230
> > > 
> > > A fix could be to reintroduce 'uintptr_t' (available through
> > > osdep.h) by modifying the linux headers update script. Ideas ?
> > > 
> > > Thanks,
> > > 
> > > C.
> > 
> > Yea sorry ( Just add
> > #define VIRTIO_RING_NO_LEGACY
> > somewhere.
> > 
> > 
> 
> Something like :
> 
>   --- a/scripts/update-linux-headers.sh
>   +++ b/scripts/update-linux-headers.sh
>   @@ -104,6 +104,7 @@ cp_portable() {
>            -e 's/struct ethhdr/struct eth_header/' \
>            -e '/\#define _LINUX_ETHTOOL_H/a \\n\#include "net/eth.h"' \
>   +        -e '/\#define _LINUX_VIRTIO_RING_H/a \\n\#define 
> VIRTIO_RING_NO_LEGACY' \
>            "$f" > "$to/$header";
>    }
> 
> 
> Thanks,
> 
> C.


right.


Reply via email to