From: Ingo Molnar <mingo@elte.hu>
To: Avi Kivity <avi@qumranet.com>
Cc: Daniel Walker <dwalker@mvista.com>,
Michal Piotrowski <michal.k.k.piotrowski@gmail.com>,
linux-pm@lists.osdl.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Adrian Bunk <bunk@stusta.de>, Pavel Machek <pavel@ucw.cz>,
Jens Axboe <jens.axboe@oracle.com>,
"Michael S. Tsirkin" <mst@mellanox.co.il>,
Thomas Gleixner <tglx@linutronix.de>,
Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [patch] KVM: T60 resume fix
Date: Mon, 5 Mar 2007 11:05:37 +0100 [thread overview]
Message-ID: <20070305100537.GA9175@elte.hu> (raw)
In-Reply-To: <45EBE288.8010101@qumranet.com>
* Avi Kivity <avi@qumranet.com> wrote:
> > suspend/resume works fine now and there are no warning messages
> > whatsoever (with suspend simulation). Thanks Avi!
>
> Where do I find this suspend simulation? Sounds like a great suspend
> debugging tool.
it's just the simple hack below.
Ingo
------------------------>
Subject: [patch] suspend debugging: simulate suspend-to-RAM
From: Ingo Molnar <mingo@elte.hu>
most resume bugs are due to the kernel hanging or crashing while trying
to resume a specific device. It is extremely hard to debug such hangs
because often when the hang happens there's no console available yet.
Make debugging such bugs easier by offering a resume mode that does not
actually call into the BIOS to turn off the machine. This, in
combination with earlyprintk=serial,ttyS0,115200,keep ,
CONFIG_PM_DEBUG=y, CONFIG_DISABLE_CONSOLE_SUSPEND=y and
/sys/power/filter enables me to have a fully functional serial console
during the full suspend/resume cycle.
I debugged two suspend bugs in the -rt kernel this way already, so it's
pretty useful.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
Documentation/kernel-parameters.txt | 4 ++++
drivers/acpi/sleep/main.c | 15 ++++++++++++++-
include/linux/acpi.h | 1 +
kernel/sysctl.c | 8 ++++++++
4 files changed, 27 insertions(+), 1 deletion(-)
Index: linux/Documentation/kernel-parameters.txt
===================================================================
--- linux.orig/Documentation/kernel-parameters.txt
+++ linux/Documentation/kernel-parameters.txt
@@ -163,6 +163,10 @@ and is between 256 and 4096 characters.
acpi_osi= [HW,ACPI] empty param disables _OSI
+ acpi_simulate_suspend_to_ram
+ [KNL] Do not call into BIOS to do suspend-to-RAM
+ Format: <0/1>
+
acpi_serialize [HW,ACPI] force serialization of AML methods
acpi_skip_timer_override [HW,ACPI]
Index: linux/drivers/acpi/sleep/main.c
===================================================================
--- linux.orig/drivers/acpi/sleep/main.c
+++ linux/drivers/acpi/sleep/main.c
@@ -35,6 +35,14 @@ static u32 acpi_suspend_states[] = {
static int init_8259A_after_S1;
+/*
+ * simulate entry into the BIOS - this way the system will not
+ * be turned off for real, and the kernel's resume functionality
+ * can be debugged while still having some system capabilities
+ * left. This is especially useful in combination with /sys/power/filter.
+ */
+int acpi_simulate_suspend_to_ram;
+
/**
* acpi_pm_prepare - Do preliminary suspend work.
* @pm_state: suspend state we're entering.
@@ -91,7 +99,12 @@ static int acpi_pm_enter(suspend_state_t
break;
case PM_SUSPEND_MEM:
- do_suspend_lowlevel();
+ if (unlikely(acpi_simulate_suspend_to_ram)) {
+ printk(KERN_INFO "ACPI: simulating suspend-to-RAM: "
+ "not calling BIOS.\n");
+ } else {
+ do_suspend_lowlevel();
+ }
break;
case PM_SUSPEND_DISK:
Index: linux/include/linux/acpi.h
===================================================================
--- linux.orig/include/linux/acpi.h
+++ linux/include/linux/acpi.h
@@ -123,6 +123,7 @@ extern int pci_mmcfg_config_num;
extern int sbf_port;
extern unsigned long acpi_video_flags;
+extern int acpi_simulate_suspend_to_ram;
#else /* !CONFIG_ACPI */
Index: linux/kernel/sysctl.c
===================================================================
--- linux.orig/kernel/sysctl.c
+++ linux/kernel/sysctl.c
@@ -581,6 +581,14 @@ static ctl_table kern_table[] = {
.mode = 0644,
.proc_handler = &proc_doulongvec_minmax,
},
+ {
+ .ctl_name = CTL_UNNUMBERED,
+ .procname = "acpi_simulate_suspend_to_ram",
+ .data = &acpi_simulate_suspend_to_ram,
+ .maxlen = sizeof (int),
+ .mode = 0644,
+ .proc_handler = &proc_dointvec,
+ },
#endif
#ifdef CONFIG_IA64
{
next prev parent reply other threads:[~2007-03-05 10:05 UTC|newest]
Thread overview: 104+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.64.0702202043280.4043@woody.linux-foundation.org>
2007-02-25 17:52 ` 2.6.21-rc1: known regressions (part 1) Adrian Bunk
2007-02-28 18:16 ` Karasyov, Konstantin A
2007-02-25 17:55 ` 2.6.21-rc1: known regressions (part 2) Adrian Bunk
2007-02-27 10:02 ` Jens Axboe
2007-02-27 10:21 ` Pavel Machek
2007-02-27 10:30 ` Jens Axboe
2007-02-27 10:34 ` Ingo Molnar
2007-02-27 10:59 ` Jens Axboe
2007-02-27 11:15 ` Jens Axboe
2007-02-27 13:09 ` Jens Axboe
2007-03-01 9:34 ` Ingo Molnar
2007-03-01 10:41 ` Ingo Molnar
2007-03-01 14:52 ` Ingo Molnar
2007-03-01 16:12 ` Rafael J. Wysocki
2007-03-02 0:26 ` Linus Torvalds
2007-03-02 0:41 ` Linus Torvalds
2007-03-02 7:14 ` Ingo Molnar
2007-03-02 7:21 ` Ingo Molnar
2007-03-02 8:04 ` Ingo Molnar
2007-03-02 10:20 ` Ingo Molnar
2007-03-02 10:22 ` [patch] KVM: T60 resume fix Ingo Molnar
2007-03-02 11:39 ` Michael S. Tsirkin
2007-03-03 8:22 ` Avi Kivity
2007-03-03 8:21 ` Avi Kivity
2007-03-03 11:57 ` Andrew Morton
2007-03-03 12:07 ` Junio C Hamano
2007-03-05 8:22 ` Ingo Molnar
2007-03-05 8:50 ` Avi Kivity
2007-03-05 8:44 ` Ingo Molnar
2007-03-05 8:57 ` Ingo Molnar
2007-03-05 9:27 ` Avi Kivity
2007-03-05 10:05 ` Ingo Molnar [this message]
2007-03-05 10:33 ` Avi Kivity
2007-03-05 10:33 ` Ingo Molnar
2007-03-05 10:40 ` Michael S. Tsirkin
2007-03-05 12:54 ` Michael S. Tsirkin
2007-03-05 12:50 ` Ingo Molnar
2007-03-05 13:26 ` Michael S. Tsirkin
2007-03-05 13:32 ` Ingo Molnar
2007-03-05 10:23 ` Michael S. Tsirkin
2007-03-05 10:29 ` Ingo Molnar
2007-03-05 15:44 ` 2.6.21-rc1: known regressions (part 2) Michael S. Tsirkin
2007-03-05 16:14 ` Michael S. Tsirkin
2007-03-05 16:41 ` Ingo Molnar
2007-03-05 18:16 ` Jens Axboe
2007-03-01 23:36 ` Linus Torvalds
2007-03-02 10:07 ` Pavel Machek
2007-03-05 8:42 ` Michael S. Tsirkin
2007-03-05 10:11 ` SATA resume slowness, e1000 MSI warning Ingo Molnar
2007-03-06 5:30 ` Jeff Garzik
2007-03-06 6:35 ` Kok, Auke
2007-03-06 9:04 ` Ingo Molnar
2007-03-06 15:34 ` Kok, Auke
2007-03-07 4:15 ` Eric W. Biederman
2007-03-07 16:31 ` Kok, Auke
2007-03-07 16:45 ` Kok, Auke
2007-03-07 19:28 ` Eric W. Biederman
2007-03-08 2:53 ` Andrew Morton
2007-03-08 6:58 ` Eric W. Biederman
2007-03-08 9:55 ` Jeff Garzik
2007-03-08 17:27 ` Eric W. Biederman
2007-03-08 19:58 ` [PATCH 0/2] Repair pci_restore_state when used with device resets Eric W. Biederman
2007-03-08 20:04 ` [PATCH 1/2] msi: Safer state caching Eric W. Biederman
2007-03-08 20:06 ` [PATCH 2/2] pci: Repair pci_save/restore_state so we can restore one save many times Eric W. Biederman
2007-03-12 22:46 ` Kok, Auke
2007-03-08 20:08 ` [PATCH 0/2] Repair pci_restore_state when used with device resets Ingo Molnar
2007-03-08 20:26 ` Eric W. Biederman
2007-03-08 10:23 ` SATA resume slowness, e1000 MSI warning Michael S. Tsirkin
2007-03-11 11:11 ` Eric W. Biederman
2007-03-11 11:24 ` Michael S. Tsirkin
2007-03-11 17:37 ` Eric W. Biederman
2007-03-11 18:03 ` Michael S. Tsirkin
2007-03-11 18:27 ` Eric W. Biederman
2007-03-11 18:37 ` Michael S. Tsirkin
2007-03-11 19:50 ` Eric W. Biederman
2007-03-12 4:35 ` Michael S. Tsirkin
2007-04-16 19:56 ` Michael S. Tsirkin
2007-03-09 23:06 ` Kok, Auke
2007-03-10 3:41 ` Eric W. Biederman
2007-03-06 9:06 ` Ingo Molnar
2007-03-06 16:26 ` Thomas Gleixner
2007-03-06 16:52 ` Linus Torvalds
2007-03-06 17:09 ` Kok, Auke
2007-03-09 6:44 ` 2.6.21-rc1: known regressions (part 2) Pavel Machek
2007-03-05 15:34 ` Michael S. Tsirkin
2007-02-27 22:09 ` Adrian Bunk
2007-02-28 7:41 ` Jens Axboe
2007-02-26 22:01 ` 2.6.21-rc1: known regressions (v2) (part 1) Adrian Bunk
2007-02-27 4:09 ` Sergio Monteiro Basto
2007-02-27 12:50 ` S.Çağlar Onur
2007-02-27 13:25 ` Ismail Dönmez
2007-02-28 21:13 ` Michael S. Tsirkin
2007-02-28 21:27 ` Thomas Gleixner
2007-02-28 21:40 ` Michael S. Tsirkin
2007-03-01 3:45 ` Jeff Chua
2007-03-02 12:26 ` [linux-pm] " Pavel Machek
2007-03-03 11:17 ` Jens Axboe
2007-03-05 0:04 ` Adrian Bunk
2007-03-06 1:32 ` Jeff Chua
2007-03-06 12:03 ` Jeff Chua
2007-03-06 12:08 ` Michael S. Tsirkin
2007-03-06 12:12 ` Jeff Chua
2007-03-19 15:32 ` Pavel Machek
2007-03-19 21:23 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070305100537.GA9175@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@linux-foundation.org \
--cc=avi@qumranet.com \
--cc=bunk@stusta.de \
--cc=dwalker@mvista.com \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.osdl.org \
--cc=michal.k.k.piotrowski@gmail.com \
--cc=mst@mellanox.co.il \
--cc=pavel@ucw.cz \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox