All of lore.kernel.org
 help / color / mirror / Atom feed
* Running XEN on imx8mq
@ 2019-03-18  7:39 Amit Tomer
  2019-03-18 10:33 ` Julien Grall
  0 siblings, 1 reply; 15+ messages in thread
From: Amit Tomer @ 2019-03-18  7:39 UTC (permalink / raw)
  To: xen-devel; +Cc: Andre Przywara, Julien Grall, Stefano Stabellini, peng.fan

[-- Attachment #1: Type: text/plain, Size: 6284 bytes --]

Hi,

Trying to run XEN on imx8mq which is different from imx8qm in term of
UART controller IP(attached is the debug code).

DTS used for host is :
https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_4.9.x_2.0.0_ga/arch/arm64/boot/dts/freescale/fsl-imx8mq.dtsi

But , I see following issue:

=> setenv xen_addr_r 0x42000000 ;setenv fdt_addr_r 0x43000000;setenv
kernel_addr_r 0x40480000
=> setenv fdt_high 0xffffffff;fdt addr $fdt_addr_r;fdt resize
=> setenv xen_bootargs console=dtuart dom0_mem=1024M
=> setenv dom0_bootargs console=hvc0,115200n8 earlycon=xenboot debug
clk_ignore_unused root=/dev/mmcblk1p1 rw rootwait
=> fdt set /chosen xen,xen-bootargs \"$xen_bootargs\";
=> fdt set /chosen xen,dom0-bootargs \"$dom0_bootargs\";fdt mknode
/chosen modules
=> fdt set /chosen/modules '#address-cells' <1>;fdt set
/chosen/modules '#size-cells' <1>;fdt mknode /chosen/modules module@0
=> fdt set /chosen/modules/module@0 compatible "xen,linux-zimage"
"xen,multiboot-module"
=> fdt set /chosen/modules/module@0 reg < $kernel_addr_r 0x1800000 >
=>
=> booti ${xen_addr_r} - ${fdt_addr_r}
## Flattened Device Tree blob at 43000000
   Booting using the fdt blob at 0x43000000
   reserving fdt memory region: addr=43000000 size=d000
   Loading Device Tree to 00000000be510000, end 00000000be51ffff ... OK

Starting kernel ...

- UART enabled -
- CPU 00000000 booting -
- Current EL 00000008 -
- Xen starting at EL2 -
- Zero BSS -
- Setting up control registers -
- Turning on paging -
- Ready -
(XEN) Checking for initrd in /chosen
(XEN) RAM: 0000000040000000 - 00000000bfffffff
(XEN)
(XEN) MODULE[0]: 00000000be510000 - 00000000be51d000 Device Tree
(XEN) MODULE[1]: 0000000040480000 - 0000000041c80000 Kernel
(XEN)  RESVD[0]: 0000000043000000 - 000000004300d000
(XEN)  RESVD[1]: 00000000be510000 - 00000000be51d000
(XEN)
(XEN)
(XEN) Command line: console=dtuart dom0_mem=1024M
(XEN) Domain heap initialised
(XEN) Booting using Device Tree
(XEN) Platform: Generic System
(XEN) Taking dtuart configuration from /chosen/stdout-path
(XEN) Looking for dtuart at "/serial@30860000", options ""
(XEN) Unable to initialize dtuart: -9
(XEN) Bad console= option 'dtuart'
 Xen 4.12.0-rc
(XEN) Xen version 4.12.0-rc (amit@) (aarch64-linux-gnu-gcc (Linaro GCC
7.3-2018.05) 7.3.1 20180425 [linaro-7.3-2018.05 revision
d29120a424ecfbc167ef90065c0eeb7f91977701]) debug=y  Mon Mar 18
12:30:38 I9
(XEN) Latest ChangeSet: Tue Mar 5 12:48:52 2019 +0000 git:4deeaf2-dirty
(XEN) Processor: 410fd034: "ARM Limited", variant: 0x0, part 0xd03, rev 0x4
(XEN) 64-bit Execution:
(XEN)   Processor Features: 0000000001002222 0000000000000000
(XEN)     Exception Levels: EL3:64+32 EL2:64+32 EL1:64+32 EL0:64+32
(XEN)     Extensions: FloatingPoint AdvancedSIMD GICv3-SysReg
(XEN)   Debug Features: 0000000010305106 0000000000000000
(XEN)   Auxiliary Features: 0000000000000000 0000000000000000
(XEN)   Memory Model Features: 0000000000001122 0000000000000000
(XEN)   ISA Features:  0000000000011120 0000000000000000
(XEN) 32-bit Execution:
(XEN)   Processor Features: 00000131:10011011
(XEN)     Instruction Sets: AArch32 A32 Thumb Thumb-2 Jazelle
(XEN)     Extensions: GenericTimer Security
(XEN)   Debug Features: 03010066
(XEN)   Auxiliary Features: 00000000
(XEN)   Memory Model Features: 10201105 40000000 01260000 02102211
(XEN)  ISA Features: 02101110 13112111 21232042 01112131 00011142 00011121
(XEN) Using SMC Calling Convention v1.0
(XEN) Using PSCI v1.0
(XEN) SMP: Allowing 4 CPUs
(XEN) Generic Timer IRQ: phys=30 hyp=26 virt=27 Freq: 8333 KHz
(XEN) GICv3 initialization:
(XEN)       gic_dist_addr=0x00000038800000
(XEN)       gic_maintenance_irq=25
(XEN)       gic_rdist_stride=0
(XEN)       gic_rdist_regions=1
(XEN)       redistributor regions:
(XEN)         - region 0: 0x00000038880000 - 0x00000038940000
(XEN) GICv3: 160 lines, (IID 0001143b).
(XEN) GICv3: CPU0: Found redistributor in region 0 @000000004001a000
(XEN) Using scheduler: SMP Credit Scheduler rev2 (credit2)
(XEN) Initializing Credit2 scheduler
(XEN)  load_precision_shift: 18
(XEN)  load_window_shift: 30
(XEN)  underload_balance_tolerance: 0
(XEN)  overload_balance_tolerance: -3
(XEN)  runqueues arrangement: socket
(XEN)  cap enforcement granularity: 10ms
(XEN) load tracking window length 1073741824 ns
(XEN) Adding cpu 0 to runqueue 0
(XEN)  First cpu on runqueue, activating
(XEN) Allocated console ring of 32 KiB.
(XEN) Bringing up CPU1
- CPU 00000001 booting -
- Current EL 00000008 -
- Xen starting at EL2 -
- Setting up control registers -
- Turning on paging -
- Ready -
(XEN) GICv3: CPU1: Found redistributor in region 0 @000000004003a000
(XEN) Adding cpu 1 to runqueue 0
(XEN) CPU 1 booted.
(XEN) Bringing up CPU2
- CPU 00000002 booting -
- Current EL 00000008 -
- Xen starting at EL2 -
- Setting up control registers -
- Turning on paging -
- Ready -
(XEN) GICv3: CPU2: Found redistributor in region 0 @000000004005a000
(XEN) Adding cpu 2 to runqueue 0
(XEN) CPU 2 booted.
(XEN) Bringing up CPU3
- CPU 00000003 booting -
- Current EL 00000008 -
- Xen starting at EL2 -
- Setting up control registers -
- Turning on paging -
- Ready -
(XEN) GICv3: CPU3: Found redistributor in region 0 @000000004007a000
(XEN) Adding cpu 3 to runqueue 0
(XEN) CPU 3 booted.
(XEN) Brought up 4 CPUs
(XEN) P2M: 40-bit IPA with 40-bit PA and 8-bit VMID
(XEN) P2M: 3 levels with order-1 root, VTCR 0x80023558
(XEN) I/O virtualisation disabled
(XEN) build-id: d884da2ad279978f5b120cd02aca4034d898f133
(XEN) alternatives: Patching with alt table 00000000002abbf8 -> 00000000002ac240
(XEN) *** LOADING DOMAIN 0 ***
(XEN) Loading Domd0 kernel from boot module @ 0000000040480000
(XEN) Allocating 1:1 mappings totalling 1024MB for dom0:
(XEN) BANK[0] 0x00000060000000-0x000000a0000000 (1024MB)
(XEN) Grant table range: 0x00000042000000-0x00000042040000
(XEN) Allocating PPI 16 for event channel interrupt
(XEN) Loading zImage from 0000000040480000 to 0000000060080000-0000000061880000
(XEN) dom0 IPA 0x0000000060080000
(XEN) P2M @ 0000000801bff4a0 mfn:0xbffcc
(XEN) Using concatenated root table 0
(XEN) 1ST[0x1] = 0x02c00000400006fd
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Unable to copy the kernel in the hwdom memory
(XEN) ****************************************
(XEN)
(XEN) Reboot in five seconds...

[-- Attachment #2: debug-imx8mq.inc --]
[-- Type: application/octet-stream, Size: 1521 bytes --]

/*
 * xen/arch/arm/arm64/debug-imx8mq.inc
 *
 * IMX8MQ specific debug code.
 *
 * Copyright (c) 2019, Amit Singh Tomar <amittomer25@gmail.com>.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms and conditions of the GNU General Public
 * License, version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; If not, see <http://www.gnu.org/licenses/>.
 */

#define IMX_UART_UTS_REG        0xb4
#define IMX_UART_UTXD_REG       0x40
#define IMX_UART_UTS_TXFULL     4
#define IMX_UART_UTS_TXEMPTY    6

/*
 * IMX8MQ UART wait UART to be ready to transmit
 * xb: register which contains the UART base address
 * c: scratch register
 */
.macro early_uart_ready xb c
1:
        ldr     w\c, [\xb, #IMX_UART_UTS_REG]        /* UART Test Register */
        tbz    w\c, #IMX_UART_UTS_TXEMPTY, 1b        /* Check TXEMPTY bit */
.endm

/*
 * IMX8MQ UART transmit character
 * xb: register which contains the UART base address
 * wt: register which contains the character to transmit
 */
.macro early_uart_transmit xb wt
	str    \wt, [\xb, #IMX_UART_UTXD_REG]
.endm

/*
 * Local variables:
 * mode: ASM
 * indent-tabs-mode: nil
 * End:
 */

[-- Attachment #3: Type: text/plain, Size: 157 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Running XEN on imx8mq
  2019-03-18  7:39 Running XEN on imx8mq Amit Tomer
@ 2019-03-18 10:33 ` Julien Grall
  2019-03-18 10:41   ` Amit Tomer
  0 siblings, 1 reply; 15+ messages in thread
From: Julien Grall @ 2019-03-18 10:33 UTC (permalink / raw)
  To: Amit Tomer, xen-devel; +Cc: Andre Przywara, peng.fan, Stefano Stabellini

On 18/03/2019 07:39, Amit Tomer wrote:
> Hi,

Hello,

> (XEN) Checking for initrd in /chosen
> (XEN) RAM: 0000000040000000 - 00000000bfffffff
> (XEN)
> (XEN) MODULE[0]: 00000000be510000 - 00000000be51d000 Device Tree
> (XEN) MODULE[1]: 0000000040480000 - 0000000041c80000 Kernel
> (XEN)  RESVD[0]: 0000000043000000 - 000000004300d000
> (XEN)  RESVD[1]: 00000000be510000 - 00000000be51d000
> (XEN)
> (XEN)
> (XEN) Command line: console=dtuart dom0_mem=1024M
> (XEN) Domain heap initialised
> (XEN) Booting using Device Tree
> (XEN) Platform: Generic System
> (XEN) Taking dtuart configuration from /chosen/stdout-path
> (XEN) Looking for dtuart at "/serial@30860000", options ""
> (XEN) Unable to initialize dtuart: -9
> (XEN) Bad console= option 'dtuart'
>   Xen 4.12.0-rc
> (XEN) Xen version 4.12.0-rc (amit@) (aarch64-linux-gnu-gcc (Linaro GCC
> 7.3-2018.05) 7.3.1 20180425 [linaro-7.3-2018.05 revision
> d29120a424ecfbc167ef90065c0eeb7f91977701]) debug=y  Mon Mar 18
> 12:30:38 I9
> (XEN) Latest ChangeSet: Tue Mar 5 12:48:52 2019 +0000 git:4deeaf2-dirty

The tree you are using is dirty. What did you change?

[..]

> (XEN) GICv3: CPU3: Found redistributor in region 0 @000000004007a000
> (XEN) Adding cpu 3 to runqueue 0
> (XEN) CPU 3 booted.
> (XEN) Brought up 4 CPUs
> (XEN) P2M: 40-bit IPA with 40-bit PA and 8-bit VMID
> (XEN) P2M: 3 levels with order-1 root, VTCR 0x80023558
> (XEN) I/O virtualisation disabled
> (XEN) build-id: d884da2ad279978f5b120cd02aca4034d898f133
> (XEN) alternatives: Patching with alt table 00000000002abbf8 -> 00000000002ac240
> (XEN) *** LOADING DOMAIN 0 ***
> (XEN) Loading Domd0 kernel from boot module @ 0000000040480000
> (XEN) Allocating 1:1 mappings totalling 1024MB for dom0:
> (XEN) BANK[0] 0x00000060000000-0x000000a0000000 (1024MB)
> (XEN) Grant table range: 0x00000042000000-0x00000042040000
> (XEN) Allocating PPI 16 for event channel interrupt
> (XEN) Loading zImage from 0000000040480000 to 0000000060080000-0000000061880000
> (XEN) dom0 IPA 0x0000000060080000
> (XEN) P2M @ 0000000801bff4a0 mfn:0xbffcc
> (XEN) Using concatenated root table 0
> (XEN) 1ST[0x1] = 0x02c00000400006fd
> (XEN) ****************************************
> (XEN) Panic on CPU 0:
> (XEN) Unable to copy the kernel in the hwdom memory
> (XEN) ****************************************

This looks like the same problem on encounter on the RCar. I.e the 
reserved-memory regions are not carved from xenheap pool.

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Running XEN on imx8mq
  2019-03-18 10:33 ` Julien Grall
