public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Matthias Weißer" <m.weisser.m@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] testing u-boot on virtual environment
Date: Sat, 24 Dec 2011 11:58:29 +0100	[thread overview]
Message-ID: <4EF5B055.6050102@googlemail.com> (raw)
In-Reply-To: <4EF5A2C0.2050104@aribaud.net>

Am 24.12.2011 11:00, schrieb Albert ARIBAUD:
> 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.

Don't forget that we have commands like tftpboot or fatload which both
get an address where to load the data. At least tftpboot is working with
my tap patch and USB should also be possible. So we may need to touch
more then just the memory commands to get the current situation fixed.

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

This was the way my original patch worked. It passed an address to mmap
which was unlikely to not match the returned address as far as I know
the typical linux process address space layout. The actual address was
then readable with the bdinfo command. Another possible solution would
be to assert when the address passed to mmap is not the same as the
returned address.

I think we should still think of sandbox as a tool which eases debugging
and shouldn't let it influence "real" systems by adding code to these
systems which is not needed.

Matthias

  reply	other threads:[~2011-12-24 10:58 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
2011-12-24 10:58           ` Matthias Weißer [this message]
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=4EF5B055.6050102@googlemail.com \
    --to=m.weisser.m@googlemail.com \
    --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