All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] vhost: flush dcache page when logging dirty pages
@ 2019-04-09  4:16 Jason Wang
  2019-04-09 13:14 ` Michael S. Tsirkin
  2019-04-09 13:14 ` Michael S. Tsirkin
  0 siblings, 2 replies; 8+ messages in thread
From: Jason Wang @ 2019-04-09  4:16 UTC (permalink / raw)
  To: mst, jasowang, kvm, virtualization, netdev, linux-kernel
  Cc: Christoph Hellwig, James Bottomley, Andrea Arcangeli

We set dirty bit through setting up kmaps and access them through
kernel virtual address, this may result alias in virtually tagged
caches that require a dcache flush afterwards.

Cc: Christoph Hellwig <hch@infradead.org>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Fixes: 3a4d5c94e9593 ("vhost_net: a kernel-level virtio server")
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 drivers/vhost/vhost.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 351af88231ad..34a1cedbc5ba 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -1711,6 +1711,7 @@ static int set_bit_to_user(int nr, void __user *addr)
 	base = kmap_atomic(page);
 	set_bit(bit, base);
 	kunmap_atomic(base);
+	flush_dcache_page(page);
 	set_page_dirty_lock(page);
 	put_page(page);
 	return 0;
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [PATCH net] vhost: flush dcache page when logging dirty pages
@ 2019-04-09  4:16 Jason Wang
  0 siblings, 0 replies; 8+ messages in thread
From: Jason Wang @ 2019-04-09  4:16 UTC (permalink / raw)
  To: mst, jasowang, kvm, virtualization, netdev, linux-kernel
  Cc: Christoph Hellwig, James Bottomley, Andrea Arcangeli

We set dirty bit through setting up kmaps and access them through
kernel virtual address, this may result alias in virtually tagged
caches that require a dcache flush afterwards.

Cc: Christoph Hellwig <hch@infradead.org>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Fixes: 3a4d5c94e9593 ("vhost_net: a kernel-level virtio server")
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 drivers/vhost/vhost.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 351af88231ad..34a1cedbc5ba 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -1711,6 +1711,7 @@ static int set_bit_to_user(int nr, void __user *addr)
 	base = kmap_atomic(page);
 	set_bit(bit, base);
 	kunmap_atomic(base);
+	flush_dcache_page(page);
 	set_page_dirty_lock(page);
 	put_page(page);
 	return 0;
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-04-10  7:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-09  4:16 [PATCH net] vhost: flush dcache page when logging dirty pages Jason Wang
2019-04-09 13:14 ` Michael S. Tsirkin
2019-04-10  7:53   ` Jason Wang
2019-04-10  7:53   ` Jason Wang
2019-04-10  7:53     ` Jason Wang
2019-04-10  7:53     ` Jason Wang
2019-04-09 13:14 ` Michael S. Tsirkin
  -- strict thread matches above, loose matches on Subject: below --
2019-04-09  4:16 Jason Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.