mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-21 08:50:27 +00:00
trusty: Simulate Secure Monitor Call(SMC) by Hypercall
For ARM, The SMC instruction is used to generate a synchronous exception that is handled by Secure Monitor code running in EL3. In the ARM architecture, synchronous control is transferred between the normal Non-secure state and the Secure state through Secure Monitor Call exceptions. SMC exceptions are generated by the SMC instruction, and handled by the Secure Monitor.The operation of the Secure Monitor is determined by the parameters that are passed in through registers. For ACRN, Hypervisor will simulate SMC by hypercall to switch vCPU State between Normal World and Secure World. There are 4 registers(RDI, RSI, RDX, RBX) reserved for paramters passing between Normal World and Secure World. Signed-off-by: Qi Yadong <yadong.qi@intel.com>
This commit is contained in:
@@ -128,5 +128,7 @@ struct secure_world_control {
|
||||
struct secure_world_memory sworld_memory;
|
||||
};
|
||||
|
||||
void switch_world(struct vcpu *vcpu, int next_world);
|
||||
|
||||
#endif /* TRUSTY_H_ */
|
||||
|
||||
|
@@ -39,6 +39,7 @@
|
||||
|
||||
struct vhm_request;
|
||||
|
||||
bool is_hypercall_from_ring0(void);
|
||||
int acrn_insert_request_wait(struct vcpu *vcpu, struct vhm_request *req);
|
||||
int acrn_insert_request_nowait(struct vcpu *vcpu, struct vhm_request *req);
|
||||
int get_req_info(char *str, int str_max);
|
||||
@@ -325,6 +326,15 @@ int64_t hcall_reset_ptdev_intr_info(struct vm *vm, uint64_t vmid,
|
||||
*/
|
||||
int64_t hcall_setup_sbuf(struct vm *vm, uint64_t param);
|
||||
|
||||
/**
|
||||
* @brief Switch VCPU state between Normal/Secure World.
|
||||
*
|
||||
* @param VCPU Pointer to VCPU data structure
|
||||
*
|
||||
* @return 0 on success, non-zero on error.
|
||||
*/
|
||||
int64_t hcall_world_switch(struct vcpu *vcpu);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
@@ -229,4 +229,5 @@ struct hc_api_version {
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ACRN_HV_DEFS_H */
|
||||
|
Reference in New Issue
Block a user