Re: CONFIG_DEBUG_VIRTUAL breaks boot on x86-32

2019-03-27 Thread William Kucharski


The dmesg output you posted confirms that max_low_pfn is indeed 0x373fe, and it 
appears
that the value of phys_mem being checked mat be 0x3f401ff1, which translates to 
pfn 0x3f401,
at least if what's still in registers can be believed.

Since that is indeed greater than max_low_pfn, VIRTUAL_BUG_ON triggers:

VIRTUAL_BUG_ON((phys_addr >> PAGE_SHIFT) > max_low_pfn);

Looking at the call stack of

copy_strings_0x220
__check_object_size+0xef

that looks to translate to this sequence:

copy_from_user(kaddr+offset, str, bytes_to_copy)
check_copy_size(kaddr+offset, bytes_to_copy, FALSE)
check_object_size(kaddr+offset, bytes_to_copy, FALSE)
__check_object_size(kaddr+offset, bytes_to_copy, FALSE)
check_heap_object(kaddr+offset, bytes_to_copy, FALSE)
virt_to_head_page(kaddr+offset)
virt_to_page(kaddr+offset)
pfn_to_page(kaddr+offset)
__pa(kaddr+offset)
__phys_addr(kaddr+offset)

so it appears the address is "too high" for low memory at that point.









Re: CONFIG_DEBUG_VIRTUAL breaks boot on x86-32

2019-03-27 Thread Meelis Roos

You might be hitting a bug I found.
Try applying this patch:
https://marc.info/?l=linux-kernel=155355953012985=2


Unfortunately it did not change anything.

--
Meelis Roos 


Re: CONFIG_DEBUG_VIRTUAL breaks boot on x86-32

2019-03-26 Thread Ralph Campbell




On 3/26/19 6:52 AM, William Kucharski wrote:

Does this still happen on 5.1-rc2?

Do you have idea as to what max_low_pfn() gets set to on your system at boot 
time?

 From the screen shot I'm guessing it MIGHT be 0x373fe, but it's hard to know 
for sure.



On Mar 21, 2019, at 2:22 PM, Meelis Roos  wrote:

I tried to debug another problem and turned on most debug options for memory.
The resulting kernel failed to boot.

Bisecting the configurations led to CONFIG_DEBUG_VIRTUAL - if I turned it on
in addition to some other debug options, the machine crashed with

kernel BUG at arch/x86/mm/physaddr.c:79!

Screenshot at http://kodu.ut.ee/~mroos/debug_virtual-boot-hang-1.jpg

The machine was Athlon XP with VIA KT600 chipset and 2G RAM.

--
Meelis Roos 





You might be hitting a bug I found.
Try applying this patch:
https://marc.info/?l=linux-kernel=155355953012985=2


Re: CONFIG_DEBUG_VIRTUAL breaks boot on x86-32

2019-03-26 Thread Meelis Roos

Does this still happen on 5.1-rc2?


Yes. 4.20 and 5.0 and anything after that up to 5.1-rc2.


Do you have idea as to what max_low_pfn() gets set to on your system at boot 
time?

 From the screen shot I'm guessing it MIGHT be 0x373fe, but it's hard to know 
for sure.



From dmesg of 5.1-rc2 without the problematic config option:

[0.007076] 1163MB HIGHMEM available.
[0.007081] 883MB LOWMEM available.
[0.007083]   mapped low ram: 0 - 373fe000
[0.007084]   low ram: 0 - 373fe000
[0.007087] BRK [0x17c7d000, 0x17c7dfff] PGTABLE
[0.008172] Zone ranges:
[0.008176]   DMA  [mem 0x1000-0x00ff]
[0.008181]   Normal   [mem 0x0100-0x373fdfff]
[0.008183]   HighMem  [mem 0x373fe000-0x7ffe]
[0.008186] Movable zone start for each node
[0.008188] Early memory node ranges
[0.008190]   node   0: [mem 0x1000-0x0009efff]
[0.008192]   node   0: [mem 0x0010-0x7ffe]


Full dmesg:

