Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UbuoJ-0001fO-Od for mharc-grub-devel@gnu.org; Mon, 13 May 2013 11:37:11 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49819) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UbuoD-0001db-5S for grub-devel@gnu.org; Mon, 13 May 2013 11:37:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ubuo9-00057f-V9 for grub-devel@gnu.org; Mon, 13 May 2013 11:37:05 -0400 Received: from mail-ea0-x22e.google.com ([2a00:1450:4013:c01::22e]:48308) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ubuo9-00057W-Ok for grub-devel@gnu.org; Mon, 13 May 2013 11:37:01 -0400 Received: by mail-ea0-f174.google.com with SMTP id z7so2648173eaf.5 for ; Mon, 13 May 2013 08:37:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent:x-gm-message-state; bh=7z4lgTubPLkGzol2TgGyiyczX3AS4I8ld0egAkiKjLY=; b=AMviaJz1tMX/Mss85Qt5UTaphzFGMjGnUq4RnUe0hNr88MecRRvjZC/T7EK3vZ9u+m ZeQrqWZgvcYdzwnQKYij2tYHWoAY05tdqa9sl0KsbXKrlg1iZBo5maVw5q9OUS0SybZN FH7xC9JBjYYCGdyAFCjxA7BgNq49B3qcCqYbY5EaQUr0/2qOUFBRLSNY24rOcFeS2Mse XjSl+hDC9UfkdI9oyVxCQ9nkLPUAsqm8sq0jl4UfP6xJsgiuZnLy2FxuUBMmlSMbyuZG tJSrGNKv/G7yKaFnrDTZe8lzBxxxqulghnzVv89qlqJ2NZGkJfnoajYRygnseTw4ZLup +PEQ== X-Received: by 10.14.0.129 with SMTP id 1mr79282621eeb.43.1368459420583; Mon, 13 May 2013 08:37:00 -0700 (PDT) Received: from rocoto.smurfnet.nu ([2001:4b98:dc0:41:216:3eff:fea7:75f3]) by mx.google.com with ESMTPSA id c42sm3255170eeb.10.2013.05.13.08.36.58 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 13 May 2013 08:36:59 -0700 (PDT) Date: Mon, 13 May 2013 15:37:32 +0000 From: Leif Lindholm To: grub-devel@gnu.org Subject: [PATCH] ARM U-Boot BSS zeroing Message-ID: <20130513153729.GL28516@rocoto.smurfnet.nu> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="WIIRZ1HQ6FgrlPgb" Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-Gm-Message-State: ALoCoQnfGgXA9zNIoIR0Xx6+JxfiCTo1Vh3tsUEgZbsGtOYASUC0cMgdZbChA5eK5XS3Fo47oTAB X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::22e Cc: patches@linaro.org X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 May 2013 15:37:09 -0000 --WIIRZ1HQ6FgrlPgb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline The import into the collaborative branch discarded the call to get_real_bss_start before starting the BSS zeroing operation. While get_real_bss_start might have been a bit of an ugly hack, simply discarding it means that we now end up doing unaligned STR operations, and any platform with MMU disabled fails to boot. The attached patch prepends a bytewise zeroing loop until word-aligned, and then continue as before. / Leif --WIIRZ1HQ6FgrlPgb Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="bss_zero_fix.patch" === modified file 'grub-core/kern/arm/uboot/startup.S' --- grub-core/kern/arm/uboot/startup.S 2013-05-03 13:07:39 +0000 +++ grub-core/kern/arm/uboot/startup.S 2013-05-13 14:59:43 +0000 @@ -100,7 +100,13 @@ @ Since we _are_ the C run-time, we need to manually zero the BSS @ region before continuing ldr r0, =EXT_C(__bss_start) @ zero from here - ldr r1, =EXT_C(_end) @ to here + @ If unaligned, bytewise zero until base address aligned. + mov r1, #0 +1: tst r0, #3 + beq 2f + strb r1, [r0], #1 + b 1b +2: ldr r1, =EXT_C(_end) @ to here mov r2, #0 1: str r2, [r0], #4 cmp r0, r1 --WIIRZ1HQ6FgrlPgb--