From: Yinghai Lu <yinghai@kernel.org>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
Ingo Molnar <mingo@redhat.com>, "Rafael J. Wysocki" <rjw@sisk.pl>,
Michael Leun <lkml20101129@newton.leun.net>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Greg Kroah-Hartman <gregkh@suse.de>,
Mike Pagano <mpagano@gentoo.org>
Subject: Re: 2.6.38.2 breaks suspend to disk
Date: Fri, 01 Apr 2011 12:32:07 -0700 [thread overview]
Message-ID: <4D962837.2070300@kernel.org> (raw)
In-Reply-To: <4D961FBC.2030105@zytor.com>
On 04/01/2011 11:55 AM, H. Peter Anvin wrote:
> On 04/01/2011 11:14 AM, Stefano Stabellini wrote:
>>> Why the heck should we save and restore CR4 only for x86-64?
>>
>> AFAICT it has always been the case since the beginning of time (Initial
>> git repository build).
>
> Doesn't change the fact that at least conceptually it's wrong; consider
> bits like NX. Rafael, do you have any thoughts on this?
>
more info:
in arch/x86/kernel/setup.c we have
#if !defined(CONFIG_X86_PAE) || defined(CONFIG_X86_64)
unsigned long mmu_cr4_features;
#else
unsigned long mmu_cr4_features = X86_CR4_PAE;
#endif
in arch/x86/kernel/head_32.S
/*
* New page tables may be in 4Mbyte page mode and may
* be using the global pages.
*
* NOTE! If we are on a 486 we may have no cr4 at all!
* So we do not try to touch it unless we really have
* some bits in it to set. This won't work if the BSP
* implements cr4 but this AP does not -- very unlikely
* but be warned! The same applies to the pse feature
* if not equally supported. --macro
*
* NOTE! We have to correct for the fact that we're
* not yet offset PAGE_OFFSET..
*/
#define cr4_bits pa(mmu_cr4_features)
movl cr4_bits,%edx
andl %edx,%edx
jz 6f
movl %cr4,%eax # Turn on paging options (PSE,PAE,..)
orl %edx,%eax
movl %eax,%cr4
...
6:
So for 32 bit, PAE support is not compiled in for old 486 cpus.
mmu_cr4_feautres will be used to make sure head_32.S will not access cr4.
that could be the reason why 32 bit does not do read back at beginning.
Thanks
Yinghai
next prev parent reply other threads:[~2011-04-01 19:32 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-30 18:32 2.6.38.2 breaks suspend to disk Michael Leun
2011-03-31 5:14 ` Yinghai Lu
2011-03-31 7:05 ` Michael Leun
2011-03-31 14:48 ` Stefano Stabellini
2011-03-31 15:53 ` Michael Leun
2011-03-31 21:48 ` Rafael J. Wysocki
2011-03-31 22:20 ` Yinghai Lu
2011-04-01 11:32 ` Stefano Stabellini
2011-04-01 16:06 ` Yinghai Lu
2011-04-01 16:22 ` H. Peter Anvin
2011-04-01 17:14 ` Yinghai Lu
2011-04-01 18:15 ` Stefano Stabellini
2011-04-01 18:14 ` Stefano Stabellini
2011-04-01 18:55 ` H. Peter Anvin
2011-04-01 19:32 ` Yinghai Lu [this message]
2011-04-01 19:36 ` H. Peter Anvin
2011-04-01 19:54 ` Yinghai Lu
2011-04-01 20:21 ` H. Peter Anvin
2011-04-01 21:24 ` Yinghai Lu
2011-04-01 21:30 ` H. Peter Anvin
2011-04-01 21:37 ` Yinghai Lu
2011-04-01 21:42 ` H. Peter Anvin
2011-04-01 23:04 ` Yinghai Lu
2011-04-01 23:12 ` H. Peter Anvin
2011-04-02 0:10 ` Yinghai Lu
2011-04-01 23:54 ` Rafael J. Wysocki
2011-04-06 20:28 ` [tip:x86/urgent] x86, hibernate: Initialize mmu_cr4_features during boot tip-bot for H. Peter Anvin
2011-04-01 6:15 ` 2.6.38.2 breaks suspend to disk Ingo Molnar
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=4D962837.2070300@kernel.org \
--to=yinghai@kernel.org \
--cc=gregkh@suse.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkml20101129@newton.leun.net \
--cc=mingo@redhat.com \
--cc=mpagano@gentoo.org \
--cc=rjw@sisk.pl \
--cc=stefano.stabellini@eu.citrix.com \
/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