lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200805092621-mutt-send-email-mst@kernel.org>
Date:   Wed, 5 Aug 2020 09:26:48 -0400
From:   "Michael S. Tsirkin" <mst@...hat.com>
To:     Cornelia Huck <cohuck@...hat.com>
Cc:     linux-kernel@...r.kernel.org,
        virtualization@...ts.linux-foundation.org
Subject: Re: [PATCH v2 14/24] virtio_net: correct tags for config space fields

On Tue, Aug 04, 2020 at 04:44:44PM +0200, Cornelia Huck wrote:
> On Mon, 3 Aug 2020 16:59:37 -0400
> "Michael S. Tsirkin" <mst@...hat.com> wrote:
> 
> > Tag config space fields as having virtio endian-ness.
> > 
> > Signed-off-by: Michael S. Tsirkin <mst@...hat.com>
> > ---
> >  include/uapi/linux/virtio_net.h | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h
> > index 19d23e5baa4e..27d996f29dd1 100644
> > --- a/include/uapi/linux/virtio_net.h
> > +++ b/include/uapi/linux/virtio_net.h
> > @@ -87,19 +87,19 @@ struct virtio_net_config {
> >  	/* The config defining mac address (if VIRTIO_NET_F_MAC) */
> >  	__u8 mac[ETH_ALEN];
> >  	/* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */
> > -	__u16 status;
> > +	__virtio16 status;
> >  	/* Maximum number of each of transmit and receive queues;
> >  	 * see VIRTIO_NET_F_MQ and VIRTIO_NET_CTRL_MQ.
> >  	 * Legal values are between 1 and 0x8000
> >  	 */
> > -	__u16 max_virtqueue_pairs;
> > +	__virtio16 max_virtqueue_pairs;
> >  	/* Default maximum transmit unit advice */
> > -	__u16 mtu;
> > +	__virtio16 mtu;
> >  	/*
> >  	 * speed, in units of 1Mb. All values 0 to INT_MAX are legal.
> >  	 * Any other value stands for unknown.
> >  	 */
> > -	__u32 speed;
> > +	__virtio32 speed;
> 
> Hm... VIRTIO_NET_F_SPEED_DUPLEX can only be negotiated if VERSION_1 has
> also been negotiated; I think this should be __le32?

OK APIs for this are in a separate patch.
I'll add conversion as a patch on top.


> >  	/*
> >  	 * 0x00 - half duplex
> >  	 * 0x01 - full duplex

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