public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] testing u-boot on virtual environment
Date: Sat, 24 Dec 2011 11:00:32 +0100	[thread overview]
Message-ID: <4EF5A2C0.2050104@aribaud.net> (raw)
In-Reply-To: <CAPnjgZ03dgeE+KQttLfwhTwxhY81FZmD7qYKyFwHMR0cp9YeKg@mail.gmail.com>

Hi Simon,

Le 24/12/2011 07:03, Simon Glass a ?crit :
> Hi,
>
> On Fri, Dec 23, 2011 at 5:53 AM, ?rico Porto<ericoporto2008@gmail.com>  wrote:
>> md 0 gives me in dmesg:
>>
>>
>> [11753.433067] u-boot[4277]: segfault at 0 ip 0805283e sp bfb809f0
>> error 4 in u-boot[8048000+1a000]
>>
>>
>> On 12/23/11, ?rico Porto<ericoporto2008@gmail.com>  wrote:
>>> Thanks!
>>>
>>> Tried to do some memory display commands but got instant segmentation
>>> fault, and tried to run it as root - but then some bad things
>>> happened, so now I know no one should run it as root.
>
> Good lesson to learn :-)
>
> There was a revert of the memory map code in cmd_mem.c about a month
> ago - if you track that down and un-revert it then md will work for
> you.
>
> The real fix is to devise some third meaning of a memory address
> (physical address, effective address, ...?) - I did post a suggestion
> to the list but no response and I haven't got back to it.

I don't understand why we'd need a third way to map. It's still an issue 
of physical vs virtual mapping, only in the sandbox case the 
phys-vs-virt mapping should be done through the mmap()/munmap() OS 
services (which at the moment it does not). Or am I missing something else?

OTOH, while reading the sandbox board config header, I see this:

	/* Memory things - we don't really want a memory test */

Seems to me like it comforts my comment that having 'effective' (in the 
sense of 'having an actual effect') memory access commands does not make 
much sense for sandbox -- it's an application in Linux and as such could 
barely use physical memory unless it is reserved for it, which on a pure 
development host is improbable: either the reserved memory is mundane 
RAM and it would best be allocated to the sandbox app as BSS or data, or 
it is actually mapped to some HW module and you had better make sure the 
underlying Linux kernel never ever uses this module.

But since the goal of sandbox is only to test U-Boot commands, not 
perform actual bootloader tasks, it can test md/mw etc. with some big 
array of RAM correctly 'mapped' to the working area defined through 
CONFIG_SYS_MEMTEST_START and CONFIG_SYS_MEMTEST_END.

I think mmap() allows the callerto suggest a value for the returned 
pointer, but it is only a suggestion, so you can never be sure what 
actual address the test RAM area will have in sandbox. But you can 
always set a pair env vars with the actual values and write the md/mw 
etc. tests so that they uses these values.

> Regards,
> Simon

Amicalement,
-- 
Albert.

  reply	other threads:[~2011-12-24 10:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-23 12:46 [U-Boot] testing u-boot on virtual environment Érico Porto
2011-12-23 12:57 ` Graeme Russ
2011-12-23 13:19   ` Érico Porto
2011-12-23 13:53     ` Érico Porto
2011-12-23 14:00       ` Érico Porto
2011-12-23 14:03         ` Érico Porto
2011-12-23 15:03           ` Albert ARIBAUD
2011-12-24  6:03       ` Simon Glass
2011-12-24 10:00         ` Albert ARIBAUD [this message]
2011-12-24 10:58           ` Matthias Weißer
2011-12-24 20:06             ` Érico Porto
2011-12-23 15:03     ` Matthias Weißer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EF5A2C0.2050104@aribaud.net \
    --to=albert.u.boot@aribaud.net \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox