search for: log_write_hva

Displaying 20 results from an estimated 25 matches for "log_write_hva".

2018 Dec 12
2
[PATCH net V2 4/4] vhost: log dirty page correctly
...); > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > index 55e5aa662ad5..3660310604fd 100644 > --- a/drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -1733,11 +1733,67 @@ static int log_write(void __user *log_base, > return r; > } > > +static int log_write_hva(struct vhost_virtqueue *vq, u64 hva, u64 len) > +{ > + struct vhost_umem *umem = vq->umem; > + struct vhost_umem_node *u; > + u64 gpa; > + int r; > + bool hit = false; > + > + list_for_each_entry(u, &umem->umem_list, link) { > + if (u->userspace_addr < hv...
2018 Dec 12
2
[PATCH net V2 4/4] vhost: log dirty page correctly
...); > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > index 55e5aa662ad5..3660310604fd 100644 > --- a/drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -1733,11 +1733,67 @@ static int log_write(void __user *log_base, > return r; > } > > +static int log_write_hva(struct vhost_virtqueue *vq, u64 hva, u64 len) > +{ > + struct vhost_umem *umem = vq->umem; > + struct vhost_umem_node *u; > + u64 gpa; > + int r; > + bool hit = false; > + > + list_for_each_entry(u, &umem->umem_list, link) { > + if (u->userspace_addr < hv...
2019 Feb 19
2
[PATCH][next] vhost: only return early if ret indicates an error or no iovecs have been processed
From: Colin Ian King <colin.king at canonical.com> Currently the loop that calls log_write_hva on each iovec is never executed because of an incorrect error check on the return from the call to translate_desc. The check should be checking for a -ve error return and because it makes no sense to iterate over zero items, the checks should also check for zero too. Detected by CoverityScan, CID...
2019 Feb 19
2
[PATCH][next] vhost: only return early if ret indicates an error or no iovecs have been processed
From: Colin Ian King <colin.king at canonical.com> Currently the loop that calls log_write_hva on each iovec is never executed because of an incorrect error check on the return from the call to translate_desc. The check should be checking for a -ve error return and because it makes no sense to iterate over zero items, the checks should also check for zero too. Detected by CoverityScan, CID...
2018 Dec 10
1
[PATCH net 4/4] vhost: log dirty page correctly
...rom pointer to integer of different size [-Wpointer-to-int-cast] ret = translate_desc(vq, (u64)vq->used + used_offset, len, iov, 64, ^ drivers//vhost/vhost.c:1776:27: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] ret = log_write_hva(vq, (u64)iov[i].iov_base, iov[i].iov_len); ^ drivers//vhost/vhost.c: In function 'vhost_log_write': drivers//vhost/vhost.c:1788:26: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] r = log_write_hva(vq, (u64)iov[i].io...
2018 Dec 10
0
[PATCH net 4/4] vhost: log dirty page correctly
...en))) { vhost_poll_queue(&vq->poll); diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 55e5aa662ad5..8ab279720a2b 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -1733,11 +1733,66 @@ static int log_write(void __user *log_base, return r; } +static int log_write_hva(struct vhost_virtqueue *vq, u64 hva, u64 len) +{ + struct vhost_umem *umem = vq->umem; + struct vhost_umem_node *u; + u64 gpa; + int r; + bool hit = false; + + list_for_each_entry(u, &umem->umem_list, link) { + if (u->userspace_addr < hva && + u->userspace_addr + u-...
2018 Dec 12
0
[PATCH net V2 4/4] vhost: log dirty page correctly
...en))) { vhost_poll_queue(&vq->poll); diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 55e5aa662ad5..3660310604fd 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -1733,11 +1733,67 @@ static int log_write(void __user *log_base, return r; } +static int log_write_hva(struct vhost_virtqueue *vq, u64 hva, u64 len) +{ + struct vhost_umem *umem = vq->umem; + struct vhost_umem_node *u; + u64 gpa; + int r; + bool hit = false; + + list_for_each_entry(u, &umem->umem_list, link) { + if (u->userspace_addr < hva && + u->userspace_addr + u-...
2020 Sep 14
0
[PATCH] vhost: reduce stack usage in log_used
...vhost/vhost.c | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) > > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > index b45519c..41769de 100644 > --- a/drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -1884,25 +1884,31 @@ static int log_write_hva(struct vhost_virtqueue *vq, > u64 hva, u64 len) > > static int log_used(struct vhost_virtqueue *vq, u64 used_offset, u64 len) > { > - struct iovec iov[64]; > + struct iovec *iov; > int i, ret; > > if (!vq->iotlb) > return log_write(vq->log_base, vq-&...
2018 Dec 13
0
[PATCH net V2 4/4] vhost: log dirty page correctly
...vhost.c b/drivers/vhost/vhost.c >> index 55e5aa662ad5..3660310604fd 100644 >> --- a/drivers/vhost/vhost.c >> +++ b/drivers/vhost/vhost.c >> @@ -1733,11 +1733,67 @@ static int log_write(void __user *log_base, >> return r; >> } >> >> +static int log_write_hva(struct vhost_virtqueue *vq, u64 hva, u64 len) >> +{ >> + struct vhost_umem *umem = vq->umem; >> + struct vhost_umem_node *u; >> + u64 gpa; >> + int r; >> + bool hit = false; >> + >> + list_for_each_entry(u, &umem->umem_list, link) { >>...
2018 Dec 12
10
[PATCH net V2 0/4] Fix various issue of vhost
Hi: This series tries to fix various issues of vhost: - Patch 1 adds a missing write barrier between used idx updating and logging. - Patch 2-3 brings back the protection of device IOTLB through vq mutex, this fixes possible use after free in device IOTLB entries. - Patch 4-7 fixes the diry page logging when device IOTLB is enabled. We should done through GPA instead of GIOVA, this was
2018 Dec 12
10
[PATCH net V2 0/4] Fix various issue of vhost
Hi: This series tries to fix various issues of vhost: - Patch 1 adds a missing write barrier between used idx updating and logging. - Patch 2-3 brings back the protection of device IOTLB through vq mutex, this fixes possible use after free in device IOTLB entries. - Patch 4-7 fixes the diry page logging when device IOTLB is enabled. We should done through GPA instead of GIOVA, this was
2018 Dec 13
2
[PATCH net V2 4/4] vhost: log dirty page correctly
...c > > > index 55e5aa662ad5..3660310604fd 100644 > > > --- a/drivers/vhost/vhost.c > > > +++ b/drivers/vhost/vhost.c > > > @@ -1733,11 +1733,67 @@ static int log_write(void __user *log_base, > > > return r; > > > } > > > +static int log_write_hva(struct vhost_virtqueue *vq, u64 hva, u64 len) > > > +{ > > > + struct vhost_umem *umem = vq->umem; > > > + struct vhost_umem_node *u; > > > + u64 gpa; > > > + int r; > > > + bool hit = false; > > > + > > > + list_for_each_en...
2018 Dec 13
2
[PATCH net V2 4/4] vhost: log dirty page correctly
...c > > > index 55e5aa662ad5..3660310604fd 100644 > > > --- a/drivers/vhost/vhost.c > > > +++ b/drivers/vhost/vhost.c > > > @@ -1733,11 +1733,67 @@ static int log_write(void __user *log_base, > > > return r; > > > } > > > +static int log_write_hva(struct vhost_virtqueue *vq, u64 hva, u64 len) > > > +{ > > > + struct vhost_umem *umem = vq->umem; > > > + struct vhost_umem_node *u; > > > + u64 gpa; > > > + int r; > > > + bool hit = false; > > > + > > > + list_for_each_en...
2018 Dec 10
9
[PATCH net 0/4] Fix various issue of vhost
Hi: This series tries to fix various issues of vhost: - Patch 1 adds a missing write barrier between used idx updating and logging. - Patch 2-3 brings back the protection of device IOTLB through vq mutex, this fixes possible use after free in device IOTLB entries. - Patch 4 fixes the diry page logging when device IOTLB is enabled. We should done through GPA instead of GIOVA, this was done
2018 Dec 10
9
[PATCH net 0/4] Fix various issue of vhost
Hi: This series tries to fix various issues of vhost: - Patch 1 adds a missing write barrier between used idx updating and logging. - Patch 2-3 brings back the protection of device IOTLB through vq mutex, this fixes possible use after free in device IOTLB entries. - Patch 4 fixes the diry page logging when device IOTLB is enabled. We should done through GPA instead of GIOVA, this was done
2019 Feb 19
0
[PATCH][next] vhost: only return early if ret indicates an error or no iovecs have been processed
On Tue, Feb 19, 2019 at 01:57:13PM +0000, Colin King wrote: > From: Colin Ian King <colin.king at canonical.com> > > Currently the loop that calls log_write_hva on each iovec is never > executed because of an incorrect error check on the return from the > call to translate_desc. The check should be checking for a -ve error > return and because it makes no sense to iterate over zero items, the > checks should also check for zero too. > >...
2020 Sep 15
0
[PATCH] vhost: reduce stack usage in log_used
...c | 2 +- > drivers/vhost/vhost.h | 1 + > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > index b45519c..31837a5 > --- a/drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -1884,7 +1884,7 @@ static int log_write_hva(struct vhost_virtqueue *vq, u64 hva, u64 len) > > static int log_used(struct vhost_virtqueue *vq, u64 used_offset, u64 len) > { > - struct iovec iov[64]; > + struct iovec *iov = vq->log_iov; > int i, ret; > > if (!vq->iotlb) > diff --git a/drivers/vh...
2019 Dec 15
0
[vhost:linux-next 12/12] drivers/vhost/vhost.c:1968:11: note: in expansion of macro 'min'
...10-02-01 1955 smp_wmb(); cc5e710759470b Jason Wang 2019-01-16 1956 cc5e710759470b Jason Wang 2019-01-16 1957 if (vq->iotlb) { cc5e710759470b Jason Wang 2019-01-16 1958 for (i = 0; i < count; i++) { cc5e710759470b Jason Wang 2019-01-16 1959 r = log_write_hva(vq, (uintptr_t)iov[i].iov_base, cc5e710759470b Jason Wang 2019-01-16 1960 iov[i].iov_len); cc5e710759470b Jason Wang 2019-01-16 1961 if (r < 0) cc5e710759470b Jason Wang 2019-01-16 1962 return r; cc5e710759470b Jason Wang 2019-01-16 1963 }...
2020 Feb 20
0
[PATCH V3 1/5] vhost: factor out IOTLB
...return -ENOMEM; @@ -1745,7 +1664,7 @@ int vhost_init_device_iotlb(struct vhost_dev *d, bool enabled) mutex_unlock(&vq->mutex); } - vhost_umem_clean(oiotlb); + vhost_iotlb_free(oiotlb); return 0; } @@ -1875,8 +1794,8 @@ static int log_write(void __user *log_base, static int log_write_hva(struct vhost_virtqueue *vq, u64 hva, u64 len) { - struct vhost_umem *umem = vq->umem; - struct vhost_umem_node *u; + struct vhost_iotlb *umem = vq->umem; + struct vhost_iotlb_map *u; u64 start, end, l, min; int r; bool hit = false; @@ -1886,16 +1805,15 @@ static int log_write_hva(struc...
2019 Dec 15
0
[vhost:linux-next 12/12] drivers/vhost/vhost.c:1968:25: sparse: sparse: incompatible types in comparison expression (different type sizes):
...10-02-01 1955 smp_wmb(); cc5e710759470b Jason Wang 2019-01-16 1956 cc5e710759470b Jason Wang 2019-01-16 1957 if (vq->iotlb) { cc5e710759470b Jason Wang 2019-01-16 1958 for (i = 0; i < count; i++) { cc5e710759470b Jason Wang 2019-01-16 1959 r = log_write_hva(vq, (uintptr_t)iov[i].iov_base, cc5e710759470b Jason Wang 2019-01-16 1960 iov[i].iov_len); cc5e710759470b Jason Wang 2019-01-16 1961 if (r < 0) cc5e710759470b Jason Wang 2019-01-16 1962 return r; cc5e710759470b Jason Wang 2019-01-16 1963 }...