From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nikita Kiryanov Date: Tue, 05 Feb 2013 08:52:06 +0200 Subject: [U-Boot] [PATCH 1/5] Add bmp_layout module for accessing BMP header data In-Reply-To: <20130204192618.529EF200113@gemini.denx.de> References: <1359977979-28585-1-git-send-email-nikita@compulab.co.il> <1359977979-28585-2-git-send-email-nikita@compulab.co.il> <20130204192618.529EF200113@gemini.denx.de> Message-ID: <5110AC16.9000306@compulab.co.il> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Wolfgang Denk, On 02/04/2013 09:26 PM, Wolfgang Denk wrote: > Dear Nikita Kiryanov, > > In message <1359977979-28585-2-git-send-email-nikita@compulab.co.il> you wrote: >> Currently code that displays BMP files does two things: >> * assume that any address is a valid load address for a BMP >> * access in-memory BMP header fields directly >> >> Since some BMP header fields are 32 bit wide, this has a potential >> for causing data aborts when these fields are placed in unaligned >> addresses. >> >> Create an API for safely accessing BMP header data, and compile it with >> $(PLATFORM_NO_UNALIGNED) to give it the ability to emulate unaligned memory >> accesses. > > Frankly, I think this is overkill. U-Boot is a bootloader, and it is > supposed to be lean and eficient. We don't have all levels of safety > systems and protective devices as in, for example, an aircraft. You > are supposed to know what you are doing, and if you ignore the rules, > you will quickly see the results yourself. [...] > You talk about BMP header - but we also have alignment requirements > for image headers, well, even for a plain "md" or "mw" command. And > none of these provide any protection against accidsential (or > intentional) access to unaligned addresses. That's true, but when md traps you simply restart the board and everything's fine. If displaying a splash screen traps- you're stuck. I'm not saying we should start implementing protection against every possible mistake, but when the repercussions are this serious I feel that protection is in order. There's a difference between a bicycle with no training wheels and one that falls apart when you turn it the wrong way. > > My recommendation is: just don;t do it, then. > > Best regards, > > Wolfgang Denk > -- Regards, Nikita.