[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4D95F80D.7070201@kernel.org>
Date: Fri, 01 Apr 2011 09:06:37 -0700
From: Yinghai Lu <yinghai@...nel.org>
To: Stefano Stabellini <stefano.stabellini@...citrix.com>,
Ingo Molnar <mingo@...hat.com>
CC: "Rafael J. Wysocki" <rjw@...k.pl>,
"H. Peter Anvin" <hpa@...or.com>,
Michael Leun <lkml20101129@...ton.leun.net>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Greg Kroah-Hartman <gregkh@...e.de>,
Mike Pagano <mpagano@...too.org>
Subject: Re: 2.6.38.2 breaks suspend to disk
On 04/01/2011 04:32 AM, Stefano Stabellini wrote:
> On Thu, 31 Mar 2011, Yinghai Lu wrote:
>> Stefano, can you explain why it fixes the problem?
>>
>> or original patch uncover the bug?
>
> as I wrote in the other email, e5f15b45ddf3afa2bbbb10c7ea34fb32b6de0a0e
> removes cleanup_highmap_brk_end but this function was not only dealing
> with mappings but it was also setting mmu_cr4_features, therefore the
> setting of mmu_cr4_features was lost.
>
> I think the real bug is that mmu_cr4_features ended up in
> cleanup_highmap_brk_end by mistake.
originally mmu_cr4 is saved in init_memory_mapping.
and init_memory_mapping will update cr4.
so please use this version instead.
From: Stefano Stabellini <stefano.stabellini@...citrix.com>
[PATCH -v2] x86: Save cr4 to mmu_cr4_features at boot time
Save cr4 to mmu_cr4_features at boot time
Michael reported 2.6.38.2 hibernation is broken by one backported patch.
it cause a freeze when resuming from hibernation
| "x86: Cleanup highmap after brk is concluded"
| commit id e5f15b45ddf3afa2bbbb10c7ea34fb32b6de0a0e.
it turns out the mmu_cr4 save it lost somehow.
-v2: need to save mmu_cr4 after init_memory_mapping(), because it updates mmu_cr4
and originally that storing action is after updating. -- by Yinghai
Bisected-and-tested-by: Michael Leun <lkml20101129@...ton.leun.net>
Signed-off-by: Stefano Stabellini <stefano.stabellini@...citrix.com>
Signed-off-by: Yinghai Lu <yinghai@...nel.org>
---
arch/x86/kernel/setup.c | 9 +++++++++
1 file changed, 9 insertions(+)
Index: linux-2.6/arch/x86/kernel/setup.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/setup.c
+++ linux-2.6/arch/x86/kernel/setup.c
@@ -294,10 +294,17 @@ static void __init init_gbpages(void)
else
direct_gbpages = 0;
}
+static void __init store_mmu_cr4(void)
+{
+ mmu_cr4_features = read_cr4();
+}
#else
static inline void init_gbpages(void)
{
}
+static void __init store_mmu_cr4(void)
+{
+}
static void __init cleanup_highmap(void)
{
}
@@ -929,6 +936,8 @@ void __init setup_arch(char **cmdline_p)
/* max_pfn_mapped is updated here */
max_low_pfn_mapped = init_memory_mapping(0, max_low_pfn<<PAGE_SHIFT);
max_pfn_mapped = max_low_pfn_mapped;
+ /* after init_memory_mapping updating cr4*/
+ store_mmu_cr4();
#ifdef CONFIG_X86_64
if (max_pfn > max_low_pfn) {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists