diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2014-10-07 10:39:43 -0400 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-12-09 05:05:24 -0500 |
commit | d025477368792b272802146a86e41f81a54d8a19 (patch) | |
tree | 7e296d48d57796d6b797f4da6dac74d1644092fe /include/linux/virtio_config.h | |
parent | 0ffaeadfc451a11b5da35578b2f9b977f9f46489 (diff) |
virtio: add support for 64 bit features.
Change u32 to u64, and use BIT_ULL and 1ULL everywhere.
Note: transports are unchanged, and only set low 32 bit.
This guarantees that no transport sets e.g. VERSION_1
by mistake without proper support.
Based on patch by Rusty.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'include/linux/virtio_config.h')
-rw-r--r-- | include/linux/virtio_config.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index ffc2ae04879c..f51788439574 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h | |||
@@ -66,7 +66,7 @@ struct virtio_config_ops { | |||
66 | vq_callback_t *callbacks[], | 66 | vq_callback_t *callbacks[], |
67 | const char *names[]); | 67 | const char *names[]); |
68 | void (*del_vqs)(struct virtio_device *); | 68 | void (*del_vqs)(struct virtio_device *); |
69 | u32 (*get_features)(struct virtio_device *vdev); | 69 | u64 (*get_features)(struct virtio_device *vdev); |
70 | void (*finalize_features)(struct virtio_device *vdev); | 70 | void (*finalize_features)(struct virtio_device *vdev); |
71 | const char *(*bus_name)(struct virtio_device *vdev); | 71 | const char *(*bus_name)(struct virtio_device *vdev); |
72 | int (*set_vq_affinity)(struct virtqueue *vq, int cpu); | 72 | int (*set_vq_affinity)(struct virtqueue *vq, int cpu); |
@@ -88,11 +88,11 @@ static inline bool __virtio_test_bit(const struct virtio_device *vdev, | |||
88 | { | 88 | { |
89 | /* Did you forget to fix assumptions on max features? */ | 89 | /* Did you forget to fix assumptions on max features? */ |
90 | if (__builtin_constant_p(fbit)) | 90 | if (__builtin_constant_p(fbit)) |
91 | BUILD_BUG_ON(fbit >= 32); | 91 | BUILD_BUG_ON(fbit >= 64); |
92 | else | 92 | else |
93 | BUG_ON(fbit >= 32); | 93 | BUG_ON(fbit >= 64); |
94 | 94 | ||
95 | return vdev->features & BIT(fbit); | 95 | return vdev->features & BIT_ULL(fbit); |
96 | } | 96 | } |
97 | 97 | ||
98 | /** | 98 | /** |
@@ -105,11 +105,11 @@ static inline void __virtio_set_bit(struct virtio_device *vdev, | |||
105 | { | 105 | { |
106 | /* Did you forget to fix assumptions on max features? */ | 106 | /* Did you forget to fix assumptions on max features? */ |
107 | if (__builtin_constant_p(fbit)) | 107 | if (__builtin_constant_p(fbit)) |
108 | BUILD_BUG_ON(fbit >= 32); | 108 | BUILD_BUG_ON(fbit >= 64); |
109 | else | 109 | else |
110 | BUG_ON(fbit >= 32); | 110 | BUG_ON(fbit >= 64); |
111 | 111 | ||
112 | vdev->features |= BIT(fbit); | 112 | vdev->features |= BIT_ULL(fbit); |
113 | } | 113 | } |
114 | 114 | ||
115 | /** | 115 | /** |
@@ -122,11 +122,11 @@ static inline void __virtio_clear_bit(struct virtio_device *vdev, | |||
122 | { | 122 | { |
123 | /* Did you forget to fix assumptions on max features? */ | 123 | /* Did you forget to fix assumptions on max features? */ |
124 | if (__builtin_constant_p(fbit)) | 124 | if (__builtin_constant_p(fbit)) |
125 | BUILD_BUG_ON(fbit >= 32); | 125 | BUILD_BUG_ON(fbit >= 64); |
126 | else | 126 | else |
127 | BUG_ON(fbit >= 32); | 127 | BUG_ON(fbit >= 64); |
128 | 128 | ||
129 | vdev->features &= ~BIT(fbit); | 129 | vdev->features &= ~BIT_ULL(fbit); |
130 | } | 130 | } |
131 | 131 | ||
132 | /** | 132 | /** |