mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 17:58:30 +00:00
trusty: init & switch world fix
- when init, cr0 & cr4 should read from VMCS - when world switch, cr0/cr4 read shadow should also be save/restore v2: - use context->vmx_cr0/cr4 to save/restore VMX_GUEST_CR0/CR4 - use context->cr0/cr4 to save/restore VMX_CR0/CR4_READ_SHADOW Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -7,6 +7,9 @@
|
||||
#include <hypervisor.h>
|
||||
#include <hypercall.h>
|
||||
|
||||
/* this hcall is only come from trusty enabled vcpu itself, and cannot be
|
||||
* called from other vcpus
|
||||
*/
|
||||
int64_t hcall_world_switch(struct vcpu *vcpu)
|
||||
{
|
||||
int next_world_id = !(vcpu->arch_vcpu.cur_context);
|
||||
@@ -31,6 +34,9 @@ int64_t hcall_world_switch(struct vcpu *vcpu)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* this hcall is only come from trusty enabled vcpu itself, and cannot be
|
||||
* called from other vcpus
|
||||
*/
|
||||
int64_t hcall_initialize_trusty(struct vcpu *vcpu, uint64_t param)
|
||||
{
|
||||
if (!vcpu->vm->sworld_control.sworld_enabled) {
|
||||
|
Reference in New Issue
Block a user