@ 2019-03-18 10:41   ` Amit Tomer
  2019-03-18 11:21     ` Julien Grall
  0 siblings, 1 reply; 15+ messages in thread
From: Amit Tomer @ 2019-03-18 10:41 UTC (permalink / raw)
  To: Julien Grall; +Cc: xen-devel, peng.fan, Stefano Stabellini, Andre Przywara

Hello,

> The tree you are using is dirty. What did you change?

Just added the imx8mq specific debug so that we can see early prints from XEN,
>
> [..]
>
> > (XEN) GICv3: CPU3: Found redistributor in region 0 @000000004007a000
> > (XEN) Adding cpu 3 to runqueue 0
> > (XEN) CPU 3 booted.
> > (XEN) Brought up 4 CPUs
> > (XEN) P2M: 40-bit IPA with 40-bit PA and 8-bit VMID
> > (XEN) P2M: 3 levels with order-1 root, VTCR 0x80023558
> > (XEN) I/O virtualisation disabled
> > (XEN) build-id: d884da2ad279978f5b120cd02aca4034d898f133
> > (XEN) alternatives: Patching with alt table 00000000002abbf8 -> 00000000002ac240
> > (XEN) *** LOADING DOMAIN 0 ***
> > (XEN) Loading Domd0 kernel from boot module @ 0000000040480000
> > (XEN) Allocating 1:1 mappings totalling 1024MB for dom0:
> > (XEN) BANK[0] 0x00000060000000-0x000000a0000000 (1024MB)
> > (XEN) Grant table range: 0x00000042000000-0x00000042040000
> > (XEN) Allocating PPI 16 for event channel interrupt
> > (XEN) Loading zImage from 0000000040480000 to 0000000060080000-0000000061880000
> > (XEN) dom0 IPA 0x0000000060080000
> > (XEN) P2M @ 0000000801bff4a0 mfn:0xbffcc
> > (XEN) Using concatenated root table 0
> > (XEN) 1ST[0x1] = 0x02c00000400006fd
> > (XEN) ****************************************
> > (XEN) Panic on CPU 0:
> > (XEN) Unable to copy the kernel in the hwdom memory
> > (XEN) ****************************************
>
> This looks like the same problem on encounter on the RCar. I.e the
> reserved-memory regions are not carved from xenheap pool.

This is the first thing we tried (removing reserved node from DTS file) but
it didn't work :(

Just wondering here, if it has some thing to do with following commit ?

https://source.codeaurora.org/external/imx/imx-xen/commit/?h=imx_4.14.62_1.0.0_beta&id=502413d9240169068cde9d73e0d4aa0675978bc5

-Thanks.
Amit

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Running XEN on imx8mq
  2019-03-18 10:41   ` Amit Tomer
@ 2019-03-18 11:21     ` Julien Grall
  2019-03-18 12:45       ` Amit Tomer
  2019-03-18 15:12       ` Amit Tomer
  0 siblings, 2 replies; 15+ messages in thread
