From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:45769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvTAa-0001mL-H8 for qemu-devel@nongnu.org; Thu, 09 Feb 2012 07:32:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RvTAR-0007mK-0w for qemu-devel@nongnu.org; Thu, 09 Feb 2012 07:32:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:9419) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvTAQ-0007m7-QP for qemu-devel@nongnu.org; Thu, 09 Feb 2012 07:32:02 -0500 Date: Thu, 9 Feb 2012 14:31:57 +0200 From: Gleb Natapov Message-ID: <20120209123157.GJ18866@redhat.com> References: <1328698819-31269-1-git-send-email-kraxel@redhat.com> <1328698819-31269-3-git-send-email-kraxel@redhat.com> <4F33AB4D.9070904@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F33AB4D.9070904@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 2/6] suspend: switch acpi s3 to new infrastructure. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: xen-devel@lists.xensource.com, Gerd Hoffmann , qemu-devel@nongnu.org On Thu, Feb 09, 2012 at 12:17:33PM +0100, Paolo Bonzini wrote: > On 02/08/2012 12:00 PM, Gerd Hoffmann wrote: > >+/* set CMOS shutdown status register (index 0xF) as S3_resume(0xFE) > >+ BIOS will read it and start S3 resume at POST Entry */ > >+static void rtc_notify_suspend(Notifier *notifier, void *data) > >+{ > >+ RTCState *s = container_of(notifier, RTCState, suspend_notifier); > >+ rtc_set_memory(&s->dev, 0xF, 0xFE); > >+} > >+ > > Out of curiosity, who would set this on real hardware? And since Real HW may have other ways to notify BIOS that system was S3 suspended (special chipset register for instance). I think we can write DSDT magic to write RTC for us, but I prefer to do it from inside QEMU. > RTC memory is nvram, what happens if I remove the mains plug while > the system is in S3? > RTC is battery backed, but what do you expect will happen to main memory where all your data resides during S3 in this case anyway? -- Gleb. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH v3 2/6] suspend: switch acpi s3 to new infrastructure. Date: Thu, 9 Feb 2012 14:31:57 +0200 Message-ID: <20120209123157.GJ18866@redhat.com> References: <1328698819-31269-1-git-send-email-kraxel@redhat.com> <1328698819-31269-3-git-send-email-kraxel@redhat.com> <4F33AB4D.9070904@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <4F33AB4D.9070904@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org To: Paolo Bonzini Cc: xen-devel@lists.xensource.com, Gerd Hoffmann , qemu-devel@nongnu.org List-Id: xen-devel@lists.xenproject.org On Thu, Feb 09, 2012 at 12:17:33PM +0100, Paolo Bonzini wrote: > On 02/08/2012 12:00 PM, Gerd Hoffmann wrote: > >+/* set CMOS shutdown status register (index 0xF) as S3_resume(0xFE) > >+ BIOS will read it and start S3 resume at POST Entry */ > >+static void rtc_notify_suspend(Notifier *notifier, void *data) > >+{ > >+ RTCState *s = container_of(notifier, RTCState, suspend_notifier); > >+ rtc_set_memory(&s->dev, 0xF, 0xFE); > >+} > >+ > > Out of curiosity, who would set this on real hardware? And since Real HW may have other ways to notify BIOS that system was S3 suspended (special chipset register for instance). I think we can write DSDT magic to write RTC for us, but I prefer to do it from inside QEMU. > RTC memory is nvram, what happens if I remove the mains plug while > the system is in S3? > RTC is battery backed, but what do you expect will happen to main memory where all your data resides during S3 in this case anyway? -- Gleb.