linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: "Muaddi, Cecilia" <cecilia.muaddi@alloptic.com>
Cc: linuxppc-embedded@lists.linuxppc.org
Subject: Re: access memory mapped registers
Date: Fri, 10 Jan 2003 02:20:23 +0100	[thread overview]
Message-ID: <20030110012028.3831EC608E@atlas.denx.de> (raw)
In-Reply-To: Your message of "Thu, 09 Jan 2003 16:46:45 PST." <885489B3B89FB6449F93E525DF78777F064542@srvnt506.ALLOPTIC.COM>


In message <885489B3B89FB6449F93E525DF78777F064542@srvnt506.ALLOPTIC.COM> you wrote:
>
> I can see if I mmap the internal 860 CPU registers, and screw up that, I
> will
> definitely screw up the system, and require it to be reboot.  BUt if the
> hardware we are mapping is outside the CPU internal memory and outside the
> RAM,
> shouldn't the failure be limited to the user application only then?

No. For example, assume there is a port pin  which  is  meant  as  an
input,  and  the  signal  is  driven from external hardware. Now your
application program by mistake re-programs this pin  as  output.  You
may smoke your board this way.

> only the memory regions that is mapped to the ethernet switching chip,
> even if I screw up on the hardware setup, shouldn't my kernel still be
> protected?  At most, the application faults and I should be able to restart
> the application without rebooting the system?

There is a simple rule: if you open backdoors in a secure system  the
result  is  an insecure system. Write clean code.


There is many things you have to keep in mind:

* Functionality: you cannot process interrupts in user space

* Performance: how do you synchronize your accesses to the  hardware?

* Communication: How do you know when data has been processed, or has
  become available, or stable, or ...?

* Tricky things: What will the caches in  your  system  do  when  the
  application  accesses  the  hardware?  How will you address memory?
  Remember that there are systems where  a  32  bit  address  is  not
  sufficient any more...

etc. etc.

Write clean code.



Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
Life is a game. Money is how we keep score.              - Ted Turner

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

       reply	other threads:[~2003-01-10  1:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <885489B3B89FB6449F93E525DF78777F064542@srvnt506.ALLOPTIC.COM>
2003-01-10  1:20 ` Wolfgang Denk [this message]
2003-01-13 15:14 ` access memory mapped registers Kenneth Johansson
2003-01-10  0:27 Muaddi, Cecilia
2003-01-10  1:12 ` Wolfgang Denk
     [not found] <885489B3B89FB6449F93E525DF78777F06453E@srvnt506.ALLOPTIC.COM>
2003-01-10  0:25 ` Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2003-01-10  0:18 Kerl, John
2003-01-09 22:00 Muaddi, Cecilia
2003-01-09 23:14 ` Wolfgang Denk

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=20030110012028.3831EC608E@atlas.denx.de \
    --to=wd@denx.de \
    --cc=cecilia.muaddi@alloptic.com \
    --cc=linuxppc-embedded@lists.linuxppc.org \
    /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;
as well as URLs for NNTP newsgroup(s).