From: Julien Grall @ 2019-03-18 11:21 UTC (permalink / raw)
  To: Amit Tomer; +Cc: xen-devel, peng.fan, Stefano Stabellini, Andre Przywara

Hello,

On 18/03/2019 10:41, Amit Tomer wrote:
> Hello,
> 
>> The tree you are using is dirty. What did you change?
> 
> Just added the imx8mq specific debug so that we can see early prints from XEN,
>>
>> [..]
>>
>>> (XEN) GICv3: CPU3: Found redistributor in region 0 @000000004007a000
>>> (XEN) Adding cpu 3 to runqueue 0
>>> (XEN) CPU 3 booted.
>>> (XEN) Brought up 4 CPUs
>>> (XEN) P2M: 40-bit IPA with 40-bit PA and 8-bit VMID
>>> (XEN) P2M: 3 levels with order-1 root, VTCR 0x80023558
>>> (XEN) I/O virtualisation disabled
>>> (XEN) build-id: d884da2ad279978f5b120cd02aca4034d898f133
>>> (XEN) alternatives: Patching with alt table 00000000002abbf8 -> 00000000002ac240
>>> (XEN) *** LOADING DOMAIN 0 ***
>>> (XEN) Loading Domd0 kernel from boot module @ 0000000040480000
>>> (XEN) Allocating 1:1 mappings totalling 1024MB for dom0:
>>> (XEN) BANK[0] 0x00000060000000-0x000000a0000000 (1024MB)
>>> (XEN) Grant table range: 0x00000042000000-0x00000042040000
>>> (XEN) Allocating PPI 16 for event channel interrupt
>>> (XEN) Loading zImage from 0000000040480000 to 0000000060080000-0000000061880000
>>> (XEN) dom0 IPA 0x0000000060080000
>>> (XEN) P2M @ 0000000801bff4a0 mfn:0xbffcc
>>> (XEN) Using concatenated root table 0
>>> (XEN) 1ST[0x1] = 0x02c00000400006fd
>>> (XEN) ****************************************
>>> (XEN) Panic on CPU 0:
>>> (XEN) Unable to copy the kernel in the hwdom memory
>>> (XEN) ****************************************
>>
>> This looks like the same problem on encounter on the RCar. I.e the
>> reserved-memory regions are not carved from xenheap pool.
> 
> This is the first thing we tried (removing reserved node from DTS file) but
> it didn't work :(

It will be difficult to help without any log. You probably want to try with 
Stefano series instead. However ...

> 
> Just wondering here, if it has some thing to do with following commit ?

... the tree you point below seems to contains a lot of patches for IMX8 support 
in Xen. So this may or may not be your issue. I am afraid I can't provide help 
on that tree.

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Running XEN on imx8mq
  2019-03-18 11:21     ` Julien Grall
@ 2019-03-18 12:45       ` Amit Tomer
  2019-03-18 15:12       ` Amit Tomer
  1 sibling, 0 replies; 15+ messages in thread
From: Amit Tomer @ 2019-03-18 12:45 UTC (permalink / raw)
  To: Julien Grall; +Cc: xen-devel, peng.fan, Stefano Stabellini, Andre Przywara

> It will be difficult to help without any log. You probably want to try with
> Stefano series instead. However ...

Yeah, tried Stefano series as well but show same message:


Starting kernel ...

- UART enabled -
- CPU 00000000 booting -
- Current EL 00000008 -
- Xen starting at EL2 -
- Zero BSS -
- Setting up control registers -
- Turning on paging -
- Ready -
(XEN) fdt: node `linux,cma': missing `reg' property
(XEN) Checking for initrd in /chosen
(XEN) RAM: 0000000040000000 - 00000000bfffffff
(XEN)
(XEN) MODULE[0]: 00000000be510000 - 00000000be51d000 Device Tree
(XEN) MODULE[1]: 0000000040480000 - 0000000042680000 Kernel
(XEN)  RESVD[0]: 0000000043000000 - 000000004300d000
(XEN)  RESVD[1]: 00000000be510000 - 00000000be51d000
(XEN)
(XEN) Command line: console=dtuart dom0_mem=2048M
(XEN) Placing Xen at 0x00000000bfe00000-0x00000000c0000000
(XEN) Update BOOTMOD_XEN from 0000000042000000-0000000042118d81 =>
00000000bfe00000-00000000bff18d81
(XEN) Domain heap initialised
(XEN) Booting using Device Tree
(XEN) Platform: Generic System
(XEN) Taking dtuart configuration from /chosen/stdout-path
(XEN) Looking for dtuart at "/serial@30860000", options ""
(XEN) Unable to initialize dtuart: -9
(XEN) Bad console= option 'dtuart'
 Xen 4.12-unstable
(XEN) Xen version 4.12-unstable (amit@) (aarch64-linux-gnu-gcc (Linaro
GCC 7.3-2018.05) 7.3.1 20180425 [linaro-7.3-2018.05 revision
d29120a424ecfbc167ef90065c0eeb7f91977701]) debug=y  Mon Mar 18 17:49:9
(XEN) Latest ChangeSet: Thu Mar 7 13:22:10 2019 -0800 git:62617af
(XEN) Processor: 410fd034: "ARM Limited", variant: 0x0, part 0xd03, rev 0x4
(XEN) 64-bit Execution:
(XEN)   Processor Features: 0000000001002222 0000000000000000
(XEN)     Exception Levels: EL3:64+32 EL2:64+32 EL1:64+32 EL0:64+32
(XEN)     Extensions: FloatingPoint AdvancedSIMD GICv3-SysReg
(XEN)   Debug Features: 0000000010305106 0000000000000000
(XEN)   Auxiliary Features: 0000000000000000 0000000000000000
(XEN)   Memory Model Features: 0000000000001122 0000000000000000
(XEN)   ISA Features:  0000000000011120 0000000000000000
(XEN) 32-bit Execution:
(XEN)   Processor Features: 00000131:10011011
(XEN)     Instruction Sets: AArch32 A32 Thumb Thumb-2 Jazelle
(XEN)     Extensions: GenericTimer Security
(XEN)   Debug Features: 03010066
(XEN)   Auxiliary Features: 00000000
(XEN)   Memory Model Features: 10201105 40000000 01260000 02102211
(XEN)  ISA Features: 02101110 13112111 21232042 01112131 00011142 00011121
(XEN) Using SMC Calling Convention v1.0
(XEN) Using PSCI v1.0
(XEN) SMP: Allowing 4 CPUs
(XEN) Generic Timer IRQ: phys=30 hyp=26 virt=27 Freq: 8333 KHz
(XEN) GICv3 initialization:
(XEN)       gic_dist_addr=0x00000038800000
(XEN)       gic_maintenance_irq=25
(XEN)       gic_rdist_stride=0
(XEN)       gic_rdist_regions=1
(XEN)       redistributor regions:
(XEN)         - region 0: 0x00000038880000 - 0x00000038940000
(XEN) GICv3: 160 lines, (IID 0001143b).
(XEN) GICv3: CPU0: Found redistributor in region 0 @000000004001a000
(XEN) Using scheduler: SMP Credit Scheduler rev2 (credit2)
(XEN) Initializing Credit2 scheduler
(XEN)  load_precision_shift: 18
(XEN)  load_window_shift: 30
(XEN)  underload_balance_tolerance: 0
(XEN)  overload_balance_tolerance: -3
(XEN)  runqueues arrangement: socket
(XEN)  cap enforcement granularity: 10ms
(XEN) load tracking window length 1073741824 ns
(XEN) Adding cpu 0 to runqueue 0
(XEN)  First cpu on runqueue, activating
(XEN) Allocated console ring of 32 KiB.
(XEN) Bringing up CPU1
- CPU 00000001 booting -
- Current EL 00000008 -
- Xen starting at EL2 -
- Setting up control registers -
- Turning on paging -
- Ready -
(XEN) GICv3: CPU1: Found redistributor in region 0 @000000004003a000
(XEN) Adding cpu 1 to runqueue 0
(XEN) CPU 1 booted.
(XEN) Bringing up CPU2
- CPU 00000002 booting -
- Current EL 00000008 -
- Xen starting at EL2 -
- Setting up control registers -
- Turning on paging -
- Ready -
(XEN) GICv3: CPU2: Found redistributor in region 0 @000000004005a000
(XEN) Adding cpu 2 to runqueue 0
(XEN) CPU 2 booted.
(XEN) Bringing up CPU3
- CPU 00000003 booting -
- Current EL 00000008 -
- Xen starting at EL2 -
- Setting up control registers -
- Turning on paging -
- Ready -
(XEN) GICv3: CPU3: Found redistributor in region 0 @000000004007a000
(XEN) Adding cpu 3 to runqueue 0
(XEN) CPU 3 booted.
(XEN) Brought up 4 CPUs
(XEN) P2M: 40-bit IPA with 40-bit PA and 8-bit VMID
(XEN) P2M: 3 levels with order-1 root, VTCR 0x80023558
(XEN) I/O virtualisation disabled
(XEN) build-id: 1635738d31cfca03ae48949e8cd29221cdfe458c
(XEN) alternatives: Patching with alt table 00000000002aba18 -> 00000000002ac018
(XEN) *** LOADING DOMAIN 0 ***
(XEN) Loading kernel from boot module @ 0000000040480000
(XEN) Allocating 1:1 mappings totalling 2048MB for dom0:
(XEN) WARNING: Failed to allocate requested dom0 memory. 224MB unallocated
(XEN) BANK[0] 0x00000044000000-0x000000b6000000 (1824MB)
(XEN) Grant table range: 0x000000bfe00000-0x000000bfe40000
(XEN) Allocating PPI 16 for event channel interrupt
(XEN) Loading zImage from 0000000040480000 to 0000000044080000-0000000046280000
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Unable to copy the kernel in the hwdom memory
(XEN) ****************************************
(XEN)
(XEN) Reboot in five seconds...

