Re: [PATCH REBASED RESEND] x86/cpu: Move early cpu initialization into a separate translation unit

2018-06-22 Thread Borislav Petkov
On Fri, Jun 22, 2018 at 06:50:56PM +0200, Thomas Gleixner wrote: > > The magic, which I cut out, will rewrite the "jmp 6f, nops" thing to > > "jmp %l[y_{yes,no}]" at the alternative patching and we'll loose the > > dynamic test, pinning the condition forever more. > > Hrm. Memory seems have to

Re: [PATCH REBASED RESEND] x86/cpu: Move early cpu initialization into a separate translation unit

2018-06-22 Thread Borislav Petkov
On Fri, Jun 22, 2018 at 06:50:56PM +0200, Thomas Gleixner wrote: > > The magic, which I cut out, will rewrite the "jmp 6f, nops" thing to > > "jmp %l[y_{yes,no}]" at the alternative patching and we'll loose the > > dynamic test, pinning the condition forever more. > > Hrm. Memory seems have to

Re: [PATCH REBASED RESEND] x86/cpu: Move early cpu initialization into a separate translation unit

2018-06-22 Thread Thomas Gleixner
On Fri, 22 Jun 2018, Peter Zijlstra wrote: > On Fri, Jun 22, 2018 at 06:16:05PM +0200, Thomas Gleixner wrote: > > On Fri, 22 Jun 2018, Kirill A. Shutemov wrote: > > > On Fri, Jun 22, 2018 at 03:35:18PM +, Thomas Gleixner wrote: > > > > > How is that supposed to work correctly? > > > > > > >

Re: [PATCH REBASED RESEND] x86/cpu: Move early cpu initialization into a separate translation unit

2018-06-22 Thread Thomas Gleixner
On Fri, 22 Jun 2018, Peter Zijlstra wrote: > On Fri, Jun 22, 2018 at 06:16:05PM +0200, Thomas Gleixner wrote: > > On Fri, 22 Jun 2018, Kirill A. Shutemov wrote: > > > On Fri, Jun 22, 2018 at 03:35:18PM +, Thomas Gleixner wrote: > > > > > How is that supposed to work correctly? > > > > > > >

Re: [PATCH REBASED RESEND] x86/cpu: Move early cpu initialization into a separate translation unit

2018-06-22 Thread Peter Zijlstra
On Fri, Jun 22, 2018 at 06:16:05PM +0200, Thomas Gleixner wrote: > On Fri, 22 Jun 2018, Kirill A. Shutemov wrote: > > On Fri, Jun 22, 2018 at 03:35:18PM +, Thomas Gleixner wrote: > > > How is that supposed to work correctly? > > > > > > start_kernel() > > > > > > trap_init() > > >

Re: [PATCH REBASED RESEND] x86/cpu: Move early cpu initialization into a separate translation unit

2018-06-22 Thread Peter Zijlstra
On Fri, Jun 22, 2018 at 06:16:05PM +0200, Thomas Gleixner wrote: > On Fri, 22 Jun 2018, Kirill A. Shutemov wrote: > > On Fri, Jun 22, 2018 at 03:35:18PM +, Thomas Gleixner wrote: > > > How is that supposed to work correctly? > > > > > > start_kernel() > > > > > > trap_init() > > >

Re: [PATCH REBASED RESEND] x86/cpu: Move early cpu initialization into a separate translation unit

2018-06-22 Thread Thomas Gleixner
On Fri, 22 Jun 2018, Kirill A. Shutemov wrote: > On Fri, Jun 22, 2018 at 03:35:18PM +, Thomas Gleixner wrote: > > > > Second thoughts. > > > > > > > > The only place where __pgtable_l5_enabled() is used in common.c is in > > > > early_identify_cpu() which is marked __init. So how is that

Re: [PATCH REBASED RESEND] x86/cpu: Move early cpu initialization into a separate translation unit

2018-06-22 Thread Thomas Gleixner
On Fri, 22 Jun 2018, Kirill A. Shutemov wrote: > On Fri, Jun 22, 2018 at 03:35:18PM +, Thomas Gleixner wrote: > > > > Second thoughts. > > > > > > > > The only place where __pgtable_l5_enabled() is used in common.c is in > > > > early_identify_cpu() which is marked __init. So how is that

Re: [PATCH REBASED RESEND] x86/cpu: Move early cpu initialization into a separate translation unit

2018-06-22 Thread Kirill A. Shutemov
On Fri, Jun 22, 2018 at 03:35:18PM +, Thomas Gleixner wrote: > On Fri, 22 Jun 2018, Kirill A. Shutemov wrote: > > On Fri, Jun 22, 2018 at 02:05:47PM +, Thomas Gleixner wrote: > > > On Tue, 12 Jun 2018, Kirill A. Shutemov wrote: > > > > > > > __pgtable_l5_enabled shouldn't be needed after

Re: [PATCH REBASED RESEND] x86/cpu: Move early cpu initialization into a separate translation unit

2018-06-22 Thread Kirill A. Shutemov
On Fri, Jun 22, 2018 at 03:35:18PM +, Thomas Gleixner wrote: > On Fri, 22 Jun 2018, Kirill A. Shutemov wrote: > > On Fri, Jun 22, 2018 at 02:05:47PM +, Thomas Gleixner wrote: > > > On Tue, 12 Jun 2018, Kirill A. Shutemov wrote: > > > > > > > __pgtable_l5_enabled shouldn't be needed after

Re: [PATCH REBASED RESEND] x86/cpu: Move early cpu initialization into a separate translation unit

2018-06-22 Thread Thomas Gleixner
On Fri, 22 Jun 2018, Kirill A. Shutemov wrote: > On Fri, Jun 22, 2018 at 02:05:47PM +, Thomas Gleixner wrote: > > On Tue, 12 Jun 2018, Kirill A. Shutemov wrote: > > > > > __pgtable_l5_enabled shouldn't be needed after system has booted, we can > > > mark it as __initdata, but it requires

Re: [PATCH REBASED RESEND] x86/cpu: Move early cpu initialization into a separate translation unit

2018-06-22 Thread Thomas Gleixner
On Fri, 22 Jun 2018, Kirill A. Shutemov wrote: > On Fri, Jun 22, 2018 at 02:05:47PM +, Thomas Gleixner wrote: > > On Tue, 12 Jun 2018, Kirill A. Shutemov wrote: > > > > > __pgtable_l5_enabled shouldn't be needed after system has booted, we can > > > mark it as __initdata, but it requires

Re: [PATCH REBASED RESEND] x86/cpu: Move early cpu initialization into a separate translation unit

2018-06-22 Thread Kirill A. Shutemov
On Fri, Jun 22, 2018 at 02:05:47PM +, Thomas Gleixner wrote: > On Tue, 12 Jun 2018, Kirill A. Shutemov wrote: > > > __pgtable_l5_enabled shouldn't be needed after system has booted, we can > > mark it as __initdata, but it requires preparation. > > > > This patch moves early cpu

Re: [PATCH REBASED RESEND] x86/cpu: Move early cpu initialization into a separate translation unit

2018-06-22 Thread Kirill A. Shutemov
On Fri, Jun 22, 2018 at 02:05:47PM +, Thomas Gleixner wrote: > On Tue, 12 Jun 2018, Kirill A. Shutemov wrote: > > > __pgtable_l5_enabled shouldn't be needed after system has booted, we can > > mark it as __initdata, but it requires preparation. > > > > This patch moves early cpu

Re: [PATCH REBASED RESEND] x86/cpu: Move early cpu initialization into a separate translation unit

2018-06-22 Thread Thomas Gleixner
On Tue, 12 Jun 2018, Kirill A. Shutemov wrote: > __pgtable_l5_enabled shouldn't be needed after system has booted, we can > mark it as __initdata, but it requires preparation. > > This patch moves early cpu initialization into a separate translation > unit. This limits effect of

Re: [PATCH REBASED RESEND] x86/cpu: Move early cpu initialization into a separate translation unit

2018-06-22 Thread Thomas Gleixner
On Tue, 12 Jun 2018, Kirill A. Shutemov wrote: > __pgtable_l5_enabled shouldn't be needed after system has booted, we can > mark it as __initdata, but it requires preparation. > > This patch moves early cpu initialization into a separate translation > unit. This limits effect of

[PATCH REBASED RESEND] x86/cpu: Move early cpu initialization into a separate translation unit

2018-06-12 Thread Kirill A. Shutemov
__pgtable_l5_enabled shouldn't be needed after system has booted, we can mark it as __initdata, but it requires preparation. This patch moves early cpu initialization into a separate translation unit. This limits effect of USE_EARLY_PGTABLE_L5 to less code. Without the change cpu_init() uses

[PATCH REBASED RESEND] x86/cpu: Move early cpu initialization into a separate translation unit

2018-06-12 Thread Kirill A. Shutemov
__pgtable_l5_enabled shouldn't be needed after system has booted, we can mark it as __initdata, but it requires preparation. This patch moves early cpu initialization into a separate translation unit. This limits effect of USE_EARLY_PGTABLE_L5 to less code. Without the change cpu_init() uses