From nobody Tue May 7 09:41:31 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1569060614; cv=none; d=zoho.com; s=zohoarc; b=EpDSNZYYqTf5/YhKE9DqLWBPtZQZ2pUI9xl+gLo7DNq9M8Zjcvvb38X6kHbp9jphibccl3b8SqK6iiPjXCP0mo2MUa1gBwNep4xSzWt/pwh+Js40IDbxOuw5TBxnemrAIbZpOBdOxJsZskULAuD1B0M+uVl6hbylR9C33eWaRSM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569060614; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=TOdFOkrOu5efTzAMfb7hJYM6wCc34o+Z+pER8vw1bc8=; b=HLyeQ3XT7fS0OBrJtrUNgnAYKbYw8LWxJ9LP0BEkM/A2ED87iFX8gDa+OBDdn7+JUqdJexVtwKhlzjJrZiPTG+59IHXjMVxXy7JlRCFxB5xofs+5bhWI3JwdIOIrv79XMU8mIq5fIKLQfM627UNnpeTq9tz1WMT36tytMmy6Dnk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1569060614151623.6316617311314; Sat, 21 Sep 2019 03:10:14 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iBcJw-0003rl-1A; Sat, 21 Sep 2019 10:08:52 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iBcJu-0003re-5G for xen-devel@lists.xenproject.org; Sat, 21 Sep 2019 10:08:50 +0000 Received: from foss.arm.com (unknown [217.140.110.172]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id cd9802e6-dc57-11e9-95b8-12813bfff9fa; Sat, 21 Sep 2019 10:08:48 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DFDDE1000; Sat, 21 Sep 2019 03:08:47 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 39FC13F59C; Sat, 21 Sep 2019 03:08:47 -0700 (PDT) X-Inumbo-ID: cd9802e6-dc57-11e9-95b8-12813bfff9fa From: Julien Grall To: xen-devel@lists.xenproject.org Date: Sat, 21 Sep 2019 11:08:36 +0100 Message-Id: <20190921100836.21396-1-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 Subject: [Xen-devel] [RESEND][PATCH for-4.13] xen/arm: mm: Clear boot pagetables before bringing-up each secondary CPU X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Julien Grall , Stefano Stabellini , Volodymyr Babchuk MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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 Reviewed-by: Stefano Stabellini --- 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_o= ffset) =20 switch_ttbr(ttbr); =20 - /* 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) =3D cpu0_pgtable; + per_cpu(xen_dommap, 0) =3D 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) + */ 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) =3D cpu0_pgtable; - per_cpu(xen_dommap, 0) =3D cpu0_dommap; -#endif } =20 #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 =3D (uintptr_t) xen_pgtable + phys_offset; @@ -767,6 +774,8 @@ int init_secondary_pagetables(int cpu) per_cpu(xen_pgtable, cpu) =3D first; per_cpu(xen_dommap, cpu) =3D domheap; =20 + clear_boot_pagetables(); + /* Set init_ttbr for this CPU coming up */ init_ttbr =3D __pa(first); clean_dcache(init_ttbr); --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel