Displaying 20 results from an estimated 216 matches for "vhost_f_log_all".
2015 Apr 02
2
[PATCH v2 7/7] vhost: feature to set the vring endianness
...s)
> vhost_hlen = 0;
> sock_hlen = hdr_len;
> }
> +
> + if (features & ((1ULL << VHOST_F_SET_ENDIAN_LEGACY) |
> + (1ULL << VIRTIO_F_VERSION_1)))
> + return -EINVAL;
> +
> mutex_lock(&n->dev.mutex);
> if ((features & (1 << VHOST_F_LOG_ALL)) &&
> !vhost_log_access_ok(&n->dev)) {
> diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
> index 71df240..b53e9c2 100644
> --- a/drivers/vhost/scsi.c
> +++ b/drivers/vhost/scsi.c
> @@ -1544,6 +1544,10 @@ static int vhost_scsi_set_features(struct vhos...
2015 Apr 02
2
[PATCH v2 7/7] vhost: feature to set the vring endianness
...s)
> vhost_hlen = 0;
> sock_hlen = hdr_len;
> }
> +
> + if (features & ((1ULL << VHOST_F_SET_ENDIAN_LEGACY) |
> + (1ULL << VIRTIO_F_VERSION_1)))
> + return -EINVAL;
> +
> mutex_lock(&n->dev.mutex);
> if ((features & (1 << VHOST_F_LOG_ALL)) &&
> !vhost_log_access_ok(&n->dev)) {
> diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
> index 71df240..b53e9c2 100644
> --- a/drivers/vhost/scsi.c
> +++ b/drivers/vhost/scsi.c
> @@ -1544,6 +1544,10 @@ static int vhost_scsi_set_features(struct vhos...
2014 Jun 05
2
[PATCH 1/2] vhost: move acked_features to VQs
...og_base;
struct vhost_log *log;
@@ -117,7 +118,6 @@ struct vhost_dev {
struct vhost_memory __rcu *memory;
struct mm_struct *mm;
struct mutex mutex;
- unsigned acked_features;
struct vhost_virtqueue **vqs;
int nvqs;
struct file *log_file;
@@ -174,13 +174,8 @@ enum {
(1ULL << VHOST_F_LOG_ALL),
};
-static inline int vhost_has_feature(struct vhost_dev *dev, int bit)
+static inline int vhost_has_feature(struct vhost_virtqueue *vq, int bit)
{
- unsigned acked_features;
-
- /* TODO: check that we are running from vhost_worker or dev mutex is
- * held? */
- acked_features = rcu_derefere...
2014 Jun 05
2
[PATCH 1/2] vhost: move acked_features to VQs
...og_base;
struct vhost_log *log;
@@ -117,7 +118,6 @@ struct vhost_dev {
struct vhost_memory __rcu *memory;
struct mm_struct *mm;
struct mutex mutex;
- unsigned acked_features;
struct vhost_virtqueue **vqs;
int nvqs;
struct file *log_file;
@@ -174,13 +174,8 @@ enum {
(1ULL << VHOST_F_LOG_ALL),
};
-static inline int vhost_has_feature(struct vhost_dev *dev, int bit)
+static inline int vhost_has_feature(struct vhost_virtqueue *vq, int bit)
{
- unsigned acked_features;
-
- /* TODO: check that we are running from vhost_worker or dev mutex is
- * held? */
- acked_features = rcu_derefere...
2015 Apr 02
0
[PATCH v2 7/7] vhost: feature to set the vring endianness
..._net_set_features(struct vhost_net *n, u64 features)
vhost_hlen = 0;
sock_hlen = hdr_len;
}
+
+ if (features & ((1ULL << VHOST_F_SET_ENDIAN_LEGACY) |
+ (1ULL << VIRTIO_F_VERSION_1)))
+ return -EINVAL;
+
mutex_lock(&n->dev.mutex);
if ((features & (1 << VHOST_F_LOG_ALL)) &&
!vhost_log_access_ok(&n->dev)) {
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 71df240..b53e9c2 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1544,6 +1544,10 @@ static int vhost_scsi_set_features(struct vhost_scsi *vs, u64 features)
if...
2015 Apr 02
0
[PATCH v2 7/7] vhost: feature to set the vring endianness
...hlen = hdr_len;
> > }
> > +
> > + if (features & ((1ULL << VHOST_F_SET_ENDIAN_LEGACY) |
> > + (1ULL << VIRTIO_F_VERSION_1)))
> > + return -EINVAL;
> > +
> > mutex_lock(&n->dev.mutex);
> > if ((features & (1 << VHOST_F_LOG_ALL)) &&
> > !vhost_log_access_ok(&n->dev)) {
> > diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
> > index 71df240..b53e9c2 100644
> > --- a/drivers/vhost/scsi.c
> > +++ b/drivers/vhost/scsi.c
> > @@ -1544,6 +1544,10 @@ static int vhost...
2014 Jun 05
1
[PATCH v2 1/2] vhost: move acked_features to VQs
...og_base;
struct vhost_log *log;
@@ -117,7 +118,6 @@ struct vhost_dev {
struct vhost_memory __rcu *memory;
struct mm_struct *mm;
struct mutex mutex;
- unsigned acked_features;
struct vhost_virtqueue **vqs;
int nvqs;
struct file *log_file;
@@ -174,13 +174,8 @@ enum {
(1ULL << VHOST_F_LOG_ALL),
};
-static inline int vhost_has_feature(struct vhost_dev *dev, int bit)
+static inline int vhost_has_feature(struct vhost_virtqueue *vq, int bit)
{
- unsigned acked_features;
-
- /* TODO: check that we are running from vhost_worker or dev mutex is
- * held? */
- acked_features = rcu_derefere...
2014 Jun 05
1
[PATCH v2 1/2] vhost: move acked_features to VQs
...og_base;
struct vhost_log *log;
@@ -117,7 +118,6 @@ struct vhost_dev {
struct vhost_memory __rcu *memory;
struct mm_struct *mm;
struct mutex mutex;
- unsigned acked_features;
struct vhost_virtqueue **vqs;
int nvqs;
struct file *log_file;
@@ -174,13 +174,8 @@ enum {
(1ULL << VHOST_F_LOG_ALL),
};
-static inline int vhost_has_feature(struct vhost_dev *dev, int bit)
+static inline int vhost_has_feature(struct vhost_virtqueue *vq, int bit)
{
- unsigned acked_features;
-
- /* TODO: check that we are running from vhost_worker or dev mutex is
- * held? */
- acked_features = rcu_derefere...
2015 Apr 02
9
[PATCH v2 0/7] vhost: support for cross endian guests
Hi,
This patchset allows vhost to be used with legacy virtio when guest and host
have a different endianness. It is a complete rework of my initial post.
Patches 1 to 5 are preliminary work: we move the endianness check out of all
memory accessors to separate functions.
Patch 6 changes the semantics of the accessors so that they have explicit big
endian support.
Patch 7 brings the cross-endian
2015 Apr 02
9
[PATCH v2 0/7] vhost: support for cross endian guests
Hi,
This patchset allows vhost to be used with legacy virtio when guest and host
have a different endianness. It is a complete rework of my initial post.
Patches 1 to 5 are preliminary work: we move the endianness check out of all
memory accessors to separate functions.
Patch 6 changes the semantics of the accessors so that they have explicit big
endian support.
Patch 7 brings the cross-endian
2019 Oct 21
0
[RFC 1/2] vhost: IFC VF hardware operation layer
...;> +
>>> +#define IFC_SUPPORTED_FEATURES \
>>> +??????? ((1ULL << VIRTIO_NET_F_MAC)??????????? | \
>>> +???????? (1ULL << VIRTIO_F_ANY_LAYOUT)??????????? | \
>>> +???????? (1ULL << VIRTIO_F_VERSION_1) | \
>>> +???????? (1ULL << VHOST_F_LOG_ALL)??????????? | \
>>
>>
>> Let's avoid using VHOST_F_LOG_ALL, using the get_mdev_features()
>> instead.
> Thanks, I will remove VHOST_F_LOG_ALL
>>
>>
>>> +???????? (1ULL << VIRTIO_NET_F_GUEST_ANNOUNCE)??????? | \
>>> +???????? (1ULL...
2018 Jun 11
1
[PATCH net] vhost_net: remove VHOST_NET_F_VIRTIO_NET_HDR support
...to a sane structure without the 64 bit padding bug
>>> right now.
>> Yes, I hit this bug when introducing V2 of msg IOTLB message.
> Sounds good, so if you like, reserve a bit for
> VHOST_NET_F_VIRTIO_NET_HDR in the new ioctl mask and
> do not enable it there.
Ok, and maybe VHOST_F_LOG_ALL.
>
>>>> Fixes: 4e9fa50c6ccbe ("vhost: move features to core")
>>> This tag makes no sense here IMHO. Looks like people are using some tool
>>> that just looks at the earliest version where patch won't apply. The
>>> commit in question just mo...
2018 Jun 08
2
[PATCH net] vhost_net: remove VHOST_NET_F_VIRTIO_NET_HDR support
...dr */
>> - vhost_hlen = 0;
>> - sock_hlen = hdr_len;
>> - }
>> +
>> + /* socket provides vnet_hdr */
>> + vhost_hlen = 0;
>> + sock_hlen = hdr_len;
>> +
>> mutex_lock(&n->dev.mutex);
>> if ((features & (1 << VHOST_F_LOG_ALL)) &&
>> !vhost_log_access_ok(&n->dev))
>> --
>> 2.7.4
2018 Jun 08
2
[PATCH net] vhost_net: remove VHOST_NET_F_VIRTIO_NET_HDR support
...dr */
>> - vhost_hlen = 0;
>> - sock_hlen = hdr_len;
>> - }
>> +
>> + /* socket provides vnet_hdr */
>> + vhost_hlen = 0;
>> + sock_hlen = hdr_len;
>> +
>> mutex_lock(&n->dev.mutex);
>> if ((features & (1 << VHOST_F_LOG_ALL)) &&
>> !vhost_log_access_ok(&n->dev))
>> --
>> 2.7.4
2010 Oct 11
2
[patch 1/2] vhost: potential integer overflows
...device mutex */
static int vq_log_access_ok(struct vhost_virtqueue *vq, void __user *log_base)
{
+ if (vq->num > UINT_MAX / sizeof *vq->used->ring - sizeof *vq->used)
+ return 0;
+
return vq_memory_access_ok(log_base, vq->dev->memory,
vhost_has_feature(vq->dev, VHOST_F_LOG_ALL)) &&
(!vq->log_used || log_access_ok(log_base, vq->log_addr,
@@ -606,12 +617,17 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
}
/* Also validate log access for used ring if enabled. */
- if ((a.flags & (0x1 << VHOST_VRING_F_...
2010 Oct 11
2
[patch 1/2] vhost: potential integer overflows
...device mutex */
static int vq_log_access_ok(struct vhost_virtqueue *vq, void __user *log_base)
{
+ if (vq->num > UINT_MAX / sizeof *vq->used->ring - sizeof *vq->used)
+ return 0;
+
return vq_memory_access_ok(log_base, vq->dev->memory,
vhost_has_feature(vq->dev, VHOST_F_LOG_ALL)) &&
(!vq->log_used || log_access_ok(log_base, vq->log_addr,
@@ -606,12 +617,17 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
}
/* Also validate log access for used ring if enabled. */
- if ((a.flags & (0x1 << VHOST_VRING_F_...
2009 Dec 20
0
[PATCH 2/3] vhost: add access_ok checks
...ruct vhost_net *n, u64 features)
+static int vhost_net_set_features(struct vhost_net *n, u64 features)
{
size_t hdr_size = features & (1 << VHOST_NET_F_VIRTIO_NET_HDR) ?
sizeof(struct virtio_net_hdr) : 0;
int i;
mutex_lock(&n->dev.mutex);
+ if ((features & (1 << VHOST_F_LOG_ALL)) &&
+ !vhost_log_access_ok(&n->dev)) {
+ mutex_unlock(&n->dev.mutex);
+ return -EFAULT;
+ }
n->dev.acked_features = features;
smp_wmb();
for (i = 0; i < VHOST_NET_VQ_MAX; ++i) {
@@ -554,6 +565,7 @@ static void vhost_net_set_features(struct vhost_net *n, u64...
2009 Dec 20
0
[PATCH 2/3] vhost: add access_ok checks
...ruct vhost_net *n, u64 features)
+static int vhost_net_set_features(struct vhost_net *n, u64 features)
{
size_t hdr_size = features & (1 << VHOST_NET_F_VIRTIO_NET_HDR) ?
sizeof(struct virtio_net_hdr) : 0;
int i;
mutex_lock(&n->dev.mutex);
+ if ((features & (1 << VHOST_F_LOG_ALL)) &&
+ !vhost_log_access_ok(&n->dev)) {
+ mutex_unlock(&n->dev.mutex);
+ return -EFAULT;
+ }
n->dev.acked_features = features;
smp_wmb();
for (i = 0; i < VHOST_NET_VQ_MAX; ++i) {
@@ -554,6 +565,7 @@ static void vhost_net_set_features(struct vhost_net *n, u64...
2018 Jun 08
3
[PATCH net] vhost_net: remove VHOST_NET_F_VIRTIO_NET_HDR support
...et_hdr */
- vhost_hlen = hdr_len;
- sock_hlen = 0;
- } else {
- /* socket provides vnet_hdr */
- vhost_hlen = 0;
- sock_hlen = hdr_len;
- }
+
+ /* socket provides vnet_hdr */
+ vhost_hlen = 0;
+ sock_hlen = hdr_len;
+
mutex_lock(&n->dev.mutex);
if ((features & (1 << VHOST_F_LOG_ALL)) &&
!vhost_log_access_ok(&n->dev))
--
2.7.4
2018 Jun 08
3
[PATCH net] vhost_net: remove VHOST_NET_F_VIRTIO_NET_HDR support
...et_hdr */
- vhost_hlen = hdr_len;
- sock_hlen = 0;
- } else {
- /* socket provides vnet_hdr */
- vhost_hlen = 0;
- sock_hlen = hdr_len;
- }
+
+ /* socket provides vnet_hdr */
+ vhost_hlen = 0;
+ sock_hlen = hdr_len;
+
mutex_lock(&n->dev.mutex);
if ((features & (1 << VHOST_F_LOG_ALL)) &&
!vhost_log_access_ok(&n->dev))
--
2.7.4