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

Re: [Xen-devel] [RESEND][PATCH for-4.13] xen/arm: mm: Clear boot pagetables before bringing-up each secondary CPU


  • To: Julien Grall <julien.grall@xxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Tue, 24 Sep 2019 14:13:48 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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-SenderADCheck; bh=2zGELjDHVo6uvJBlHTa4kq3pC8MPAUDyNnidPny+Ces=; b=H87//+HtJbnBCD7RH0mf+dnmWurhep8QVNeKbiOSZIZb21y6LM4CIiZ1cLIKIQFxQd21qVWGGHXbZrkIo8aIAyIlka1b4Wl3WFmb3UyASLiJCMOHm7PVki873jG031HRhDjwdcyeP6j1MjGHvOCh3mIc+DRnsBwJ/YLsOboFH2Nzlj4BGHKvwJ/U+xQ+T+67TNCiGP/62WEFF4GmQW1BTiyi6qMgmrBugnjKJZWlDzpKwLidsNMPX/SPEU0Vl9YnOumkRmlNWTdaFWnZq8NC+3y98hJRNuV0r+eisDpEA8Puyh5eJfvs1fDfgP+KUUepVb2/D9l9361FVoMhu+9jZg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m5MNVbR0RBFS2TTCo5WzTPGTSnyb50WetQfhzD1hSqBfZNsSKuT7lDc7g98wuWSTw2k6loiP6UhQhFsUsMVdFEJHxNjO23F4WEOdpJgJlxDxdAPxtR7go/nKkyYRBDhQdDid3L5u7XI01rBcNA4JrbsM9HoKnnCoRzpli1Wqk4wP4Y8IT2ubkCiIO2NYUmLcLctXN7Q/XOc0a39IpQU4lpLT3yWwGjjP2BGuLMicGaDcBp2rV3F6kwVmn7wJ1Vk9k+1ETLOoJFgge+zViR/qDIzoYR55gX7oS0pb7m8xLJFFytzwPic0kSIcf166Klm6F8ihZ/a0NxEJ2KMGT9j0bg==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Volodymyr_Babchuk@xxxxxxxx;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Tue, 24 Sep 2019 14:13:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVcGSSchlMtB7wCE+xgHav8WanLqc648aA
  • Thread-topic: [RESEND][PATCH for-4.13] xen/arm: mm: Clear boot pagetables before bringing-up each secondary CPU

Julien Grall writes:

> At the moment, boot pagetables are only cleared once at boot. This means
> when booting CPU2 (and onwards) then boot pagetables will not be
> cleared.
>
> To keep the interface exactly the same for all secondary CPU, the boot
> pagetables are now cleared before bringing-up each secondary CPU.
>
> Signed-off-by: Julien Grall <julien.grall@xxxxxxx>
Taking into account fixed remark below:

Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>

> ---
>  xen/arch/arm/mm.c | 27 ++++++++++++++++++---------
>  1 file changed, 18 insertions(+), 9 deletions(-)
>
> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
> index 1129dc28c8..e14ee76ff8 100644
> --- a/xen/arch/arm/mm.c
> +++ b/xen/arch/arm/mm.c
> @@ -704,8 +704,20 @@ void __init setup_pagetables(unsigned long 
> boot_phys_offset)
>  
>      switch_ttbr(ttbr);
>  
> -    /* Clear the copy of the boot pagetables. Each secondary CPU
> -     * rebuilds these itself (see head.S) */
> +    xen_pt_enforce_wnx();
> +
> +#ifdef CONFIG_ARM_32
> +    per_cpu(xen_pgtable, 0) = cpu0_pgtable;
> +    per_cpu(xen_dommap, 0) = cpu0_dommap;
> +#endif
> +}
> +
> +static void clear_boot_pagetables(void)
> +{
> +    /*
> +     * Clear the copy of the boot pagetables. Each secondary CPU
> +     * rebuilds these itself (see head.S)
Missing full stop.

> +     */
>      clear_table(boot_pgtable);
>  #ifdef CONFIG_ARM_64
>      clear_table(boot_first);
> @@ -713,18 +725,13 @@ void __init setup_pagetables(unsigned long 
> boot_phys_offset)
>  #endif
>      clear_table(boot_second);
>      clear_table(boot_third);
> -
> -    xen_pt_enforce_wnx();
> -
> -#ifdef CONFIG_ARM_32
> -    per_cpu(xen_pgtable, 0) = cpu0_pgtable;
> -    per_cpu(xen_dommap, 0) = cpu0_dommap;
> -#endif
>  }
>  
>  #ifdef CONFIG_ARM_64
>  int init_secondary_pagetables(int cpu)
>  {
> +    clear_boot_pagetables();
> +
>      /* Set init_ttbr for this CPU coming up. All CPus share a single setof
>       * pagetables, but rewrite it each time for consistency with 32 bit. */
>      init_ttbr = (uintptr_t) xen_pgtable + phys_offset;
> @@ -767,6 +774,8 @@ int init_secondary_pagetables(int cpu)
>      per_cpu(xen_pgtable, cpu) = first;
>      per_cpu(xen_dommap, cpu) = domheap;
>  
> +    clear_boot_pagetables();
> +
>      /* Set init_ttbr for this CPU coming up */
>      init_ttbr = __pa(first);
>      clean_dcache(init_ttbr);


-- 
Volodymyr Babchuk at EPAM
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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