From patchwork Mon Aug 12 17:30:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 171148 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp506397ily; Mon, 12 Aug 2019 23:47:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxS4DGofkV/6Nh0dt0GnkpB32RSFJSa/MmR7IPcFn4uWErjF1vPOneJDLWWi1CLyon8gkiD X-Received: by 2002:a02:c992:: with SMTP id b18mr28534587jap.128.1565678866235; Mon, 12 Aug 2019 23:47:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565678866; cv=none; d=google.com; s=arc-20160816; b=ldLaa5W3nA7BQDo/H35v1LEXeLTCEkt1+nIcyNNZD8X25RejF43UNX10B0j6dN3Zi+ 3gufmgMIszhpRu3hZTYhDw5q+hf8+LjVdyDgXU9lKKXlPaP5iHNCjmnarsmbXHrLQ3SB 5P6pUSP0S35GoiLasK9EP4cIxSGFX7VReQ3mpjkGSDQD3jSOuYHKfEMZjIhsrMJ2nLLG eU2otm7AVOLvUGTqCgGP37hc8DfCZaWx31yXB03lAIx5qPWyoYQ2Sj0tsvwM1qF4VWp4 TjbzLL63m8od4KbwWbQ+9s5+kcgv6Qxgu+jgmjzLWcslmsg3SQ424y/rRot6LxL7NDLE si2w== 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=JLeCiNn5svnzKhZF8NXdx8eNdHs7LpSasB4UiewQO8Q=; b=g9ixUEE1NX2o0AYLmQjveYzIdZCcbNqyf1W4zMFAAyZ9lvTxmdXZZv2xS75RgC110h kyteWZNOQJT30Yikx5kztqriIoZnNy+xe+Fn1JLzQ2rHar75M/sswBga0lrrFOPKAEcy F7IukxtlEKlEixJ1Y+N+l0EraLyfVfPAdHsgz9V7ISrsyPhPtHMF4KNP28xaxLka910H +rVD+KZqflLBY1CoZPFO2JwQonlsenD0EeXLrjz5vp8vXhZcDclJlC6BlNpYQpGomvKy /OOpiBnA5GySPE+tNOVrgaVeF+g2Oil5ykowIeJfWYR7RbwW7guHgSn18v71AmG1g0v8 CTCg== 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 p3si143816741iom.77.2019.08.12.23.47.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Aug 2019 23:47:46 -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 1hxQZv-00007O-Sm; Tue, 13 Aug 2019 06:46:43 +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 1hxQZu-00007F-UI for xen-devel@lists.xenproject.org; Tue, 13 Aug 2019 06:46:42 +0000 X-Inumbo-ID: e7fe84b6-bd26-11e9-a00c-e78223b30793 Received: from foss.arm.com (unknown [217.140.110.172]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id e7fe84b6-bd26-11e9-a00c-e78223b30793; Mon, 12 Aug 2019 17:30:41 +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 D59531993; Mon, 12 Aug 2019 10:30:40 -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 2FC9A3F706; Mon, 12 Aug 2019 10:30:40 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 12 Aug 2019 18:30:06 +0100 Message-Id: <20190812173019.11956-16-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 15/28] 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 v3: - Add Stefano's reviewed-by 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 c7b4fe4cd4..1189ed6c47 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 @@ -238,11 +237,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 @@ -254,7 +257,6 @@ zero_bss: cmp r0, r1 blo 1b -skip_bss: mov pc, lr ENDPROC(zero_bss)