diff mbox series

[RFC,kvmtool,v1,24/32] Change vesa mapping from private to shared

Message ID 20221202174417.1310826-25-tabba@google.com (mailing list archive)
State New, archived
Headers show
Series Add support for restricted guest memory in kvmtool | expand

Commit Message

Fuad Tabba Dec. 2, 2022, 5:44 p.m. UTC
Private mappings don't work with restricted memory since it
might be COWed.

Signed-off-by: Fuad Tabba <tabba@google.com>
---
 hw/vesa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/hw/vesa.c b/hw/vesa.c
index 277d638..3233794 100644
--- a/hw/vesa.c
+++ b/hw/vesa.c
@@ -96,7 +96,7 @@  struct framebuffer *vesa__init(struct kvm *kvm)
 		goto unregister_device;
 	}
 
-	mem = mmap(NULL, VESA_MEM_SIZE, PROT_RW, MAP_PRIVATE, mem_fd, 0);
+	mem = mmap(NULL, VESA_MEM_SIZE, PROT_RW, MAP_SHARED, mem_fd, 0);
 	if (mem == MAP_FAILED) {
 		r = -errno;
 		goto close_memfd;