On 17/12/2019 12:38, Roger Pau Monné wrote:
>> @@ -46,25 +14,9 @@ void restore_rest_processor_state(void)
>>      /* Restore full CR4 (inc MCE) now that the IDT is in place. */
>>      write_cr4(mmu_cr4_features);
>>  
>> -    /* Recover syscall MSRs */
>> -    wrmsrl(MSR_LSTAR, saved_lstar);
>> -    wrmsrl(MSR_CSTAR, saved_cstar);
>> -    wrmsrl(MSR_STAR, XEN_MSR_STAR);
>> -    wrmsrl(MSR_SYSCALL_MASK, XEN_SYSCALL_MASK);
>> -
>> -    wrfsbase(saved_fs_base);
>> -    wrgsbase(saved_gs_base);
>> -    wrmsrl(MSR_SHADOW_GS_BASE, saved_kernel_gs_base);
>> -
>> -    if ( cpu_has_sep )
>> -    {
>> -        /* Recover sysenter MSRs */
>> -        wrmsrl(MSR_IA32_SYSENTER_ESP, saved_sysenter_esp);
>> -        wrmsrl(MSR_IA32_SYSENTER_EIP, saved_sysenter_eip);
>> -        wrmsr(MSR_IA32_SYSENTER_CS, __HYPERVISOR_CS, 0);
>> -    }
>> +    percpu_traps_init();
>>  
>> -    if ( cpu_has_xsave && !set_xcr0(saved_xcr0) )
>> +    if ( cpu_has_xsave && !set_xcr0(get_xcr0()) )
>>          BUG();
>>  
>>      wrmsrl(MSR_IA32_CR_PAT, XEN_MSR_PAT);
> Given what this functions does after this change, would it be feasible
> to place such calls directly in enter_state?
>
> AFAICT there's already some restoring done there anyway.

Hmm - we already appear to double up CR4/EFER restoration, so there is
clearly more cleanup to do.  I'll see if I can make
restore_rest_processor_state() disappear completely.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to