[PATCH v2 2/3] resource: add walk_system_ram_res_rev()

2018-04-07 Thread Baoquan He
_file code. Signed-off-by: Baoquan He Cc: Andrew Morton Cc: Thomas Gleixner Cc: Brijesh Singh Cc: "Jérôme Glisse" Cc: Borislav Petkov Cc: Tom Lendacky Cc: Wei Yang --- include/linux/ioport.h | 3 +++ kernel/resource.c | 40 2 files ch

[PATCH v2 3/3] kexec_file: Load kernel at top of system RAM if required

2018-04-07 Thread Baoquan He
, call the newly added walk_system_ram_res_rev() to find memory region from top to down to load kernel. Signed-off-by: Baoquan He Cc: Eric Biederman Cc: Vivek Goyal Cc: Dave Young Cc: Andrew Morton Cc: Yinghai Lu Cc: ke...@lists.infradead.org --- kernel/kexec_file.c | 2 ++ 1 file changed, 2

[PATCH v2 1/3] resource: Use list_head to link sibling resource

2018-04-07 Thread Baoquan He
nux-foundation.org> Signed-off-by: Baoquan He <b...@redhat.com> Cc: Patrik Jakobsson <patrik.r.jakobs...@gmail.com> Cc: David Airlie <airl...@linux.ie> Cc: "K. Y. Srinivasan" <k...@microsoft.com> Cc: Haiyang Zhang <haiya...@microsoft.com> Cc: Stephen Hemminge

[PATCH v2 1/3] resource: Use list_head to link sibling resource

2018-04-07 Thread Baoquan He
The struct resource uses singly linked list to link siblings. It's not easy to do reverse iteration on sibling list. So replace it with list_head. And this makes codes in kernel/resource.c more readable after refactoring than pointer operation. Suggested-by: Andrew Morton Signed-off-by: Baoquan

[PATCH v2 0/3] resource: Use list_head to link sibling resource

2018-04-07 Thread Baoquan He
ngs. This is suggested by Andrew. Rewrite walk_system_ram_res_rev() after list_head is taken to link resouce siblings. Baoquan He (3): resource: Use list_head to link sibling resource resource: add walk_system_ram_res_rev() kexec_file: Load kernel at top of system RAM if required drivers/

[PATCH v2 0/3] resource: Use list_head to link sibling resource

2018-04-07 Thread Baoquan He
ngs. This is suggested by Andrew. Rewrite walk_system_ram_res_rev() after list_head is taken to link resouce siblings. Baoquan He (3): resource: Use list_head to link sibling resource resource: add walk_system_ram_res_rev() kexec_file: Load kernel at top of system RAM if required drivers/

Re: [PATCH 1/2] resource: add walk_system_ram_res_rev()

2018-03-26 Thread Baoquan He
Hi Wei Yang, On 03/25/18 at 12:13am, Wei Yang wrote: > On Sat, Mar 24, 2018 at 09:33:30PM +0800, Baoquan He wrote: > >> > >> Yes. That sounds perfectly acceptable. > >> > >> It would be interesting to see what this approach looks like, if you &g

Re: [PATCH 1/2] resource: add walk_system_ram_res_rev()

2018-03-26 Thread Baoquan He
Hi Wei Yang, On 03/25/18 at 12:13am, Wei Yang wrote: > On Sat, Mar 24, 2018 at 09:33:30PM +0800, Baoquan He wrote: > >> > >> Yes. That sounds perfectly acceptable. > >> > >> It would be interesting to see what this approach looks like, if you &g

Re: [PATCH 1/2] resource: add walk_system_ram_res_rev()

2018-03-24 Thread Baoquan He
On 03/23/18 at 01:06pm, Andrew Morton wrote: > On Fri, 23 Mar 2018 11:10:13 +0800 Baoquan He <b...@redhat.com> wrote: > > > On 03/22/18 at 07:06pm, Andrew Morton wrote: > > > On Fri, 23 Mar 2018 08:58:45 +0800 Baoquan He <b...@redhat.com> wrote: > > > &

Re: [PATCH 1/2] resource: add walk_system_ram_res_rev()

2018-03-24 Thread Baoquan He
On 03/23/18 at 01:06pm, Andrew Morton wrote: > On Fri, 23 Mar 2018 11:10:13 +0800 Baoquan He wrote: > > > On 03/22/18 at 07:06pm, Andrew Morton wrote: > > > On Fri, 23 Mar 2018 08:58:45 +0800 Baoquan He wrote: > > > > > > > > erk, th

Re: [PATCH 0/2] Kexec_file: Load kernel at top of system ram

2018-03-23 Thread Baoquan He
On 03/22/18 at 03:38pm, Andrew Morton wrote: > On Thu, 22 Mar 2018 11:37:20 +0800 Baoquan He <b...@redhat.com> wrote: > > > The current kexec_file ignores kexec_buf.top_down value when call > > arch_kexec_walk_mem() to allocate memory for loading kernel/initrd > >

Re: [PATCH 0/2] Kexec_file: Load kernel at top of system ram

2018-03-23 Thread Baoquan He
On 03/22/18 at 03:38pm, Andrew Morton wrote: > On Thu, 22 Mar 2018 11:37:20 +0800 Baoquan He wrote: > > > The current kexec_file ignores kexec_buf.top_down value when call > > arch_kexec_walk_mem() to allocate memory for loading kernel/initrd > > stuffs. This is

Re: [PATCH 1/2] resource: add walk_system_ram_res_rev()

2018-03-22 Thread Baoquan He
On 03/22/18 at 07:06pm, Andrew Morton wrote: > On Fri, 23 Mar 2018 08:58:45 +0800 Baoquan He <b...@redhat.com> wrote: > > > > erk, this is pretty nasty. Isn't there a better way :( > > > > Yes, this is not efficient. > > > > In struct resource{}, -

