From: Ondrej Zary <linux@rainbow-software.org>
To: "Linux-pm mailing list" <linux-pm@lists.linux-foundation.org>
Cc: Kernel development list <linux-kernel@vger.kernel.org>,
Alan Stern <stern@rowland.harvard.edu>,
"H. Peter Anvin" <hpa@zytor.com>, Len Brown <len.brown@intel.com>,
Pavel Machek <pavel@ucw.cz>, "Rafael J. Wysocki" <rjw@sisk.pl>
Subject: [PATCH] [RFC] Save/restore MISC_ENABLE register
Date: Mon, 7 Jun 2010 18:14:49 +0200 [thread overview]
Message-ID: <201006071814.53583.linux@rainbow-software.org> (raw)
Save/restore MISC_ENABLE register on suspend/resume.
This fixes OOPS (invalid opcode) on resume from STR on Asus P4P800-VM, which
wakes up with MWAIT disabled.
Is this a correct thing to do? Is it OK on x86_64?
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
diff -urp linux-2.6.35-rc1-git2-orig/arch/x86/include/asm/suspend_32.h linux-2.6.35-rc1-git2/arch/x86/include/asm/suspend_32.h
--- linux-2.6.35-rc1-git2-orig/arch/x86/include/asm/suspend_32.h 2010-05-30 22:21:02.000000000 +0200
+++ linux-2.6.35-rc1-git2/arch/x86/include/asm/suspend_32.h 2010-06-04 23:52:22.000000000 +0200
@@ -15,6 +15,7 @@ static inline int arch_prepare_suspend(v
struct saved_context {
u16 es, fs, gs, ss;
unsigned long cr0, cr2, cr3, cr4;
+ unsigned long misc_enable;
struct desc_ptr gdt;
struct desc_ptr idt;
u16 ldt;
diff -urp linux-2.6.35-rc1-git2-orig/arch/x86/include/asm/suspend_64.h linux-2.6.35-rc1-git2/arch/x86/include/asm/suspend_64.h
--- linux-2.6.35-rc1-git2-orig/arch/x86/include/asm/suspend_64.h 2010-05-30 22:21:02.000000000 +0200
+++ linux-2.6.35-rc1-git2/arch/x86/include/asm/suspend_64.h 2010-06-04 23:52:21.000000000 +0200
@@ -27,6 +27,7 @@ struct saved_context {
u16 ds, es, fs, gs, ss;
unsigned long gs_base, gs_kernel_base, fs_base;
unsigned long cr0, cr2, cr3, cr4, cr8;
+ unsigned long misc_enable;
unsigned long efer;
u16 gdt_pad;
u16 gdt_limit;
diff -urp linux-2.6.35-rc1-git2-orig/arch/x86/power/cpu.c linux-2.6.35-rc1-git2/arch/x86/power/cpu.c
--- linux-2.6.35-rc1-git2-orig/arch/x86/power/cpu.c 2010-05-30 22:21:02.000000000 +0200
+++ linux-2.6.35-rc1-git2/arch/x86/power/cpu.c 2010-06-04 23:50:52.000000000 +0200
@@ -105,6 +105,7 @@ static void __save_processor_state(struc
ctxt->cr4 = read_cr4();
ctxt->cr8 = read_cr8();
#endif
+ rdmsrl(MSR_IA32_MISC_ENABLE, ctxt->misc_enable);
}
/* Needed by apm.c */
@@ -152,6 +153,7 @@ static void fix_processor_context(void)
*/
static void __restore_processor_state(struct saved_context *ctxt)
{
+ wrmsrl(MSR_IA32_MISC_ENABLE, ctxt->misc_enable);
/*
* control registers
*/
--
Ondrej Zary
next reply other threads:[~2010-06-07 16:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-07 16:14 Ondrej Zary [this message]
2010-06-07 17:27 ` [PATCH] [RFC] Save/restore MISC_ENABLE register H. Peter Anvin
2010-06-07 17:27 ` H. Peter Anvin
2010-06-07 18:51 ` Ondrej Zary
2010-06-07 18:51 ` Ondrej Zary
2010-06-07 18:53 ` H. Peter Anvin
2010-06-07 18:53 ` H. Peter Anvin
2010-06-07 19:02 ` Ondrej Zary
2010-06-07 19:02 ` Ondrej Zary
2010-06-07 21:05 ` Rafael J. Wysocki
2010-06-07 21:06 ` H. Peter Anvin
2010-06-07 21:06 ` H. Peter Anvin
2010-06-07 21:09 ` Alan Stern
2010-06-07 21:09 ` Alan Stern
2010-06-07 21:05 ` Rafael J. Wysocki
-- strict thread matches above, loose matches on Subject: below --
2010-06-07 16:14 Ondrej Zary
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=201006071814.53583.linux@rainbow-software.org \
--to=linux@rainbow-software.org \
--cc=hpa@zytor.com \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=pavel@ucw.cz \
--cc=rjw@sisk.pl \
--cc=stern@rowland.harvard.edu \
/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 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.