All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.cz>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "H. Peter Anvin" <hpa@linux.intel.com>,
	"Fernando Luis Vázquez Cao" <fernando@oss.ntt.co.jp>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	x86@kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] Revert "x86-64, init: Do not set NX bits on non-NX capable hardware"
Date: Mon, 20 May 2013 17:03:12 +0200	[thread overview]
Message-ID: <1369062192-7066-1-git-send-email-mhocko@suse.cz> (raw)
In-Reply-To: <20130514160108.GA5055@dhcp22.suse.cz>

This reverts commit 78d77df71510a96e042de7ba6dbd7998103642cb because
it breaks resume from suspend to ram. Git bisect pointed to this patch
and the revert fixes the problem.

There are no error messages neither during suspend not on resume when
the machine simply starts booting as if it wasn't suspended in RAM at
all.

References: https://lkml.org/lkml/2013/5/14/398
Cc: stable@vger.kernel.org # 3.9
Signed-off-by: Michal Hocko <mhocko@suse.cz>
---
 arch/x86/kernel/head64.c  |    3 +--
 arch/x86/kernel/head_64.S |    1 -
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index dab95a8..101ac1a9 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -34,7 +34,6 @@
 extern pgd_t early_level4_pgt[PTRS_PER_PGD];
 extern pmd_t early_dynamic_pgts[EARLY_DYNAMIC_PAGE_TABLES][PTRS_PER_PMD];
 static unsigned int __initdata next_early_pgt = 2;
-pmdval_t __initdata early_pmd_flags = __PAGE_KERNEL_LARGE & ~(_PAGE_GLOBAL | _PAGE_NX);
 
 /* Wipe all early page tables except for the kernel symbol map */
 static void __init reset_early_page_tables(void)
@@ -100,7 +99,7 @@ again:
 			pmd_p[i] = 0;
 		*pud_p = (pudval_t)pmd_p - __START_KERNEL_map + phys_base + _KERNPG_TABLE;
 	}
-	pmd = (physaddr & PMD_MASK) + early_pmd_flags;
+	pmd = (physaddr & PMD_MASK) + (__PAGE_KERNEL_LARGE & ~_PAGE_GLOBAL);
 	pmd_p[pmd_index(address)] = pmd;
 
 	return 0;
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 08f7e80..6859e96 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -200,7 +200,6 @@ ENTRY(secondary_startup_64)
 	btl	$20,%edi		/* No Execute supported? */
 	jnc     1f
 	btsl	$_EFER_NX, %eax
-	btsq	$_PAGE_BIT_NX,early_pmd_flags(%rip)
 1:	wrmsr				/* Make changes effective */
 
 	/* Setup cr0 */
-- 
1.7.10.4


  parent reply	other threads:[~2013-05-20 15:03 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-14 16:01 3.10-rc1 system starts regular boot when waking from s2ram Michal Hocko
2013-05-14 20:09 ` Rafael J. Wysocki
2013-05-15  8:01   ` Michal Hocko
2013-05-15  8:29     ` Pavel Machek
2013-05-15  9:05     ` Pavel Machek
2013-05-15  9:56 ` Michal Hocko
2013-05-17  7:54   ` Michal Hocko
2013-05-17 12:11     ` Rafael J. Wysocki
2013-05-17 12:09       ` Michal Hocko
2013-05-17 12:23         ` Rafael J. Wysocki
2013-05-17 12:30           ` Michal Hocko
2013-05-15 13:17 ` CONFIG_HYPERVISOR_GUEST=y {-- replace -- CONFIG_PARAVIRT_GUEST=y {= { # CONFIG_HYPERVISOR_GUEST is not set } Re: 3.10-rc1 system starts regular boot when waking from s2ram Fw: [PATCH 2/2] x86: Make Linux guest support optional Victor Miasnikov
2013-05-15 13:17   ` Victor Miasnikov
2013-05-15 13:34   ` Michal Hocko
2013-05-15 13:44     ` Victor Miasnikov
2013-05-15 13:44       ` Victor Miasnikov
2013-05-15 13:46       ` Michal Hocko
2013-05-15 14:05         ` CONFIG_HYPERVISOR_GUEST=y {-- replace -- CONFIG_PARAVIRT_GUEST=y {= { # CONFIG_HYPERVISOR_GUEST is not set } Re: 3.10-rc1 " Victor Miasnikov
2013-05-15 14:05           ` Victor Miasnikov
2013-05-15 14:21           ` Borislav Petkov
2013-05-15 14:52             ` Victor Miasnikov
2013-05-15 14:52               ` Victor Miasnikov
2013-05-15 17:34             ` Luck, Tony
2013-05-15 17:34               ` Luck, Tony
2013-05-20 15:03 ` Michal Hocko [this message]
2013-05-20 15:58   ` [PATCH] Revert "x86-64, init: Do not set NX bits on non-NX capable hardware" H. Peter Anvin
2013-05-20 16:43     ` Michal Hocko
2013-05-20 17:21       ` Linus Torvalds
2013-05-20 18:13         ` H. Peter Anvin
2013-05-20 18:18           ` Linus Torvalds
2013-05-20 18:19             ` H. Peter Anvin
2013-05-20 18:23         ` Michal Hocko
2013-05-20 18:30           ` H. Peter Anvin
2013-05-20 18:31             ` Michal Hocko
2013-05-20 18:31             ` Linus Torvalds
2013-05-20 18:36               ` H. Peter Anvin
2013-05-20 18:42           ` [tip:x86/urgent] x86-64: Make early_pmd_flags __cpuinitdata tip-bot for H. Peter Anvin
2013-05-20 18:50           ` tip-bot for 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=1369062192-7066-1-git-send-email-mhocko@suse.cz \
    --to=mhocko@suse.cz \
    --cc=fernando@oss.ntt.co.jp \
    --cc=hpa@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=torvalds@linux-foundation.org \
    --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 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.