Thanks
-Amit

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Running XEN on imx8mq
  2019-03-18 11:21     ` Julien Grall
  2019-03-18 12:45       ` Amit Tomer
@ 2019-03-18 15:12       ` Amit Tomer
  2019-03-19 10:33         ` Arm boot regression with Xen 4.12 Julien Grall
  1 sibling, 1 reply; 15+ messages in thread
From: Amit Tomer @ 2019-03-18 15:12 UTC (permalink / raw)
  To: Julien Grall; +Cc: xen-devel, peng.fan, Stefano Stabellini, Andre Przywara

Hello,

> It will be difficult to help without any log. You probably want to try with
> Stefano series instead. However ...

If we comment out GPU node(gpu@38000000) , we don't see this issue and
Dom0 kernel is
loaded into memory but we following crash:

Starting kernel ...

- UART enabled -
- CPU 00000000 booting -
- Current EL 00000008 -
- Xen starting at EL2 -
- Zero BSS -
- Setting up control registers -
- Turning on paging -
- Ready -
(XEN) Checking for initrd in /chosen
(XEN) RAM: 0000000040000000 - 00000000bfffffff
(XEN)
(XEN) MODULE[0]: 00000000be511000 - 00000000be51d000 Device Tree
(XEN) MODULE[1]: 0000000040480000 - 0000000042680000 Kernel
(XEN)  RESVD[0]: 0000000043000000 - 000000004300c000
(XEN)  RESVD[1]: 00000000be511000 - 00000000be51d000
(XEN)
(XEN)
(XEN) Command line: console=dtuart dom0_mem=1024M
(XEN) Domain heap initialised
(XEN) Booting using Device Tree
(XEN) Platform: Generic System
(XEN) Taking dtuart configuration from /chosen/stdout-path
(XEN) Looking for dtuart at "/serial@30860000", options ""
(XEN) Unable to initialize dtuart: -9
(XEN) Bad console= option 'dtuart'
 Xen 4.12.0-rc
(XEN) Xen version 4.12.0-rc (amit@) (aarch64-linux-gnu-gcc (Linaro GCC
7.3-2018.05) 7.3.1 20180425 [linaro-7.3-2018.05 revision
d29120a424ecfbc167ef90065c0eeb7f91977701]) debug=y  Mon Mar 18
20:31:35 I9
(XEN) Latest ChangeSet: Tue Mar 5 12:48:52 2019 +0000 git:4deeaf2
(XEN) Processor: 410fd034: "ARM Limited", variant: 0x0, part 0xd03, rev 0x4
(XEN) 64-bit Execution:
(XEN)   Processor Features: 0000000001002222 0000000000000000
(XEN)     Exception Levels: EL3:64+32 EL2:64+32 EL1:64+32 EL0:64+32
(XEN)     Extensions: FloatingPoint AdvancedSIMD GICv3-SysReg
(XEN)   Debug Features: 0000000010305106 0000000000000000
(XEN)   Auxiliary Features: 0000000000000000 0000000000000000
(XEN)   Memory Model Features: 0000000000001122 0000000000000000
(XEN)   ISA Features:  0000000000011120 0000000000000000
(XEN) 32-bit Execution:
(XEN)   Processor Features: 00000131:10011011
(XEN)     Instruction Sets: AArch32 A32 Thumb Thumb-2 Jazelle
(XEN)     Extensions: GenericTimer Security
(XEN)   Debug Features: 03010066
(XEN)   Auxiliary Features: 00000000
(XEN)   Memory Model Features: 10201105 40000000 01260000 02102211
(XEN)  ISA Features: 02101110 13112111 21232042 01112131 00011142 00011121
(XEN) Using SMC Calling Convention v1.0
(XEN) Using PSCI v1.0
(XEN) SMP: Allowing 4 CPUs
(XEN) Generic Timer IRQ: phys=30 hyp=26 virt=27 Freq: 8333 KHz
(XEN) GICv3 initialization:
(XEN)       gic_dist_addr=0x00000038800000
(XEN)       gic_maintenance_irq=25
(XEN)       gic_rdist_stride=0
(XEN)       gic_rdist_regions=1
(XEN)       redistributor regions:
(XEN)         - region 0: 0x00000038880000 - 0x00000038940000
(XEN) GICv3: 160 lines, (IID 0001143b).
(XEN) GICv3: CPU0: Found redistributor in region 0 @000000004001a000
(XEN) Using scheduler: SMP Credit Scheduler rev2 (credit2)
(XEN) Initializing Credit2 scheduler
(XEN)  load_precision_shift: 18
(XEN)  load_window_shift: 30
(XEN)  underload_balance_tolerance: 0
(XEN)  overload_balance_tolerance: -3
(XEN)  runqueues arrangement: socket
(XEN)  cap enforcement granularity: 10ms
(XEN) load tracking window length 1073741824 ns
(XEN) Adding cpu 0 to runqueue 0
(XEN)  First cpu on runqueue, activating
(XEN) Allocated console ring of 32 KiB.
(XEN) Bringing up CPU1
- CPU 00000001 booting -
- Current EL 00000008 -
- Xen starting at EL2 -
- Setting up control registers -
- Turning on paging -
- Ready -
(XEN) GICv3: CPU1: Found redistributor in region 0 @000000004003a000
(XEN) Adding cpu 1 to runqueue 0
(XEN) CPU 1 booted.
(XEN) Bringing up CPU2
- CPU 00000002 booting -
- Current EL 00000008 -
- Xen starting at EL2 -
- Setting up control registers -
- Turning on paging -
- Ready -
(XEN) GICv3: CPU2: Found redistributor in region 0 @000000004005a000
(XEN) Adding cpu 2 to runqueue 0
(XEN) CPU 2 booted.
(XEN) Bringing up CPU3
- CPU 00000003 booting -
- Current EL 00000008 -
- Xen starting at EL2 -
- Setting up control registers -
- Turning on paging -
- Ready -
(XEN) GICv3: CPU3: Found redistributor in region 0 @000000004007a000
(XEN) Adding cpu 3 to runqueue 0
(XEN) CPU 3 booted.
(XEN) Brought up 4 CPUs
(XEN) P2M: 40-bit IPA with 40-bit PA and 8-bit VMID
(XEN) P2M: 3 levels with order-1 root, VTCR 0x80023558
(XEN) I/O virtualisation disabled
(XEN) build-id: e89d2543bdd91038674917e9d0be5b56a3ef0fd7
(XEN) alternatives: Patching with alt table 00000000002abbd8 -> 00000000002ac220
(XEN) *** LOADING DOMAIN 0 ***
(XEN) Loading Domd0 kernel from boot module @ 0000000040480000
(XEN) Allocating 1:1 mappings totalling 1024MB for dom0:
(XEN) BANK[0] 0x00000060000000-0x000000a0000000 (1024MB)
(XEN) Grant table range: 0x00000042000000-0x00000042040000
(XEN) Allocating PPI 16 for event channel interrupt
(XEN) Loading zImage from 0000000040480000 to 0000000060080000-0000000062280000
(XEN) Loading dom0 DTB to 0x0000000068000000-0x000000006800b99e
(XEN) Initial low memory virq threshold set at 0x4000 pages.
(XEN) Scrubbing Free RAM in background
(XEN) Std. Loglevel: All
(XEN) Guest Loglevel: All
(XEN) *** Serial input to DOM0 (type 'CTRL-a' three times to switch input)
(XEN) Data Abort Trap. Syndrome=0x6
(XEN) Walking Hypervisor VA 0x8 on CPU0 via TTBR 0x0000000042114000
(XEN) 0TH[0x0] = 0x0000000042113f7f
(XEN) 1ST[0x0] = 0x0000000042110f7f
(XEN) 2ND[0x0] = 0x0000000000000000
(XEN) CPU0: Unexpected Trap: Data Abort
(XEN) ----[ Xen-4.12.0-rc  arm64  debug=y   Not tainted ]----
(XEN) CPU:    0
(XEN) PC:     000000000021c220 page_alloc.c#free_heap_pages+0x3b0/0x58c
(XEN) LR:     000000000021c20c
(XEN) SP:     000080007ffefd90
(XEN) CPSR:   40000249 MODE:64-bit EL2h (Hypervisor, handler)
(XEN)      X0: 0000000000000000  X1: 0000000000000000  X2: 0000000000288db0
(XEN)      X3: ffffffffffffffff  X4: 0000000000040000  X5: 0000000000000000
(XEN)      X6: 0000000000000001  X7: 0180000000000000  X8: 0080000000000000
(XEN)      X9: 0000000000288da0 X10: 0000000000000000 X11: 0000000047ffffff
(XEN)     X12: 0000000000288000 X13: 0000000000288000 X14: 0000000000289000
(XEN)     X15: 6db6db6db6db6db7 X16: fffffff800000000 X17: 3d3d3d3d3d3d3d3d
(XEN)     X18: 0000000000289000 X19: 0000000000000000 X20: 0000000800071e30
(XEN)     X21: 0000000000000000 X22: 6db6db6db6db6db7 X23: 0000000000000013
(XEN)     X24: 0000000000288da0 X25: 0000000000289000 X26: 0000000000200200
(XEN)     X27: 0000000000100100 X28: 0000000800071e68  FP: 000080007ffefd90
(XEN)
(XEN)   VTCR_EL2: 80023558
(XEN)  VTTBR_EL2: 0000000000000000
(XEN)
(XEN)  SCTLR_EL2: 30cd183d
(XEN)    HCR_EL2: 000000000000003a
(XEN)  TTBR0_EL2: 0000000042114000
(XEN)
(XEN)    ESR_EL2: 96000006
(XEN)  HPFAR_EL2: 00000000fdce5ac0
(XEN)    FAR_EL2: 0000000000000008
(XEN)
(XEN) Xen stack trace from sp=000080007ffefd90:
(XEN)    000080007ffefdf0 000000000021e5f4 00000000002e0d40 0000000800071e30
(XEN)    0000000000000000 0000000000000056 0000000000288d78 0000000800071e30
(XEN)    0000000000000000 0000000040000000 00000000c0000000 6db6db6db6db6db7
(XEN)    000080007ffefe60 000000000021e840 0000000000056000 0000000000015800
(XEN)    000000004208a000 0000000000015800 0000000000000004 0000000000283630
(XEN)    00000000002b83d0 0000000040000000 00000000c0000000 0000000000000001
(XEN)    00000000be511000 00000000002e0d90 000080007ffefe70 000000000024e178
(XEN)    000080007ffefea0 0000000000252580 0000000000287000 0000000000000004
(XEN)    0000000000287c80 000000000031a430 00000000002d7de0 000000000029daa8
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000
(XEN) Xen call trace:
(XEN)    [<000000000021c220>] page_alloc.c#free_heap_pages+0x3b0/0x58c (PC)
(XEN)    [<000000000021c20c>] page_alloc.c#free_heap_pages+0x39c/0x58c (LR)
(XEN)    [<000000000021e5f4>] page_alloc.c#init_heap_pages+0x334/0x4ec
(XEN)    [<000000000021e840>] init_domheap_pages+0x94/0x9c
(XEN)    [<000000000024e178>] free_init_memory+0xac/0xe0
(XEN)    [<0000000000252580>] setup.c#init_done+0x14/0x20
(XEN)    [<000000000029daa8>] 000000000029daa8
(XEN)
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) CPU0: Unexpected Trap: Data Abort
(XEN) ****************************************
(XEN)
(XEN) Reboot in five seconds...



> ... the tree you point below seems to contains a lot of patches for IMX8 support
> in Xen. So this may or may not be your issue. I am afraid I can't provide help
> on that tree.
>
> Cheers,
>
> --
> Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Arm boot regression with Xen 4.12
  2019-03-18 15:12       ` Amit Tomer
@ 2019-03-19 10:33         ` Julien Grall
  2019-03-19 14:01           ` Amit Tomer
  0 siblings, 1 reply; 15+ messages in thread
From: Julien Grall @ 2019-03-19 10:33 UTC (permalink / raw)
  To: Amit Tomer
  Cc: Juergen Gross, xen-devel, peng.fan, Stefano Stabellini, Andre Przywara

(+ Juergen)

Hi Amit,

On 3/18/19 3:12 PM, Amit Tomer wrote:
>> It will be difficult to help without any log. You probably want to try with
>> Stefano series instead. However ...
> 
> If we comment out GPU node(gpu@38000000) , we don't see this issue and
> Dom0 kernel is
> loaded into memory but we following crash:
> 
> Starting kernel ...
> 
> - UART enabled -
> - CPU 00000000 booting -
> - Current EL 00000008 -
> - Xen starting at EL2 -
> - Zero BSS -
> - Setting up control registers -
> - Turning on paging -
> - Ready -
> (XEN) Checking for initrd in /chosen
> (XEN) RAM: 0000000040000000 - 00000000bfffffff
> (XEN)
> (XEN) MODULE[0]: 00000000be511000 - 00000000be51d000 Device Tree
> (XEN) MODULE[1]: 0000000040480000 - 0000000042680000 Kernel
> (XEN)  RESVD[0]: 0000000043000000 - 000000004300c000
> (XEN)  RESVD[1]: 00000000be511000 - 00000000be51d000

[...]

> (XEN) *** Serial input to DOM0 (type 'CTRL-a' three times to switch input)
> (XEN) Data Abort Trap. Syndrome=0x6
> (XEN) Walking Hypervisor VA 0x8 on CPU0 via TTBR 0x0000000042114000
> (XEN) 0TH[0x0] = 0x0000000042113f7f
> (XEN) 1ST[0x0] = 0x0000000042110f7f
> (XEN) 2ND[0x0] = 0x0000000000000000
> (XEN) CPU0: Unexpected Trap: Data Abort
> (XEN) ----[ Xen-4.12.0-rc  arm64  debug=y   Not tainted ]----
> (XEN) CPU:    0
> (XEN) PC:     000000000021c220 page_alloc.c#free_heap_pages+0x3b0/0x58c

[...]

> (XEN) Xen call trace:
> (XEN)    [<000000000021c220>] page_alloc.c#free_heap_pages+0x3b0/0x58c (PC)
> (XEN)    [<000000000021c20c>] page_alloc.c#free_heap_pages+0x39c/0x58c (LR)
> (XEN)    [<000000000021e5f4>] page_alloc.c#init_heap_pages+0x334/0x4ec
> (XEN)    [<000000000021e840>] init_domheap_pages+0x94/0x9c
> (XEN)    [<000000000024e178>] free_init_memory+0xac/0xe0
> (XEN)    [<0000000000252580>] setup.c#init_done+0x14/0x20
> (XEN)    [<000000000029daa8>] 000000000029daa8
> (XEN)
> (XEN)
> (XEN) ****************************************
> (XEN) Panic on CPU 0:
> (XEN) CPU0: Unexpected Trap: Data Abort
> (XEN) ****************************************
> (XEN)
> (XEN) Reboot in five seconds...

Could you give a try to the below patch?

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 01ae2cccc0..2c34138bbd 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1139,7 +1139,7 @@ void free_init_memory(void)
         *(p + i) = insn;
 
     set_pte_flags_on_range(__init_begin, len, mg_clear);
-    init_domheap_pages(pa, pa + len);
+    dt_unreserved_regions(pa, pa + len, init_domheap_pages, 0);
     printk("Freed %ldkB init memory.\n", (long)(__init_end-__init_begin)>>10);
 }

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 444857a967..8dbc4f819b 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -764,18 +764,18 @@ void __init start_xen(unsigned long boot_phys_offset,
               "Please check your bootloader.\n",
               fdt_paddr);
 
-    fdt_size = boot_fdt_info(device_tree_flattened, fdt_paddr);
-
-    cmdline = boot_fdt_cmdline(device_tree_flattened);
-    printk("Command line: %s\n", cmdline);
-    cmdline_parse(cmdline);
-
     /* Register Xen's load address as a boot module. */
     xen_bootmodule = add_boot_module(BOOTMOD_XEN,
                              (paddr_t)(uintptr_t)(_start + boot_phys_offset),
                              (paddr_t)(uintptr_t)(_end - _start + 1), false);
     BUG_ON(!xen_bootmodule);
 
+    fdt_size = boot_fdt_info(device_tree_flattened, fdt_paddr);
+
+    cmdline = boot_fdt_cmdline(device_tree_flattened);
+    printk("Command line: %s\n", cmdline);
+    cmdline_parse(cmdline);
+
     setup_pagetables(boot_phys_offset);
 
     setup_mm(fdt_paddr, fdt_size);

Now the long answer.

Unfortunately, in a recent page, I removed the log telling where
Xen lives in memory,  so I am not 100% sure this is your problem.

From my own testing, I think the problem is Xen will try to hand reserved
memory (the old fashion /memreserve/ and not /reserved-regions) to the
allocator. This happen when freeing the init regions (see free_init_memory).

We do handle correctly all the others modules (see discard_initial_modules).

On my setup this does not crash Xen, instead it happily hand the page to
the allocator which is not good. The difference in behavior may be because
on how the PDX is setup (I need to investigate that). So by luck, I have
a struct page_info backing the reserved-memory region. This does not
mean it is better :).

This regression was introduced by commit f60658c6ae "xen/arm: Stop
relocating Xen". Before hand, Xen was always relocated so the original
Xen was left untouched. The relocated version would always live in
non-reserved area.

On my setup, Xen was not in the reserved region area by default. I had
to modify the Device-Tree. I don't know how many platform are putting
Xen in /memreserve/ region. Amit, assuming the patch above works for you,
could you tell who created the /memreserve/?

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: Arm boot regression with Xen 4.12
  2019-03-19 10:33         ` Arm boot regression with Xen 4.12 Julien Grall
