[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 1/6] xen/arm: Skip initializing the BSS section when it is empty


  • To: Julien Grall <julien@xxxxxxx>, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Ayan Kumar Halder <ayankuma@xxxxxxx>
  • Date: Mon, 21 Oct 2024 12:12:58 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=G/hq6ogFFoePwgmFZF9miXV3OIKmYM6Dzdrg5I2d4RQ=; b=hnjzUJbxKElX1HJtyRbkblqQi87rE8FeIdtbExHEukkGWfakPQhJfA/dzhG2ZXi/35JvIA+vyCu+RC0N1e/ywYUmRiUT+9bJM6nXp26oTADVlilzQL1WuehxyZmjM3dXV/EIr2AX51eYRmxkYQwrC/02u5XpMgIOag4beP5ezWuk6Hw7D4hyckMRjiA0EQrlWlKGhl7j7wTjbL1UwHFpCPpUbDUZsenjuBLRfn73DtIjoZrvs6cOTeVzfWGszXd31ei8EJRzSxeFWfteQHnqz4NnjIJMReoWHtQA2ZjgI8oz5yZY2GG5pLqCYB0HEKih4FiEx/faynxpF8uGWfK1Mg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MFAK4Q8jh0lexQ7oiLkRzvQTeV9qdzAf/3Bqc7eQ5mOTnAyAAKokf/RkHrPEs+nH1gxHb0j2cM7BeYECofpWQ+8t3rcAlA7329B5ZZI8BfUvItltfvvGSmkqGX0y6pfmevKjh2LwGe3CdzNreTe0xqpOg3P867wN/C3UVpUXA7r6h1Q495NnECq2vImlNVSOe4kBzoQRBoArVMqPAklB1JR3St/kT5hbP01G96146tyEfjDPsBBeFCNn2qkN8wTc1Xu0d2oOzP7F5b6zy99GAZbPHPL+KAL1tmiQ7ec/nm4Ibgmo8wo8BL20VnWrHtJRsQM2hyj/3Iiwoeltz7h4UA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 21 Oct 2024 11:13:14 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 18/10/2024 14:41, Julien Grall wrote:
Hi Ayan,
Hi Julien,

On 10/10/2024 15:03, Ayan Kumar Halder wrote:
If the BSS section is empty, then the function can just return.

This is more than "can", right? If we don't do it, we will end up to zero outside of BSS. This could be critical data...
s/can just/should

Also, I am tempted to suggest to add a Fixes tag because even if it is unlikely BSS will be zero in the current Xen, it is also not unlikely.

The tag would be:

Fixes: dac84b66cc9a ("xen: arm64: initial build + config changes, start of day code")
Ack.


Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>

I saw the discussion. I don't have a strong opinion on the exact approach choosen for zeroing. With the commit message updated:

Acked-by: Julien Grall <jgrall@xxxxxxxxxx>

I propose that this patch to be committed. The changes to the commit message can be done on commit.


---
Changes from :-

v1..v2 - New patch introduced in v3.

  xen/arch/arm/arm64/head.S | 2 ++

Don't we need a similar change on the arm32 code?

I haven't looked at the arm32 code. My idea is to get the earlyboot (ie the asm part) of Xen working on R82 and then do the similar changes for R52 (ie arm32).

So that when we start plumbing the lateboot (ie start_xen() onwards), we can test it for both R82 + R52 as a significant part of the code will be common.

Let me know if this sounds ok.

- Ayan


  1 file changed, 2 insertions(+)

diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index 14c3720d80..72c7b24498 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -346,6 +346,8 @@ FUNC_LOCAL(zero_bss)
          PRINT("- Zero BSS -\r\n")
          ldr   x0, =__bss_start       /* x0 := vaddr(__bss_start) */
          ldr   x1, =__bss_end         /* x1 := vaddr(__bss_end)   */
+        cmp   x1, x0
+        beq   skip_bss
    1:      str   xzr, [x0], #8
          cmp   x0, x1

Cheers,




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.