Re: updated: kvm networking todo wiki

2013-05-29 Thread Stefan Hajnoczi
On Thu, May 30, 2013 at 7:23 AM, Rusty Russell wrote: > Anthony Liguori writes: >> Rusty Russell writes: >>> On Fri, May 24, 2013 at 08:47:58AM -0500, Anthony Liguori wrote: FWIW, I think what's more interesting is using vhost-net as a networking backend with virtio-net in QEMU being w

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Michael S. Tsirkin
On Thu, May 30, 2013 at 01:28:26PM +0930, Rusty Russell wrote: > Anthony Liguori writes: > > Rusty Russell writes: > > > >> Anthony Liguori writes: > >>> "Michael S. Tsirkin" writes: > +case offsetof(struct virtio_pci_common_cfg, device_feature_select): > +return proxy->de

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Rusty Russell
Anthony Liguori writes: > Rusty Russell writes: > >> Anthony Liguori writes: >>> "Michael S. Tsirkin" writes: +case offsetof(struct virtio_pci_common_cfg, device_feature_select): +return proxy->device_feature_select; >>> >>> Oh dear no... Please use defines like the rest

Re: [PATCH] virtio_pci: fix capability format, comments

2013-05-29 Thread Rusty Russell
"Michael S. Tsirkin" writes: > - queue size can actually be 0 which is not a power of 2 Actually, that points to a flaw in the code. When we shut down the queue, we should ideally reset it to what the device started with, rather than 0. See below. > - fix capability format. PCI spec says: >

Re: [RFC 7/11] virtio_pci: new, capability-aware driver.

2013-05-29 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Wed, May 29, 2013 at 10:47:52AM +0930, Rusty Russell wrote: >> "Michael S. Tsirkin" writes: >> >> > On Mon, Dec 12, 2011 at 01:49:13PM +0200, Michael S. Tsirkin wrote: >> >> On Mon, Dec 12, 2011 at 09:15:03AM +1030, Rusty Russell wrote: >> >> > On Sun, 11 Dec 20

Re: updated: kvm networking todo wiki

2013-05-29 Thread Rusty Russell
Anthony Liguori writes: > Rusty Russell writes: >> On Fri, May 24, 2013 at 08:47:58AM -0500, Anthony Liguori wrote: >>> FWIW, I think what's more interesting is using vhost-net as a networking >>> backend with virtio-net in QEMU being what's guest facing. >>> >>> In theory, this gives you the be

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Michael S. Tsirkin
On Wed, May 29, 2013 at 09:55:55AM -0500, Anthony Liguori wrote: > > Not we. The BIOS can disable IO BAR: it can do this already > > but the device won't be functional. > > But the only way to expose the device over PCI express is to disable the > IO BAR, right? I think this is the source of the

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Michael S. Tsirkin
On Wed, May 29, 2013 at 09:55:55AM -0500, Anthony Liguori wrote: > "Michael S. Tsirkin" writes: > > > On Wed, May 29, 2013 at 09:16:39AM -0500, Anthony Liguori wrote: > >> "Michael S. Tsirkin" writes: > >> > I'm guessing any compiler that decides to waste memory in this way > >> > will quickly g

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Anthony Liguori
"Michael S. Tsirkin" writes: > On Wed, May 29, 2013 at 09:16:39AM -0500, Anthony Liguori wrote: >> "Michael S. Tsirkin" writes: >> > I'm guessing any compiler that decides to waste memory in this way >> > will quickly get dropped by users and then we won't worry >> > about building QEMU with it.

Re: [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code

2013-05-29 Thread Anthony Liguori
"Michael S. Tsirkin" writes: > On Wed, May 29, 2013 at 08:05:29AM -0500, Anthony Liguori wrote: >> Rusty Russell writes: >> >> > Anthony Liguori writes: >> >> The headers say they are BSD licensed... but they include a GPLv2+ >> >> header. Doesn't make a lot of sense, does it? >> > >> > It ma

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Michael S. Tsirkin
On Wed, May 29, 2013 at 04:32:31PM +0200, Paolo Bonzini wrote: > Il 29/05/2013 16:30, Michael S. Tsirkin ha scritto: > >> > There are other responses in the thread here and I don't really care to > >> > bikeshed on this issue. > > Great. Let's make the bikeshed blue then? > > Yes, let's make it bl

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Paolo Bonzini
Il 29/05/2013 16:30, Michael S. Tsirkin ha scritto: >> > There are other responses in the thread here and I don't really care to >> > bikeshed on this issue. > Great. Let's make the bikeshed blue then? Yes, let's make it blue, but please promise to check into Peter's register API so we can remove

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Michael S. Tsirkin
On Wed, May 29, 2013 at 09:16:39AM -0500, Anthony Liguori wrote: > "Michael S. Tsirkin" writes: > > > On Wed, May 29, 2013 at 07:52:37AM -0500, Anthony Liguori wrote: > >> 1) C makes no guarantees about structure layout beyond the first > >>member. Yes, if it's naturally aligned or has a pac

