diff mbox series

[RFC,kvmtool,v1,32/32] pkvm: Unmap all guest memory after initialization

Message ID 20221202174417.1310826-33-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
In pkvm, assume that all guest memory is private and unmap it by default.
If it's shared and needed, the host can map it later.

Signed-off-by: Fuad Tabba <tabba@google.com>
---
 builtin-run.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/builtin-run.c b/builtin-run.c
index 9ec5701..23a4f8b 100644
--- a/builtin-run.c
+++ b/builtin-run.c
@@ -780,6 +780,9 @@  static struct kvm *kvm_cmd_run_init(int argc, const char **argv)
 	if (init_list__init(kvm) < 0)
 		die ("Initialisation failed");
 
+	if (kvm->cfg.pkvm)
+		unmap_guest(kvm);
+
 	return kvm;
 }