From patchwork Mon Jul 22 21:39:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 169441 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp8012407ilk; Mon, 22 Jul 2019 14:41:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzaGJMIz9oJoQd6kM1cbqxUxRlpQqg4SBnHg8FGa7TIbmsp7J2AyxI65/vwzoI39LKsT+im X-Received: by 2002:a5e:d618:: with SMTP id w24mr32647151iom.73.1563831685800; Mon, 22 Jul 2019 14:41:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563831685; cv=none; d=google.com; s=arc-20160816; b=rE81MDuSIBnLUlzm/Q59pKG8f+iBQ+tkufx5neEGX1T1EdJwNrfNSz6Z0YNVbItJ8U FPZ7+T8Bu4jYSVKNe/fAb+BqMLVEAxNIWfAB9gwp/sPAYr5aSrawNVLVld94/wTGLPS7 sX3/RM9YOV8Gyt4yfkeCVPdfrecl3MT23AcmYIe6rL0g76H1Cqw+GNIZwQ3JdRf22Pob 4CKCS2qUmLZgG+Vej4mExHp2/+kwSsmL+6RglmVPnLJfMdX+h36xtxhgg+6EsJovwZs0 Knxq81w1Y1P6GLb2m1RBByEMzFgcBV7heZWU2ulyQ9mx0avJvZSHOWHf6DwDj4UZRhjL o1Mw== 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=dQZoslaYH0KO5kTkzETWpn4LLBmT8iTAY4UxYCEbW+s=; b=F/U3QVmA9GxDM6c5dxXgszoWUq1fbUl1NTpIg6fjI5f5JnMERguq11Q7Q4lwe09+N6 q1JpguYHQ4PwhQrfa84nnKXvkzhPe47/g1x8mI45XINM8HBV3gDbKi9gOK+HBBww1llC j/GrLWLC7VRzhUTk3ywKUsedf4X0FxOlzpmhIbIR02vRDoh3pgAKrzu2Ub2xh+yawtUM wwQ63Bg9Ss2Wg+VHpcot0Br7O7sI2oJwJwUpgQOpMnkMCUuaiCJe0CMEqBuTaa2dAQLd T/zwDDTEks1ltWIyDPDdjn5K5hW5yQz150zDZKOcAC0g5ScQMd/aXBHZvNq/P4XaEiRi Qxog== 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 n26si55099201iob.66.2019.07.22.14.41.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jul 2019 14:41:25 -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 1hpg2u-0003CH-9k; Mon, 22 Jul 2019 21:40:36 +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 1hpg2p-00031D-RG for xen-devel@lists.xenproject.org; Mon, 22 Jul 2019 21:40:31 +0000 X-Inumbo-ID: 53162772-acc9-11e9-85bd-17aa413bce38 Received: from foss.arm.com (unknown [217.140.110.172]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 53162772-acc9-11e9-85bd-17aa413bce38; Mon, 22 Jul 2019 21:40:29 +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 3E903153B; Mon, 22 Jul 2019 14:40:29 -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 8C80B3F71F; Mon, 22 Jul 2019 14:40:28 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 22 Jul 2019 22:39:49 +0100 Message-Id: <20190722213958.5761-27-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 26/35] xen/arm32: head: Rework and document zero_bss() 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" On secondary CPUs, zero_bss() will be a NOP because BSS only need to be zeroed once at boot. So the call in the secondary CPUs path can be removed. Lastly, document the behavior and the main registers usage within the function. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- Changes in v2: - Patch added --- xen/arch/arm/arm32/head.S | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S index 0959c4f044..119d2a0df8 100644 --- a/xen/arch/arm/arm32/head.S +++ b/xen/arch/arm/arm32/head.S @@ -192,7 +192,6 @@ GLOBAL(init_secondary) PRINT(" booting -\r\n") #endif bl check_cpu_mode - bl zero_bss bl cpu_init bl create_page_tables bl enable_mmu @@ -237,11 +236,15 @@ check_cpu_mode: b fail ENDPROC(check_cpu_mode) +/* + * Zero BSS + * + * Inputs: + * r10: Physical offset + * + * Clobbers r0 - r3 + */ zero_bss: - /* Zero BSS On the boot CPU to avoid nasty surprises */ - teq r12, #0 - bne skip_bss - PRINT("- Zero BSS -\r\n") ldr r0, =__bss_start /* Load start & end of bss */ ldr r1, =__bss_end @@ -253,7 +256,6 @@ zero_bss: cmp r0, r1 blo 1b -skip_bss: mov pc, lr ENDPROC(zero_bss)