diff mbox series

[RFC,kvmtool,v1,23/32] Change pvtime mapping from private to shared

Message ID 20221202174417.1310826-24-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>
---
 arm/aarch64/pvtime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/arm/aarch64/pvtime.c b/arm/aarch64/pvtime.c
index 9b06ee4..a452938 100644
--- a/arm/aarch64/pvtime.c
+++ b/arm/aarch64/pvtime.c
@@ -20,7 +20,7 @@  static int pvtime__alloc_region(struct kvm *kvm)
 	if (mem_fd < 0)
 		return -errno;
 
-	mem = mmap(NULL, ARM_PVTIME_SIZE, PROT_RW, MAP_PRIVATE, mem_fd, 0);
+	mem = mmap(NULL, ARM_PVTIME_SIZE, PROT_RW, MAP_SHARED, mem_fd, 0);
 	if (mem == MAP_FAILED) {
 		ret = -errno;
 		close(mem_fd);