From: Ian Campbell Date: Thu, 11 Oct 2012 14:56:56 +0000 (+0100) Subject: arm: Zero the BSS at start of day. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~7757 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c113b2c4bb48f5c24397aed25d79ff975d08e87d;p=xen.git arm: Zero the BSS at start of day. Avoids surprises e.g. when loading via the boot-wrapper. Signed-off-by: Ian Campbell Acked-by: Tim Deegan Committed-by: Ian Campbell --- diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S index cdbe011820..9fdeda7c56 100644 --- a/xen/arch/arm/head.S +++ b/xen/arch/arm/head.S @@ -127,8 +127,26 @@ boot_cpu: add pc, r0, r10 /* Call PA of function */ hyp: - PRINT("- Setting up control registers -\r\n") + /* 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 + add r0, r0, r10 /* Apply physical offset */ + add r1, r1, r10 + + mov r2, #0 +1: str r2, [r0], #4 + cmp r0, r1 + blo 1b + +skip_bss: + + PRINT("- Setting up control registers -\r\n") + /* Set up memory attribute type tables */ ldr r0, =MAIR0VAL ldr r1, =MAIR1VAL diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S index 6fb76628af..f0f4cd3d9f 100644 --- a/xen/arch/arm/xen.lds.S +++ b/xen/arch/arm/xen.lds.S @@ -119,6 +119,7 @@ SECTIONS *(.bss.percpu.read_mostly) . = ALIGN(SMP_CACHE_BYTES); __per_cpu_data_end = .; + __bss_end = .; } :text _end = . ;