@ 2019-03-19 14:01           ` Amit Tomer
  2019-03-19 15:05             ` Julien Grall
  0 siblings, 1 reply; 15+ messages in thread
From: Amit Tomer @ 2019-03-19 14:01 UTC (permalink / raw)
  To: Julien Grall
  Cc: Juergen Gross, xen-devel, peng.fan, Stefano Stabellini, Andre Przywara

Hi,

> Could you give a try to the below patch?
>
> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
> index 01ae2cccc0..2c34138bbd 100644
> --- a/xen/arch/arm/mm.c
> +++ b/xen/arch/arm/mm.c
> @@ -1139,7 +1139,7 @@ void free_init_memory(void)
>          *(p + i) = insn;
>
>      set_pte_flags_on_range(__init_begin, len, mg_clear);
> -    init_domheap_pages(pa, pa + len);
> +    dt_unreserved_regions(pa, pa + len, init_domheap_pages, 0);
>      printk("Freed %ldkB init memory.\n", (long)(__init_end-__init_begin)>>10);
>  }
>
> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
> index 444857a967..8dbc4f819b 100644
> --- a/xen/arch/arm/setup.c
> +++ b/xen/arch/arm/setup.c
> @@ -764,18 +764,18 @@ void __init start_xen(unsigned long boot_phys_offset,
>                "Please check your bootloader.\n",
>                fdt_paddr);
>
> -    fdt_size = boot_fdt_info(device_tree_flattened, fdt_paddr);
> -
> -    cmdline = boot_fdt_cmdline(device_tree_flattened);
> -    printk("Command line: %s\n", cmdline);
> -    cmdline_parse(cmdline);
> -
>      /* Register Xen's load address as a boot module. */
>      xen_bootmodule = add_boot_module(BOOTMOD_XEN,
>                               (paddr_t)(uintptr_t)(_start + boot_phys_offset),
>                               (paddr_t)(uintptr_t)(_end - _start + 1), false);
>      BUG_ON(!xen_bootmodule);
>
> +    fdt_size = boot_fdt_info(device_tree_flattened, fdt_paddr);
> +
> +    cmdline = boot_fdt_cmdline(device_tree_flattened);
> +    printk("Command line: %s\n", cmdline);
> +    cmdline_parse(cmdline);
> +
>      setup_pagetables(boot_phys_offset);
>
>      setup_mm(fdt_paddr, fdt_size);
>


I tried the above patch but still see the same crash:

tarting kernel ...

- UART enabled -
- CPU 00000000 booting -
- Current EL 00000008 -
- Xen starting at EL2 -
- Zero BSS -
- Setting up control registers -
- Turning on paging -
- Ready -
(XEN) Checking for initrd in /chosen
(XEN) RAM: 0000000040000000 - 00000000bfffffff
(XEN)
(XEN) MODULE[0]: 0000000042000000 - 0000000042120d81 Xen
(XEN) MODULE[1]: 00000000be510000 - 00000000be51d000 Device Tree
(XEN) MODULE[2]: 0000000040480000 - 0000000042680000 Kernel
(XEN)  RESVD[0]: 0000000043000000 - 000000004300d000
(XEN)  RESVD[1]: 00000000be510000 - 00000000be51d000
(XEN)
(XEN)
(XEN) Command line: console=dtuart dom0_mem=1024M
(XEN) Domain heap initialised
(XEN) Booting using Device Tree
(XEN) Platform: Generic System
(XEN) Taking dtuart configuration from /chosen/stdout-path
(XEN) Looking for dtuart at "/serial@30860000", options ""
(XEN) Unable to initialize dtuart: -9
(XEN) Bad console= option 'dtuart'
 Xen 4.13-unstable
