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

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


  • To: Julien Grall <julien@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Fri, 12 Jan 2024 08:46:13 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=xen.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • 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=bnd7J5FANgzq3NBtty+tCjcs0vY7BqLpDfokzVuEKQE=; b=JmmsOjP5BhvSiOPX2Bt0UuO/0yivVjXBVp3iyt18gClog7ngikDEjmgejpmC/ZH5VntPxrqRO0GNU7uJuVDOyPtLDffH3EG2jGfV28YG3SsGb/ScfkqTrQjfX3ww83puzXKAbfJpv9Eu2CUS1lrppP/jwE+YwqhYZmzx70amxxG/isWHulUtFbuGNmysbT19HPqR7fd9Z3a1mdI8rHM3AiPc85Qq23UUpO9iBoixA0VWyv9V/6h3AM7soMWey1Cb+NU10HsdvkjjpP9YU+iaSVntY/0zI/W3gHrWJxU73LzhX2eSIc2JNv8aAWYSrjdQmAHvKuyy2DSTU0ycT9IGvg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mKdHEDxHvKJkvaFl8rAcLP4AYLywqpJEq8RMx94YQZNvNgoUUm/A0TxqX2RO8r0l/tp/xhxGdpNMlLypTTIW4DPpWtM6UT4p06FacAl//7sZxJ7B15b6GWSlKycXrUxT3rJ75aKDs3cCwGk74aarjSVBopmYgi7VR3NExaC64trjZrLLFhDBz03Owp/o6pTY0FkPsZWpGyq5yr/h+PzH9TUr9CAuueYU6/twLak8FeD9zRBRybdJiuyn/Z/ToMKvxMyUlpp6J4SvvqnunvU3RNcNIIYQp7UEc2K0Zu8hy+sqSJZOfeJreueQC92j3WlcGQXwKoXkbDzH+WkeKHSrRw==
  • Cc: Julien Grall <jgrall@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Fri, 12 Jan 2024 07:46:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Julien,

On 11/01/2024 19:34, Julien Grall 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>
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>

with below 2 adjustments:
> 
> ----
> 
>     Changelog since v1:
>         * Rebase
>         * Move the UART mapping enable_mm_boot_cpu()
> ---
>  xen/arch/arm/arm32/mmu/head.S | 61 ++++++++---------------------------
>  1 file changed, 14 insertions(+), 47 deletions(-)
> 
> diff --git a/xen/arch/arm/arm32/mmu/head.S b/xen/arch/arm/arm32/mmu/head.S
> index 4e6395e7876d..a90799ad5451 100644
> --- a/xen/arch/arm/arm32/mmu/head.S
> +++ b/xen/arch/arm/arm32/mmu/head.S
> @@ -165,11 +165,6 @@
>   * Rebuild the boot pagetable's first-level entries. The structure
>   * is described in mm.c.
>   *
> - * After the CPU enables paging it will add the fixmap mapping
> - * to these page tables, however this may clash with the 1:1
> - * mapping. So each CPU must rebuild the page tables here with
> - * the 1:1 in place.
> - *
>   * Inputs:
>   *   r9 : paddr(start)
>   *   r10: phys offset
> @@ -197,6 +192,10 @@ create_page_tables:
>          add   r5, r5, #PAGE_SIZE            /* r5 := Next table */
>  .endr
> 
> +        /* Map the fixmap into boot_second */
> +        mov_w r0, FIXMAP_ADDR(0)
> +        create_table_entry boot_second, xen_fixmap, r0, 2
> +
>          /*
>           * Find the size of Xen in pages and multiply by the size of a
>           * PTE. This will then be compared in the mapping loop below.
> @@ -442,19 +441,20 @@ ENDPROC(enable_secondary_cpu_mm)
>  ENTRY(enable_boot_cpu_mm)
>          mov   r6, lr
> 
> +#ifdef CONFIG_EARLY_PRINTK
> +        /*
> +         * Add the UART mapping to the fixmap so the UART can be used
> +         * as the MMU is on. This only need to do done on the boot CPU.
s/need to do done/needs to be done/

> +         */
> +        mov_w r0, EARLY_UART_VIRTUAL_ADDRESS
> +        create_mapping_entry xen_fixmap, r0, r11, type=PT_DEV_L3
Would you mind listing r11 in the Input section of a comment?

~Michal



 


Rackspace

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