[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v6 3/5] xen/arm64: mm: Introduce helpers to prepare/enable/disable the identity mapping


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Fri, 3 Mar 2023 10:35:14 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cN5YmQIz2EE/czgxeRJLRjP2UdqsnUy2/I1lmBst4ho=; b=fdxsvB3zI5VNqAqLtAv961bnGfG+AwvcrqnLWEivreo+x66osZc28V6fl635Wm6fcCtxwqoOo4ZhS+hxk5YZ/Rg8jdH0X+pexBS8KC58m4fsip7MEiqQ+Xc/mel6aCAJHDYX6Ctr3oBVsa9/KIggtN+3GbEZrqtEWHyEulybE8BPjf2DygqL0Ot78RZCeRCNkzGGeXFqTLXPMwRhGuBn6jOTQTvL4YE5ZXMUPVAV/V9wCibtFrAoz1YGKntyBHWE9Kk3UyewNNcaAf1u59QWYMZM++vPwm3ZE8ruw51SjCiXWiKUYzzlOec3HldRGxDCgFpqrMWkahyT0Q+33j/V0g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SHRTn1TcJAs67CZJkyKlemyyIrqeJkWQ5aKogIBqijDxLXVQQB0iNG/RIABXzXtuzjyYwol/j9p2XrxkxAZBJmqUXZL+tkGrwoE98CaCXJyqsT0EHYC20s+WP9kneSG76Mki/XIgEhZIvpNbRm9oRDEx9ln/EVRSOgTNAGOB8AlipSVZ/wyrG9gay/Vspc9B95mVnJoGUwOFDnROJwf2oQu/DLB1PldQNhRmvBulM8ZieNymysG/91TVIjSHYtRXBN6SxLfA9dW3/wmuPaXhfDpVir5nbBJMy38tSRZ9yARSgaRhbryStquGc2kfRYDDpe1HSDoi/5KDrOxA5s7/qw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Luca Fancellu <Luca.Fancellu@xxxxxxx>, "michal.orzel@xxxxxxx" <michal.orzel@xxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>
  • Delivery-date: Fri, 03 Mar 2023 10:35:41 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZTRemNcTNCEx/pkKdN97JgIHeCq7o3XCA
  • Thread-topic: [PATCH v6 3/5] xen/arm64: mm: Introduce helpers to prepare/enable/disable the identity mapping

Hi Julien,

> On 2 Mar 2023, at 15:59, Julien Grall <julien@xxxxxxx> wrote:
> 
> From: Julien Grall <jgrall@xxxxxxxxxx>
> 
> In follow-up patches we will need to have part of Xen identity mapped in
> order to safely switch the TTBR.
> 
> On some platform, the identity mapping may have to start at 0. If we always
> keep the identity region mapped, NULL pointer dereference would lead to
> access to valid mapping.
> 
> It would be possible to relocate Xen to avoid clashing with address 0.
> However the identity mapping is only meant to be used in very limited
> places. Therefore it would be better to keep the identity region invalid
> for most of the time.
> 
> Two new external helpers are introduced:
>    - arch_setup_page_tables() will setup the page-tables so it is
>      easy to create the mapping afterwards.
>    - update_identity_mapping() will create/remove the identity mapping
> 
> Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>

In Arm internal CI this patch (or maybe an other in the serie) made one
of our test crash on qemu-arm64.

The error log is here after.

Cheers
Bertrand

- UART enabled -

- Boot CPU booting -

- Current EL 0000000000000008 -

- Initialize CPU -

- Turning on paging -

- Zero BSS -

- Ready -

(XEN) Checking for initrd in /chosen

(XEN) RAM: 0000000040000000 - 00000000bfffffff

(XEN) 

(XEN) MODULE[0]: 0000000040200000 - 00000000403590c8 Xen 

(XEN) MODULE[1]: 0000000048000000 - 0000000048008f20 Device Tree 

