Of the state saved by the insn and reloaded by the corresponding VMLOAD
- TR and syscall state are invariant while having Xen's state loaded,
- sysenter is unused altogether by Xen,
- FS, GS, and LDTR are not used by Xen and get suitably set in PV
context switch code.
Note that state is suitably populated in _svm_cpu_up(); a minimal
respective assertion gets added.
Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
svm_restore_dr(v);
- svm_vmsave_pa(per_cpu(host_vmcb, cpu));
vmcb->cleanbits.raw = 0;
svm_tsc_ratio_load(v);
/* Initialize OSVW bits to be used by guests */
svm_host_osvw_init();
+ /* Minimal checking that enough CPU setup was done by now. */
+ ASSERT(str() == TSS_SELECTOR);
svm_vmsave_pa(per_cpu(host_vmcb, cpu));
return 0;
__asm__ __volatile__ ( "ltr %w0" :: "rm" (sel) : "memory" );
}
+static inline unsigned int str(void)
+{
+ unsigned int sel;
+
+ __asm__ ( "str %0" : "=r" (sel) );
+
+ return sel;
+}
+
#endif /* !__ASSEMBLY__ */
#endif /* __ARCH_DESC_H */