From patchwork Mon Aug 12 17:30:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 171156 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp513449ily; Mon, 12 Aug 2019 23:56:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1QecXK2R3scY2TngjhZ9h31sXkOQqev0vUryMBkG7XqXtOBN4SDQAdgSaqFfoNUTqRyDk X-Received: by 2002:a6b:f30b:: with SMTP id m11mr22020193ioh.214.1565679413944; Mon, 12 Aug 2019 23:56:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565679413; cv=none; d=google.com; s=arc-20160816; b=UgoVTkHZRdCRqe8C5OMTG7n0kRdABR8dxIwVXoiDEXl+GBGn6jB1V4d58aSgkyl+J7 LPVWjkvFYmhe+Vz6FuyMC7e/ndLZdiM1hwXxDKqwR7a18amwZJ/WpjNfVUhKpy3Kcz2k HDSG244Xr4MGJisf0OZ/hKCokPf8xxH+tdXKP0k0+p/LoSjeNFsGCHtPEInUmYkhZh++ KbbTOiCSdy0Ea+6qoL5PULrKqZO5Z2nOOhPi3nYXDODrtY/MsqOH32jEWE63aPeVu+xW 3BSRyf6wsFqbpEQ1r8PYarF/49uIbu8dVOF/AcA/eBi8HoGB9ITn+9LRqFuoXI8cHc4y CnxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=fJRtBSa9M5G/U3wKch+mL1O4lf10buC8DkOiaD2TQL4=; b=mCKfuY7evmzT69J+M1RhLd+uII4kP68Rkb4dKCcZ13mBh49mWCkdmYOswwV9DUPMyg x9ZwLlZr5Nk3MaoI1uBSuS97jXrlAGZ8BUMUo6RLyo8AI8x5LaSbYi0P6psFcSqkdHee 7GSJddvQ4K8eBFQjJHu3OdeFF6CplUVmF6xkEv5LqtWO8Np+osTfCEWf6BZfw1kyBdDu 5YzpAddIKkJth2ZXRVOUhA3dQ2d3/dsuWBmLzeExhcrgxKGUWKxOrbvW/Q9yGwQmymOO BRvvDeDXuKkK2NI5bNvqjt9Nz6a4lrvpDWGh4MggGaMP8h++qWv9/pWnA67ki1741WSM pNkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id u12si13708576jap.79.2019.08.12.23.56.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Aug 2019 23:56:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hxQj5-00046F-8X; Tue, 13 Aug 2019 06:56:11 +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 1hxQj4-00045J-9J for xen-devel@lists.xenproject.org; Tue, 13 Aug 2019 06:56:10 +0000 X-Inumbo-ID: ea194f92-bd26-11e9-bd8c-07b407aedc9a Received: from foss.arm.com (unknown [217.140.110.172]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id ea194f92-bd26-11e9-bd8c-07b407aedc9a; Mon, 12 Aug 2019 17:30:44 +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 6F22F174E; Mon, 12 Aug 2019 10:30:44 -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 BD98E3F706; Mon, 12 Aug 2019 10:30:43 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 12 Aug 2019 18:30:10 +0100 Message-Id: <20190812173019.11956-20-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190812173019.11956-1-julien.grall@arm.com> References: <20190812173019.11956-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH v3 19/28] xen/arm32: head: Don't setup the fixmap on secondary CPUs 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 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" setup_fixmap() will setup the fixmap in the boot page tables in order to use earlyprintk and also update the register r11 holding the address to the UART. However, secondary CPUs are not using earlyprintk between turning the MMU on and switching to the runtime page table. So setting up the fixmap in the boot pages table is pointless. This means most of setup_fixmap() is not necessary for the secondary CPUs. The update of UART address is now moved out of setup_fixmap() and duplicated in the CPU boot and secondary CPUs boot. Additionally, the call to setup_fixmap() is removed from secondary CPUs boot. Lastly, take the opportunity to replace load from literal pool with the new macro mov_w. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- Changes in v3: - Add Stefano's reviewed-by Changes in v2: - Patch added --- xen/arch/arm/arm32/head.S | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S index 0c95d1c432..8f945d318a 100644 --- a/xen/arch/arm/arm32/head.S +++ b/xen/arch/arm/arm32/head.S @@ -159,6 +159,10 @@ past_zImage: mov pc, r0 primary_switched: bl setup_fixmap +#ifdef CONFIG_EARLY_PRINTK + /* Use a virtual address to access the UART. */ + mov_w r11, EARLY_UART_VIRTUAL_ADDRESS +#endif b launch ENDPROC(start) @@ -201,8 +205,6 @@ GLOBAL(init_secondary) ldr r0, =secondary_switched mov pc, r0 secondary_switched: - bl setup_fixmap - /* * Non-boot CPUs need to move on to the proper pagetables, which were * setup in init_secondary_pagetables. @@ -221,6 +223,10 @@ secondary_switched: dsb /* Ensure completion of TLB+BP flush */ isb +#ifdef CONFIG_EARLY_PRINTK + /* Use a virtual address to access the UART. */ + mov_w r11, EARLY_UART_VIRTUAL_ADDRESS +#endif b launch ENDPROC(init_secondary) @@ -475,13 +481,6 @@ setup_fixmap: */ dsb #if defined(CONFIG_EARLY_PRINTK) /* Fixmap is only used by early printk */ - /* - * Non-boot CPUs don't need to rebuild the fixmap itself, just - * the mapping from boot_second to xen_fixmap - */ - teq r12, #0 - bne 1f - /* Add UART to the fixmap table */ ldr r1, =xen_fixmap /* r1 := vaddr (xen_fixmap) */ lsr r2, r11, #THIRD_SHIFT @@ -502,9 +501,6 @@ setup_fixmap: mov r4, r4, lsr #(SECOND_SHIFT - 3) /* r4 := Slot for FIXMAP(0) */ mov r3, #0x0 strd r2, r3, [r1, r4] /* Map it in the fixmap's slot */ - - /* Use a virtual address to access the UART. */ - ldr r11, =EARLY_UART_VIRTUAL_ADDRESS #endif /*