(XEN) MODULE[2]: 0000000045000000 - 00000000463e3200 Kernel 

(XEN) 

(XEN) 

(XEN) Command line: console=dtuart dtuart=/pl011@9000000 dom0_mem=512m

(XEN) Domain heap initialised

(XEN) Booting using Device Tree

(XEN) Platform: Generic System

(XEN) Looking for dtuart at "/pl011@9000000", options ""

Xen 4.18-unstable

(XEN) Xen version 4.18-unstable (@eu-west-1.compute.internal) 
(aarch64-poky-linux-gcc (GCC) 11.3.0) debug=y 2023-03-02

(XEN) Latest ChangeSet: 

(XEN) build-id: cc83f93cef7a75d303680ba1f98e756c07df5497

(XEN) Processor: 00000000411fd070: "ARM Limited", variant: 0x1, part 0xd07,rev 
0x0

(XEN) 64-bit Execution:

(XEN) Processor Features: 0000000001000222 0000000000000000

(XEN) Exception Levels: EL3:No 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: 0000000000001124 0000000000000000

(XEN) ISA Features: 0000000000011120 0000000000000000

(XEN) 32-bit Execution:

(XEN) Processor Features: 0000000000000131:0000000010011001

(XEN) Instruction Sets: AArch32 A32 Thumb Thumb-2 Jazelle

(XEN) Extensions: GenericTimer

(XEN) Debug Features: 0000000003010066

(XEN) Auxiliary Features: 0000000000000000

(XEN) Memory Model Features: 0000000010101105 0000000040000000

(XEN) 0000000001260000 0000000002102211

(XEN) ISA Features: 0000000002101110 0000000013112111 0000000021232042

(XEN) 0000000001112131 0000000000011142 0000000000011121

(XEN) Using SMC Calling Convention v1.0

(XEN) Using PSCI v0.2

(XEN) SMP: Allowing 4 CPUs

(XEN) enabled workaround for: ARM erratum 832075

(XEN) enabled workaround for: ARM erratum 834220

(XEN) enabled workaround for: ARM erratum 1319367

(XEN) Generic Timer IRQ: phys=30 hyp=26 virt=27 Freq: 62500 KHz

(XEN) GICv3 initialization:

(XEN) gic_dist_addr=0x00000008000000

(XEN) gic_maintenance_irq=25

(XEN) gic_rdist_stride=0

(XEN) gic_rdist_regions=1

(XEN) redistributor regions:

(XEN) - region 0: 0x000000080a0000 - 0x00000009000000

(XEN) GICv3: 256 lines, (IID 0000043b).

(XEN) GICv3: CPU0: Found redistributor in region 0 @000000004001c000

(XEN) XSM Framework v1.0.1 initialized

(XEN) Initialising XSM SILO mode

(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) Allocated console ring of 32 KiB.

(XEN) CPU0: Guest atomics will try 1 times before pausing the domain

(XEN) Bringing up CPU1

(XEN) arch/arm/mm.c:874: Changing MFN for a valid entry is not allowed (0x8284 
-> 0x40200).

(XEN) Xen WARN at arch/arm/mm.c:874

(XEN) ----[ Xen-4.18-unstable arm64 debug=y Not tainted ]----

(XEN) CPU: 0

(XEN) PC: 0000020000272438 mm.c#xen_pt_update+0x6d0/0x82c

(XEN) LR: 0000020000272438

(XEN) SP: 000002000030fc60

(XEN) CPSR: 0000000080000249 MODE:64-bit EL2h (Hypervisor, handler)

(XEN) X0: 0000020000318038 X1: 0000000000000002 X2: 0000000000000000

(XEN) X3: 0000000000000003 X4: 00000200002be956 X5: 0000000000000002

(XEN) X6: 000080007ffe9360 X7: fefefefefefefefe X8: ffffffffffffffff

(XEN) X9: 0000000000000080 X10: 7f7f7f7f7f7f7f7f X11: 0101010101010101

