All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 1334397] [NEW] cmos RTC alarms no longer wake system from suspend
@ 2014-06-25 18:39 John Stultz
  2014-06-25 20:11 ` Paolo Bonzini
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: John Stultz @ 2014-06-25 18:39 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

Running QEMU emulator version 2.0.0 (Debian 2.0.0+dfsg-2ubuntu1.1),
booting Linux kernels with qemu-system-x86_64 and qemu-system-i386, I no
longer see the system resume from suspend when an RTC alarm is set.

My simple test application can be found here:
https://github.com/johnstultz-work/timetests/blob/master/alarmtimer-suspend.c

Previously this worked w/ QEMU 1.5  (bascially up until I upgraded from
Ubuntu 13.10 to Ubuntu 14.04, which came with 2.0).

** Affects: qemu
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1334397

Title:
  cmos RTC alarms no longer wake system from suspend

Status in QEMU:
  New

Bug description:
  Running QEMU emulator version 2.0.0 (Debian 2.0.0+dfsg-2ubuntu1.1),
  booting Linux kernels with qemu-system-x86_64 and qemu-system-i386, I
  no longer see the system resume from suspend when an RTC alarm is set.

  My simple test application can be found here:
  https://github.com/johnstultz-work/timetests/blob/master/alarmtimer-suspend.c

  Previously this worked w/ QEMU 1.5  (bascially up until I upgraded
  from Ubuntu 13.10 to Ubuntu 14.04, which came with 2.0).

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1334397/+subscriptions

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [Bug 1334397] [NEW] cmos RTC alarms no longer wake system from suspend
  2014-06-25 18:39 [Qemu-devel] [Bug 1334397] [NEW] cmos RTC alarms no longer wake system from suspend John Stultz
@ 2014-06-25 20:11 ` Paolo Bonzini
  2014-06-26  7:02   ` Paolo Bonzini
  2014-06-26 10:01 ` Paolo Bonzini
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 8+ messages in thread
From: Paolo Bonzini @ 2014-06-25 20:11 UTC (permalink / raw)
  To: Bug 1334397, qemu-devel

Il 25/06/2014 20:39, John Stultz ha scritto:
> Public bug reported:
>
> Running QEMU emulator version 2.0.0 (Debian 2.0.0+dfsg-2ubuntu1.1),
> booting Linux kernels with qemu-system-x86_64 and qemu-system-i386, I no
> longer see the system resume from suspend when an RTC alarm is set.
>
> My simple test application can be found here:
> https://github.com/johnstultz-work/timetests/blob/master/alarmtimer-suspend.c
>
> Previously this worked w/ QEMU 1.5  (bascially up until I upgraded from
> Ubuntu 13.10 to Ubuntu 14.04, which came with 2.0).

Hi John,

I tried instrumenting QEMU and it looks like the RTC emulation is working:

cmos: write index=0x0b val=0x02
  cur 19:53:10 alarm 0:0:0
  next  alarm 14810
  cur 19:53:10 alarm 0:0:0
  next  alarm 14810
cmos: write index=0x05 val=0x19
  cur 19:53:10 alarm 19:0:0
  next  alarm 83210
cmos: write index=0x03 val=0x53
  cur 19:53:10 alarm 19:53:0
  next  alarm 86390
cmos: write index=0x01 val=0x24
  cur 19:53:10 alarm 19:53:24
  next  alarm 14
cmos: write index=0x0b val=0x22
  cur 19:53:10 alarm 19:53:24
  next  alarm 14
cmos: write index=0x0b val=0x22
  cur 19:53:10 alarm 19:53:24
  next  alarm 14
  cur 19:53:11 alarm 19:53:24
  next  alarm 13
alarm 22
  cur 19:53:24 alarm 19:53:24
  next  alarm 86400
RTC wakeup!
cmos: write index=0x0f val=0x00
cmos: write index=0x0b val=0x22
  cur 19:53:24 alarm 19:53:24
  next  alarm 86400
cmos: write index=0x0b val=0x02
  cur 19:53:24 alarm 19:53:24
  next  alarm 86400
cmos: write index=0x0b val=0x02
  cur 19:53:24 alarm 19:53:24
  next  alarm 86400
  cur 19:53:25 alarm 19:53:24
  next  alarm 86399
cmos: write index=0x0b val=0x02
  cur 19:53:25 alarm 19:53:24
  next  alarm 86399
  cur 19:53:25 alarm 19:53:24
  next  alarm 86399
