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

Re: [PATCH 1/2] xen/arm32: head: Rework how the fixmap and early UART mapping are prepared


  • To: Julien Grall <julien@xxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Thu, 2 Nov 2023 02:29:57 +0000
  • Accept-language: zh-CN, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • 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=2; 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=Jtxg3k86Voh2Q2GNY+hGzJPlq9sU77v95sycEcpAjQQ=; b=gp/dOSJnmzTI0N8RbhY+1L0MGax+4NDQqAp4LjLAn9ZOUBcLCCJRrHFznZq3TIY2N/IHsB/PrDG+E0lVKsGN2OCA56e7RR9DWaYugS/6pyc2swYWA+ENLFdsLYcB4b+hh7zORWQBN2kfBUkWnWzaJpnTL6ZGFABgj3rak2f8wwfCZyiGeSQtviwh+wG5spWV2F7UtfLVAPB0INtUr/CElooZr6nopQgyxC0Z6ZrCoAwUUyfAuclp/uTNN05dgZKbf8+To7Wdm5E6fqBqRZ4FH5HqtDaB4TdCHrJXeXMOvsmojfGVHA3P8rU7n4k8Utqh7QxbFf7cEUHKRjnL4j4a9A==
  • 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=Jtxg3k86Voh2Q2GNY+hGzJPlq9sU77v95sycEcpAjQQ=; b=VqGFAz2/glXxIwmTJxy8l1a7HmpcSLhE/KHwexthjxaDMn+DLpbJ4rbIDzclRfbNMKIbei6T07ilLxom3PeWhRut0vVU89MriUCuyH2ZbCwC1h7e3TZFjzWXJxOBT2ZlVF9X1EElCClRTPiXEK6ghlINdJRuI5hGQEHIadjTHi+yNmeqJ6jXH4vs3skB3K/hlA2effFNYUtKmBF4JrAy5y1eXxRDpvuxCsy3BrfIvU36nuFe1L4SJ5caL9K4fRT636xoTTBaLSFhlkD+EhZxDmwzJexmUFEK7DagGr1ZEyBHyqvPG+/qOoK4I928Ph4DtRwH5jqmfH1o/5lfZvh7Jw==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=YN/FKm4XupnlHxv6d8srl2WU5HgDXuj6Se6m8FGoMC6k5chjoln4EC88bDyMA+lgbMEeCjNd+j6o9j8ySH8S3hpuI9PzZWgOUM4+HZ2NcHbSLlHTQWKmv9k7gwLDGT9pYIA9e5eAdRvSuM0/xr+xXxN2W/UmmdYKPZcj2ka0sprHIL2DtQIXx+yEJro2OZUMfHDTRCDlU3NxtCMgr2hbAEjVQbW4uGdq6+dd9CNVYya7UQKDfMrfZ0n6Cjnfb/tU0CtX7YMS3jESDd4MXAUiaDJLDzcNAPXDb75fGa5xj87x2lE6sVBgZ9FKmmqO2w4YBfmrWcwxzZV+9hXjCG1b8w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c/TA0iMwM8/hqsha7h4PijpeVY81gqoQvOI/7kOvmcEbQlqFO0jduNKwWNf7FM+x+669laG9zGRtC+TPAJU/MwLUl6OM4ajqu/+gc/c01aKCGWN2fJadYWJB1OH3qUSmCNOIV97M9dQW9QkgcLTs86WPn8lqU75vLyjCBo8BHrXL44lUlL5m2JKQ57rlnVJsgjHXhqmqOibcAaH3hb9Etih3oyMnyeCofId5BZ+5P08byT3kXs2IGWxAmTu4jrkKduBOnlfUeeQRJNNLduc7zf39IOZRTfsgjWlC5osFe5GXyrlCT3rwncsqjjfp3T6R7qKSV4fQAdkRhn9zzic58Q==
  • 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>, Michal Orzel <michal.orzel@xxxxxxx>, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Thu, 02 Nov 2023 02:30:39 +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: AQHaDRtrrldLYi71I0SBpLEDDiH4ZbBmTqoA
  • Thread-topic: [PATCH 1/2] xen/arm32: head: Rework how the fixmap and early UART mapping are prepared

Hi Julien,

> On Nov 2, 2023, at 07:30, Julien Grall <julien@xxxxxxx> wrote:
> 
> From: Julien Grall <jgrall@xxxxxxxxxx>
> 
> Since commit 5e213f0f4d2c ("xen/arm32: head: Widen the use of the
> temporary mapping"), boot_second (used to cover regions like Xen and
> the fixmap) will not be mapped if the identity mapping overlap.
> 
> So it is ok to prepare the fixmap table and link it in boot_second
> earlier. With that, the fixmap can also be used earlier via the
> temporary mapping.
> 
> Therefore split setup_fixmap() in two:
>    * The table is now linked in create_page_tables() because
>      the boot page tables needs to be recreated for every CPU.
>    * The early UART mapping is only added for the boot CPU0 as the
>      fixmap table is not cleared when secondary CPUs boot.
> 
> Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>
> ---
> xen/arch/arm/arm32/head.S | 48 ++++++++-------------------------------
> 1 file changed, 9 insertions(+), 39 deletions(-)
> 
> diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
> index 33b038e7e0ca..fec2433e568f 100644
> --- a/xen/arch/arm/arm32/head.S
> +++ b/xen/arch/arm/arm32/head.S
> @@ -183,12 +183,16 @@ past_zImage:
>         bl    check_cpu_mode
>         bl    cpu_init
>         bl    create_page_tables
> +        /* Add the UART mapping if requested */
> +#ifdef CONFIG_EARLY_PRINTK
> +        mov_w r0, EARLY_UART_VIRTUAL_ADDRESS
> +        create_mapping_entry xen_fixmap, r0, r11, type=PT_DEV_L3

I tried to test this series today and found a corner case in this patch:

If we build Xen only with this patch, and CONFIG_EARLY_PRINTK=y, we
will get below from compiler:

```
arch/arm/arm32/head.S: Assembler messages:
arch/arm/arm32/head.S:189: Error: bad instruction `create_mapping_entry 
xen_fixmap,r0,r11,type=0xe73'
make[3]: *** [Rules.mk:253: arch/arm/arm32/head.o] Error 1
```

With the second patch applied, the above error will disappear and I confirm
arm32 will work fine with both patch applied + either CONFIG_EARLY_PRINTK={y,n}.

Kind regards,
Henry







 


Rackspace

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