From: David Miller <davem@davemloft.net>
To: jasowang@redhat.com
Cc: mst@redhat.com, kvm@vger.kernel.org,
virtualization@lists.linux-foundation.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH V2 3/3] vhost: access vq metadata through kernel virtual address
Date: Fri, 28 Dec 2018 11:34:44 -0800 (PST) [thread overview]
Message-ID: <20181228.113444.2162917443074434767.davem@davemloft.net> (raw)
In-Reply-To: <20181228075537.21402-4-jasowang@redhat.com>
From: Jason Wang <jasowang@redhat.com>
Date: Fri, 28 Dec 2018 15:55:37 +0800
> +static int vhost_invalidate_vmap(struct vhost_virtqueue *vq,
> + struct vhost_vmap *map,
> + unsigned long uaddr,
> + unsigned long start,
> + unsigned long end,
> + bool blockable)
> +{
> + if (start < uaddr && end >= uaddr) {
> + if (!blockable)
> + return -EAGAIN;
> + mutex_lock(&vq->mutex);
> + if (map->addr)
> + vunmap(map->unmap_addr);
> + map->addr = NULL;
> + map->unmap_addr = NULL;
> + mutex_unlock(&vq->mutex);
> + }
> +
> + return 0;
> +}
What are the rules for these invalidate operations?
Can there be partial overlaps? If so, wouldn't you need some way of
keeping track of the partially overlapping unmaps so that once all of
the invalidates covering the range occur you properly cleanup and do
the vunmap()?
next prev parent reply other threads:[~2018-12-28 19:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-28 7:55 [RFC PATCH V2 0/3] vhost: accelerate metadata access through vmap() Jason Wang
2018-12-28 7:55 ` [RFC PATCH V2 1/3] vhost: generalize adding used elem Jason Wang
2018-12-28 7:55 ` [RFC PATCH V2 2/3] vhost: fine grain userspace memory accessors Jason Wang
2018-12-28 7:55 ` [RFC PATCH V2 3/3] vhost: access vq metadata through kernel virtual address Jason Wang
2018-12-28 19:34 ` David Miller [this message]
2018-12-29 12:41 ` Jason Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181228.113444.2162917443074434767.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=jasowang@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®