Re: [PATCH v4 1/2] x86/setup: always add the beginning of RAM as memblock.memory

2021-02-01 Thread Mike Rapoport
On Mon, Feb 01, 2021 at 03:32:33PM +0100, David Hildenbrand wrote: > On 01.02.21 15:30, Mike Rapoport wrote: > > > > > > I'd suggest going through all zone ranges in free_area_init() first, > > > dealing > > > with zones that have "not section aligned start/end", clamping them > > > up/down > >

Re: [PATCH v4 1/2] x86/setup: always add the beginning of RAM as memblock.memory

2021-02-01 Thread Baoquan He
On 02/01/21 at 04:34pm, Mike Rapoport wrote: > On Mon, Feb 01, 2021 at 07:26:05PM +0800, Baoquan He wrote: > > On 02/01/21 at 10:32am, David Hildenbrand wrote: > > > > > > 2) In init_zone_unavailable_mem(), similar to round_up(max_pfn, > > > PAGES_PER_SECTION) handling, consider range > > > [rou

Re: [PATCH v4 1/2] x86/setup: always add the beginning of RAM as memblock.memory

2021-02-01 Thread Mike Rapoport
On Mon, Feb 01, 2021 at 07:26:05PM +0800, Baoquan He wrote: > On 02/01/21 at 10:32am, David Hildenbrand wrote: > > > > 2) In init_zone_unavailable_mem(), similar to round_up(max_pfn, > > PAGES_PER_SECTION) handling, consider range > > [round_down(min_pfn, PAGES_PER_SECTION), min_pfn - 1] > > w

Re: [PATCH v4 1/2] x86/setup: always add the beginning of RAM as memblock.memory

2021-02-01 Thread David Hildenbrand
On 01.02.21 15:30, Mike Rapoport wrote: On Mon, Feb 01, 2021 at 10:32:44AM +0100, David Hildenbrand wrote: On 30.01.21 23:10, Mike Rapoport wrote: From: Mike Rapoport The physical memory on an x86 system starts at address 0, but this is not always reflected in e820 map. For example, the BIOS

Re: [PATCH v4 1/2] x86/setup: always add the beginning of RAM as memblock.memory

2021-02-01 Thread Mike Rapoport
On Mon, Feb 01, 2021 at 10:32:44AM +0100, David Hildenbrand wrote: > On 30.01.21 23:10, Mike Rapoport wrote: > > From: Mike Rapoport > > > > The physical memory on an x86 system starts at address 0, but this is not > > always reflected in e820 map. For example, the BIOS can have e820 entries > >

Re: [PATCH v4 1/2] x86/setup: always add the beginning of RAM as memblock.memory

2021-02-01 Thread Mike Rapoport
On Sun, Jan 31, 2021 at 01:49:27PM -0800, Linus Torvalds wrote: > On Sun, Jan 31, 2021 at 12:04 AM Mike Rapoport wrote: > > > > > > > > That's *particularly* true when the very line above it did a > > > "memblock_reserve()" of the exact same range that the memblock_add() > > > "adds". > > > > The

Re: [PATCH v4 1/2] x86/setup: always add the beginning of RAM as memblock.memory

2021-02-01 Thread Baoquan He
On 02/01/21 at 10:32am, David Hildenbrand wrote: > On 30.01.21 23:10, Mike Rapoport wrote: > > From: Mike Rapoport > > > > The physical memory on an x86 system starts at address 0, but this is not > > always reflected in e820 map. For example, the BIOS can have e820 entries > > like > > > > [

Re: [PATCH v4 1/2] x86/setup: always add the beginning of RAM as memblock.memory

2021-02-01 Thread David Hildenbrand
On 30.01.21 23:10, Mike Rapoport wrote: From: Mike Rapoport The physical memory on an x86 system starts at address 0, but this is not always reflected in e820 map. For example, the BIOS can have e820 entries like [0.00] BIOS-provided physical RAM map: [0.00] BIOS-e820: [mem 0x0

Re: [PATCH v4 1/2] x86/setup: always add the beginning of RAM as memblock.memory

2021-01-31 Thread Linus Torvalds
On Sun, Jan 31, 2021 at 12:04 AM Mike Rapoport wrote: > > > > > That's *particularly* true when the very line above it did a > > "memblock_reserve()" of the exact same range that the memblock_add() > > "adds". > > The most correct thing to do would have been to > > memblock_add(0, end_of_f

Re: [PATCH v4 1/2] x86/setup: always add the beginning of RAM as memblock.memory

2021-01-31 Thread Mike Rapoport
On Sat, Jan 30, 2021 at 04:37:54PM -0800, Linus Torvalds wrote: > On Sat, Jan 30, 2021 at 2:10 PM Mike Rapoport wrote: > > > > In either case, e820__memblock_setup() won't add the range 0x - 0x1000 > > to memblock.memory and later during memory map initialization this range is > > left outside

Re: [PATCH v4 1/2] x86/setup: always add the beginning of RAM as memblock.memory

2021-01-30 Thread Linus Torvalds
On Sat, Jan 30, 2021 at 2:10 PM Mike Rapoport wrote: > > In either case, e820__memblock_setup() won't add the range 0x - 0x1000 > to memblock.memory and later during memory map initialization this range is > left outside any zone. Honestly, this just sounds like memblock being stupid in the f