@@ -3858,6 +3858,9 @@ static void hvm_s3_suspend(struct domain *d)
hvm_vcpu_reset_state(d->vcpu[0], 0xf000, 0xfff0);
+ if ( hvm_funcs.s3_suspend )
+ hvm_funcs.s3_suspend(d);
+
domain_unlock(d);
}
@@ -2290,6 +2290,12 @@ static bool vmx_get_pending_event(struct vcpu *v, struct x86_event *info)
return true;
}
+static void vmx_s3_suspend(struct domain *d)
+{
+ if ( domain_has_sgx(d) )
+ hvm_reset_epc(d, false);
+}
+
static struct hvm_function_table __initdata vmx_function_table = {
.name = "VMX",
.cpu_up_prepare = vmx_cpu_up_prepare,
@@ -2360,6 +2366,7 @@ static struct hvm_function_table __initdata vmx_function_table = {
.max_ratio = VMX_TSC_MULTIPLIER_MAX,
.setup = vmx_setup_tsc_scaling,
},
+ .s3_suspend = vmx_s3_suspend,
};
/* Handle VT-d posted-interrupt when VCPU is blocked. */
@@ -226,6 +226,9 @@ struct hvm_function_table {
/* Architecture function to setup TSC scaling ratio */
void (*setup)(struct vcpu *v);
} tsc_scaling;
+
+ /* Domain S3 suspend */
+ void (*s3_suspend)(struct domain *d);
};
extern struct hvm_function_table hvm_funcs;
EPC is destroyed when power state goes to S3-S5. Emulate this behavior. A new function s3_suspend is added to hvm_function_table for this purpose. Signed-off-by: Kai Huang <kai.huang@linux.intel.com> --- xen/arch/x86/hvm/hvm.c | 3 +++ xen/arch/x86/hvm/vmx/vmx.c | 7 +++++++ xen/include/asm-x86/hvm/hvm.h | 3 +++ 3 files changed, 13 insertions(+)