cmos: write index=0x05 val=0x19
  cur 19:53:25 alarm 19:53:24
  next  alarm 86399
cmos: write index=0x03 val=0x53
  cur 19:53:25 alarm 19:53:24
  next  alarm 86399
cmos: write index=0x01 val=0x39
  cur 19:53:25 alarm 19:53:39
  next  alarm 14
cmos: write index=0x0b val=0x22
  cur 19:53:25 alarm 19:53:39
  next  alarm 14
cmos: write index=0x0b val=0x22
  cur 19:53:25 alarm 19:53:39
  next  alarm 14
  cur 19:53:26 alarm 19:53:39
  next  alarm 13
alarm 22
  cur 19:53:39 alarm 19:53:39
  next  alarm 86400
RTC wakeup!
cmos: write index=0x0f val=0x00
cmos: write index=0x0b val=0x22
  cur 19:53:39 alarm 19:53:39
  next  alarm 86400
cmos: write index=0x0b val=0x02
  cur 19:53:39 alarm 19:53:39
  next  alarm 86400
cmos: write index=0x0b val=0x02
  cur 19:53:39 alarm 19:53:39
  next  alarm 86400
  cur 19:53:40 alarm 19:53:39
  next  alarm 86399
cmos: write index=0x0b val=0x02
  cur 19:53:40 alarm 19:53:39
  next  alarm 86399
  cur 19:53:40 alarm 19:53:39
  next  alarm 86399
cmos: write index=0x05 val=0x19
  cur 19:53:40 alarm 19:53:39
  next  alarm 86399
cmos: write index=0x03 val=0x53
  cur 19:53:40 alarm 19:53:39
  next  alarm 86399
cmos: write index=0x01 val=0x54
  cur 19:53:40 alarm 19:53:54
  next  alarm 14
cmos: write index=0x0b val=0x22
  cur 19:53:40 alarm 19:53:54
  next  alarm 14

The only way to have the CMOS updated is from the guest, so the guest is 
resumed.  The "RTC wakeup!" also is just before setting the 
RT_CLOCK_STATUS field in the ACPI PM1A event status register.

However, I can reproduce that the system looks indeed like it's crashed 
and I don't see neither the resumption nor the printf from the 
sigalarm() function.  This is on kernel 3.11.10.

Also, I see that register C (the current interrupt) is always read as zero.

Right now I don't have an older QEMU, but I'll look at it tomorrow.

Paolo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [Bug 1334397] [NEW] cmos RTC alarms no longer wake system from suspend
  2014-06-25 20:11 ` Paolo Bonzini
@ 2014-06-26  7:02   ` Paolo Bonzini
  0 siblings, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2014-06-26  7:02 UTC (permalink / raw)
  To: Bug 1334397, qemu-devel

Il 25/06/2014 22:11, Paolo Bonzini ha scritto:
> The only way to have the CMOS updated is from the guest, so the guest is
> resumed.  The "RTC wakeup!" also is just before setting the
> RT_CLOCK_STATUS field in the ACPI PM1A event status register.
> 
> However, I can reproduce that the system looks indeed like it's crashed
> and I don't see neither the resumption nor the printf from the
> sigalarm() function.  This is on kernel 3.11.10.
> 
> Also, I see that register C (the current interrupt) is always read as zero.
> 
> Right now I don't have an older QEMU, but I'll look at it tomorrow.

Try running with "-qmp stdio" and, at the prompt, type:

{'execute':'qmp_capabilities'}

With 1.7.0 I see:

{"timestamp": {"seconds": 1403765768, "microseconds": 655089}, "event": "SUSPEND"}
{"timestamp": {"seconds": 1403765782, "microseconds": 239222}, "event": "WAKEUP"}

and then it hangs.

With 2.0.0 I see:

{"timestamp": {"seconds": 1403765911, "microseconds": 941161}, "event": "SUSPEND"}
{"timestamp": {"seconds": 1403765925, "microseconds": 295253}, "event": "WAKEUP"}
{"timestamp": {"seconds": 1403765926, "microseconds": 839634}, "event": "SUSPEND"}
{"timestamp": {"seconds": 1403765940, "microseconds": 294228}, "event": "WAKEUP"}
{"timestamp": {"seconds": 1403765941, "microseconds": 759962}, "event": "SUSPEND"}
{"timestamp": {"seconds": 1403765955, "microseconds": 295250}, "event": "WAKEUP"}

