Bug#853170: fails to boot on debian's MP30-AR1 systems [regression]

2017-01-30 Thread Peter Palfrader
Package: linux-image-4.9.0-1-arm64
Version: 4.9.6-3
Severity: grave
User: debian-ad...@lists.debian.org
Usertags: needed-by-DSA-Team

The 4.9.6-3 kernel package fails to boot on Debian's aagaard and acker
systems.  4.9.2-2 before that booted just fine.

This is from the serial:

[..]
] Updating memory slots
] Searching for slot 1 structure
] Loading Linux 4.9.0-1-arm64 ...
] Loading initial ramdisk ...
] Loading driver at 0x08079224000 EntryPoint=0x08079B28670
] EFI stub: Booting Linux Kernel...
] ConvertPages: Incompatible memory types
] EFI stub: EFI_RNG_PROTOCOL unavailable, no randomness supplied
] EFI stub: Using DTB from configuration table
] EFI stub: Exiting boot services and installing virtual address map...
] OSBootEvent = Success
] L3c Cache: 8MB
] 
] 
] Synchronous Exception at 0x00807954A740
] 
]   X0 0x9FE059D0   X1 0x008079BC369D   X2 0x0010   X3 
0x6D6D2D696665752C
]   X4 0x0065   X5 0x   X6 0x8000   X7 
0x73716073722C6F60
]   X8 0x0005   X9 0x0008  X10 0xFFFD  X11 
0x
]  X12 0x0002  X13 0x9FE0  X14 0xEE030400  X15 
0xFFF1
]  X16 0x000FFFE366D0  X17 0x0004  X18 0x  X19 
0x539C
]  X20 0x9FE053D4  X21 0x9FE0  X22 0x0015  X23 
0x000FFFE364BC
]  X24 0x9FE059C3  X25 0x008079BC3698  X26 0x00807FF9  X27 
0x
]  X28 0x5350   FP 0x000FFFE36410   LR 0x008079B2F0C4  
] 
]   V0 0x931FB7DE0AF5E032 B5FDFBBDDEFBF6F6   V1 0xDFF9BFCDD5A9DC14 
FCCD1F828E36EFAB
]   V2 0x9595DCB5BF2ADA46 FFDE4B719BD36EC5   V3 0xE7FCDF7AE399BBFF 
D5FFCF7729F963DE
]   V4 0x73BE4F7E3F33F753 DF77DEF7BBE1F987   V5 0x2357FFFEA5798E68 
FDCEDECEF3C7CB91
]   V6 0xF7D6DFFA3237ABBE 9F3FDFEFEFB22FCC   V7 0xA4FD7B2FFF865F7F 
EFDF6DB9EADB7BA6
]   V8 0x    V9 0x 
0003
]  V10 0x D7EACFFFEB7D6F7F  V11 0x 
DDD9CF78D6C07BAA
]  V12 0x DBB1DEEDFBFB2B38  V13 0x 
7FF8BBFEF5F7EFFF
]  V14 0x D7BE6674E7FF  V15 0x 

]  V16 0x53FFDA68FF1BDF17 55DDDFFBFB736BE7  V17 0x912EC77BF436FB27 
BBF87C9F6F9DDF57
]  V18 0xF338DE75A9F7FB77 CD18137BFFE7FBA7  V19 0x7F35FBF2CE83FABA 
F9F8C7D5DB91DDE6
]  V20 0x080080022000 6008484020882008  V21 0x009000500800800A 
201240100402
]  V22 0x014200A02404 000A025062004100  V23 0x01004000 
50501808
]  V24 0x0500D8400201 014208042000  V25 0xC420D4208000 
402000188000
]  V26 0x00089240A0200041 12A00020  V27 0x020C48010001000A 
043800128000
]  V28 0xC000C2D4C018 00028A005180  V29 0x104022036000 
54204050082D0C08
]  V30 0x84300804 0040801080004048  V31 0x424202010206 
0504421020242840
] 
]   SP 0x000FFFE36410  ELR 0x00807954A740  SPSR 0x0309  FPSR 
0x288A
]  ESR 0x9621  FAR 0x008079BC369D
] 
]  ESR : EC 0x25  IL 0x1  ISS 0x0021
] 
] Data abort: Alignment fault
] 
] 
] Synchronous Exception at 0x00807954A740
] 
]   X0 0x9FE059D0   X1 0x008079BC369D   X2 0x0010   X3 
0x6D6D2D696665752C
]   X4 0x0065   X5 0x   X6 0x8000   X7 
0x73716073722C6F60
]   X8 0x0005   X9 0x0008  X10 0xFFFD  X11 
0x
]  X12 0x0002  X13 0x9FE0  X14 0xEE030400  X15 
0xFFF1
]  X16 0x000FFFE366D0  X17 0x0004  X18 0x  X19 
0x539C
]  X20 0x9FE053D4  X21 0x9FE0  X22 0x0015  X23 
0x000FFFE364BC
]  X24 0x9FE059C3  X25 0x008079BC3698  X26D1F828E36EFAB
]   V2 0x9595DCB5BF2ADA46 FFDE4B719BD36EC5   V3 0xE7FCDF7AE399BBFF 
D5FFCF7729F963DE
]   V4 0x73BE4F7E3F33F753 DF77DEF7BBE1F987   V5 0x2357FFFEA5798E68 
FDCEDECEF3C7CB91
]   V6 0xF7D6DFFA3237ABBE 9F3FDFEFEFB22FCC   V7 0xA4FD7B2FFF865F7F 
EFDF6DB9EADB7BA6
]   V8 0x    V9 0x 
0003
]  V10 0x D7EACFFFEB7D6F7F  V11 0x 
DDD9CF78D6C07BAA
]  V12 0x DBB1DEEDFBFB2B38  V13 0x 
7FF8BBFEF5F7EFFF
]  V14 0x D7BE6674E7FF  V15 0x 

]  V16 0x53FFDA68FF1BDF17 55DDDFFBFB736BE7  V17 0x912EC77BF436FB27 
BBF87C9F6F9DDF57
]  V18 0xF338DE75A9F7FB77 CD18137BFFE7FBA7  V19 0x7F35FBF2CE83FABA 
F9F8C7D5DB91DDE6
]  V20 0x080080022000 6008484020882008  V21 0x009000500800800A 
201240100402
]  V22 0x014200A02404 000A025062004100  V23 0x01004000 
50501808
]  V24 0x0500D8400201 014208042000  V25 0xC420D4208000 
402000188000
]  V26 0x00089240A0200041 12A00020  V27 0x020C48010001000A 
043800128000
]  

