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

Re: [XEN v4 1/2] xen/arm32: head: Introduce enable_{boot,secondary}_cpu_mm()


  • To: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Mon, 20 Nov 2023 08:07:07 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=BYh1IDibsWIqHo7v72+Jzf4DCElzE2X9QKGgnPPDBjI=; b=k7SzM7zErTI/bdT/wgR+00hVROcq+J19MayCAApmAVe3pQwe84muEPfko/8y/hbFOejqOo4SfeDK1VyRjfmn/D8NnMkkThWAZiqPh6s3CZZXA6nWYNAChr9kIFTGTp7gIc1NYpAf1XDw7F1BZPnWOjar8vDn/Qui9ZW1s24TOmhvENQr/mmZxWv/sgHcVb78r5HeHvkTFRyfvFFi5Hddw5/zTme9bbtjKt39IIlsTeECJ0fF+2DcA9PJU4a4pG/NLyrcNy899YXlUuWDbwKL1E/tMzPSz+1BPWh44khGHvet6k0BOsTnkPJ7TqZkbjcOwkz+zZReqYBrJc71XU/GGA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kpQDOhKojxeJailGZTn2hUTMcHcWX8k7EAIBWuVbd54g29OQTvEPTE4sfVYlSNMO/6mtJPKbmo4kodf490PkQf9n07/1rxTiUqnQ73Kk1elIAmcReBugVegKkSxHGcgakwxUCPA67vHRWObDNv4hgz/2eSwFkr6vDXx0NFGK4QcpvHL53hyGP7GYi/YAI+HdWCt7XNzPoZv5V2ucblFn7JZdNJcUolEzvPF16w3IGl4KnPEEhB1R/qeq7pQFveE9iydPGZrHl0yavs4GS61ZSvNFOMoWtrWYFwz3P8Sfl+zVL9G2wOmygQL5or5CFoM+HbUbYWQ4vlD1jDYm2Sz5fw==
  • Cc: <sstabellini@xxxxxxxxxx>, <stefano.stabellini@xxxxxxx>, <julien@xxxxxxx>, <Volodymyr_Babchuk@xxxxxxxx>, <bertrand.marquis@xxxxxxx>, <jgrall@xxxxxxxxxx>, <henry.wang@xxxxxxx>
  • Delivery-date: Mon, 20 Nov 2023 07:07:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Ayan,

On 17/11/2023 16:31, Ayan Kumar Halder wrote:
> All the MMU related functionality have been clubbed together in
> enable_boot_cpu_mm() for booting primary cpu and enable_secondary_cpu_mm() for
> booting secondary cpus.
> This is done in preparation for moving the code related to MMU in MMU specific
> file and in order to support non MMU cpus in future.
> 
> This is based on d2f8df5b3ede ("xen/arm64: head.S: Introduce 
> enable_{boot,secondary}_cpu_mm()").
> 
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
> Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>
> Acked-by: Julien Grall <jgrall@xxxxxxxxxx>
> ---
> 
> Changes from :-
> 
> v1 - 1. Added a proper commit message.
> 2. Some style and other fixes suggested in v1. 
> 
> v2 - 1. Updated the comment on top of enable_boot_cpu_mm() and
> enable_secondary_cpu_mm() ie mentioned the input and output registers.
> 2. Updated the comment inside enable_boot_cpu_mm().
> 
> v3 - 1. No changes.
> 
>  xen/arch/arm/arm32/head.S | 102 ++++++++++++++++++++++++++++++--------
>  1 file changed, 80 insertions(+), 22 deletions(-)
> 
[...]

> +
> +/*
> + * Enable mm (turn on the data cache and the MMU) for the boot CPU.
> + * The function will return to the virtual address provided in LR (e.g. the
> + * runtime mapping).
> + *
> + * Inputs:
> + *   r9 : paddr(start)
> + *   r10: phys offset
> + *   lr : Virtual address to return to.
> + *
> + * Output:
> + *   r12: Was a temporary mapping created?
> + *
> + * Clobbers r0 - r6
> + */
> +enable_boot_cpu_mm:
> +        mov   r6, lr
> +
> +        bl    create_page_tables
> +
> +        /* Address in the runtime mapping to jump to after the MMU is 
> enabled */
> +        mov_w lr, 1f
> +        b     enable_mmu
> +1:
> +        /*
> +         * Prepare the fixmap. The function will return to the virtual 
> address
> +         * requested by the caller.
> +         */
It seems like you did not handle my remark from v3. This comment should be 
moved above branch
to setup_fixmap.

> +        mov   lr, r6
> +
> +        b     setup_fixmap
> +ENDPROC(enable_boot_cpu_mm)
> +
>  /*
>   * Remove the 1:1 map from the page-tables. It is not easy to keep track
>   * where the 1:1 map was mapped, so we will look for the top-level entry


~Michal



 


Rackspace

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