Re: [PATCH v2 0/2] virtio-balloon spec: silent deflation

2013-05-29 Thread Michael S. Tsirkin
On Tue, May 28, 2013 at 07:40:16PM +0200, Paolo Bonzini wrote: > Here is the series, split in two patches, with small edits and new > commit messages. > > Paolo Bonzini (2): > virtio-balloon spec: rewrite description of > VIRTIO_BALLOON_F_MUST_TELL_HOST > virtio-balloon spec: reintroduce "

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Anthony Liguori
Paolo Bonzini writes: > Il 29/05/2013 15:24, Michael S. Tsirkin ha scritto: >> You expect a compiler to pad this structure: >> >> struct foo { >> uint8_t a; >> uint8_t b; >> uint16_t c; >> uint32_t d; >> }; >> >> I'm guessing any compiler that decides to waste memory in this

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Anthony Liguori
"Michael S. Tsirkin" writes: > On Wed, May 29, 2013 at 07:52:37AM -0500, Anthony Liguori wrote: >> 1) C makes no guarantees about structure layout beyond the first >>member. Yes, if it's naturally aligned or has a packed attribute, >>GCC does the right thing. But this isn't kernel land

Re: updated: kvm networking todo wiki

2013-05-29 Thread Michael S. Tsirkin
On Wed, May 29, 2013 at 08:01:03AM -0500, Anthony Liguori wrote: > Rusty Russell writes: > > > "Michael S. Tsirkin" writes: > >> On Fri, May 24, 2013 at 08:47:58AM -0500, Anthony Liguori wrote: > >>> "Michael S. Tsirkin" writes: > >>> > >>> > On Fri, May 24, 2013 at 05:41:11PM +0800, Jason Wan

Re: [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code

2013-05-29 Thread Michael S. Tsirkin
On Wed, May 29, 2013 at 08:05:29AM -0500, Anthony Liguori wrote: > Rusty Russell writes: > > > Anthony Liguori writes: > >> The headers say they are BSD licensed... but they include a GPLv2+ > >> header. Doesn't make a lot of sense, does it? > > > > It makes perfect sense: you're overthinking i

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Michael S. Tsirkin
On Wed, May 29, 2013 at 03:41:09PM +0200, Paolo Bonzini wrote: > Il 29/05/2013 15:24, Michael S. Tsirkin ha scritto: > > You expect a compiler to pad this structure: > > > > struct foo { > > uint8_t a; > > uint8_t b; > > uint16_t c; > > uint32_t d; > > }; > > > > I'm guessing any

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Paolo Bonzini
Il 29/05/2013 15:24, Michael S. Tsirkin ha scritto: > You expect a compiler to pad this structure: > > struct foo { > uint8_t a; > uint8_t b; > uint16_t c; > uint32_t d; > }; > > I'm guessing any compiler that decides to waste memory in this way > will quickly get dropped

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Peter Maydell
On 29 May 2013 14:24, Michael S. Tsirkin wrote: > On Wed, May 29, 2013 at 07:52:37AM -0500, Anthony Liguori wrote: >> 1) C makes no guarantees about structure layout beyond the first >>member. Yes, if it's naturally aligned or has a packed attribute, >>GCC does the right thing. But this

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Michael S. Tsirkin
On Wed, May 29, 2013 at 07:52:37AM -0500, Anthony Liguori wrote: > Rusty Russell writes: > > > Anthony Liguori writes: > >> "Michael S. Tsirkin" writes: > >>> +case offsetof(struct virtio_pci_common_cfg, device_feature_select): > >>> +return proxy->device_feature_select; > >> > >> O