Bug#853170: fails to boot on debian's MP30-AR1 systems [regression]

2017-01-30 Thread Peter Palfrader
As requested, boot log of working kernel:

[...]
] *** SmbiosDynamicUpdate Entry ***
] ***  SMBIOS - AddUpdateType13  ***
] ***  SMBIOS - WriteStructureByHandle  ***
] *** SMBIOS - UpdateSmbiosTableHeader  ***
] ***  SMBIOS 3.0 - TableAddress = 00807d93d000  ***
] :::  SMBIOS - Exit UpdateEPSHeader_3  :::
] :::  SMBIOS - Exit UpdateSmbiosTableHeader  :::
] :::  SMBIOS - Exit WriteStructureByHandle  :::
] :::  SMBIOS - Exit AddUpdateType13  :::
] *** Before DynamicUpdateStructures (SMBIOS_DYNAMIC_UPDATE_POLICY = 0) ***
] ***  SMBIOS - DynamicUpdateStructures  ***
] ***  SMBIOS - DynamicUpdateSlotsData  ***
] :::  SMBIOS - Exit DynamicUpdateSlotsData  :::
] ***  SMBIOS - DynamicUpdateOnboardDevData  ***
] :::  SMBIOS - Exit DynamicUpdateOnboardDevData  :::
] ***  SMBIOS - DynamicUpdateMemoryData  ***
] Updating memory slots
] Searching for slot 1 structure
] Loading Linux 4.9.0-1-arm64 ...
] Loading initial ramdisk ...
] Loading driver at 0x08078ABC000 EntryPoint=0x08079380630
] EFI stub: Booting Linux Kernel...
] ConvertPages: Incompatible memory types
] EFI stub: EFI_RNG_PROTOCOL unavailable, no randomness supplied
] EFI stub: Using DTB from configuration table
] EFI stub: Exiting boot services and installing virtual address map...
] OSBootEvent = Success
] L3c Cache: 8MB
] [0.00] Booting Linux on physical CPU 0x0
] [0.00] Linux version 4.9.0-1-arm64 (debian-kernel@lists.debian.org) 
(gcc version 6.3.0 20161229 (Debian 6.3.0-2) ) #1 SMP Debian 4.9.2-2 
(2017-01-12)
] [0.00] Boot CPU: AArch64 Processor [500f0001]
] [0.00] efi: Getting EFI parameters from FDT:
] [0.00] efi: EFI v2.40 by American Megatrends
] [0.00] efi:  ACPI 2.0=0x807ff43000  ESRT=0x807e161e18  SMBIOS 
3.0=0x807e161c18 
] [0.00] esrt: Reserving ESRT space from 0x00807e161e18 to 
0x00807e161e50.
] [0.00] percpu: Embedded 22 pages/cpu @807fffe93000 s50200 r8192 
d31720 u90112
] [0.00] Detected PIPT I-cache on CPU0
] [0.00] Built 1 zonelists in Zone order, mobility grouping on.  Total 
pages: 16515072
] [0.00] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.9.0-1-arm64 
root=UUID=2cf290a8-9f94-42fd-a141-86c7e96dae7f ro console=ttyS0,115200 earlycon
] [0.00] PID hash table entries: 4096 (order: 3, 32768 bytes)
] [0.00] Dentry cache hash table entries: 8388608 (order: 14, 67108864 
bytes)
] [0.00] Inode-cache hash table entries: 4194304 (order: 13, 33554432 
bytes)
] [0.00] software IO TLB [mem 0xfbfec000-0xfffec000] (64MB) mapped at 
[80007bfec000-80007ffebfff]
] [0.00] Memory: 65832944K/67108864K available (6780K kernel code, 
1020K rwdata, 2164K rodata, 3264K init, 634K bss, 1275920K reserved, 0K 
cma-reserved)
] [0.00] Virtual kernel memory layout:
] [0.00] modules : 0x - 0x0800   (   
128 MB)
] [0.00] vmalloc : 0x0800 - 0x7dffbfff   
(129022 GB)
] [0.00]   .text : 0x0808 - 0x0872   (  
6784 KB)
] [0.00] .rodata : 0x0872 - 0x0894   (  
2176 KB)
] [0.00]   .init : 0x0894 - 0x08c7   (  
3264 KB)
] [0.00]   .data : 0x08c7 - 0x08d6f200   (  
1021 KB)
] [0.00].bss : 0x08d6f200 - 0x08e0dbb4   (   
635 KB)
] [0.00] fixed   : 0x7dfffe7fd000 - 0x7dfffec0   (  
4108 KB)
] [0.00] PCI I/O : 0x7dfffee0 - 0x7de0   (
16 MB)
] [0.00] vmemmap : 0x7e00 - 0x8000   (  
2048 GB maximum)
] [0.00]   0x7e00 - 0x7e02   (  
8192 MB actual)
] [0.00] memory  : 0x8000 - 0x8080   
(524288 MB)
] [0.00] Hierarchical RCU implementation.
] [0.00]  Build-time adjustment of leaf fanout to 64.
] [0.00]  RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=8.
] [0.00] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=8
] [0.00] NR_IRQS:64 nr_irqs:64 0
] [0.00] GIC: Adjusting CPU interface base to 0x780af000
] [0.00] GIC: Using split EOI/Deactivate mode
] [0.00] GIC: PPI0 is secure or misconfigured
] [0.00] GIC: PPI13 is secure or misconfigured
] [0.00] arm_arch_timer: WARNING: Invalid trigger for IRQ2, assuming 
level low
] [0.00] arm_arch_timer: WARNING: Please fix your firmware
] [0.00] arm_arch_timer: WARNING: Invalid trigger for IRQ3, assuming 
level low
] [0.00] arm_arch_timer: WARNING: Please fix your firmware
] [0.00] arm_arch_timer: Architected cp15 timer(s) running at 50.00MHz 
(phys).
] [0.00] clocksource: arch_sys_counter: mask: 0xff 
max_cycles: 0xb8812736b, max_idle_ns: 440795202655 ns
] [0.02] sched_clock: 56 bits at 50MHz, resolution 20ns,

