On 28/08/2019 15:10, Jan Beulich wrote:
> On 12.08.2019 20:21, Andrew Cooper wrote:
>> load_TR() is used exclusively in the resume path, but jumps through a lot of
>> unnecessary hoops.
>>
>> As suspend/resume is strictly on CPU0 in idle context, the correct GDT to use
>> is boot_gdt, which means it doesn't need saving on suspend.  Similarly, the
>> correct IDT to use can be derived, and the LDT is guaranteed to be NUL.
>>
>> The TR is still correct in the GDT, but needs the busy bit clearing before we
>> can reload it.
>>
>> Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>
>> ---
>> CC: Jan Beulich <jbeul...@suse.com>
>> CC: Wei Liu <w...@xen.org>
>> CC: Roger Pau Monné <roger....@citrix.com>
>>
>> A slightly different option would be to call load_system_tables() rather than
>> opencoding part of it in restore_rest_processor_state().  However, that is
>> more setup than is necessary.  Thoughts?
> This might indeed be better (despite the parts not needed on this
> path), as it would further centralize the handling. Of course only
> as long as there's no (significant) change needed to the function
> in order to be used here.

No change at all.  The AP's already do go through load_system_tables()
on S3 resume.

It is slightly suboptimal that we get two identical lgdt's this close
together, but it is the only way of ending up entering C with
__HYPERVISOR_CS.

At some future point, I'll see how easy it is to arrange the trampoline
GDT to be usable with __HYPERVISOR_CS, which would simplify the boot and
resume paths.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to