From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46500) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WztY7-0005AD-6U for qemu-devel@nongnu.org; Wed, 25 Jun 2014 16:12:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WztY1-0004Mi-6z for qemu-devel@nongnu.org; Wed, 25 Jun 2014 16:12:07 -0400 Received: from mail-wg0-x22d.google.com ([2a00:1450:400c:c00::22d]:38527) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WztY0-0004MR-U4 for qemu-devel@nongnu.org; Wed, 25 Jun 2014 16:12:01 -0400 Received: by mail-wg0-f45.google.com with SMTP id l18so2666251wgh.16 for ; Wed, 25 Jun 2014 13:12:00 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <53AB2D0C.6020803@redhat.com> Date: Wed, 25 Jun 2014 22:11:56 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <20140625183928.7492.77861.malonedeb@chaenomeles.canonical.com> <20140625183928.7492.77861.malonedeb@chaenomeles.canonical.com> In-Reply-To: <20140625183928.7492.77861.malonedeb@chaenomeles.canonical.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Bug 1334397] [NEW] cmos RTC alarms no longer wake system from suspend List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bug 1334397 <1334397@bugs.launchpad.net>, qemu-devel@nongnu.org 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