So it seems like it's doing things correctly.

Can you try doing this?

Paolo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [Bug 1334397] [NEW] cmos RTC alarms no longer wake system from suspend
  2014-06-25 18:39 [Qemu-devel] [Bug 1334397] [NEW] cmos RTC alarms no longer wake system from suspend John Stultz
  2014-06-25 20:11 ` Paolo Bonzini
@ 2014-06-26 10:01 ` Paolo Bonzini
  2014-06-26 10:02 ` [Qemu-devel] [Bug 1334397] " Paolo Bonzini
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2014-06-26 10:01 UTC (permalink / raw)
  To: Bug 1334397, qemu-devel

Il 25/06/2014 20:39, John Stultz ha scritto:
> Public bug reported:
>
> Running QEMU emulator version 2.0.0 (Debian 2.0.0+dfsg-2ubuntu1.1),
> booting Linux kernels with qemu-system-x86_64 and qemu-system-i386, I no
> longer see the system resume from suspend when an RTC alarm is set.
>
> My simple test application can be found here:
> https://github.com/johnstultz-work/timetests/blob/master/alarmtimer-suspend.c
>
> Previously this worked w/ QEMU 1.5  (bascially up until I upgraded from
> Ubuntu 13.10 to Ubuntu 14.04, which came with 2.0).

Ok, bisected.  The first commit to break it is:

     commit c046e8c4a26c902ca1b4f5bdf668a2da6bc75f54
     Author: Michael S. Tsirkin <mst@redhat.com>
     Date:   Wed Sep 11 13:33:31 2013 +0300

         piix4: disable io on reset

and the first commit to fix it is:

     commit db76ec6291df8a03c2cc82ea1249049383cca392
     Author: Gerd Hoffmann <kraxel@redhat.com>
     Date:   Thu May 15 14:01:59 2014 +0200

         seabios: update to 1.7.5-rc1

Yesterday I could not reproduce it because, even though Fedora has QEMU 
2.0.0, it has already updated SeaBIOS to 1.7.5.

In fact, the fix is actually not in QEMU but rather in SeaBIOS:

     commit 40d020f56226aee7c75a6c29f471c4b866765732
     Author: Marcel Apfelbaum <marcel.a@redhat.com>
     Date:   Wed Jan 15 14:20:06 2014 +0200

         resume: restore piix pm config registers after resume

Ubuntu can fix it by upgrading to SeaBIOS 1.7.5, or including this patch 
in their package (untested, but looks pretty safe).

Paolo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] [Bug 1334397] Re: cmos RTC alarms no longer wake system from suspend
  2014-06-25 18:39 [Qemu-devel] [Bug 1334397] [NEW] cmos RTC alarms no longer wake system from suspend John Stultz
  2014-06-25 20:11 ` Paolo Bonzini
  2014-06-26 10:01 ` Paolo Bonzini
@ 2014-06-26 10:02 ` Paolo Bonzini
  2014-06-26 16:16 ` John Stultz
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2014-06-26 10:02 UTC (permalink / raw)
  To: qemu-devel

** Changed in: qemu
       Status: New => Fix Committed

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1334397

Title:
  cmos RTC alarms no longer wake system from suspend

Status in QEMU:
  Fix Committed

Bug description:
  Running QEMU emulator version 2.0.0 (Debian 2.0.0+dfsg-2ubuntu1.1),
  booting Linux kernels with qemu-system-x86_64 and qemu-system-i386, I
  no longer see the system resume from suspend when an RTC alarm is set.

  My simple test application can be found here:
  https://github.com/johnstultz-work/timetests/blob/master/alarmtimer-suspend.c

  Previously this worked w/ QEMU 1.5  (bascially up until I upgraded
  from Ubuntu 13.10 to Ubuntu 14.04, which came with 2.0).

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1334397/+subscriptions

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] [Bug 1334397] Re: cmos RTC alarms no longer wake system from suspend
  2014-06-25 18:39 [Qemu-devel] [Bug 1334397] [NEW] cmos RTC alarms no longer wake system from suspend John Stultz
                   ` (2 preceding siblings ...)
  2014-06-26 10:02 ` [Qemu-devel] [Bug 1334397] " Paolo Bonzini
@ 2014-06-26 16:16 ` John Stultz
  2014-06-26 16:56 ` John Stultz
  2017-07-21 14:32 ` Thomas Huth
  5 siblings, 0 replies; 8+ messages in thread
