hv: Save/restore MSR_IA32_CSTAR during context switch

Both Windows guest and Linux guest use the MSR MSR_IA32_CSTAR, while
Linux uses it rarely. Now vcpu context switch doesn't save/restore it.
Windows detects the change of the MSR and rises a exception.

Do the save/resotre MSR_IA32_CSTAR during context switch.

Tracked-On: #5899
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
This commit is contained in:
Shuo A Liu
2021-04-01 10:50:53 +08:00
committed by wenlingz
parent 9e4fd1f119
commit 684766f008
2 changed files with 3 additions and 0 deletions

View File

@@ -392,6 +392,7 @@ struct ext_context {
struct segment_sel gs;
uint64_t ia32_star;
uint64_t ia32_cstar;
uint64_t ia32_lstar;
uint64_t ia32_fmask;
uint64_t ia32_kernel_gs_base;