Re: [PATCH 1/2] resource: add walk_system_ram_res_rev()

2018-03-22 Thread Baoquan He
On 03/22/18 at 07:06pm, Andrew Morton wrote: > On Fri, 23 Mar 2018 08:58:45 +0800 Baoquan He wrote: > > > > erk, this is pretty nasty. Isn't there a better way :( > > > > Yes, this is not efficient. > > > > In struct resource{}, ->sibling list is a si

Re: [PATCH 1/2] resource: add walk_system_ram_res_rev()

2018-03-22 Thread Baoquan He
Hi Andrew, Thanks a lot for your reviewing! On 03/22/18 at 03:29pm, Andrew Morton wrote: > > /* > > + * This function, being a variant of walk_system_ram_res(), calls the @func > > + * callback against all memory ranges of type System RAM which are marked > > as > > + * IORESOURCE_SYSTEM_RAM

Re: [PATCH 1/2] resource: add walk_system_ram_res_rev()

2018-03-22 Thread Baoquan He
Hi Andrew, Thanks a lot for your reviewing! On 03/22/18 at 03:29pm, Andrew Morton wrote: > > /* > > + * This function, being a variant of walk_system_ram_res(), calls the @func > > + * callback against all memory ranges of type System RAM which are marked > > as > > + * IORESOURCE_SYSTEM_RAM

[PATCH 0/2] Kexec_file: Load kernel at top of system ram

2018-03-21 Thread Baoquan He
, check kexec_buf.top_down in arch_kexec_walk_mem(), if its value is 'true', call walk_system_ram_res_rev(). Otherwise call walk_system_ram_res(). AKASHI Takahiro (1): resource: add walk_system_ram_res_rev() Baoquan He (1): kexec_file: Load kernel at top of system RAM if required include

[PATCH 1/2] resource: add walk_system_ram_res_rev()

2018-03-21 Thread Baoquan He
.e., from higher to lower. It will be used in kexec_file code. Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Signed-off-by: Baoquan He <b...@redhat.com> --- include/linux/ioport.h | 3 +++ kernel/resource.c | 63 +++

[PATCH 0/2] Kexec_file: Load kernel at top of system ram

2018-03-21 Thread Baoquan He
, check kexec_buf.top_down in arch_kexec_walk_mem(), if its value is 'true', call walk_system_ram_res_rev(). Otherwise call walk_system_ram_res(). AKASHI Takahiro (1): resource: add walk_system_ram_res_rev() Baoquan He (1): kexec_file: Load kernel at top of system RAM if required include

[PATCH 1/2] resource: add walk_system_ram_res_rev()

2018-03-21 Thread Baoquan He
ll be used in kexec_file code. Signed-off-by: AKASHI Takahiro Signed-off-by: Baoquan He --- include/linux/ioport.h | 3 +++ kernel/resource.c | 63 ++ 2 files changed, 66 insertions(+) diff --git a/include/linux/ioport.h b/include/linux/iopo

[PATCH 2/2] kexec_file: Load kernel at top of system RAM if required

2018-03-21 Thread Baoquan He
. This is not right. Here add checking if kexec_buf.top_down is 'true' in arch_kexec_walk_mem(), if yes, call the newly added walk_system_ram_res_rev() to find memory region from top to down to load kernel. Signed-off-by: Baoquan He <b...@redhat.com> --- kernel/kexec_file.c | 2 ++ 1 file chan

[PATCH 2/2] kexec_file: Load kernel at top of system RAM if required

2018-03-21 Thread Baoquan He
. This is not right. Here add checking if kexec_buf.top_down is 'true' in arch_kexec_walk_mem(), if yes, call the newly added walk_system_ram_res_rev() to find memory region from top to down to load kernel. Signed-off-by: Baoquan He --- kernel/kexec_file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

Re: [PATCH v8 01/13] resource: add walk_system_ram_res_rev()

2018-03-19 Thread Baoquan He
On 03/20/18 at 12:12pm, AKASHI Takahiro wrote: > Baoquan, > > On Tue, Mar 20, 2018 at 09:43:18AM +0800, Baoquan He wrote: > > On 02/23/18 at 04:36pm, Dave Young wrote: > > > Hi AKASHI, > > > > > > On 02/22/18 at 08:17pm, AKASHI Takahiro wro

Re: [PATCH v8 01/13] resource: add walk_system_ram_res_rev()

2018-03-19 Thread Baoquan He
On 03/20/18 at 12:12pm, AKASHI Takahiro wrote: > Baoquan, > > On Tue, Mar 20, 2018 at 09:43:18AM +0800, Baoquan He wrote: > > On 02/23/18 at 04:36pm, Dave Young wrote: > > > Hi AKASHI, > > > > > > On 02/22/18 at 08:17pm, AKASHI Takahiro wro

Re: [PATCH v8 01/13] resource: add walk_system_ram_res_rev()

2018-03-19 Thread Baoquan He
On 02/23/18 at 04:36pm, Dave Young wrote: > Hi AKASHI, > > On 02/22/18 at 08:17pm, AKASHI Takahiro wrote: > > This function, being a variant of walk_system_ram_res() introduced in > > commit 8c86e70acead ("resource: provide new functions to walk through > > resources"), walks through a list of

Re: [PATCH v8 01/13] resource: add walk_system_ram_res_rev()

2018-03-19 Thread Baoquan He
On 02/23/18 at 04:36pm, Dave Young wrote: > Hi AKASHI, > > On 02/22/18 at 08:17pm, AKASHI Takahiro wrote: > > This function, being a variant of walk_system_ram_res() introduced in > > commit 8c86e70acead ("resource: provide new functions to walk through > > resources"), walks through a list of

Re: [PATCH v9 0/5] x86/KASLR: Add parameter kaslr_boot_mem=nn[KMG]@ss[KMG]

2018-03-19 Thread Baoquan He
On 03/12/18 at 08:04pm, Chao Fan wrote: > On Mon, Mar 12, 2018 at 11:57:27AM +0100, Ingo Molnar wrote: > > > >* Baoquan He <b...@redhat.com> wrote: > > > >> Hi Ingo, > >> > >> On 03/12/18 at 10:35am, Ingo Molnar wrote: >

Re: [PATCH v9 0/5] x86/KASLR: Add parameter kaslr_boot_mem=nn[KMG]@ss[KMG]

2018-03-19 Thread Baoquan He
On 03/12/18 at 08:04pm, Chao Fan wrote: > On Mon, Mar 12, 2018 at 11:57:27AM +0100, Ingo Molnar wrote: > > > >* Baoquan He wrote: > > > >> Hi Ingo, > >> > >> On 03/12/18 at 10:35am, Ingo Molnar wrote: > >> > > >> > * C

Re: [PATCH v9 0/5] x86/KASLR: Add parameter kaslr_boot_mem=nn[KMG]@ss[KMG]

2018-03-13 Thread Baoquan He
On 03/12/18 at 08:04pm, Chao Fan wrote: > On Mon, Mar 12, 2018 at 11:57:27AM +0100, Ingo Molnar wrote: > >> > > ***Background: > >> > > People reported that kaslr may randomly chooses some positions > >> > > which are located in movable memory regions. This will break memory > >> > > hotplug

Re: [PATCH v9 0/5] x86/KASLR: Add parameter kaslr_boot_mem=nn[KMG]@ss[KMG]

2018-03-13 Thread Baoquan He
On 03/12/18 at 08:04pm, Chao Fan wrote: > On Mon, Mar 12, 2018 at 11:57:27AM +0100, Ingo Molnar wrote: > >> > > ***Background: > >> > > People reported that kaslr may randomly chooses some positions > >> > > which are located in movable memory regions. This will break memory > >> > > hotplug

Re: [PATCH v9 0/5] x86/KASLR: Add parameter kaslr_boot_mem=nn[KMG]@ss[KMG]

2018-03-12 Thread Baoquan He
Hi Ingo, On 03/12/18 at 10:35am, Ingo Molnar wrote: > > * Chao Fan wrote: > > > Long time no reply, rebase the patchset, change the parameter name > > from 'kaslr_mem' to 'kaslr_boot_mem'. There's no more code change. > > > > ***Background: > > People reported that

Re: [PATCH v9 0/5] x86/KASLR: Add parameter kaslr_boot_mem=nn[KMG]@ss[KMG]

2018-03-12 Thread Baoquan He
Hi Ingo, On 03/12/18 at 10:35am, Ingo Molnar wrote: > > * Chao Fan wrote: > > > Long time no reply, rebase the patchset, change the parameter name > > from 'kaslr_mem' to 'kaslr_boot_mem'. There's no more code change. > > > > ***Background: > > People reported that kaslr may randomly chooses

[tip:x86/mm] kdump, vmcoreinfo: Export pgtable_l5_enabled value

2018-03-12 Thread tip-bot for Baoquan He
Commit-ID: c100a583601d357f923c41af5434dc1f8d07890f Gitweb: https://git.kernel.org/tip/c100a583601d357f923c41af5434dc1f8d07890f Author: Baoquan He <b...@redhat.com> AuthorDate: Fri, 2 Mar 2018 13:18:01 +0800 Committer: Ingo Molnar <mi...@kernel.org> CommitDate: Mon, 12 Mar 2

[tip:x86/mm] kdump, vmcoreinfo: Export pgtable_l5_enabled value

2018-03-12 Thread tip-bot for Baoquan He
Commit-ID: c100a583601d357f923c41af5434dc1f8d07890f Gitweb: https://git.kernel.org/tip/c100a583601d357f923c41af5434dc1f8d07890f Author: Baoquan He AuthorDate: Fri, 2 Mar 2018 13:18:01 +0800 Committer: Ingo Molnar CommitDate: Mon, 12 Mar 2018 09:43:56 +0100 kdump, vmcoreinfo: Export

[PATCH] kdump, vmcoreinfo: Export value to tell if 5-level is enabled

2018-03-01 Thread Baoquan He
pgtable_l5_enabled != 0 when Compile with CONFIG_X86_5LEVEL=y and cpu has 'la57' flag Signed-off-by: Baoquan He <b...@redhat.com> --- arch/x86/kernel/machine_kexec_64.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexe

[PATCH] kdump, vmcoreinfo: Export value to tell if 5-level is enabled

2018-03-01 Thread Baoquan He
pgtable_l5_enabled != 0 when Compile with CONFIG_X86_5LEVEL=y and cpu has 'la57' flag Signed-off-by: Baoquan He --- arch/x86/kernel/machine_kexec_64.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index 1f790cf9d38f

[PATCH v3 1/4] mm/sparse: Add a static variable nr_present_sections

2018-02-27 Thread Baoquan He
It's used to record how many memory sections are marked as present during system boot up, and will be used in the later patch. Signed-off-by: Baoquan He <b...@redhat.com> --- mm/sparse.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/mm/sparse.c b/mm/sparse.c index 7af5e7

[PATCH v3 1/4] mm/sparse: Add a static variable nr_present_sections

2018-02-27 Thread Baoquan He
It's used to record how many memory sections are marked as present during system boot up, and will be used in the later patch. Signed-off-by: Baoquan He --- mm/sparse.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/mm/sparse.c b/mm/sparse.c index 7af5e7a92528..3400c1c02f7a 100644

[PATCH v3 3/4] mm/sparse: Add a new parameter 'data_unit_size' for alloc_usemap_and_memmap

2018-02-27 Thread Baoquan He
It's used to pass the size of map data unit into alloc_usemap_and_memmap, and is preparation for next patch. Signed-off-by: Baoquan He <b...@redhat.com> --- mm/sparse.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mm/sparse.c b/mm/sparse.c index 5769a0

[PATCH v3 3/4] mm/sparse: Add a new parameter 'data_unit_size' for alloc_usemap_and_memmap

2018-02-27 Thread Baoquan He
It's used to pass the size of map data unit into alloc_usemap_and_memmap, and is preparation for next patch. Signed-off-by: Baoquan He --- mm/sparse.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mm/sparse.c b/mm/sparse.c index 5769a0a79dc1..e1aa2f44530d 100644

[PATCH v3 2/4] mm/sparsemem: Defer the ms->section_mem_map clearing

2018-02-27 Thread Baoquan He
) loop. This is in preparation for later optimizing the mem map allocation. Signed-off-by: Baoquan He <b...@redhat.com> --- mm/sparse-vmemmap.c | 1 - mm/sparse.c | 12 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vme

[PATCH v3 0/4] mm/sparse: Optimize memmap allocation during sparse_init()

2018-02-27 Thread Baoquan He
ing as a single patch for easier reviewing. Rewrite patch log according to Dave's suggestion. Fix code bug in patch 0002 reported by test robot. Baoquan He (4): mm/sparse: Add a static variable nr_present_sections mm/sparsemem: Defer the ms->section_mem_map clearing mm/sparse: Add

[PATCH v3 4/4] mm/sparse: Optimize memmap allocation during sparse_init()

2018-02-27 Thread Baoquan He
and set them into mem_section[] accordingly. Signed-off-by: Baoquan He <b...@redhat.com> --- mm/sparse-vmemmap.c | 5 +++-- mm/sparse.c | 33 +++-- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c index 640e68f8

[PATCH v3 2/4] mm/sparsemem: Defer the ms->section_mem_map clearing

2018-02-27 Thread Baoquan He
) loop. This is in preparation for later optimizing the mem map allocation. Signed-off-by: Baoquan He --- mm/sparse-vmemmap.c | 1 - mm/sparse.c | 12 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c index bd0276

[PATCH v3 0/4] mm/sparse: Optimize memmap allocation during sparse_init()

2018-02-27 Thread Baoquan He
ing as a single patch for easier reviewing. Rewrite patch log according to Dave's suggestion. Fix code bug in patch 0002 reported by test robot. Baoquan He (4): mm/sparse: Add a static variable nr_present_sections mm/sparsemem: Defer the ms->section_mem_map clearing mm/sparse: Add

[PATCH v3 4/4] mm/sparse: Optimize memmap allocation during sparse_init()

2018-02-27 Thread Baoquan He
and set them into mem_section[] accordingly. Signed-off-by: Baoquan He --- mm/sparse-vmemmap.c | 5 +++-- mm/sparse.c | 33 +++-- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c index 640e68f8324b..ca72203d5b49 100

Re: [PATCH v2 3/3] mm/sparse: Optimize memmap allocation during sparse_init()

2018-02-22 Thread Baoquan He
On 02/22/18 at 02:22pm, Dave Hansen wrote: > First of all, this is a much-improved changelog. Thanks for that! > > On 02/22/2018 01:11 AM, Baoquan He wrote: > > In sparse_init(), two temporary pointer arrays, usemap_map and map_map > > are allocated with the si

Re: [PATCH v2 3/3] mm/sparse: Optimize memmap allocation during sparse_init()

2018-02-22 Thread Baoquan He
On 02/22/18 at 02:22pm, Dave Hansen wrote: > First of all, this is a much-improved changelog. Thanks for that! > > On 02/22/2018 01:11 AM, Baoquan He wrote: > > In sparse_init(), two temporary pointer arrays, usemap_map and map_map > > are allocated with the si

Re: [PATCH v2 1/3] mm/sparse: Add a static variable nr_present_sections

2018-02-22 Thread Baoquan He
On 02/22/18 at 01:24pm, Andrew Morton wrote: > On Thu, 22 Feb 2018 17:11:28 +0800 Baoquan He <b...@redhat.com> wrote: > > > It's used to record how many memory sections are marked as present > > during system boot up, and will be used in the later patch. > > >

Re: [PATCH v2 1/3] mm/sparse: Add a static variable nr_present_sections

2018-02-22 Thread Baoquan He
On 02/22/18 at 01:24pm, Andrew Morton wrote: > On Thu, 22 Feb 2018 17:11:28 +0800 Baoquan He wrote: > > > It's used to record how many memory sections are marked as present > > during system boot up, and will be used in the later patch. > > > > --- a/mm/

Re: [PATCH v2 3/3] mm/sparse: Optimize memmap allocation during sparse_init()

2018-02-22 Thread Baoquan He
usemap_map and map_map with the size of > > 'nr_present_sections'. For the i-th present memory section, install its > > usemap and memmap to usemap_map[i] and mam_map[i] during allocation. Then > > in the last for_each_present_section_nr() loop which clears the failed > > memory

Re: [PATCH v2 3/3] mm/sparse: Optimize memmap allocation during sparse_init()

2018-02-22 Thread Baoquan He
usemap_map and map_map with the size of > > 'nr_present_sections'. For the i-th present memory section, install its > > usemap and memmap to usemap_map[i] and mam_map[i] during allocation. Then > > in the last for_each_present_section_nr() loop which clears the failed > > memory sect

Re: [PATCH v2 0/3] mm/sparse: Optimize memmap allocation during sparse_init()

2018-02-22 Thread Baoquan He
On 02/22/18 at 05:11pm, Baoquan He wrote: > This is v2 post. V1 can be found here: > https://www.spinics.net/lists/linux-mm/msg144486.html > > In sparse_init(), two temporary pointer arrays, usemap_map and map_map > are allocated with the size of NR_MEM_SECTIONS. They are used

Re: [PATCH v2 0/3] mm/sparse: Optimize memmap allocation during sparse_init()

2018-02-22 Thread Baoquan He
On 02/22/18 at 05:11pm, Baoquan He wrote: > This is v2 post. V1 can be found here: > https://www.spinics.net/lists/linux-mm/msg144486.html > > In sparse_init(), two temporary pointer arrays, usemap_map and map_map > are allocated with the size of NR_MEM_SECTIONS. They are used

[PATCH v2 0/3] mm/sparse: Optimize memmap allocation during sparse_init()

2018-02-22 Thread Baoquan He
allocation code to only use usemap_map and map_map with the size of nr_present_sections. This makes kdump kernel boot up with normal crashkernel='' setting when CONFIG_X86_5LEVEL=y. Baoquan He (3): mm/sparse: Add a static variable nr_present_sections mm/sparsemem: Defer the ms->section_mem_

[PATCH v2 0/3] mm/sparse: Optimize memmap allocation during sparse_init()

2018-02-22 Thread Baoquan He
allocation code to only use usemap_map and map_map with the size of nr_present_sections. This makes kdump kernel boot up with normal crashkernel='' setting when CONFIG_X86_5LEVEL=y. Baoquan He (3): mm/sparse: Add a static variable nr_present_sections mm/sparsemem: Defer the ms->section_mem_

[PATCH v2 2/3] mm/sparsemem: Defer the ms->section_mem_map clearing

2018-02-22 Thread Baoquan He
) loop. This is in preparation for later optimizing the mem map allocation. Signed-off-by: Baoquan He <b...@redhat.com> --- mm/sparse-vmemmap.c | 1 - mm/sparse.c | 12 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vme

[PATCH v2 2/3] mm/sparsemem: Defer the ms->section_mem_map clearing

2018-02-22 Thread Baoquan He
) loop. This is in preparation for later optimizing the mem map allocation. Signed-off-by: Baoquan He --- mm/sparse-vmemmap.c | 1 - mm/sparse.c | 12 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c index bd0276

[PATCH v2 3/3] mm/sparse: Optimize memmap allocation during sparse_init()

2018-02-22 Thread Baoquan He
-by: Baoquan He <b...@redhat.com> Signed-off-by: Baoquan He <b...@redhat.com> --- mm/sparse-vmemmap.c | 8 +--- mm/sparse.c | 40 ++-- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmem

[PATCH v2 3/3] mm/sparse: Optimize memmap allocation during sparse_init()

2018-02-22 Thread Baoquan He
-by: Baoquan He Signed-off-by: Baoquan He --- mm/sparse-vmemmap.c | 8 +--- mm/sparse.c | 40 ++-- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c index 640e68f8324b..f83723a49e47 100644 ---

[PATCH v2 1/3] mm/sparse: Add a static variable nr_present_sections

2018-02-22 Thread Baoquan He
It's used to record how many memory sections are marked as present during system boot up, and will be used in the later patch. Signed-off-by: Baoquan He <b...@redhat.com> --- mm/sparse.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/sparse.c b/mm/sparse.c index 7af5e7

[PATCH v2 1/3] mm/sparse: Add a static variable nr_present_sections

2018-02-22 Thread Baoquan He
It's used to record how many memory sections are marked as present during system boot up, and will be used in the later patch. Signed-off-by: Baoquan He --- mm/sparse.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/sparse.c b/mm/sparse.c index 7af5e7a92528..433d3c9b4b56 100644

[tip:x86/apic] x86/apic: Set up through-local-APIC mode on the boot CPU if 'noapic' specified

2018-02-17 Thread tip-bot for Baoquan He
Commit-ID: bee3204ec3c49f6f53add9c3962c9012a5c036fa Gitweb: https://git.kernel.org/tip/bee3204ec3c49f6f53add9c3962c9012a5c036fa Author: Baoquan He <b...@redhat.com> AuthorDate: Wed, 14 Feb 2018 13:46:56 +0800 Committer: Ingo Molnar <mi...@kernel.org> CommitDate: Sat, 17 Feb 2

[tip:x86/apic] x86/apic: Set up through-local-APIC mode on the boot CPU if 'noapic' specified

2018-02-17 Thread tip-bot for Baoquan He
Commit-ID: bee3204ec3c49f6f53add9c3962c9012a5c036fa Gitweb: https://git.kernel.org/tip/bee3204ec3c49f6f53add9c3962c9012a5c036fa Author: Baoquan He AuthorDate: Wed, 14 Feb 2018 13:46:56 +0800 Committer: Ingo Molnar CommitDate: Sat, 17 Feb 2018 11:47:46 +0100 x86/apic: Set up through

[tip:x86/apic] x86/apic: Rename variables and functions related to x86_io_apic_ops

2018-02-17 Thread tip-bot for Baoquan He
Commit-ID: 51b146c572201e3c368e0baa3e565760aefcf25f Gitweb: https://git.kernel.org/tip/51b146c572201e3c368e0baa3e565760aefcf25f Author: Baoquan He <b...@redhat.com> AuthorDate: Wed, 14 Feb 2018 13:46:55 +0800 Committer: Ingo Molnar <mi...@kernel.org> CommitDate: Sat, 17 Feb 2

[tip:x86/apic] x86/apic: Rename variables and functions related to x86_io_apic_ops

2018-02-17 Thread tip-bot for Baoquan He
Commit-ID: 51b146c572201e3c368e0baa3e565760aefcf25f Gitweb: https://git.kernel.org/tip/51b146c572201e3c368e0baa3e565760aefcf25f Author: Baoquan He AuthorDate: Wed, 14 Feb 2018 13:46:55 +0800 Committer: Ingo Molnar CommitDate: Sat, 17 Feb 2018 11:47:45 +0100 x86/apic: Rename variables

[tip:x86/apic] x86/apic: Remove the (now) unused disable_IO_APIC() function

2018-02-17 Thread tip-bot for Baoquan He
Commit-ID: 50374b96d2d30c03c8d42b3f8846d8938748d454 Gitweb: https://git.kernel.org/tip/50374b96d2d30c03c8d42b3f8846d8938748d454 Author: Baoquan He <b...@redhat.com> AuthorDate: Wed, 14 Feb 2018 13:46:54 +0800 Committer: Ingo Molnar <mi...@kernel.org> CommitDate: Sat, 17 Feb 2

[tip:x86/apic] x86/apic: Remove the (now) unused disable_IO_APIC() function

2018-02-17 Thread tip-bot for Baoquan He
Commit-ID: 50374b96d2d30c03c8d42b3f8846d8938748d454 Gitweb: https://git.kernel.org/tip/50374b96d2d30c03c8d42b3f8846d8938748d454 Author: Baoquan He AuthorDate: Wed, 14 Feb 2018 13:46:54 +0800 Committer: Ingo Molnar CommitDate: Sat, 17 Feb 2018 11:47:45 +0100 x86/apic: Remove the (now

[tip:x86/apic] x86/apic: Fix restoring boot IRQ mode in reboot and kexec/kdump

2018-02-17 Thread tip-bot for Baoquan He
Commit-ID: 339b2ae0cd5d4a58f9efe06e4ee36adbeca59228 Gitweb: https://git.kernel.org/tip/339b2ae0cd5d4a58f9efe06e4ee36adbeca59228 Author: Baoquan He <b...@redhat.com> AuthorDate: Wed, 14 Feb 2018 13:46:53 +0800 Committer: Ingo Molnar <mi...@kernel.org> CommitDate: Sat, 17 Feb 2

[tip:x86/apic] x86/apic: Fix restoring boot IRQ mode in reboot and kexec/kdump

2018-02-17 Thread tip-bot for Baoquan He
Commit-ID: 339b2ae0cd5d4a58f9efe06e4ee36adbeca59228 Gitweb: https://git.kernel.org/tip/339b2ae0cd5d4a58f9efe06e4ee36adbeca59228 Author: Baoquan He AuthorDate: Wed, 14 Feb 2018 13:46:53 +0800 Committer: Ingo Molnar CommitDate: Sat, 17 Feb 2018 11:47:45 +0100 x86/apic: Fix restoring

[tip:x86/apic] x86/apic: Split disable_IO_APIC() into two functions to fix CONFIG_KEXEC_JUMP=y

2018-02-17 Thread tip-bot for Baoquan He
Commit-ID: 3c9e76dbea004b2c7c3ce872022ceaf5ff0dae79 Gitweb: https://git.kernel.org/tip/3c9e76dbea004b2c7c3ce872022ceaf5ff0dae79 Author: Baoquan He <b...@redhat.com> AuthorDate: Wed, 14 Feb 2018 13:46:52 +0800 Committer: Ingo Molnar <mi...@kernel.org> CommitDate: Sat, 17 Feb 2

[tip:x86/apic] x86/apic: Split disable_IO_APIC() into two functions to fix CONFIG_KEXEC_JUMP=y

2018-02-17 Thread tip-bot for Baoquan He
Commit-ID: 3c9e76dbea004b2c7c3ce872022ceaf5ff0dae79 Gitweb: https://git.kernel.org/tip/3c9e76dbea004b2c7c3ce872022ceaf5ff0dae79 Author: Baoquan He AuthorDate: Wed, 14 Feb 2018 13:46:52 +0800 Committer: Ingo Molnar CommitDate: Sat, 17 Feb 2018 11:47:44 +0100 x86/apic: Split

[tip:x86/apic] x86/apic: Split out restore_boot_irq_mode() from disable_IO_APIC()

2018-02-17 Thread tip-bot for Baoquan He
Commit-ID: ce279cdc04aafd5c41ae49f941ee2c3342e35e3e Gitweb: https://git.kernel.org/tip/ce279cdc04aafd5c41ae49f941ee2c3342e35e3e Author: Baoquan He <b...@redhat.com> AuthorDate: Wed, 14 Feb 2018 13:46:51 +0800 Committer: Ingo Molnar <mi...@kernel.org> CommitDate: Sat, 17 Feb 2

[tip:x86/apic] x86/apic: Split out restore_boot_irq_mode() from disable_IO_APIC()

2018-02-17 Thread tip-bot for Baoquan He
Commit-ID: ce279cdc04aafd5c41ae49f941ee2c3342e35e3e Gitweb: https://git.kernel.org/tip/ce279cdc04aafd5c41ae49f941ee2c3342e35e3e Author: Baoquan He AuthorDate: Wed, 14 Feb 2018 13:46:51 +0800 Committer: Ingo Molnar CommitDate: Sat, 17 Feb 2018 11:47:29 +0100 x86/apic: Split out

Re: [PATCH v5 0/6] x86/apic: Fix restoring boot irq mode in reboot and kexec/kdump

2018-02-17 Thread Baoquan He
On 02/17/18 at 11:46am, Ingo Molnar wrote: > > * Baoquan He <b...@redhat.com> wrote: > > > Thanks for checking this! > > > > I got warning message from kbuild test robot on previous v3 and v4. I > > guess this v5 post also has the issue since the

Re: [PATCH v5 0/6] x86/apic: Fix restoring boot irq mode in reboot and kexec/kdump

2018-02-17 Thread Baoquan He
On 02/17/18 at 11:46am, Ingo Molnar wrote: > > * Baoquan He wrote: > > > Thanks for checking this! > > > > I got warning message from kbuild test robot on previous v3 and v4. I > > guess this v5 post also has the issue since the code is the same,

Re: [PATCH v5 0/6] x86/apic: Fix restoring boot irq mode in reboot and kexec/kdump

2018-02-16 Thread Baoquan He
Hi Ingo, Eric, On 02/16/18 at 10:38am, Ingo Molnar wrote: > > * Baoquan He <b...@redhat.com> wrote: > > > This is v5 post. Newly added patch 0002 includes the change > > related to KEXEC_JUMP path. Patch 0003 only includes the > > regression fix. > &g

Re: [PATCH v5 0/6] x86/apic: Fix restoring boot irq mode in reboot and kexec/kdump

2018-02-16 Thread Baoquan He
Hi Ingo, Eric, On 02/16/18 at 10:38am, Ingo Molnar wrote: > > * Baoquan He wrote: > > > This is v5 post. Newly added patch 0002 includes the change > > related to KEXEC_JUMP path. Patch 0003 only includes the > > regression fix. > > > > A regres

[PATCH v5 5/6] x86/apic: Rename variable/function related to x86_io_apic_ops

2018-02-13 Thread Baoquan He
to x86_apic_ops since it doesn't only handle IO_APIC, also LAPIC. And also rename its member variables and the related hooks. Signed-off-by: Baoquan He <b...@redhat.com> --- arch/x86/include/asm/io_apic.h | 6 +++--- arch/x86/include/asm/x86_init.h | 8 arch/x86/kernel/apic/io_apic.

[PATCH v5 6/6] x86/apic: Set up through-local-APIC on boot CPU if 'noapic' specified

2018-02-13 Thread Baoquan He
ugh we fix the regression introduced by criminal commit 522e664644, for safety and clarity, better set up through-local-APIC explicitly, but not rely on the default boot irq mode. Do it now. Signed-off-by: Baoquan He <b...@redhat.com> --- arch/x86/kernel/apic/apic.c | 2 +- 1 file changed, 1 insertio

[PATCH v5 5/6] x86/apic: Rename variable/function related to x86_io_apic_ops

2018-02-13 Thread Baoquan He
to x86_apic_ops since it doesn't only handle IO_APIC, also LAPIC. And also rename its member variables and the related hooks. Signed-off-by: Baoquan He --- arch/x86/include/asm/io_apic.h | 6 +++--- arch/x86/include/asm/x86_init.h | 8 arch/x86/kernel/apic/io_apic.c | 4 ++-- arch/x86/kernel

[PATCH v5 6/6] x86/apic: Set up through-local-APIC on boot CPU if 'noapic' specified

2018-02-13 Thread Baoquan He
ugh we fix the regression introduced by criminal commit 522e664644, for safety and clarity, better set up through-local-APIC explicitly, but not rely on the default boot irq mode. Do it now. Signed-off-by: Baoquan He --- arch/x86/kernel/apic/apic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH v5 3/6] x86/apic: Fix restoring boot irq mode in reboot and kexec/kdump

2018-02-13 Thread Baoquan He
]--- [0.001000] masked ExtINT on CPU#0 To fix this, just call clear_IO_APIC() to stop IO_APIC where disable_IO_APIC() was called, and call restore_boot_irq_mode() to restore boot irq mode before reboot or kexec/kdump jump. Signed-off-by: Baoquan He <b...@redhat.com> Fixes: commit 522

[PATCH v5 0/6] x86/apic: Fix restoring boot irq mode in reboot and kexec/kdump

2018-02-13 Thread Baoquan He
Fixes tag and Cc to stable. v2->v3: Change as Eric suggested: Rerrange patches and change code and messy function/variable naming. Change patch subject and log to make it more understandable. *** BLURB HERE *** Baoquan He (6): x86/apic: Split out restore_boot_irq_mode from disable_IO_APIC

[PATCH v5 3/6] x86/apic: Fix restoring boot irq mode in reboot and kexec/kdump

2018-02-13 Thread Baoquan He
]--- [0.001000] masked ExtINT on CPU#0 To fix this, just call clear_IO_APIC() to stop IO_APIC where disable_IO_APIC() was called, and call restore_boot_irq_mode() to restore boot irq mode before reboot or kexec/kdump jump. Signed-off-by: Baoquan He Fixes: commit 522e66464467 ("x

[PATCH v5 0/6] x86/apic: Fix restoring boot irq mode in reboot and kexec/kdump

2018-02-13 Thread Baoquan He
Fixes tag and Cc to stable. v2->v3: Change as Eric suggested: Rerrange patches and change code and messy function/variable naming. Change patch subject and log to make it more understandable. *** BLURB HERE *** Baoquan He (6): x86/apic: Split out restore_boot_irq_mode from disable_IO_APIC

[PATCH v5 4/6] x86/apic: Remove useless disable_IO_APIC

2018-02-13 Thread Baoquan He
No one uses it anymore. Signed-off-by: Baoquan He <b...@redhat.com> --- arch/x86/include/asm/io_apic.h | 1 - arch/x86/kernel/apic/io_apic.c | 13 - arch/x86/kernel/machine_kexec_32.c | 5 ++--- arch/x86/kernel/machine_kexec_64.c | 5 ++--- 4 files changed, 4 inse

[PATCH v5 4/6] x86/apic: Remove useless disable_IO_APIC

2018-02-13 Thread Baoquan He
No one uses it anymore. Signed-off-by: Baoquan He --- arch/x86/include/asm/io_apic.h | 1 - arch/x86/kernel/apic/io_apic.c | 13 - arch/x86/kernel/machine_kexec_32.c | 5 ++--- arch/x86/kernel/machine_kexec_64.c | 5 ++--- 4 files changed, 4 insertions(+), 20 deletions

[PATCH v5 2/6] x86/apic: Replace disable_IO_APIC for KEXEC_JUMP

2018-02-13 Thread Baoquan He
functional change. Signed-off-by: Baoquan He <b...@redhat.com> --- v4->v5: Make this patch to replace disable_IO_APIC() with clear_IO_APIC and restore_boot_irq_mode() for KEXEC_JUMP path only. This makes patch easier to review according to Eric's suggestion.. arch/x86/include/as

[PATCH v5 2/6] x86/apic: Replace disable_IO_APIC for KEXEC_JUMP

2018-02-13 Thread Baoquan He
functional change. Signed-off-by: Baoquan He --- v4->v5: Make this patch to replace disable_IO_APIC() with clear_IO_APIC and restore_boot_irq_mode() for KEXEC_JUMP path only. This makes patch easier to review according to Eric's suggestion.. arch/x86/include/asm/io_apic.h | 1 + arch/x8

[PATCH v5 1/6] x86/apic: Split out restore_boot_irq_mode from disable_IO_APIC

2018-02-13 Thread Baoquan He
This is a preparation patch. Split out the code which restores boot irq mode from disable_IO_APIC() and wrap into a new function restore_boot_irq_mode(). No functional change. Signed-off-by: Baoquan He <b...@redhat.com> --- arch/x86/include/asm/io_apic.h | 1 + arch/x86/kernel/apic/io_apic

[PATCH v5 1/6] x86/apic: Split out restore_boot_irq_mode from disable_IO_APIC

2018-02-13 Thread Baoquan He
This is a preparation patch. Split out the code which restores boot irq mode from disable_IO_APIC() and wrap into a new function restore_boot_irq_mode(). No functional change. Signed-off-by: Baoquan He --- arch/x86/include/asm/io_apic.h | 1 + arch/x86/kernel/apic/io_apic.c | 5 + 2 files

Re: [PATCH v3 2/5] x86/apic: Fix restoring boot irq mode in reboot and kexec/kdump

2018-02-13 Thread Baoquan He
On 02/13/18 at 11:44am, Eric W. Biederman wrote: > Baoquan He <b...@redhat.com> writes: > > > Hi Eric, > > > > On 02/11/18 at 09:08pm, Eric W. Biederman wrote: > >> Baoquan He <b...@redhat.com> writes: > >> > >> > This is a

Re: [PATCH v3 2/5] x86/apic: Fix restoring boot irq mode in reboot and kexec/kdump

2018-02-13 Thread Baoquan He
On 02/13/18 at 11:44am, Eric W. Biederman wrote: > Baoquan He writes: > > > Hi Eric, > > > > On 02/11/18 at 09:08pm, Eric W. Biederman wrote: > >> Baoquan He writes: > >> > >> > This is a regression fix. > >> > > >&

[PATCH v4 5/5] x86/apic: Set up through-local-APIC on boot CPU if 'noapic' specified

2018-02-13 Thread Baoquan He
ugh we fix the regression introduced by criminal commit 522e664644, for safety and clarity, better set up through-local-APIC explicitly, but not rely on the default boot irq mode. Do it now. Signed-off-by: Baoquan He <b...@redhat.com> --- arch/x86/kernel/apic/apic.c | 2 +- 1 file changed, 1 insertio

[PATCH v4 5/5] x86/apic: Set up through-local-APIC on boot CPU if 'noapic' specified

2018-02-13 Thread Baoquan He
ugh we fix the regression introduced by criminal commit 522e664644, for safety and clarity, better set up through-local-APIC explicitly, but not rely on the default boot irq mode. Do it now. Signed-off-by: Baoquan He --- arch/x86/kernel/apic/apic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH v4 1/5] x86/apic: Split out restore_boot_irq_mode from disable_IO_APIC

2018-02-13 Thread Baoquan He
This is a preparation patch. Split out the code which restores boot irq mode from disable_IO_APIC() and wrap into a new function restore_boot_irq_mode(). No functional change. Signed-off-by: Baoquan He <b...@redhat.com> --- arch/x86/include/asm/io_apic.h | 1 + arch/x86/kernel/apic/io_apic

[PATCH v4 1/5] x86/apic: Split out restore_boot_irq_mode from disable_IO_APIC

2018-02-13 Thread Baoquan He
This is a preparation patch. Split out the code which restores boot irq mode from disable_IO_APIC() and wrap into a new function restore_boot_irq_mode(). No functional change. Signed-off-by: Baoquan He --- arch/x86/include/asm/io_apic.h | 1 + arch/x86/kernel/apic/io_apic.c | 5 + 2 files

[PATCH v4 0/5] x86/apic: Fix restoring boot irq mode in reboot and kexec/kdump

2018-02-13 Thread Baoquan He
is not right. Correct it. Add Fixes tag and Cc to stable. v2->v3: Change as Eric suggested: Rerrange patches and change code and messy function/variable naming. Change patch subject and log to make it more understandable. Baoquan He (5): x86/apic: Split out restore_bo

[PATCH v4 2/5] x86/apic: Fix restoring boot irq mode in reboot and kexec/kdump

2018-02-13 Thread Baoquan He
ittle different then reboot and kexec/kdump. It doesn't call lapic_shutdown() before jump, so is not impacted by commit 522e66464467. Here in order to keep it the same as the old code, replace the old disable_IO_APIC() with clear_IO_APIC() and restore_boot_irq_mode(). Signed-off-by: Baoquan He <

<    4   5   6   7   8   9   10   11   12   13   >