Bug#853170: fails to boot on debian's MP30-AR1 systems [regression]

2017-01-31 Thread Riku Voipio
Quick test with 
4.9.2-2 with new arm64 kernel config: boots
4.9.6-3 work old arm64 kernel config: booms

This hints that numerous kernel config changes we did are probably
not the reason, but some of the kernel changes between 4.9.2 and 4.9.6.

Especially between 4.9.5 and 4.9.6 a bulk of arm64 changes went in. So
next logical step is try with 4.9.5 - if that fails, there is only a 
few potential commits for breakage between 4.9.2 - 4.9.5 - and if succeeds
we have a more tedious way to go.

Riku



Bug#853170: fails to boot on debian's MP30-AR1 systems [regression]

2017-02-01 Thread Riku Voipio
On Tue, Jan 31, 2017 at 02:30:10PM +, Riku Voipio wrote:
> This hints that numerous kernel config changes we did are probably
> not the reason, but some of the kernel changes between 4.9.2 and 4.9.6.

The offending commit is:

http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?h=linux-4.9.y&id=74ce3fd64bc44f89856ff57bf684882dc098f93b

Upstream fix proposal:

http://lists.infradead.org/pipermail/linux-arm-kernel/2017-February/484924.html

Attached is patch verified fixing booting by simply reverting the change.

