36 lines
1.2 KiB
Diff
36 lines
1.2 KiB
Diff
|
|
From a3e8267b93d1e77dc547fff6fb9af6f8d48a674f Mon Sep 17 00:00:00 2001
|
||
|
|
From: jiangxin <jiangxin@hygon.cn>
|
||
|
|
Date: Wed, 25 Aug 2021 12:36:00 +0800
|
||
|
|
Subject: [PATCH] target/i386: csv: Do not register/unregister guest secure
|
||
|
|
memory for CSV3 guest
|
||
|
|
|
||
|
|
CSV3's guest memory is allocated by firmware in secure processor
|
||
|
|
from dedicated memory reserved upon system boot up, consequently
|
||
|
|
it is not necessary to add notifier to pin/unpin memory.
|
||
|
|
|
||
|
|
Signed-off-by: Xin Jiang <jiangxin@hygon.cn>
|
||
|
|
Signed-off-by: hanliyang <hanliyang@hygon.cn>
|
||
|
|
---
|
||
|
|
target/i386/sev.c | 5 ++++-
|
||
|
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
||
|
|
|
||
|
|
diff --git a/target/i386/sev.c b/target/i386/sev.c
|
||
|
|
index 6ff8891678..0012a5efb0 100644
|
||
|
|
--- a/target/i386/sev.c
|
||
|
|
+++ b/target/i386/sev.c
|
||
|
|
@@ -1262,7 +1262,10 @@ int sev_kvm_init(ConfidentialGuestSupport *cgs, Error **errp)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
- ram_block_notifier_add(&sev_ram_notifier);
|
||
|
|
+ /* CSV3 guest do not need notifier to reg/unreg memory */
|
||
|
|
+ if (!csv3_enabled()) {
|
||
|
|
+ ram_block_notifier_add(&sev_ram_notifier);
|
||
|
|
+ }
|
||
|
|
qemu_add_machine_init_done_notifier(&sev_machine_done_notify);
|
||
|
|
qemu_add_vm_change_state_handler(sev_vm_state_change, sev);
|
||
|
|
migration_add_notifier(&sev_migration_state, sev_migration_state_notifier);
|
||
|
|
--
|
||
|
|
2.41.0.windows.1
|
||
|
|
|