linux-parisc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Grundler <grundler@parisc-linux.org>
To: Artem Alimarine <artem.alimarine@stromasys.com>
Cc: Kyle McMartin <kyle@mcmartin.ca>, linux-parisc@vger.kernel.org
Subject: Re: unaligned accesses in apply_relocate_add
Date: Fri, 28 Aug 2009 12:42:01 -0600	[thread overview]
Message-ID: <20090828184201.GA14548@lackof.org> (raw)
In-Reply-To: <4A954990.7070007@stromasys.com>

On Wed, Aug 26, 2009 at 04:41:20PM +0200, Artem Alimarine wrote:
> One point is that in the function apply_relocate_add a 4-byte aligned  
> address is created:
>
> 627                dot = (Elf64_Addr)loc & ~0x03;
> 628                loc64 = (Elf64_Xword *)loc;
>
> and used as a 64-bit location
>
> 711                case R_PARISC_DIR64:
> 712                        /* 64-bit effective address */
> 713                        *loc64 = val + addend;
> 714                        break;
>
> So, 8-byte word is read with a 4-byte alignment.

Perhaps this is expected to be an 8byte address pointing at a 4-byte word?
(and it's a bug that ist's not)

> I am busy building a parisc hardware emulator. It boots Linux, but it is  
> unstable yet. There are unaligned accesses in the emulation trace. I was  
> wandering whether it is normal behavior or caused by a bug in the  
> emulation.

HP has such an emulator. I've even tried to boot parisc-linux on it (failed)
~8 years ago.  Any chance someone from HP could publish it?

You might also look at Aries PA-RISC emulator (on ia64):
    http://www.princeton.edu/~rblee/ELE572Papers/PARISCtoIA64.htm

> The emulation trace gives a lot of accesses like this:
> 0-4011f968: translate_virtual_write unaligned_trap, va=0:416a20c  
> pa=1db1820c
> 0-4011f968: translate_virtual_write unaligned_trap, va=0:416a21c  
> pa=1db1821c
> 0-4011f968: translate_virtual_write unaligned_trap, va=0:416a224  
> pa=1db18224
>
> They are indeed 4-byte aligned. The PC address matches  
> apply_relocate_add in the kernel map.

*nod*

thanks,
grant

  reply	other threads:[~2009-08-28 18:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-26  8:37 unaligned accesses in apply_relocate_add Artem Alimarine
2009-08-26 13:17 ` Kyle McMartin
2009-08-26 14:41   ` Artem Alimarine
2009-08-28 18:42     ` Grant Grundler [this message]
2009-08-28 18:58       ` John David Anglin
2009-09-04 22:37       ` Artem Alimarine

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=20090828184201.GA14548@lackof.org \
    --to=grundler@parisc-linux.org \
    --cc=artem.alimarine@stromasys.com \
    --cc=kyle@mcmartin.ca \
    --cc=linux-parisc@vger.kernel.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).