Re: Virtio 1.0 for the kernel

2019-01-19 Thread Stefan Fritsch
On Saturday, 12 January 2019 01:49:09 CET Jonathan Gray wrote: > On Fri, Jan 11, 2019 at 03:21:11PM -0800, William Ahern wrote: > > On Fri, Jan 11, 2019 at 10:43:25AM +0100, Stefan Fritsch wrote: > > > > > > > /* only used for sizeof, not actually allocated */ > > > extern struct virtio_pci_commo

Re: Virtio 1.0 for the kernel

2019-01-11 Thread Jonathan Gray
On Fri, Jan 11, 2019 at 03:21:11PM -0800, William Ahern wrote: > On Fri, Jan 11, 2019 at 10:43:25AM +0100, Stefan Fritsch wrote: > > > /* only used for sizeof, not actually allocated */ > > extern struct virtio_pci_common_cfg ccfg; > > > #define CREAD(sc, memb) _cread(sc, \ > > offsetof(st

Re: Virtio 1.0 for the kernel

2019-01-11 Thread William Ahern
On Fri, Jan 11, 2019 at 10:43:25AM +0100, Stefan Fritsch wrote: > /* only used for sizeof, not actually allocated */ > extern struct virtio_pci_common_cfg ccfg; > #define CREAD(sc, memb) _cread(sc, \ > offsetof(struct virtio_pci_common_cfg, memb), sizeof(ccfg.memb)) > > The compiler shoul

Re: Virtio 1.0 for the kernel

2019-01-11 Thread Ted Unangst
Stefan Fritsch wrote: > On Fri, 11 Jan 2019, Ted Unangst wrote: > A simple inline function does not work because memb is the name of a > member of a struct. But combined with a macro it would work. Like this: yeah, that looks pretty normal.

Re: Virtio 1.0 for the kernel

2019-01-11 Thread Stefan Fritsch
On Fri, 11 Jan 2019, Ted Unangst wrote: > Stefan Fritsch wrote: > > +#define CREAD(sc, memb) > > \ > > + ({ > > \ > > + struct virtio_pci_common_cfg c;

Re: Virtio 1.0 for the kernel

2019-01-11 Thread Ted Unangst
Stefan Fritsch wrote: > +#define CREAD(sc, memb) > \ > + ({ > \ > + struct virtio_pci_common_cfg c; > \ > +

Re: Virtio 1.0 for the kernel

2019-01-11 Thread Stefan Fritsch
Hi Carlos, > > I'm getting ramped back up from being AWOL for several months, so > apologies in advance for the delay of going through your diff (and the > virtio header re-order one that you fixed). It'll be over the weekend > at the earliest before I can review/test it out. There is no hurry,

Re: Virtio 1.0 for the kernel

2019-01-11 Thread Stefan Fritsch
On Fri, 11 Jan 2019, Jonathan Gray wrote: > Assuming a qcow2 image created by something along the lines of > 'qemu-img create -f qcow2 root.qcow2 2g' miniroot64.fs from an arm64 > snapshot and u-boot for qemu_arm64 from the u-boot-aarch64 package: > > doas sh -c "qemu-system-aarch64 -runas $USER \

Re: Virtio 1.0 for the kernel

2019-01-11 Thread Stefan Fritsch
On Thu, 10 Jan 2019, Theo de Raadt wrote: > arm64 also uses this subsystem, and as a result this diff breaks > all those kernels. The diff also breaks vmd. Even if it compiles it will still be broken. As I wrote, it's not ready for commit yet. > > You ask how to run arm64 Uhm, you didn't e

Re: Virtio 1.0 for the kernel

2019-01-10 Thread Theo de Raadt
arm64 also uses this subsystem, and as a result this diff breaks all those kernels. You ask how to run arm64 Uhm, you didn't even try to compile it.

Re: Virtio 1.0 for the kernel

2019-01-10 Thread Jonathan Gray
On Thu, Jan 10, 2019 at 11:38:38PM +0100, Stefan Fritsch wrote: > Hi, > > the diff below implements the virtio 1.0 standard in the kernel (0.9 keeps > working, of course). It's not ready for commit, yet, but I would like some > input. > > For the most part, the changes from 0.9 to 1.0 are not t

Virtio 1.0 for the kernel

2019-01-10 Thread Stefan Fritsch
Hi, the diff below implements the virtio 1.0 standard in the kernel (0.9 keeps working, of course). It's not ready for commit, yet, but I would like some input. For the most part, the changes from 0.9 to 1.0 are not that big, but there are some notable differences. Since some headers are also