From patchwork Mon Jul 22 21:39:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 169443 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp8012419ilk; Mon, 22 Jul 2019 14:41:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzCqPymjat63t+5uBZcnFwNO24mHsIHyyyUFgoMK3qRtOLvEUWjjbzEifhQVc8aK4Sdvf5 X-Received: by 2002:a02:716e:: with SMTP id n46mr77063497jaf.137.1563831686763; Mon, 22 Jul 2019 14:41:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563831686; cv=none; d=google.com; s=arc-20160816; b=LYw93WnvmdKekMJ2ZGyb9ttkzvQamdahoQDdR9MrsW2QB90e8Mp8fvBNLQZ0Rf+XDW 9Z0kxESMQ7PWotHSPFvd52GLrht21dGb+SmsA+0PDXl4rbbCUn8tdV3PhQe02eKr6H1T fsbHdYVAuGULpe86Iig8O5nk5kbeGeUwL0NbwnIrvLCzOnKd3f7kKhLbwHF1GPJ7FYgy QbalGnJQe0iEQPeDHKtGGkdskz+YaUCDRyyrScv/e+8SImOxHhqIkgklRge3NMZzp82p Z/hg+1muC5TIC0ovP2z4QfWGvzEeSKLar1EI+8dibGRgS6zU8oLdLQR68YMVfeDXXaMD FkGg== 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=O7LIKDLREBBAhuirKQaIkVzSkaUZvVao+Sbh0xF8Chc=; b=uWUq4T/u4ZK2+XM8O4BcejUenEAPrB4l00Z8JmtzcDf8wXRbexNld3qkLGDxiNQjfW Ia4ulpNNhqfg9mgUDEMapac+YzUO8k1PBzrw2QjZcXvzBTcf5pdaLz+aepigqEnqs99f Me+QhI7UiAmV+u7LfY4bV68xYiz2AImAfZpYefRejLc4ShJ6ZxXPI5MWrSFGZqVb2bvE Y2rhp2xsXHpO8lUQuvETh55vcBCzu1hbwtJTqL0Y33h9nvTH/Qej74jPjWHmq5lJdX1n w/mjFYoHOOH5q/rGGaf/CaW55c4UUGEJ68LMbhp6rzE/rL0RxJSFcSdG9r8Ztubkgcml NNEA== 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 e9si54345330iom.123.2019.07.22.14.41.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jul 2019 14:41:26 -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 1hpg2y-0003M5-CG; Mon, 22 Jul 2019 21:40:40 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hpg2r-00035e-KO for xen-devel@lists.xenproject.org; Mon, 22 Jul 2019 21:40:33 +0000 X-Inumbo-ID: 552bfa33-acc9-11e9-8980-bc764e045a96 Received: from foss.arm.com (unknown [217.140.110.172]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 552bfa33-acc9-11e9-8980-bc764e045a96; Mon, 22 Jul 2019 21:40:32 +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 CB68D1595; Mon, 22 Jul 2019 14:40:32 -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 2546F3F71F; Mon, 22 Jul 2019 14:40:32 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 22 Jul 2019 22:39:53 +0100 Message-Id: <20190722213958.5761-31-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190722213958.5761-1-julien.grall@arm.com> References: <20190722213958.5761-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH v2 30/35] 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 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 6dc6032498..0a5c3a8525 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) @@ -200,8 +204,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 /*