Re: [Xen-devel] [PATCH for-4.9 4/4] xen/arm: Properly map the FDT in the boot page table
Hi Stefano, On 19/04/17 22:56, Stefano Stabellini wrote: On Wed, 19 Apr 2017, Julien Grall wrote: On 19/04/2017 22:01, Stefano Stabellini wrote: On Wed, 19 Apr 2017, Julien Grall wrote: @@ -113,12 +113,12 @@ #define FIXMAP_ADDR(n)(_AT(vaddr_t,0x0040) + (n) * PAGE_SIZE) #define BOOT_FDT_VIRT_START_AT(vaddr_t,0x0060) -#define BOOT_FDT_SLOT_SIZE MB(2) +#define BOOT_FDT_SLOT_SIZE MB(4) #define BOOT_FDT_VIRT_END (BOOT_FDT_VIRT_START + BOOT_FDT_SLOT_SIZE) -#define BOOT_RELOC_VIRT_START _AT(vaddr_t,0x0080) +#define BOOT_RELOC_VIRT_START _AT(vaddr_t,0x00a0) Wouldn't it be better to define it as BOOT_FDT_VIRT_END? It is kind of not really related to this patch and how we handle all the region in config.h today. So if we define in term of *_END this one, then we need to do it for everyone. Fair enough I will prepare a patch for that and send it later on. Cheers, -- Julien Grall ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH for-4.9 4/4] xen/arm: Properly map the FDT in the boot page table
On Wed, 19 Apr 2017, Julien Grall wrote: > Hi Stefano, > > On 19/04/2017 22:01, Stefano Stabellini wrote: > > On Wed, 19 Apr 2017, Julien Grall wrote: > > > Currently, Xen is assuming the FDT will always fit in a 2MB section. > > > Recently, I noticed an early crash on Xen when using GRUB with the > > > following call trace: > > > > > > (XEN) Hypervisor Trap. HSR=0x9606 EC=0x25 IL=1 Syndrome=0x6 > > > (XEN) CPU0: Unexpected Trap: Hypervisor > > > (XEN) [ Xen-4.9-unstable arm64 debug=y Not tainted ] > > > (XEN) CPU:0 > > > (XEN) PC: 00264140 strlen+0x10/0x84 > > > (XEN) LR: 002401c0 > > > (XEN) SP: 002cfc20 > > > (XEN) CPSR: 43c9 MODE:64-bit EL2h (Hypervisor, handler) > > > (XEN) X0: 00801230 X1: 00801230 X2: > > > 5230 > > > (XEN) X3: 0030 X4: 0030 X5: > > > 0038 > > > (XEN) X6: 0034 X7: X8: > > > 7f7f7f7f7f7f7f7f > > > (XEN) X9: 64622c6479687222 X10: 7f7f7f7f7f7f7f7f X11: > > > 0101010101010101 > > > (XEN) X12: 0030 X13: ff00ff00 X14: > > > 08000300 > > > (XEN) X15: X16: fefff610 X17: > > > 00f0 > > > (XEN) X18: 0004 X19: 0008 X20: > > > 007fc040 > > > (XEN) X21: 007fc000 X22: 000e X23: > > > > > > (XEN) X24: 002a9f58 X25: 00801230 X26: > > > 002a9f68 > > > (XEN) X27: 002a9f58 X28: 00298910 FP: > > > 002cfc20 > > > (XEN) > > > (XEN) VTCR_EL2: 80010c40 > > > (XEN) VTTBR_EL2: 082800203000 > > > (XEN) > > > (XEN) SCTLR_EL2: 30c5183d > > > (XEN)HCR_EL2: 0038663f > > > (XEN) TTBR0_EL2: f4912000 > > > (XEN) > > > (XEN)ESR_EL2: 9606 > > > (XEN) HPFAR_EL2: e8071000 > > > (XEN)FAR_EL2: 00801230 > > > (XEN) > > > (XEN) Xen stack trace from sp=002cfc20: > > > (XEN)002cfc70 00240254 002a9f58 > > > 007fc000 > > > (XEN) > > > 007fc03c > > > (XEN)002cfd78 002cfca0 > > > 002986fc > > > (XEN) 007fc000 > > > > > > (XEN)002cfcc0 00298f1c > > > 007fc000 > > > (XEN)002cfdc0 0029904c f47fc000 > > > f4604000 > > > (XEN)f47fc000 007fc000 0040 > > > 0100 > > > (XEN)f4604000 0001 0001 > > > 8002 > > > (XEN) > > > > > > (XEN) > > > > > > (XEN) > > > > > > (XEN) 002cfdc0 > > > 00299038 > > > (XEN)f47fc000 f4604000 f47fc000 > > > > > > (XEN)002cfe20 0029c420 002d8000 > > > f4604000 > > > (XEN)f47fc000 0040 > > > 0100 > > > (XEN)f4604000 0001 f47fc000 > > > 0029c404 > > > (XEN)fefff510 00200624 f4804000 > > > f4604000 > > > (XEN)f47fc000 0040 > > > 0100 > > > (XEN)0001 0001 0001 > > > 8002 > > > (XEN)f47fc000 > > > > > > (XEN) > > > > > > (XEN) > > > > > > (XEN) > > > > > > (XEN) > > > > > > (XEN) > > > > > > (XEN) > > > > > > (XEN) > > > > > > (XEN) > > > > > > (XEN) > > > > > > (XEN) > > > > > > (XEN) > > > > > > (XEN) Xen call trace: > > > (XEN)[<00264140>] strlen+0x10/0x84 (PC) > > > (XEN)[<002401c0>] fdt_get_property_namelen+0x9c/0xf0 (LR) > > > (XEN)[<00240254>]
Re: [Xen-devel] [PATCH for-4.9 4/4] xen/arm: Properly map the FDT in the boot page table
Hi Stefano, On 19/04/2017 22:01, Stefano Stabellini wrote: On Wed, 19 Apr 2017, Julien Grall wrote: Currently, Xen is assuming the FDT will always fit in a 2MB section. Recently, I noticed an early crash on Xen when using GRUB with the following call trace: (XEN) Hypervisor Trap. HSR=0x9606 EC=0x25 IL=1 Syndrome=0x6 (XEN) CPU0: Unexpected Trap: Hypervisor (XEN) [ Xen-4.9-unstable arm64 debug=y Not tainted ] (XEN) CPU:0 (XEN) PC: 00264140 strlen+0x10/0x84 (XEN) LR: 002401c0 (XEN) SP: 002cfc20 (XEN) CPSR: 43c9 MODE:64-bit EL2h (Hypervisor, handler) (XEN) X0: 00801230 X1: 00801230 X2: 5230 (XEN) X3: 0030 X4: 0030 X5: 0038 (XEN) X6: 0034 X7: X8: 7f7f7f7f7f7f7f7f (XEN) X9: 64622c6479687222 X10: 7f7f7f7f7f7f7f7f X11: 0101010101010101 (XEN) X12: 0030 X13: ff00ff00 X14: 08000300 (XEN) X15: X16: fefff610 X17: 00f0 (XEN) X18: 0004 X19: 0008 X20: 007fc040 (XEN) X21: 007fc000 X22: 000e X23: (XEN) X24: 002a9f58 X25: 00801230 X26: 002a9f68 (XEN) X27: 002a9f58 X28: 00298910 FP: 002cfc20 (XEN) (XEN) VTCR_EL2: 80010c40 (XEN) VTTBR_EL2: 082800203000 (XEN) (XEN) SCTLR_EL2: 30c5183d (XEN)HCR_EL2: 0038663f (XEN) TTBR0_EL2: f4912000 (XEN) (XEN)ESR_EL2: 9606 (XEN) HPFAR_EL2: e8071000 (XEN)FAR_EL2: 00801230 (XEN) (XEN) Xen stack trace from sp=002cfc20: (XEN)002cfc70 00240254 002a9f58 007fc000 (XEN) 007fc03c (XEN)002cfd78 002cfca0 002986fc (XEN) 007fc000 (XEN)002cfcc0 00298f1c 007fc000 (XEN)002cfdc0 0029904c f47fc000 f4604000 (XEN)f47fc000 007fc000 0040 0100 (XEN)f4604000 0001 0001 8002 (XEN) (XEN) (XEN) (XEN) 002cfdc0 00299038 (XEN)f47fc000 f4604000 f47fc000 (XEN)002cfe20 0029c420 002d8000 f4604000 (XEN)f47fc000 0040 0100 (XEN)f4604000 0001 f47fc000 0029c404 (XEN)fefff510 00200624 f4804000 f4604000 (XEN)f47fc000 0040 0100 (XEN)0001 0001 0001 8002 (XEN)f47fc000 (XEN) (XEN) (XEN) (XEN) (XEN) (XEN) (XEN) (XEN) (XEN) (XEN) (XEN) (XEN) Xen call trace: (XEN)[<00264140>] strlen+0x10/0x84 (PC) (XEN)[<002401c0>] fdt_get_property_namelen+0x9c/0xf0 (LR) (XEN)[<00240254>] fdt_get_property+0x40/0x50 (XEN)[<002986fc>] bootfdt.c#device_tree_get_u32+0x18/0x5c (XEN)[<00298f1c>] device_tree_for_each_node+0x84/0x144 (XEN)[<0029904c>] boot_fdt_info+0x70/0x23c (XEN)[<0029c420>] start_xen+0x9c/0xd30 (XEN)[<00200624>] arm64/head.o#paging+0x84/0xbc (XEN) (XEN) (XEN) (XEN) Panic on CPU 0: (XEN) CPU0: Unexpected Trap: Hypervisor (XEN) (XEN) Indeed, the booting documentation for AArch32 and AArch64 only requires the FDT to be placed on a 8-byte boundary. This means the Device-Tree can cross a 2MB boundary. Given that Xen limits the size of the FDT to 2MB, it
Re: [Xen-devel] [PATCH for-4.9 4/4] xen/arm: Properly map the FDT in the boot page table
On Wed, 19 Apr 2017, Julien Grall wrote: > Currently, Xen is assuming the FDT will always fit in a 2MB section. > Recently, I noticed an early crash on Xen when using GRUB with the > following call trace: > > (XEN) Hypervisor Trap. HSR=0x9606 EC=0x25 IL=1 Syndrome=0x6 > (XEN) CPU0: Unexpected Trap: Hypervisor > (XEN) [ Xen-4.9-unstable arm64 debug=y Not tainted ] > (XEN) CPU:0 > (XEN) PC: 00264140 strlen+0x10/0x84 > (XEN) LR: 002401c0 > (XEN) SP: 002cfc20 > (XEN) CPSR: 43c9 MODE:64-bit EL2h (Hypervisor, handler) > (XEN) X0: 00801230 X1: 00801230 X2: 5230 > (XEN) X3: 0030 X4: 0030 X5: 0038 > (XEN) X6: 0034 X7: X8: 7f7f7f7f7f7f7f7f > (XEN) X9: 64622c6479687222 X10: 7f7f7f7f7f7f7f7f X11: 0101010101010101 > (XEN) X12: 0030 X13: ff00ff00 X14: 08000300 > (XEN) X15: X16: fefff610 X17: 00f0 > (XEN) X18: 0004 X19: 0008 X20: 007fc040 > (XEN) X21: 007fc000 X22: 000e X23: > (XEN) X24: 002a9f58 X25: 00801230 X26: 002a9f68 > (XEN) X27: 002a9f58 X28: 00298910 FP: 002cfc20 > (XEN) > (XEN) VTCR_EL2: 80010c40 > (XEN) VTTBR_EL2: 082800203000 > (XEN) > (XEN) SCTLR_EL2: 30c5183d > (XEN)HCR_EL2: 0038663f > (XEN) TTBR0_EL2: f4912000 > (XEN) > (XEN)ESR_EL2: 9606 > (XEN) HPFAR_EL2: e8071000 > (XEN)FAR_EL2: 00801230 > (XEN) > (XEN) Xen stack trace from sp=002cfc20: > (XEN)002cfc70 00240254 002a9f58 007fc000 > (XEN) 007fc03c > (XEN)002cfd78 002cfca0 002986fc > (XEN) 007fc000 > (XEN)002cfcc0 00298f1c 007fc000 > (XEN)002cfdc0 0029904c f47fc000 f4604000 > (XEN)f47fc000 007fc000 0040 0100 > (XEN)f4604000 0001 0001 8002 > (XEN) > (XEN) > (XEN) > (XEN) 002cfdc0 00299038 > (XEN)f47fc000 f4604000 f47fc000 > (XEN)002cfe20 0029c420 002d8000 f4604000 > (XEN)f47fc000 0040 0100 > (XEN)f4604000 0001 f47fc000 0029c404 > (XEN)fefff510 00200624 f4804000 f4604000 > (XEN)f47fc000 0040 0100 > (XEN)0001 0001 0001 8002 > (XEN)f47fc000 > (XEN) > (XEN) > (XEN) > (XEN) > (XEN) > (XEN) > (XEN) > (XEN) > (XEN) > (XEN) > (XEN) > (XEN) Xen call trace: > (XEN)[<00264140>] strlen+0x10/0x84 (PC) > (XEN)[<002401c0>] fdt_get_property_namelen+0x9c/0xf0 (LR) > (XEN)[<00240254>] fdt_get_property+0x40/0x50 > (XEN)[<002986fc>] bootfdt.c#device_tree_get_u32+0x18/0x5c > (XEN)[<00298f1c>] device_tree_for_each_node+0x84/0x144 > (XEN)[<0029904c>] boot_fdt_info+0x70/0x23c > (XEN)[<0029c420>] start_xen+0x9c/0xd30 > (XEN)[<00200624>] arm64/head.o#paging+0x84/0xbc > (XEN) > (XEN) > (XEN) > (XEN) Panic on CPU 0: > (XEN) CPU0: Unexpected Trap: Hypervisor > (XEN) > (XEN) > > Indeed, the booting documentation for AArch32 and AArch64 only requires > the FDT to be placed on a 8-byte boundary.
[Xen-devel] [PATCH for-4.9 4/4] xen/arm: Properly map the FDT in the boot page table
Currently, Xen is assuming the FDT will always fit in a 2MB section. Recently, I noticed an early crash on Xen when using GRUB with the following call trace: (XEN) Hypervisor Trap. HSR=0x9606 EC=0x25 IL=1 Syndrome=0x6 (XEN) CPU0: Unexpected Trap: Hypervisor (XEN) [ Xen-4.9-unstable arm64 debug=y Not tainted ] (XEN) CPU:0 (XEN) PC: 00264140 strlen+0x10/0x84 (XEN) LR: 002401c0 (XEN) SP: 002cfc20 (XEN) CPSR: 43c9 MODE:64-bit EL2h (Hypervisor, handler) (XEN) X0: 00801230 X1: 00801230 X2: 5230 (XEN) X3: 0030 X4: 0030 X5: 0038 (XEN) X6: 0034 X7: X8: 7f7f7f7f7f7f7f7f (XEN) X9: 64622c6479687222 X10: 7f7f7f7f7f7f7f7f X11: 0101010101010101 (XEN) X12: 0030 X13: ff00ff00 X14: 08000300 (XEN) X15: X16: fefff610 X17: 00f0 (XEN) X18: 0004 X19: 0008 X20: 007fc040 (XEN) X21: 007fc000 X22: 000e X23: (XEN) X24: 002a9f58 X25: 00801230 X26: 002a9f68 (XEN) X27: 002a9f58 X28: 00298910 FP: 002cfc20 (XEN) (XEN) VTCR_EL2: 80010c40 (XEN) VTTBR_EL2: 082800203000 (XEN) (XEN) SCTLR_EL2: 30c5183d (XEN)HCR_EL2: 0038663f (XEN) TTBR0_EL2: f4912000 (XEN) (XEN)ESR_EL2: 9606 (XEN) HPFAR_EL2: e8071000 (XEN)FAR_EL2: 00801230 (XEN) (XEN) Xen stack trace from sp=002cfc20: (XEN)002cfc70 00240254 002a9f58 007fc000 (XEN) 007fc03c (XEN)002cfd78 002cfca0 002986fc (XEN) 007fc000 (XEN)002cfcc0 00298f1c 007fc000 (XEN)002cfdc0 0029904c f47fc000 f4604000 (XEN)f47fc000 007fc000 0040 0100 (XEN)f4604000 0001 0001 8002 (XEN) (XEN) (XEN) (XEN) 002cfdc0 00299038 (XEN)f47fc000 f4604000 f47fc000 (XEN)002cfe20 0029c420 002d8000 f4604000 (XEN)f47fc000 0040 0100 (XEN)f4604000 0001 f47fc000 0029c404 (XEN)fefff510 00200624 f4804000 f4604000 (XEN)f47fc000 0040 0100 (XEN)0001 0001 0001 8002 (XEN)f47fc000 (XEN) (XEN) (XEN) (XEN) (XEN) (XEN) (XEN) (XEN) (XEN) (XEN) (XEN) (XEN) Xen call trace: (XEN)[<00264140>] strlen+0x10/0x84 (PC) (XEN)[<002401c0>] fdt_get_property_namelen+0x9c/0xf0 (LR) (XEN)[<00240254>] fdt_get_property+0x40/0x50 (XEN)[<002986fc>] bootfdt.c#device_tree_get_u32+0x18/0x5c (XEN)[<00298f1c>] device_tree_for_each_node+0x84/0x144 (XEN)[<0029904c>] boot_fdt_info+0x70/0x23c (XEN)[<0029c420>] start_xen+0x9c/0xd30 (XEN)[<00200624>] arm64/head.o#paging+0x84/0xbc (XEN) (XEN) (XEN) (XEN) Panic on CPU 0: (XEN) CPU0: Unexpected Trap: Hypervisor (XEN) (XEN) Indeed, the booting documentation for AArch32 and AArch64 only requires the FDT to be placed on a 8-byte boundary. This means the Device-Tree can cross a 2MB boundary. Given that Xen limits the size of the FDT to 2MB, it will always fit in a 4MB slot. So extend the fixmap slot for FDT from 2MB to 4MB. The second 2MB