Riku
>From 23d82932b1b129b30ea2322c7ed3bffa5cb1a9ba Mon Sep 17 00:00:00 2001
From: Riku Voipio 
Date: Wed, 1 Feb 2017 14:39:59 +0200
Subject: [PATCH] [arm64] Revert efistub changes, Closes: #853170

---
 ...libstub-arm-pass-latest-memory-map-to-the.patch | 200 +
 debian/patches/series  |   1 +
 3 files changed, 206 insertions(+), 2 deletions(-)
 create mode 100644 debian/patches/bugfix/arm64/efi-libstub-arm-pass-latest-memory-map-to-the.patch

diff --git a/debian/patches/bugfix/arm64/efi-libstub-arm-pass-latest-memory-map-to-the.patch b/debian/patches/bugfix/arm64/efi-libstub-arm-pass-latest-memory-map-to-the.patch
new file mode 100644
index 0..07f161d9e
--- /dev/null
+++ b/debian/patches/bugfix/arm64/efi-libstub-arm-pass-latest-memory-map-to-the.patch
@@ -0,0 +1,200 @@
+From 1816e2e5003836a142056957f7a813d846eba992 Mon Sep 17 00:00:00 2001
+From: Riku Voipio 
+Date: Wed, 1 Feb 2017 13:37:49 +0200
+Subject: [PATCH] Revert "efi/libstub/arm*: Pass latest memory map to the
+ kernel"
+
+This reverts commit 74ce3fd64bc44f89856ff57bf684882dc098f93b.
+---
+ drivers/firmware/efi/libstub/efistub.h |  8 
+ drivers/firmware/efi/libstub/fdt.c | 87 --
+ 2 files changed, 39 insertions(+), 56 deletions(-)
+
+diff --git a/drivers/firmware/efi/libstub/efistub.h b/drivers/firmware/efi/libstub/efistub.h
+index fac67992bede..ee49cd23ee63 100644
+--- a/drivers/firmware/efi/libstub/efistub.h
 b/drivers/firmware/efi/libstub/efistub.h
+@@ -30,6 +30,14 @@ efi_status_t efi_file_close(void *handle);
+ 
+ unsigned long get_dram_base(efi_system_table_t *sys_table_arg);
+ 
++efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt,
++			unsigned long orig_fdt_size,
++			void *fdt, int new_fdt_size, char *cmdline_ptr,
++			u64 initrd_addr, u64 initrd_size,
++			efi_memory_desc_t *memory_map,
++			unsigned long map_size, unsigned long desc_size,
++			u32 desc_ver);
++
+ efi_status_t allocate_new_fdt_and_exit_boot(efi_system_table_t *sys_table,
+ 	void *handle,
+ 	unsigned long *new_fdt_addr,
+diff --git a/drivers/firmware/efi/libstub/fdt.c b/drivers/firmware/efi/libstub/fdt.c
+index 921dfa047202..a6a93116a8f0 100644
+--- a/drivers/firmware/efi/libstub/fdt.c
 b/drivers/firmware/efi/libstub/fdt.c
+@@ -16,10 +16,13 @@
+ 
+ #include "efistub.h"
+ 
+-static efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt,
+-			   unsigned long orig_fdt_size,
+-			   void *fdt, int new_fdt_size, char *cmdline_ptr,
+-			   u64 initrd_addr, u64 initrd_size)
++efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt,
++			unsigned long orig_fdt_size,
++			void *fdt, int new_fdt_size, char *cmdline_ptr,
++			u64 initrd_addr, u64 initrd_size,
++			efi_memory_desc_t *memory_map,
++			unsigned long map_size, unsigned long desc_size,
++			u32 desc_ver)
+ {
+ 	int node, num_rsv;
+ 	int status;
+@@ -98,23 +101,25 @@ static efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt,
+ 	if (status)
+ 		goto fdt_set_fail;
+ 
+-	fdt_val64 = U64_MAX; /* placeholder */
++	fdt_val64 = cpu_to_fdt64((u64)(unsigned long)memory_map);
+ 	status = fdt_setprop(fdt, node, "linux,uefi-mmap-start",
+ 			 &fdt_val64,  sizeof(fdt_val64));
+ 	if (status)
+ 		goto fdt_set_fail;
+ 
+-	fdt_val32 = U32_MAX; /* placeholder */
++	fdt_val32 = cpu_to_fdt32(map_size);
+ 	status = fdt_setprop(fdt, node, "linux,uefi-mmap-size",
+ 			 &fdt_val32,  sizeof(fdt_val32));
+ 	if (status)
+ 		goto fdt_set_fail;
+ 
++	fdt_val32 = cpu_to_fdt32(desc_size);
+ 	status = fdt_setprop(fdt, node, "linux,uefi-mmap-desc-size",
+ 			 &fdt_val32, sizeof(fdt_val32));
+ 	if (status)
+ 		goto fdt_set_fail;
+ 
++	fdt_val32 = cpu_to_fdt32(desc_ver);
+ 	status = fdt_setprop(fdt, node, "linux,uefi-mmap-desc-ver",
+ 			 &fdt_val32, sizeof(fdt_val32));
+ 	if (status)
+@@ -143,43 +148,6 @@ static efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt,
+ 	return EFI_LOAD_ERROR;
+ }
+ 
+-static efi_status_t update_fdt_memmap(void *fdt, struct efi_boot_memmap *map)
+-{
+-	int node = fdt_path_offset(fdt, "/chosen");
+-	u64 fdt_val64;
+-	u32 fdt_val32;
+-	int err;
+-
+-	if (node < 0)
+-		return EFI_LOAD_ERROR;
+-
+-	fdt_val64 = cpu_to_fdt64((unsigned long)*map->map);
+-	err = fdt_setprop_inplace(fdt, node, "linux,uefi-mmap-start",
+-  &fdt_val64, sizeof(fdt_val64));
+-	if (err)