(XEN) Xen version 4.13-unstable (atomar@) (aarch64-linux-gnu-gcc
(Linaro GCC 7.3-2018.05) 7.3.1 20180425 [linaro-7.3-2018.05 revision
d29120a424ecfbc167ef90065c0eeb7f91977701]) debug=y  Tue Mar 19 19:14:9
(XEN) Latest ChangeSet: Tue Feb 12 18:33:30 2019 +0000 git:1e780ef-dirty
(XEN) Processor: 410fd034: "ARM Limited", variant: 0x0, part 0xd03, rev 0x4
(XEN) 64-bit Execution:
(XEN)   Processor Features: 0000000001002222 0000000000000000
(XEN)     Exception Levels: EL3:64+32 EL2:64+32 EL1:64+32 EL0:64+32
(XEN)     Extensions: FloatingPoint AdvancedSIMD GICv3-SysReg
(XEN)   Debug Features: 0000000010305106 0000000000000000
(XEN)   Auxiliary Features: 0000000000000000 0000000000000000
(XEN)   Memory Model Features: 0000000000001122 0000000000000000
(XEN)   ISA Features:  0000000000011120 0000000000000000
(XEN) 32-bit Execution:
(XEN)   Processor Features: 00000131:10011011
(XEN)     Instruction Sets: AArch32 A32 Thumb Thumb-2 Jazelle
(XEN)     Extensions: GenericTimer Security
(XEN)   Debug Features: 03010066
(XEN)   Auxiliary Features: 00000000
(XEN)   Memory Model Features: 10201105 40000000 01260000 02102211
(XEN)  ISA Features: 02101110 13112111 21232042 01112131 00011142 00011121
(XEN) Using SMC Calling Convention v1.0
(XEN) Using PSCI v1.0
(XEN) SMP: Allowing 4 CPUs
(XEN) Generic Timer IRQ: phys=30 hyp=26 virt=27 Freq: 8333 KHz
(XEN) GICv3 initialization:
(XEN)       gic_dist_addr=0x00000038800000
(XEN)       gic_maintenance_irq=25
(XEN)       gic_rdist_stride=0
(XEN)       gic_rdist_regions=1
(XEN)       redistributor regions:
(XEN)         - region 0: 0x00000038880000 - 0x00000038940000
(XEN) GICv3: 160 lines, (IID 0001143b).
(XEN) GICv3: CPU0: Found redistributor in region 0 @000000004001a000
(XEN) Using scheduler: SMP Credit Scheduler rev2 (credit2)
(XEN) Initializing Credit2 scheduler
(XEN)  load_precision_shift: 18
(XEN)  load_window_shift: 30
(XEN)  underload_balance_tolerance: 0
(XEN)  overload_balance_tolerance: -3
(XEN)  runqueues arrangement: socket
(XEN)  cap enforcement granularity: 10ms
(XEN) load tracking window length 1073741824 ns
(XEN) Adding cpu 0 to runqueue 0
(XEN)  First cpu on runqueue, activating
(XEN) Allocated console ring of 32 KiB.
(XEN) Bringing up CPU1
- CPU 00000001 booting -
- Current EL 00000008 -
- Xen starting at EL2 -
- Setting up control registers -
- Turning on paging -
- Ready -
(XEN) GICv3: CPU1: Found redistributor in region 0 @000000004003a000
(XEN) Adding cpu 1 to runqueue 0
(XEN) CPU 1 booted.
(XEN) Bringing up CPU2
- CPU 00000002 booting -
- Current EL 00000008 -
- Xen starting at EL2 -
- Setting up control registers -
- Turning on paging -
- Ready -
(XEN) GICv3: CPU2: Found redistributor in region 0 @000000004005a000
(XEN) Adding cpu 2 to runqueue 0
(XEN) CPU 2 booted.
(XEN) Bringing up CPU3
- CPU 00000003 booting -
- Current EL 00000008 -
- Xen starting at EL2 -
- Setting up control registers -
- Turning on paging -
- Ready -
(XEN) GICv3: CPU3: Found redistributor in region 0 @000000004007a000
(XEN) Adding cpu 3 to runqueue 0
(XEN) CPU 3 booted.
(XEN) Brought up 4 CPUs
(XEN) P2M: 40-bit IPA with 40-bit PA and 8-bit VMID
(XEN) P2M: 3 levels with order-1 root, VTCR 0x80023558
(XEN) I/O virtualisation disabled
(XEN) build-id: 0e92db8580ada91ca578019e95e002da80d47cdb
(XEN) alternatives: Patching with alt table 00000000002abbf0 -> 00000000002ac238
(XEN) *** LOADING DOMAIN 0 ***
(XEN) Loading Domd0 kernel from boot module @ 0000000040480000
(XEN) Allocating 1:1 mappings totalling 1024MB for dom0:
(XEN) BANK[0] 0x00000060000000-0x000000a0000000 (1024MB)
(XEN) Grant table range: 0x00000042000000-0x00000042040000
(XEN) Allocating PPI 16 for event channel interrupt
(XEN) Loading zImage from 0000000040480000 to 0000000060080000-0000000062280000
(XEN) Loading dom0 DTB to 0x0000000068000000-0x000000006800bab2
(XEN) Initial low memory virq threshold set at 0x4000 pages.
(XEN) Scrubbing Free RAM in background
(XEN) Std. Loglevel: All
(XEN) Guest Loglevel: All
(XEN) *** Serial input to DOM0 (type 'CTRL-a' three times to switch input)
(XEN) Data Abort Trap. Syndrome=0x6
(XEN) Walking Hypervisor VA 0x8 on CPU0 via TTBR 0x0000000042114000
(XEN) 0TH[0x0] = 0x0000000042113f7f
(XEN) 1ST[0x0] = 0x0000000042110f7f
(XEN) 2ND[0x0] = 0x0000000000000000
(XEN) CPU0: Unexpected Trap: Data Abort
(XEN) ----[ Xen-4.13-unstable  arm64  debug=y   Not tainted ]----
(XEN) CPU:    0
(XEN) PC:     000000000021c30c page_alloc.c#free_heap_pages+0x4ac/0x58c
(XEN) LR:     000000000021c308
(XEN) SP:     000080007ffefd30
(XEN) CPSR:   80000249 MODE:64-bit EL2h (Hypervisor, handler)
(XEN)      X0: 0000000000000000  X1: 0000000000000000  X2: 0000000000288db0
(XEN)      X3: ffffffffffffffff  X4: 0000000000040000  X5: 0000000000000000
(XEN)      X6: 0000000000000001  X7: 0180000000000000  X8: 0080000000000000
(XEN)      X9: 0000000000288da0 X10: 0000000000000000 X11: 0000000047ffffff
(XEN)     X12: 0000000000288000 X13: 0000000000288000 X14: 0000000000289000
(XEN)     X15: 6db6db6db6db6db7 X16: fffffff800000000 X17: 3d3d3d3d3d3d3d3d
(XEN)     X18: 0000000000289000 X19: 0000000000000000 X20: 0000000800073f38
(XEN)     X21: 0000000000000000 X22: 6db6db6db6db6db7 X23: 0000000000000013
(XEN)     X24: 0000000000288da0 X25: 0000000000289000 X26: 0000000000200200
(XEN)     X27: 0000000000100100 X28: 0000000800073f00  FP: 000080007ffefd30
(XEN)
(XEN)   VTCR_EL2: 80023558
(XEN)  VTTBR_EL2: 0000000000000000
(XEN)
(XEN)  SCTLR_EL2: 30cd183d
(XEN)    HCR_EL2: 000000000000003a
(XEN)  TTBR0_EL2: 0000000042114000
(XEN)
(XEN)    ESR_EL2: 96000006
(XEN)  HPFAR_EL2: 00000000fdce5ac0
(XEN)    FAR_EL2: 0000000000000008
(XEN)
(XEN) Xen stack trace from sp=000080007ffefd30:
(XEN)    000080007ffefd90 000000000021e5e4 00000000002e0d40 0000000800073f38
(XEN)    0000000000001ca1 0000000000002200 0000000000288d78 000000080000fc00
(XEN)    0000000000000000 0000000040000000 00000000c0000000 6db6db6db6db6db7
(XEN)    000080007ffefe00 000000000021e830 0000000000000002 00000000002b83c0
(XEN)    0000000000288da0 0000000040480000 0000000042680000 000000000021e79c
(XEN)    00000000002b83d0 0000000040000000 00000000c0000000 0000000000000001
(XEN)    0000000000000001 00000000002e0d90 000080007ffefe10 000000000029c938
(XEN)    000080007ffefe60 000000000029cef4 0000000000000002 00000000002b83c0
(XEN)    0000000000288da0 000000000021e79c 0000000042680000 0000000040480000
(XEN)    00000000be510000 00000000be51d000 000080007ffefea0 0000000000252588
(XEN)    0000000000287000 0000000000000004 0000000000287c80 000000000031a430
(XEN)    0000000000000004 00000000002836a0 00000000002d7de0 000000000029daac
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000
(XEN) Xen call trace:
(XEN)    [<000000000021c30c>] page_alloc.c#free_heap_pages+0x4ac/0x58c (PC)
(XEN)    [<000000000021c308>] page_alloc.c#free_heap_pages+0x4a8/0x58c (LR)
(XEN)    [<000000000021e5e4>] page_alloc.c#init_heap_pages+0x334/0x4ec
(XEN)    [<000000000021e830>] init_domheap_pages+0x94/0x9c
(XEN)    [<000000000029c938>] 000000000029c938
(XEN)    [<000000000029cef4>] 000000000029cef4
(XEN)    [<0000000000252588>] setup.c#init_done+0x10/0x20
(XEN)    [<000000000029daac>] 000000000029daac
(XEN)
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) CPU0: Unexpected Trap: Data Abort
(XEN) ****************************************
(XEN)
(XEN) Reboot in five seconds...


On the other hand, it didn't come on 4.11.

Thanks
-Amit

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Arm boot regression with Xen 4.12
  2019-03-19 14:01           ` Amit Tomer
@ 2019-03-19 15:05             ` Julien Grall
  2019-03-22 10:48               ` Julien Grall
  0 siblings, 1 reply; 15+ messages in thread
From: Julien Grall @ 2019-03-19 15:05 UTC (permalink / raw)
  To: Amit Tomer
  Cc: Juergen Gross, xen-devel, peng.fan, Stefano Stabellini, Andre Przywara



On 19/03/2019 14:01, Amit Tomer wrote:
> I tried the above patch but still see the same crash:

[..]

> 
> On the other hand, it didn't come on 4.11.

That's good to know. Can you bisect Xen and see if you can pin point a specific 
commit?

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Arm boot regression with Xen 4.12
  2019-03-19 15:05             ` Julien Grall
