mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-07 09:41:30 +00:00
HV: trusty: new hypercall to save/restore context of secure world
New field in VM's structure:
sworld_snapshot: save cpu_context of secure world.
New hypercall: HC_SAVE_RESTORE_SWORLD_CTX
In UOS S3 suspend path: trusty kernel driver will call this hypercall
to require Hypervisor save context of secure world.
In UOS S3 resume path: virtual firmware will call this hypercall to
require Hypervisor restore context of secure world.
New bit in secure_world_control.flag:
ctx_saved: indicate whether cpu_context of secure world is saved.
Signed-off-by: Qi Yadong <yadong.qi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -104,11 +104,13 @@ struct secure_world_memory {
|
||||
struct secure_world_control {
|
||||
/* Flag indicates Secure World's state */
|
||||
struct {
|
||||
/* secure world supporting: 0(unsupported), 1(supported) */
|
||||
/* sworld supporting: 0(unsupported), 1(supported) */
|
||||
uint64_t supported : 1;
|
||||
/* secure world running status: 0(inactive), 1(active) */
|
||||
/* sworld running status: 0(inactive), 1(active) */
|
||||
uint64_t active : 1;
|
||||
uint64_t reserved : 62;
|
||||
/* sworld context saving status: 0(unsaved), 1(saved) */
|
||||
uint64_t ctx_saved : 1;
|
||||
uint64_t reserved : 61;
|
||||
} flag;
|
||||
/* Secure world memory structure */
|
||||
struct secure_world_memory sworld_memory;
|
||||
@@ -126,7 +128,8 @@ struct trusty_startup_param {
|
||||
void switch_world(struct vcpu *vcpu, int next_world);
|
||||
bool initialize_trusty(struct vcpu *vcpu, uint64_t param);
|
||||
void destroy_secure_world(struct vm *vm);
|
||||
|
||||
void save_sworld_context(struct vcpu *vcpu);
|
||||
void restore_sworld_context(struct vcpu *vcpu);
|
||||
void trusty_set_dseed(void *dseed, uint8_t dseed_num);
|
||||
|
||||
#endif /* TRUSTY_H_ */
|
||||
|
||||
Reference in New Issue
Block a user