mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
SVM patch for 64bit hv, to reset the ss, es, ds host selectors to NULL
during a context switch to the SVM domain's vcpu. This patch also initializes the tlb_control to 1 for the initial do_launch(). Signed-off-by: Tom Woller <thomas.woller@amd.com>
This commit is contained in:
1 parent
d3997b960e
commit
f9caf5ffab
2 files changed
+16
No files matched your search
@@ -61,6 +61,9 @@ static unsigned long trace_values[NR_CPUS][4];
|
||||
/* Useful define */
|
||||
#define MAX_INST_SIZE 15
|
||||
|
||||
#define set_segment_register(name, value) \
|
||||
__asm__ __volatile__ ( "movw %%ax ,%%" STR(name) "" : : "a" (value) )
|
||||
|
||||
/*
|
||||
* External functions, etc. We should move these to some suitable header file(s) */
|
||||
|
||||
@@ -681,6 +684,17 @@ static void svm_ctxt_switch_from(struct vcpu *v)
|
||||
|
||||
static void svm_ctxt_switch_to(struct vcpu *v)
|
||||
{
|
||||
#if __x86_64__
|
||||
/*
|
||||
* This is required, because VMRUN does consistency check
|
||||
* and some of the DOM0 selectors are pointing to
|
||||
* invalid GDT locations, and cause AMD processors
|
||||
* to shutdown.
|
||||
*/
|
||||
set_segment_register(ds, 0);
|
||||
set_segment_register(es, 0);
|
||||
set_segment_register(ss, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
void svm_final_setup_guest(struct vcpu *v)
|
||||
|
||||
@@ -428,6 +428,8 @@ void svm_do_launch(struct vcpu *v)
|
||||
|
||||
if (svm_dbg_on)
|
||||
svm_dump_vmcb(__func__, vmcb);
|
||||
|
||||
vmcb->tlb_control = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||