From: John Stultz @ 2014-06-26 16:16 UTC (permalink / raw)
  To: qemu-devel

If a fix has already been committed, is there a branch or tag in the
qemu git repo I should validate this with?

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1334397

Title:
  cmos RTC alarms no longer wake system from suspend

Status in QEMU:
  Fix Committed

Bug description:
  Running QEMU emulator version 2.0.0 (Debian 2.0.0+dfsg-2ubuntu1.1),
  booting Linux kernels with qemu-system-x86_64 and qemu-system-i386, I
  no longer see the system resume from suspend when an RTC alarm is set.

  My simple test application can be found here:
  https://github.com/johnstultz-work/timetests/blob/master/alarmtimer-suspend.c

  Previously this worked w/ QEMU 1.5  (bascially up until I upgraded
  from Ubuntu 13.10 to Ubuntu 14.04, which came with 2.0).

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1334397/+subscriptions

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] [Bug 1334397] Re: cmos RTC alarms no longer wake system from suspend
  2014-06-25 18:39 [Qemu-devel] [Bug 1334397] [NEW] cmos RTC alarms no longer wake system from suspend John Stultz
                   ` (3 preceding siblings ...)
  2014-06-26 16:16 ` John Stultz
@ 2014-06-26 16:56 ` John Stultz
  2017-07-21 14:32 ` Thomas Huth
  5 siblings, 0 replies; 8+ messages in thread
From: John Stultz @ 2014-06-26 16:56 UTC (permalink / raw)
  To: qemu-devel

I went back and tried the 1.7 and 1.6 releases, and they both seem to
have been broken as well wrt cmos alarms waking from suspend.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1334397

Title:
  cmos RTC alarms no longer wake system from suspend

Status in QEMU:
  Fix Committed

Bug description:
  Running QEMU emulator version 2.0.0 (Debian 2.0.0+dfsg-2ubuntu1.1),
  booting Linux kernels with qemu-system-x86_64 and qemu-system-i386, I
  no longer see the system resume from suspend when an RTC alarm is set.

  My simple test application can be found here:
  https://github.com/johnstultz-work/timetests/blob/master/alarmtimer-suspend.c

  Previously this worked w/ QEMU 1.5  (bascially up until I upgraded
  from Ubuntu 13.10 to Ubuntu 14.04, which came with 2.0).

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1334397/+subscriptions

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] [Bug 1334397] Re: cmos RTC alarms no longer wake system from suspend
  2014-06-25 18:39 [Qemu-devel] [Bug 1334397] [NEW] cmos RTC alarms no longer wake system from suspend John Stultz
                   ` (4 preceding siblings ...)
  2014-06-26 16:56 ` John Stultz
@ 2017-07-21 14:32 ` Thomas Huth
  5 siblings, 0 replies; 8+ messages in thread
From: Thomas Huth @ 2017-07-21 14:32 UTC (permalink / raw)
  To: qemu-devel

I assume this has been fixed in v2.1.0 or newer, like the "Fix
committed" state indicates, so closing as "Fix released" now. In case
there still something left to do here, feel free to re-open it.

** Changed in: qemu
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1334397

Title:
  cmos RTC alarms no longer wake system from suspend

Status in QEMU:
  Fix Released

Bug description:
  Running QEMU emulator version 2.0.0 (Debian 2.0.0+dfsg-2ubuntu1.1),
  booting Linux kernels with qemu-system-x86_64 and qemu-system-i386, I
  no longer see the system resume from suspend when an RTC alarm is set.

  My simple test application can be found here:
  https://github.com/johnstultz-work/timetests/blob/master/alarmtimer-suspend.c

  Previously this worked w/ QEMU 1.5  (bascially up until I upgraded
  from Ubuntu 13.10 to Ubuntu 14.04, which came with 2.0).

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1334397/+subscriptions

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-07-21 14:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-25 18:39 [Qemu-devel] [Bug 1334397] [NEW] cmos RTC alarms no longer wake system from suspend John Stultz
2014-06-25 20:11 ` Paolo Bonzini
2014-06-26  7:02   ` Paolo Bonzini
2014-06-26 10:01 ` Paolo Bonzini
2014-06-26 10:02 ` [Qemu-devel] [Bug 1334397] " Paolo Bonzini
2014-06-26 16:16 ` John Stultz
2014-06-26 16:56 ` John Stultz
2017-07-21 14:32 ` Thomas Huth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.