diff mbox

Revert "x86-64, init: Do not set NX bits on non-NX capable hardware"

Message ID 20130520182306.GA5348@dhcp22.suse.cz (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Michal Hocko May 20, 2013, 6:23 p.m. UTC
On Mon 20-05-13 10:21:09, Linus Torvalds wrote:
> On Mon, May 20, 2013 at 9:43 AM, Michal Hocko <mhocko@suse.cz> wrote:
> >
> > The configuration has been posted in the referenced thread:
> > https://lkml.org/lkml/2013/5/14/398
> 
> Hmm. That's a regular intel i5 Sandybridge CPU. Which certainly has NX.
> 
> Hmm. secondary_startup_64 isn't __initcode, is it? I think it's used
> for resuming the other CPU's too and for CPU hotplug. Yes/no?
> 
> If so early_pmd_flags shouldn't be __initdata, I think.
> 
> Michal, does it work if you don't do the revert, but just remove the
> __initdata instead?

Right you are! The following patch on top of your tree fixes the
problem. Thanks a lot. I will leave the proper changelog to somebody who
is more familiar with the area but AFAIU the real problem is that
early_pmd_flags is no longer available beacause the section is gone.

Anyway, feel free to add my 
Tested-by: Michal Hocko <mhocko@suse.cz>
and mark it for 3.9 stable tree
---

Comments

H. Peter Anvin May 20, 2013, 6:30 p.m. UTC | #1
On 05/20/2013 11:23 AM, Michal Hocko wrote:
> On Mon 20-05-13 10:21:09, Linus Torvalds wrote:
>> On Mon, May 20, 2013 at 9:43 AM, Michal Hocko <mhocko@suse.cz> wrote:
>>>
>>> The configuration has been posted in the referenced thread:
>>> https://lkml.org/lkml/2013/5/14/398
>>
>> Hmm. That's a regular intel i5 Sandybridge CPU. Which certainly has NX.
>>
>> Hmm. secondary_startup_64 isn't __initcode, is it? I think it's used
>> for resuming the other CPU's too and for CPU hotplug. Yes/no?
>>
>> If so early_pmd_flags shouldn't be __initdata, I think.
>>
>> Michal, does it work if you don't do the revert, but just remove the
>> __initdata instead?
> 
> Right you are! The following patch on top of your tree fixes the
> problem. Thanks a lot. I will leave the proper changelog to somebody who
> is more familiar with the area but AFAIU the real problem is that
> early_pmd_flags is no longer available beacause the section is gone.
> 

I'll write it up and send a pull request to Linus.

	-hpa

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Michal Hocko May 20, 2013, 6:31 p.m. UTC | #2
On Mon 20-05-13 11:30:31, H. Peter Anvin wrote:
> On 05/20/2013 11:23 AM, Michal Hocko wrote:
> > On Mon 20-05-13 10:21:09, Linus Torvalds wrote:
> >> On Mon, May 20, 2013 at 9:43 AM, Michal Hocko <mhocko@suse.cz> wrote:
> >>>
> >>> The configuration has been posted in the referenced thread:
> >>> https://lkml.org/lkml/2013/5/14/398
> >>
> >> Hmm. That's a regular intel i5 Sandybridge CPU. Which certainly has NX.
> >>
> >> Hmm. secondary_startup_64 isn't __initcode, is it? I think it's used
> >> for resuming the other CPU's too and for CPU hotplug. Yes/no?
> >>
> >> If so early_pmd_flags shouldn't be __initdata, I think.
> >>
> >> Michal, does it work if you don't do the revert, but just remove the
> >> __initdata instead?
> > 
> > Right you are! The following patch on top of your tree fixes the
> > problem. Thanks a lot. I will leave the proper changelog to somebody who
> > is more familiar with the area but AFAIU the real problem is that
> > early_pmd_flags is no longer available beacause the section is gone.
> > 
> 
> I'll write it up and send a pull request to Linus.

Thanks, Peter
Linus Torvalds May 20, 2013, 6:31 p.m. UTC | #3
On Mon, May 20, 2013 at 11:30 AM, H. Peter Anvin <hpa@linux.intel.com> wrote:
>
> I'll write it up and send a pull request to Linus.

I'm already doing it.

          Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
H. Peter Anvin May 20, 2013, 6:36 p.m. UTC | #4
On 05/20/2013 11:31 AM, Linus Torvalds wrote:
> On Mon, May 20, 2013 at 11:30 AM, H. Peter Anvin <hpa@linux.intel.com> wrote:
>>
>> I'll write it up and send a pull request to Linus.
> 
> I'm already doing it.
> 

If you prefer.  It should be __cpuinitdata and not just blank, I believe.

	-hpa

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index dab95a8..55b6761 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -34,7 +34,7 @@ 
 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);
+pmdval_t 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)