lkml.org 
[lkml]   [2011]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH] virtio: 64 bit features
On Tue, Apr 12, 2011 at 04:04:56PM +0200, Christian Borntraeger wrote:
> Am 11.04.2011 18:55, schrieb Michael S. Tsirkin:
>
> Looks mostly good, but
>
>
> > --- a/drivers/s390/kvm/kvm_virtio.c
> > +++ b/drivers/s390/kvm/kvm_virtio.c
> > @@ -82,13 +82,13 @@ static unsigned desc_size(const struct kvm_device_desc *desc)
> > static u32 kvm_get_features(struct virtio_device *vdev)
>
> This should be u64.
>

Ugh. Sure. Will fix, thanks!

> > {
> > unsigned int i;
> > - u32 features = 0;
> > + u64 features = 0;
> > struct kvm_device_desc *desc = to_kvmdev(vdev)->desc;
> > u8 *in_features = kvm_vq_features(desc);
> >
> > - for (i = 0; i < min(desc->feature_len * 8, 32); i++)
> > + for (i = 0; i < min(desc->feature_len * 8, 64); i++)
> > if (in_features[i / 8] & (1 << (i % 8)))
> > - features |= (1 << i);
> > + features |= (1ull << i);
> > return features;
> > }


\
 
 \ /
  Last update: 2011-04-12 16:49    [W:0.201 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site