@ 2019-03-22 10:48               ` Julien Grall
  2019-03-22 11:35                 ` Amit Tomer
  0 siblings, 1 reply; 15+ messages in thread
From: Julien Grall @ 2019-03-22 10:48 UTC (permalink / raw)
  To: Amit Tomer
  Cc: Juergen Gross, xen-devel, peng.fan, Stefano Stabellini, Andre Przywara

Hi Amit,

On 19/03/2019 15:05, Julien Grall wrote:
> 
> 
> On 19/03/2019 14:01, Amit Tomer wrote:
>> I tried the above patch but still see the same crash:
> 
> [..]
> 
>>
>> On the other hand, it didn't come on 4.11.
> 
> That's good to know. Can you bisect Xen and see if you can pin point a specific 
> commit?

I am wondering if you had time to bisect the issue?

We are releasing Xen 4.12 soon so we need to make the decision whether this 
should be fixed after (and backport it) or before.

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Arm boot regression with Xen 4.12
  2019-03-22 10:48               ` Julien Grall
@ 2019-03-22 11:35                 ` Amit Tomer
  2019-04-17  8:02                     ` [Xen-devel] " Amit Tomer
  0 siblings, 1 reply; 15+ messages in thread
From: Amit Tomer @ 2019-03-22 11:35 UTC (permalink / raw)
  To: Julien Grall
  Cc: Juergen Gross, xen-devel, peng.fan, Stefano Stabellini, Andre Przywara

Hi,


> I am wondering if you had time to bisect the issue?
>
> We are releasing Xen 4.12 soon so we need to make the decision whether this
> should be fixed after (and backport it) or before.

I am planning to look at it on this weekends and let you know if I find
something.

Thanks
-Amit

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Arm boot regression with Xen 4.12
@ 2019-04-17  8:02                     ` Amit Tomer
  0 siblings, 0 replies; 15+ messages in thread
From: Amit Tomer @ 2019-04-17  8:02 UTC (permalink / raw)
  To: Julien Grall
  Cc: Juergen Gross, xen-devel, peng.fan, Stefano Stabellini, Andre Przywara

Hello,

On Fri, Mar 22, 2019 at 5:05 PM Amit Tomer <amittomer25@gmail.com> wrote:
>
> Hi,
>
>
> > I am wondering if you had time to bisect the issue?
> >
> > We are releasing Xen 4.12 soon so we need to make the decision whether this
> > should be fixed after (and backport it) or before.

Don't see this crash if I chose to have different load addresses(Load
kernel at 2 MB aligned address).
For instance, using

"setenv xen_addr_r 0x40480000 ;setenv fdt_addr_r 0x43000000;setenv
kernel_addr_r 0x41000000"
 instead of
"setenv xen_addr_r 0x42000000 ;setenv fdt_addr_r 0x43000000;setenv
kernel_addr_r 0x40480000"

Allow it boot properly(Tested it with 4.13).

Thanks
-Amit

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Xen-devel] Arm boot regression with Xen 4.12
@ 2019-04-17  8:02                     ` Amit Tomer
  0 siblings, 0 replies; 15+ messages in thread
From: Amit Tomer @ 2019-04-17  8:02 UTC (permalink / raw)
  To: Julien Grall
  Cc: Juergen Gross, xen-devel, peng.fan, Stefano Stabellini, Andre Przywara

Hello,

On Fri, Mar 22, 2019 at 5:05 PM Amit Tomer <amittomer25@gmail.com> wrote:
>
> Hi,
>
>
> > I am wondering if you had time to bisect the issue?
> >
> > We are releasing Xen 4.12 soon so we need to make the decision whether this
> > should be fixed after (and backport it) or before.

Don't see this crash if I chose to have different load addresses(Load
kernel at 2 MB aligned address).
For instance, using

"setenv xen_addr_r 0x40480000 ;setenv fdt_addr_r 0x43000000;setenv
kernel_addr_r 0x41000000"
 instead of
"setenv xen_addr_r 0x42000000 ;setenv fdt_addr_r 0x43000000;setenv
kernel_addr_r 0x40480000"

Allow it boot properly(Tested it with 4.13).

Thanks
-Amit

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Arm boot regression with Xen 4.12
@ 2019-04-17  9:22                       ` Julien Grall
  0 siblings, 0 replies; 15+ messages in thread
From: Julien Grall @ 2019-04-17  9:22 UTC (permalink / raw)
  To: Amit Tomer
  Cc: Juergen Gross, xen-devel, peng.fan, Stefano Stabellini, Andre Przywara

On 17/04/2019 09:02, Amit Tomer wrote:
> Hello,

Hi,

> On Fri, Mar 22, 2019 at 5:05 PM Amit Tomer <amittomer25@gmail.com> wrote:
>>
>> Hi,
>>
>>
>>> I am wondering if you had time to bisect the issue?
>>>
>>> We are releasing Xen 4.12 soon so we need to make the decision whether this
>>> should be fixed after (and backport it) or before.
> 
> Don't see this crash if I chose to have different load addresses(Load
> kernel at 2 MB aligned address).
> For instance, using
> 
> "setenv xen_addr_r 0x40480000 ;setenv fdt_addr_r 0x43000000;setenv
> kernel_addr_r 0x41000000"
>   instead of
> "setenv xen_addr_r 0x42000000 ;setenv fdt_addr_r 0x43000000;setenv
> kernel_addr_r 0x40480000"

Glad to hear that you manage to boot Xen with a different load address. I would 
still like to understand what is the exact issue as this may be a bug in Xen.

On IRC, you mention the offending commit is f60658c6ae "xen/arm: Stop relocating 
Xen". You also pointed out that init_heap_pages was call with a NULL page.

Did you find out why it is NULL? What was the MFN looked up?

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Xen-devel] Arm boot regression with Xen 4.12
@ 2019-04-17  9:22                       ` Julien Grall
  0 siblings, 0 replies; 15+ messages in thread
From: Julien Grall @ 2019-04-17  9:22 UTC (permalink / raw)
  To: Amit Tomer
  Cc: Juergen Gross, xen-devel, peng.fan, Stefano Stabellini, Andre Przywara

On 17/04/2019 09:02, Amit Tomer wrote:
> Hello,

Hi,

> On Fri, Mar 22, 2019 at 5:05 PM Amit Tomer <amittomer25@gmail.com> wrote:
>>
>> Hi,
>>
>>
>>> I am wondering if you had time to bisect the issue?
>>>
>>> We are releasing Xen 4.12 soon so we need to make the decision whether this
>>> should be fixed after (and backport it) or before.
> 
> Don't see this crash if I chose to have different load addresses(Load
> kernel at 2 MB aligned address).
> For instance, using
> 
> "setenv xen_addr_r 0x40480000 ;setenv fdt_addr_r 0x43000000;setenv
> kernel_addr_r 0x41000000"
>   instead of
> "setenv xen_addr_r 0x42000000 ;setenv fdt_addr_r 0x43000000;setenv
> kernel_addr_r 0x40480000"

Glad to hear that you manage to boot Xen with a different load address. I would 
still like to understand what is the exact issue as this may be a bug in Xen.

On IRC, you mention the offending commit is f60658c6ae "xen/arm: Stop relocating 
Xen". You also pointed out that init_heap_pages was call with a NULL page.

Did you find out why it is NULL? What was the MFN looked up?

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2019-04-17  9:23 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-18  7:39 Running XEN on imx8mq Amit Tomer
2019-03-18 10:33 ` Julien Grall
2019-03-18 10:41   ` Amit Tomer
2019-03-18 11:21     ` Julien Grall
2019-03-18 12:45       ` Amit Tomer
2019-03-18 15:12       ` Amit Tomer
2019-03-19 10:33         ` Arm boot regression with Xen 4.12 Julien Grall
2019-03-19 14:01           ` Amit Tomer
2019-03-19 15:05             ` Julien Grall
2019-03-22 10:48               ` Julien Grall
2019-03-22 11:35                 ` Amit Tomer
2019-04-17  8:02                   ` Amit Tomer
2019-04-17  8:02                     ` [Xen-devel] " Amit Tomer
2019-04-17  9:22                     ` Julien Grall
2019-04-17  9:22                       ` [Xen-devel] " Julien Grall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.