Re: [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code

2013-05-29 Thread Anthony Liguori
Rusty Russell writes: > Anthony Liguori writes: >> The headers say they are BSD licensed... but they include a GPLv2+ >> header. Doesn't make a lot of sense, does it? > > It makes perfect sense: you're overthinking it. It just means that > copying the BSD headers outside Linux is encouraged.

Re: updated: kvm networking todo wiki

2013-05-29 Thread Anthony Liguori
Rusty Russell writes: > "Michael S. Tsirkin" writes: >> On Fri, May 24, 2013 at 08:47:58AM -0500, Anthony Liguori wrote: >>> "Michael S. Tsirkin" writes: >>> >>> > On Fri, May 24, 2013 at 05:41:11PM +0800, Jason Wang wrote: >>> >> On 05/23/2013 04:50 PM, Michael S. Tsirkin wrote: >>> >> > Hey

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Anthony Liguori
Rusty Russell writes: > Anthony Liguori writes: >> "Michael S. Tsirkin" writes: >>> +case offsetof(struct virtio_pci_common_cfg, device_feature_select): >>> +return proxy->device_feature_select; >> >> Oh dear no... Please use defines like the rest of QEMU. > > It is pretty ugly. I

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Michael S. Tsirkin
On Wed, May 29, 2013 at 02:28:32PM +0200, Paolo Bonzini wrote: > Il 29/05/2013 14:16, Michael S. Tsirkin ha scritto: > > >> If you really want to use offsetof like this you're > > >> going to need to decorate the structs with QEMU_PACKED. > >> > > >>> > > Nope. > >>> > > These structs ar

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Paolo Bonzini
Il 29/05/2013 14:16, Michael S. Tsirkin ha scritto: > >> If you really want to use offsetof like this you're > >> going to need to decorate the structs with QEMU_PACKED. >> > >>> > > Nope. >>> > > These structs are carefully designed not to have any padding. >> > >> > ...on every compil

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Michael S. Tsirkin
On Wed, May 29, 2013 at 11:53:17AM +0100, Peter Maydell wrote: > On 29 May 2013 11:08, Michael S. Tsirkin wrote: > > On Wed, May 29, 2013 at 10:00:33AM +0100, Peter Maydell wrote: > >> Asserting is definitely the wrong thing here, since the > >> guest can trigger it. > > > > So? > > So "guest sho

anyone willing to review a virtio-net guest driver for OVMF?

2013-05-29 Thread Laszlo Ersek
(Resending to the virt list after the original qemu-devel posting, following MST's advice; plus adding ipxe-devel too -- apologies for spamming!) Hi, the driver in question is intended as a fallback driver when the iPXE EFI driver for virtio-net is not present as an oprom. The series starts with

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Peter Maydell
On 29 May 2013 11:08, Michael S. Tsirkin wrote: > On Wed, May 29, 2013 at 10:00:33AM +0100, Peter Maydell wrote: >> Asserting is definitely the wrong thing here, since the >> guest can trigger it. > > So? So "guest should not be able to crash QEMU" is a standard rule: assert() is for QEMU bugs, n

Re: [RFC 7/11] virtio_pci: new, capability-aware driver.

2013-05-29 Thread Michael S. Tsirkin
On Wed, May 29, 2013 at 10:47:52AM +0930, Rusty Russell wrote: > "Michael S. Tsirkin" writes: > > > On Mon, Dec 12, 2011 at 01:49:13PM +0200, Michael S. Tsirkin wrote: > >> On Mon, Dec 12, 2011 at 09:15:03AM +1030, Rusty Russell wrote: > >> > On Sun, 11 Dec 2011 11:42:56 +0200, "Michael S. Tsirki

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Michael S. Tsirkin
On Wed, May 29, 2013 at 10:00:33AM +0100, Peter Maydell wrote: > On 29 May 2013 09:24, Michael S. Tsirkin wrote: > > diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c > > index f4db224..fd09ea7 100644 > > --- a/hw/virtio/virtio-pci.c > > +++ b/hw/virtio/virtio-pci.c > > @@ -467,51 +467,

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Laszlo Ersek
On 05/29/13 09:27, Paolo Bonzini wrote: > Il 29/05/2013 06:33, Rusty Russell ha scritto: >> Paolo Bonzini writes: >>> Il 28/05/2013 19:32, Michael S. Tsirkin ha scritto: + +switch (addr) { +case offsetof(struct virtio_pci_common_cfg, device_feature_sele

Re: [PATCH v2 2/2] virtio-balloon spec: reintroduce "silent deflation" feature

2013-05-29 Thread Michael S. Tsirkin
On Wed, May 29, 2013 at 10:47:08AM +0200, Paolo Bonzini wrote: > Il 29/05/2013 09:49, Michael S. Tsirkin ha scritto: > > On Tue, May 28, 2013 at 07:40:18PM +0200, Paolo Bonzini wrote: > >> The original idea of the VIRTIO_BALLOON_F_MUST_TELL_HOST feature was to > >> let drivers skip usage of the def

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Peter Maydell
On 29 May 2013 09:24, Michael S. Tsirkin wrote: > diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c > index f4db224..fd09ea7 100644 > --- a/hw/virtio/virtio-pci.c > +++ b/hw/virtio/virtio-pci.c > @@ -467,51 +467,70 @@ static uint64_t virtio_pci_config_common_read(void > *opaque, hwaddr

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Paolo Bonzini
Il 29/05/2013 10:24, Michael S. Tsirkin ha scritto: > On Wed, May 29, 2013 at 02:01:18PM +0930, Rusty Russell wrote: >> Anthony Liguori writes: >>> "Michael S. Tsirkin" writes: +case offsetof(struct virtio_pci_common_cfg, device_feature_select): +return proxy->device_feature

Re: [PATCH v2 2/2] virtio-balloon spec: reintroduce "silent deflation" feature

2013-05-29 Thread Paolo Bonzini
Il 29/05/2013 09:49, Michael S. Tsirkin ha scritto: > On Tue, May 28, 2013 at 07:40:18PM +0200, Paolo Bonzini wrote: >> The original idea of the VIRTIO_BALLOON_F_MUST_TELL_HOST feature was to >> let drivers skip usage of the deflate queue when leaking the balloon >> ("silent deflation"). Guests ma

Re: [PATCH v2 1/2] virtio-balloon spec: rewrite description of VIRTIO_BALLOON_F_MUST_TELL_HOST

2013-05-29 Thread Paolo Bonzini
Il 29/05/2013 09:45, Michael S. Tsirkin ha scritto: > On Wed, May 29, 2013 at 08:24:10AM +0200, Paolo Bonzini wrote: >> Il 28/05/2013 20:15, Michael S. Tsirkin ha scritto: >>> What you write in spec below and what you write above seems to >>> contradict. >>> >>> Look, how about the simpler patch th

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Michael S. Tsirkin
On Wed, May 29, 2013 at 02:01:18PM +0930, Rusty Russell wrote: > Anthony Liguori writes: > > "Michael S. Tsirkin" writes: > >> +case offsetof(struct virtio_pci_common_cfg, device_feature_select): > >> +return proxy->device_feature_select; > > > > Oh dear no... Please use defines like

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Michael S. Tsirkin
On Wed, May 29, 2013 at 09:27:02AM +0200, Paolo Bonzini wrote: > Il 29/05/2013 06:33, Rusty Russell ha scritto: > > Paolo Bonzini writes: > >> Il 28/05/2013 19:32, Michael S. Tsirkin ha scritto: > >>> + > >>> +switch (addr) { > >>> +case offsetof(struct virtio_pci_common_cfg,

Re: [PATCH v2 2/2] virtio-balloon spec: reintroduce "silent deflation" feature

2013-05-29 Thread Michael S. Tsirkin
On Tue, May 28, 2013 at 07:40:18PM +0200, Paolo Bonzini wrote: > The original idea of the VIRTIO_BALLOON_F_MUST_TELL_HOST feature was to > let drivers skip usage of the deflate queue when leaking the balloon > ("silent deflation"). Guests may benefit from silent deflate by > aggressively inflating

Re: [PATCH v2 1/2] virtio-balloon spec: rewrite description of VIRTIO_BALLOON_F_MUST_TELL_HOST

2013-05-29 Thread Michael S. Tsirkin
On Wed, May 29, 2013 at 08:24:10AM +0200, Paolo Bonzini wrote: > Il 28/05/2013 20:15, Michael S. Tsirkin ha scritto: > > What you write in spec below and what you write above seems to > > contradict. > > > > Look, how about the simpler patch that I sent: > > "[PATCH] virtio-spec: balloon: MUST_TEL

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-05-29 Thread Paolo Bonzini
Il 29/05/2013 06:33, Rusty Russell ha scritto: > Paolo Bonzini writes: >> Il 28/05/2013 19:32, Michael S. Tsirkin ha scritto: >>> + >>> +switch (addr) { >>> +case offsetof(struct virtio_pci_common_cfg, device_feature_select): >>> +return proxy->device_feature_select