(XEN) X12: 0000000000000008 X13: 0000000000000030 X14: 0000000000000005

(XEN) X15: 0000000000000000 X16: fffffff800000000 X17: 0000000000000001

(XEN) X18: 0180000000000000 X19: 0000800000326000 X20: 0000000000000003

(XEN) X21: 0000800000326000 X22: 000002000030fd5c X23: 000002000034f000

(XEN) X24: 0000000000000003 X25: 0000000000040200 X26: 000002000031b074

(XEN) X27: 0000000000000000 X28: 0000000000040200 FP: 000002000030fc60

(XEN) 

(XEN) VTCR_EL2: 0000000000000000

(XEN) VTTBR_EL2: 0000000000000000

(XEN) 

(XEN) SCTLR_EL2: 0000000030cd183d

(XEN) HCR_EL2: 0000000000000038

(XEN) TTBR0_EL2: 000000004034e000

(XEN) 

(XEN) ESR_EL2: 00000000f2000001

(XEN) HPFAR_EL2: 0000000000000000

(XEN) FAR_EL2: 0000000000000000

(XEN) 

(XEN) Xen stack trace from sp=000002000030fc60:

(XEN) 000002000030fd60 00000200002727f8 ff00000040200b80 0000000000000000

(XEN) 0000000000000001 000002000034f430 000002000034f000 00000200002aef18

(XEN) 00000200002f0d38 0000000000000001 0000000048000000 0000000000008f20

(XEN) 0000000000000001 0000020000000037 0000000000000001 0000000000000001

(XEN) 000000010030fd00 00000200002b4eb8 0000000000000001 000000000004034e

(XEN) 0000000000000020 0000020000000037 0000000000000000 0000000000000001

(XEN) 0000000000000000 000002000031b074 0000000040200000 0000000000000001

(XEN) 000002000030fd60 000002000024c710 0000000100000000 0000000000000001

(XEN) 000002000030fd70 0000020000265cac 000002000030fda0 0000020000265d38

(XEN) 0000000000000001 0000000000000000 0000000000000001 00000200002aef18

(XEN) 000002000030fdc0 00000200002787f4 0000000000000001 00000200002787ac

(XEN) 000002000030fe10 0000020000201f78 0000000000000001 0000000000000000

(XEN) 00000200002f0d38 00000200002dccf8 000002000030fe10 0000020000201f50

(XEN) 0000000000000001 00000200002c1358 000002000030fe40 00000200002dc92c

(XEN) 0000000000000001 00000200002b3000 00000000c0000000 00000200002bee58

(XEN) 0000000000000000 00000200002001bc 0000000040200000 fffffe0040000000

(XEN) 0000000048000000 0000000000000000 0000020000400000 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 0000000000000000 0000000000000000

(XEN) 0000000000000000 0000000000000000 0000000000000000 0000000000000000

(XEN) 0000000000000000 0000000000000000 0000000000000000 0000000000000000

(XEN) Xen call trace:

(XEN) [<0000020000272438>] mm.c#xen_pt_update+0x6d0/0x82c (PC)

(XEN) [<0000020000272438>] mm.c#xen_pt_update+0x6d0/0x82c (LR)

(XEN) [<00000200002727f8>] map_pages_to_xen+0x10/0x1c

(XEN) [<0000020000265cac>] update_identity_mapping+0x58/0x94

(XEN) [<0000020000265d38>] arch_cpu_up+0x30/0x78

(XEN) [<00000200002787f4>] __cpu_up+0x80/0x1d0

(XEN) [<0000020000201f78>] cpu_up+0xc8/0xf8

(XEN) [<00000200002dc92c>] start_xen+0x8fc/0xcb0

(XEN) [<00000200002001bc>] head.o#primary_switched+0x10/0x30

(XEN) 

(XEN) Xen BUG at arch/arm/arm64/mm.c:120

