From patchwork Mon Jun 10 19:32: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: 166365 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1410269ilk; Mon, 10 Jun 2019 12:33:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqzhLpx8Dc+D1AeCz47AGDfsPZzBOxflsxXjgJ2fbj8s/NoTaNiQAw8D4UduVfkGGm7hvLqC X-Received: by 2002:a24:c3c5:: with SMTP id s188mr1636554itg.17.1560195230274; Mon, 10 Jun 2019 12:33:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560195230; cv=none; d=google.com; s=arc-20160816; b=byf45M2TjEgBHvDGN1YjB7PyAxNIhNC8oSO2wFvbGqlU3sL2qpuFPiWfBSItMVLpUo sFAfEib0qcNkEcd6cZYZU/yGdfAOCAsIpqEKsWVabMErlh3eILpfRFR9/XmJuORq4Jz8 oskM4PsBcGK5fE+Qo9jDzL7jgUoAkxIel+jyA3ra8c0athTEb91SE+KzYo/43Fwhpnyl 9+ZwXHDGIivQcf1fLxrbqigS72avIJ4EgMXNZQo7v9vM6VRihHWN0s3Pp9s/pA8DLEPy 2Dxne2RoYC7YHWb9WIyoOffSIgK30P4DK8Oz2hisYoO1Z0phrD/0K5G8RhY7qUJGI0iM UypA== 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=toLMwV51nwk3tyYHMbZHqJfezWKBnIhVGofydTZX5cU=; b=n7wxmqkyQ6Tg/n2mDwNvYGXElSkPd0ciuKx7Z3BK/aO7ZozaeAQw3Lgu9Z9XpP2PmQ U3vusIML8TuNuI+mABkrib3Pri0roay/kRdwVdz4BJ2xur3Avn62uWVlNn6KFefc8MTe O8KM0vno+LISoNAWybOzSANYJdRQ3B7wN0n8hHvmKW2Eimf9yfxklt7QDJwGbntp/RRe WquB1ov7SYojqcpSJE+CQVEcIiufDsgJPTMGnnKQr/9YKCLw724EpJ0o7fnprBVv14/k +33ecESCJcny19aSHZbKwWXNjf5HO8C+ufWQhZk90mIRgp+qWKlTamJXp8nKeu0IjwAe JQYw== 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 b81si185694itb.103.2019.06.10.12.33.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Jun 2019 12:33:50 -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 1haQ1w-0007hY-WB; Mon, 10 Jun 2019 19:32:32 +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 1haQ1v-0007fS-7t for xen-devel@lists.xenproject.org; Mon, 10 Jun 2019 19:32:31 +0000 X-Inumbo-ID: 7bfa0d68-8bb6-11e9-a239-6f7b6f0f0c80 Received: from foss.arm.com (unknown [217.140.110.172]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 7bfa0d68-8bb6-11e9-a239-6f7b6f0f0c80; Mon, 10 Jun 2019 19:32: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 0E115346; Mon, 10 Jun 2019 12:32: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 25EDD3F73C; Mon, 10 Jun 2019 12:32:28 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 10 Jun 2019 20:32:06 +0100 Message-Id: <20190610193215.23704-9-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190610193215.23704-1-julien.grall@arm.com> References: <20190610193215.23704-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 08/17] xen/arm64: 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: andre.przywara@arm.com, Julien Grall , Stefano Stabellini , andrii_anisov@epam.com, Oleksandr_Tyshchenko@epam.com 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. It also means that x26 does not need to set and is now only used by the boot CPU. Lastly, document the behavior and the main registers usage within the function. Signed-off-by: Julien Grall --- xen/arch/arm/arm64/head.S | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S index 87fcd3be6c..6aa3148192 100644 --- a/xen/arch/arm/arm64/head.S +++ b/xen/arch/arm/arm64/head.S @@ -71,7 +71,7 @@ * x23 - UART address * x24 - * x25 - identity map in place - * x26 - skip_zero_bss + * x26 - skip_zero_bss (boot cpu only) * x27 - * x28 - * x29 - @@ -313,8 +313,6 @@ GLOBAL(init_secondary) sub x20, x19, x0 /* x20 := phys-offset */ mov x22, #1 /* x22 := is_secondary_cpu */ - /* Boot CPU already zero BSS so skip it on secondary CPUs. */ - mov x26, #1 /* X26 := skip_zero_bss */ mrs x0, mpidr_el1 ldr x13, =(~MPIDR_HWID_MASK) @@ -337,7 +335,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 @@ -375,6 +372,14 @@ check_cpu_mode: b fail ENDPROC(check_cpu_mode) +/* + * Zero BSS + * + * Inputs: + * x26: Do we need to zero BSS? + * + * Clobbers x0 - x3 + */ zero_bss: /* Zero BSS only when requested */ cbnz x26, skip_bss