Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1633720

Re: [PATCH v2] x86/mm: Fix incorrect for loop count calculation in sync_global_pgds

From Dan Williams <dan.j.williams@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2] x86/mm: Fix incorrect for loop count calculation in sync_global_pgds
Date 2017-05-01 18:10 +0200
Message-ID <tCm3D-2R0-3@gated-at.bofh.it> (permalink)
References <tClTY-2yI-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, May 1, 2017 at 8:55 AM, Baoquan He <bhe@redhat.com> wrote:
> Jeff Moyer reported that on his system with two memory regions 0~64G and
> 1T~1T+192G, and kernel option "memmap=192G!1024G" added, enabling kaslr
> will make system hang intermittently during boot. While adding 'nokaslr'
> won't.
>
> This is because the for loop count calculation in sync_global_pgds is
> not correct. When a mapping area crosses pgd entries, we should
> calculate the starting address of region which next pgd covers and assign
> it to next for loop count, but not add PGDIR_SIZE directly. The old
> code works right only if the mapping area is times of PGDIR_SIZE,
> otherwize the end region could be skipped so that it can't be synchronized
> to all other processes from kernel pgd init_mm.pgd.
>
> In Jeff's system, emulated pmem area [1024G, 1216G) is smaller than
> PGDIR_SIZE. While 'nokaslr' works because PAGE_OFFSET is 1T aligned, it
> makes this area be mapped inside one pgd entry. With kaslr enabled,
> this area could cross two pgd entries, then the next pgd entry won't
> be synced to all other processes. That is why we saw empty PGD.
>
> Fix it in this patch.
>
[..]
>
> Reported-by: Jeff Moyer <jmoyer@redhat.com>
> Signed-off-by: Baoquan He <bhe@redhat.com>
[..]

Reviewed-by: Dan Williams <dan.j.williams@intel.com>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2] x86/mm: Fix incorrect for loop count calculation in sync_global_pgds Baoquan He <bhe@redhat.com> - 2017-05-01 18:00 +0200
  Re: [PATCH v2] x86/mm: Fix incorrect for loop count calculation in sync_global_pgds Dan Williams <dan.j.williams@intel.com> - 2017-05-01 18:10 +0200
  Re: [PATCH v2] x86/mm: Fix incorrect for loop count calculation in  sync_global_pgds Ingo Molnar <mingo@kernel.org> - 2017-05-01 21:40 +0200
    Re: [PATCH v2] x86/mm: Fix incorrect for loop count calculation in sync_global_pgds Yinghai Lu <yinghai@kernel.org> - 2017-05-02 00:10 +0200

csiph-web