From: Jim Paradis <jrp@jrp.tiac.net>
Subject: Re: This may be a really dumb question
Date: Tue, 23 Sep 1997 21:28:48 -0400 [thread overview]
Message-ID: <93bac309c98e6202fc6cf35886d3587d.axp-list@archive.invalid> (raw)
Sheer Panic wrote:
>
> But what _exactly_ causes an unaligned trap on the kernel?
Unaligned accesses 8-)
The Alpha architecture requires that memory operations take place on
"natural" boundaries; e.g. the effective address of a longword
load/store must be 0 MOD 4, the effective address of a quadword
load/store must be 0 MOD 8, etc. Accesses that violate these rules
are called "unaligned" accesses; they are not supported by the
processor, and they cause an exception when they occur. Imposing the
requirement of aligned accesses saves a *lot* of silicon that can
be put to other uses (reduces the amount of shift logic required to
line up the appropriate byte lanes with the register file, and streamlines
the cache address logic, among other things).
Every sane operating system for Alpha includes an "unaligned access"
handler which intercepts these exceptions and performs the desired
memory access in software. Needless to say, this is *VERY* inefficient;
instead of executing one memory access instruction, you've just executed
several hundred in the act of taking the exception, simulating the unaligned
access, and returning to the main code. You also may have messed up your
I-cache and branch-prediction stacks too.
This is why the kernel prints a message when an unaligned access occurs;
it's to encourage you VERY STRONGLY to root them out in the source and
avoid the massive performance penalty.
--
Jim Paradis jrp@jrp.tiac.net http://www.tiac.net/users/jrp/index.html
"It's not procrastination, it's my new Just-In-Time Workload Management System!"
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
next reply other threads:[~1997-09-24 1:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-09-24 1:28 Jim Paradis [this message]
-- strict thread matches above, loose matches on Subject: below --
1997-09-25 0:57 This may be a really dumb question Uncle George
1997-09-24 16:39 Przemek Klosowski
1997-09-24 17:12 ` Tom Linden
1997-09-28 4:23 ` Richard Henderson
1997-09-24 5:32 Jim Paradis
[not found] <Pine.LNX.3.95.970923051536.527L-100000@sheerx.eni.net>
1997-09-24 1:10 ` Tom Linden
1997-09-24 16:38 ` Volker Barthelmann
1997-09-28 3:39 ` Richard Henderson
1997-09-23 12:15 Sheer Panic
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox