[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



Hi Ayan,

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...

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")


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>

---
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?

  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,

--
Julien Grall




 


Rackspace

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