[0.00] Linux version 5.1.0-rc2 (mroos@kt600) (gcc version 8.3.0 (Debian 
8.3.0-3)) #15 Mon Mar 25 14:06:22 EET 2019
[0.00] x86/fpu: x87 FPU will use FXSAVE
[0.00] BIOS-provided physical RAM map:
[0.00] BIOS-e820: [mem 0x-0x0009fbff] usable
[0.00] BIOS-e820: [mem 0x0009fc00-0x0009] reserved
[0.00] BIOS-e820: [mem 0x000ce000-0x000d3fff] reserved
[0.00] BIOS-e820: [mem 0x000f-0x000f] reserved
[0.00] BIOS-e820: [mem 0x0010-0x7ffe] usable
[0.00] BIOS-e820: [mem 0x7fff-0x7fff7fff] ACPI data
[0.00] BIOS-e820: [mem 0x7fff8000-0x7fff] ACPI NVS
[0.00] BIOS-e820: [mem 0xfec0-0xfec00fff] reserved
[0.00] BIOS-e820: [mem 0xfee0-0xfee00fff] reserved
[0.00] BIOS-e820: [mem 0xfff8-0x] reserved
[0.00] Notice: NX (Execute Disable) protection missing in CPU!
[0.00] Legacy DMI 2.3 present.
[0.00] DMI:  K7VT6-C /K7VT6-C , BIOS P1.50 06/15/2006
[0.00] tsc: Fast TSC calibration using PIT
[0.00] tsc: Detected 1798.230 MHz processor
[0.006130] e820: update [mem 0x-0x0fff] usable ==> reserved
[0.006134] e820: remove [mem 0x000a-0x000f] usable
[0.006144] last_pfn = 0x7fff0 max_arch_pfn = 0x10
[0.006153] MTRR default type: uncachable
[0.006154] MTRR fixed ranges enabled:
[0.006156]   0-9 write-back
[0.006158]   A-B uncachable
[0.006159]   C-C7FFF write-protect
[0.006160]   C8000-E uncachable
[0.006162]   F-F write-protect
[0.006163] MTRR variable ranges enabled:
[0.006166]   0 base 0 mask F8000 write-back
[0.006166]   1 disabled
[0.006167]   2 disabled
[0.006168]   3 disabled
[0.006168]   4 disabled
[0.006170]   5 base 0E000 mask FF000 write-combining
[0.006171]   6 disabled
[0.006171]   7 disabled
[0.006526] x86/PAT: Configuration [0-7]: WB  WC  UC- UC  WB  WP  UC- WT
[0.006886] check: Scanning 1 areas for low memory corruption
[0.006895] initial memory mapped: [mem 0x-0x17ff]
[0.006903] Base memory trampoline at [(ptrval)] 9b000 size 16384
[0.006952] BRK [0x17c7c000, 0x17c7cfff] PGTABLE
[0.006986] ACPI: Early table checksum verification disabled
[0.007003] ACPI: RSDP 0x000FA920 14 (v00 AMI   )
[0.007011] ACPI: RSDT 0x7FFF 2C (v01 AMIINT VIA_K7   
0010 MSFT 0097)
[0.007024] ACPI: FACP 0x7FFF0030 81 (v01 AMIINT VIA_K7   
0011 MSFT 0097)
[0.007041] ACPI: DSDT 0x7FFF0120 00324C (v01 VIAK7VT4
1000 INTL 02002024)
[0.007047] ACPI: FACS 0x7FFF8000 40
[0.007052] ACPI: APIC 0x7FFF00C0 54 (v01 AMIINT VIA_K7   
0009 MSFT 0097)
[0.007069] ACPI: Local APIC address 0xfee0
[0.007076] 1163MB HIGHMEM available.
[0.007081] 883MB LOWMEM available.
[0.007083]   mapped low ram: 0 - 373fe000
[0.007084]   low ram: 0 - 373fe000
[0.007087] BRK [0x17c7d000, 0x17c7dfff] PGTABLE
[0.008172] Zone ranges:
[0.008176]   DMA  [mem 0x1000-0x00ff]
[0.008181]   Normal   [mem 0x0100-0x373fdfff]
[0.008183]   HighMem  [mem 0x373fe000-0x7ffe]
[0.008186] Movable zone start for each node
[0.008188] Early memory node ranges
[0.008190]   node   0: [mem 0x1000-0x0009efff]
[0.008192]   node   0: [mem 0x0010-0x7ffe]
[0.008205] Zeroed struct page in unavailable ranges: 98 pages
[0.008208] Initmem setup node 0 [mem 0x1000-0x7ffe]
[0.008214] On node 0 totalpages: 524174
[0.008217]   DMA zone: 

Re: CONFIG_DEBUG_VIRTUAL breaks boot on x86-32

2019-03-26 Thread William Kucharski
Does this still happen on 5.1-rc2?

Do you have idea as to what max_low_pfn() gets set to on your system at boot 
time?

From the screen shot I'm guessing it MIGHT be 0x373fe, but it's hard to know 
for sure.


> On Mar 21, 2019, at 2:22 PM, Meelis Roos  wrote:
> 
> I tried to debug another problem and turned on most debug options for memory.
> The resulting kernel failed to boot.
> 
> Bisecting the configurations led to CONFIG_DEBUG_VIRTUAL - if I turned it on
> in addition to some other debug options, the machine crashed with
> 
> kernel BUG at arch/x86/mm/physaddr.c:79!
> 
> Screenshot at http://kodu.ut.ee/~mroos/debug_virtual-boot-hang-1.jpg
> 
> The machine was Athlon XP with VIA KT600 chipset and 2G RAM.
> 
> -- 
> Meelis Roos 
> 



CONFIG_DEBUG_VIRTUAL breaks boot on x86-32

2019-03-21 Thread Meelis Roos

I tried to debug another problem and turned on most debug options for memory.
The resulting kernel failed to boot.

Bisecting the configurations led to CONFIG_DEBUG_VIRTUAL - if I turned it on
in addition to some other debug options, the machine crashed with

kernel BUG at arch/x86/mm/physaddr.c:79!

Screenshot at http://kodu.ut.ee/~mroos/debug_virtual-boot-hang-1.jpg

The machine was Athlon XP with VIA KT600 chipset and 2G RAM.

--
Meelis Roos