(XEN) ----[ Xen-4.18-unstable arm64 debug=y Not tainted ]----

(XEN) CPU: 0

(XEN) PC: 0000020000265ce4 update_identity_mapping+0x90/0x94

(XEN) LR: 0000020000265cac

(XEN) SP: 000002000030fd70

(XEN) CPSR: 0000000080000249 MODE:64-bit EL2h (Hypervisor, handler)

(XEN) X0: 00000000ffffffea X1: 0000000000000001 X2: 0000000000000000

(XEN) X3: 0000000000000002 X4: 00000200002bee06 X5: 0000000000000001

(XEN) X6: 000080007ffe9358 X7: fefefefefefefefe X8: ffffffffffffffff

(XEN) X9: 0000000000000080 X10: 7f7f7f7f7f7f7f7f X11: 0101010101010101

(XEN) X12: 0000000000000008 X13: 0000000000000030 X14: 0000000000000005

(XEN) X15: 0000000000000000 X16: fffffff800000000 X17: 0000000000000001

(XEN) X18: 0180000000000000 X19: ff00000040200b80 X20: 0000000000000000

(XEN) X21: 0000000000000001 X22: 000002000034f430 X23: 000002000034f000

(XEN) X24: 00000200002aef18 X25: 00000200002f0d38 X26: 0000000000000001

(XEN) X27: 0000000048000000 X28: 0000000000008f20 FP: 000002000030fd70

(XEN) 

(XEN) VTCR_EL2: 0000000000000000

(XEN) VTTBR_EL2: 0000000000000000

(XEN) 

(XEN) SCTLR_EL2: 0000000030cd183d

(XEN) HCR_EL2: 0000000000000038

(XEN) TTBR0_EL2: 000000004034e000

(XEN) 

(XEN) ESR_EL2: 00000000f2000001

(XEN) HPFAR_EL2: 0000000000000000

(XEN) FAR_EL2: 0000000000000000

(XEN) 

(XEN) Xen stack trace from sp=000002000030fd70:

(XEN) 000002000030fda0 0000020000265d38 0000000000000001 0000000000000000

(XEN) 0000000000000001 00000200002aef18 000002000030fdc0 00000200002787f4

(XEN) 0000000000000001 00000200002787ac 000002000030fe10 0000020000201f78

(XEN) 0000000000000001 0000000000000000 00000200002f0d38 00000200002dccf8

(XEN) 000002000030fe10 0000020000201f50 0000000000000001 00000200002c1358

(XEN) 000002000030fe40 00000200002dc92c 0000000000000001 00000200002b3000

(XEN) 00000000c0000000 00000200002bee58 0000000000000000 00000200002001bc

(XEN) 0000000040200000 fffffe0040000000 0000000048000000 0000000000000000

(XEN) 0000020000400000 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 0000000000000000 0000000000000000

(XEN) 0000000000000000 0000000000000000 0000000000000000 0000000000000000

(XEN) 0000000000000000 0000000000000000

(XEN) Xen call trace:

(XEN) [<0000020000265ce4>] update_identity_mapping+0x90/0x94 (PC)

(XEN) [<0000020000265cac>] update_identity_mapping+0x58/0x94 (LR)

(XEN) [<0000020000265d38>] arch_cpu_up+0x30/0x78

(XEN) [<00000200002787f4>] __cpu_up+0x80/0x1d0

(XEN) [<0000020000201f78>] cpu_up+0xc8/0xf8

(XEN) [<00000200002dc92c>] start_xen+0x8fc/0xcb0

(XEN) [<00000200002001bc>] head.o#primary_switched+0x10/0x30

(XEN) 

(XEN) 

(XEN) ****************************************

(XEN) Panic on CPU 0:

(XEN) Xen BUG at arch/arm/arm64/mm.c:120

(XEN) ****************************************

(XEN) 

(XEN) Reboot in five seconds...





 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.