* [PATCH] hvm: reset TSC to 0 after domain resume from S3
@ 2013-11-20 14:22 Tomasz Wroblewski
2013-11-20 15:02 ` Jan Beulich
0 siblings, 1 reply; 3+ messages in thread
From: Tomasz Wroblewski @ 2013-11-20 14:22 UTC (permalink / raw)
To: xen-devel; +Cc: Tomasz Wroblewski
Host S3 implicitly resets the host TSC to 0, but the tsc offset for hvm domains is not recalculated
when they resume, causing it to go into negative values. In Linux guest using tsc clocksource, this
results in a hang after wrap back to positive values since the tsc clocksource implementation
expects it reset.
Signed-off-by: Tomasz Wroblewski <tomasz.wroblewski@citrix.com>
---
xen/arch/x86/hvm/hvm.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 3b353ec..3d48978 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3736,8 +3736,13 @@ static void hvm_s3_suspend(struct domain *d)
static void hvm_s3_resume(struct domain *d)
{
+ struct vcpu *v;
if ( test_and_clear_bool(d->arch.hvm_domain.is_s3_suspended) )
+ {
+ for_each_vcpu( d, v )
+ hvm_set_guest_tsc( v, 0 );
domain_unpause(d);
+ }
}
static int hvmop_set_isa_irq_level(
--
1.8.4.rc3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] hvm: reset TSC to 0 after domain resume from S3
2013-11-20 14:22 [PATCH] hvm: reset TSC to 0 after domain resume from S3 Tomasz Wroblewski
@ 2013-11-20 15:02 ` Jan Beulich
2013-11-20 16:14 ` Tomasz Wroblewski
0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2013-11-20 15:02 UTC (permalink / raw)
To: Tomasz Wroblewski; +Cc: xen-devel
>>> On 20.11.13 at 15:22, Tomasz Wroblewski <tomasz.wroblewski@citrix.com> wrote:
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -3736,8 +3736,13 @@ static void hvm_s3_suspend(struct domain *d)
>
> static void hvm_s3_resume(struct domain *d)
> {
> + struct vcpu *v;
Blank line needed here.
And it would imo be better to move the declaration inside the body
of the if().
> if ( test_and_clear_bool(d->arch.hvm_domain.is_s3_suspended) )
> + {
> + for_each_vcpu( d, v )
> + hvm_set_guest_tsc( v, 0 );
Stray blanks inside the parentheses.
(If I'm ending up committing this, and if no other need to redo
the patch shows up, I can take care of these cosmetics on the
fly, i.e. no need to send a v2 just for this.)
Jan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] hvm: reset TSC to 0 after domain resume from S3
2013-11-20 15:02 ` Jan Beulich
@ 2013-11-20 16:14 ` Tomasz Wroblewski
0 siblings, 0 replies; 3+ messages in thread
From: Tomasz Wroblewski @ 2013-11-20 16:14 UTC (permalink / raw)
To: Jan Beulich; +Cc: xen-devel
> (If I'm ending up committing this, and if no other need to redo
> the patch shows up, I can take care of these cosmetics on the
> fly, i.e. no need to send a v2 just for this.)
>
All right, thanks! Sorry for the blanks, I post patches infrequently enough to forget the precise rules but frequently enough to delude
myself I still remember them.
> Jan
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-11-20 16:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-20 14:22 [PATCH] hvm: reset TSC to 0 after domain resume from S3 Tomasz Wroblewski
2013-11-20 15:02 ` Jan Beulich
2013-11-20 16:14 ` Tomasz Wroblewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).