linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Christian Sünkenberg" <christian.suenkenberg@student.kit.edu>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Jonas Heinrich <onny@project-insanity.org>,
	"len.brown@intel.com" <len.brown@intel.com>,
	"pavel@ucw.cz" <pavel@ucw.cz>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"x86@kernel.org" <x86@kernel.org>, "rjw@sisk.pl" <rjw@sisk.pl>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>
Subject: Re: [Bisected] 3.7-rc1 can't resume (still present in 3.9)
Date: Sat, 13 Jul 2013 01:36:28 +0200	[thread overview]
Message-ID: <51E092FC.1030200@student.kit.edu> (raw)
In-Reply-To: <51DDF4DF.4000902@zytor.com>

[-- Attachment #1: Type: text/plain, Size: 2391 bytes --]

Hello,

On 07/11/2013 01:57 AM, H. Peter Anvin wrote:
> On 07/10/2013 01:52 PM, Christian Sünkenberg wrote:
>> Hello,
>>
>> On 05/01/2013 07:33 PM, H. Peter Anvin wrote:
>>> On 05/01/2013 10:01 AM, Jonas Heinrich wrote:
>>>> Hello, I tried the newest kernel, 3.9 today but the bug is still
>>>> present. Applying the attached patch solves the bug for me.
>>>>
>>>> Best regards, Jonas Heinrich
>>>
>>> Okay... WTF is going on here?  Does pmode_behavior just not get set up
>>> correctly?  Since it seems you can get it to wake up with your patch,
>>> perhaps we can get read out the value of pmode_behavior and print it...
>>
>> indeed, arch/x86/kernel/acpi/sleep.c tries an rdmsr_safe(MSR_EFER, ...)
>> and sets WAKEUP_BEHAVIOR_RESTORE_EFER bit on success, however,
>> on 90 nm Pentium M (Family 6, Model 13), reading an invalid MSR
>> is not guaranteed to trap, see Erratum X4 in "Intel® Pentium® M
>> Processor on 90 nm Process with 2-MB L2 Cache and Intel® Processor A100
>> and A110 on 90 nm process with 512-KB L2 Cache Specification Update".
>> On Jonas' T43, which has an affected Pentium M without EFER,
>> rdmsr_safe(MSR_EFER, ...) succeeds and WAKEUP_BEHAVIOR_RESTORE_EFER
>> gets set, while on resume the corresponding wrmsr traps and thus resume
>> fails.
>>
>> The pre-3.7 code snippet incidentally catched this by not restoring
>> EFER when it would be restored to all 0s.
>>
> 
> That does seem like a reasonable explanation.
> 
> Does this patch fix the problem?  (Comment blatantly ripped off from
> your email message.)

Jonas tried your patch and it fixes suspend/resume on his T43, although
IMHO the safest approach would be to just add an exception for
Vendor==Intel && Family==6 && Model==13, or more generally Vendor==Intel
&& !supports_long_mode, as the same erratum also warns about wrmsr
possibly not triggering a GP either.
Anyways, at least on this specific MSR with the Pentium M Jonas tested,
it behaved correctly on every try, so I'd say your patch does the trick,
thank you very much!

As a side note, I found a similar erratum #33 in "Pentium® Processor
Specification Update" for Intel P54C (Family 5, Model 2), which would,
supposed there are P54C systems with ACPI sleep/resume support, result
in MSR 0 (P5_MC_ADDR) to be saved and restored instead of nonexistent EFER.

Kind regards,
Christian


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5002 bytes --]

  reply	other threads:[~2013-07-12 23:36 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-18 15:54 [Bisected] 3.7-rc1 can't resume Jonas Heinrich
2013-02-18 16:21 ` H. Peter Anvin
2013-02-23 13:18   ` Jonas Heinrich
2013-02-23 21:54     ` H. Peter Anvin
     [not found]       ` <20130320143257.GA473@onny>
2013-05-01 17:01         ` [Bisected] 3.7-rc1 can't resume (still present in 3.9) Jonas Heinrich
2013-05-01 17:33           ` H. Peter Anvin
2013-05-01 18:51             ` Jonas Heinrich
2013-05-01 18:55               ` H. Peter Anvin
2013-05-02  0:45                 ` Rafael J. Wysocki
2013-05-02 20:32                   ` Jonas Heinrich
2013-05-02 23:29                     ` Rafael J. Wysocki
2013-05-03 11:07                       ` Jonas Heinrich
2013-05-03 11:37                         ` Rafael J. Wysocki
2013-05-28 21:36                           ` Rafael J. Wysocki
2013-05-03 12:15                         ` Jarkko Sakkinen
2013-07-08  9:50                           ` Jonas Heinrich
2013-07-08 13:05                             ` Rafael J. Wysocki
2013-07-15 21:11                               ` H. Peter Anvin
2013-07-10 20:52             ` Christian Sünkenberg
2013-07-10 23:57               ` H. Peter Anvin
2013-07-12 23:36                 ` Christian Sünkenberg [this message]
2013-07-12 23:45                   ` H. Peter Anvin

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=51E092FC.1030200@student.kit.edu \
    --to=christian.suenkenberg@student.kit.edu \
    --cc=hpa@zytor.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=onny@project-insanity.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@sisk.pl \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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;
as well as URLs for NNTP newsgroup(s).