qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Blue Swirl" <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Fix symbol lookup for mips64* targets
Date: Fri, 3 Oct 2008 20:13:24 +0300	[thread overview]
Message-ID: <f43fc5580810031013h471c53f7vdcc3fe8378645364@mail.gmail.com> (raw)
In-Reply-To: <48E5EF45.6070900@mail.berlios.de>

On 10/3/08, Stefan Weil <weil@mail.berlios.de> wrote:
> Thiemo Seufer schrieb:
>
> > Stefan Weil wrote:
>  >
>  >> For 64 bit targets, lookup_symbol() compares a 64-bit target address
>  >> with a 32 bit symbol address. This only works for addresses less than 2^32.
>  >>
>  >> MIPS64 kernels use addresses larger than 0xffffffff80000000,
>  >> so qemu.log never shows symbolic names.
>  >>
>  >> My patch is a workaround which works with Qemu's 32 bit address hack.
>  >> Please apply it to Qemu trunk.
>  >>
>  >> Maybe a better solution would use symbol addresses without shortening
>  >> them to 32 bits.
>  >>
>  >> Regards
>  >> Stefan
>  >>
>  >>
>  >
>  >
>  >> Fix symbol lookup for mips64* targets.
>  >>
>  >> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
>  >>
>  >> Index: disas.c
>  >> ===================================================================
>  >> --- disas.c  (Revision 5400)
>  >> +++ disas.c  (Arbeitskopie)
>  >> @@ -309,6 +309,11 @@
>  >>      struct syminfo *s;
>  >>      target_ulong addr;
>  >>
>  >> +#if defined(TARGET_MIPS64)
>  >> +    /* Adresses in syminfos are 32 bit values. */
>  >> +    orig_addr &= 0xffffffff;
>  >>
>  >
>  > This isn't true in general, not all MIPS64 kernels use the -msym32
>  > optimization.
>  >
>  >
>  > Thiemo
>
> Nor does my MIPS64 kernel: it uses 64 bit symbol addresses.
>
>  The current Qemu loads these addresses, reduces them to 32 bit and
>  stores the reduced 32 bit addresses. So the 32 bit addresses are made
>  by Qemu. They have nothing to do with kernel compile flags.
>
>  In lookup_symbol, Qemu compares real 64 bit addresses to the reduced
>  32 bit addresses which does not work for addresses larger than 2^32.
>  x86_64 kernels have no problem because they have small addresses.
>  MIPS64 kernels have a problem because they have large addresses.
>  I don't know whether ppc64 and sparc64 work, maybe someone who
>  has such kernels can do a "nm vmlinux".

Sparc64 kernel is located below 4G.

>  My patch is only a workaround which reduces the real 64 bit addresses
>  to 32 bit, too.
>
>  I suggest to apply it to Qemu trunk (because it is small and it improves
>  the current situation) and to add a note to the TODO list:
>  - store symbol addresses in full size (important for 64 bit targets)

We could be more ambitious and make the symbol size depend on target.
It does not look too hard.

      parent reply	other threads:[~2008-10-03 17:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-02 19:26 [Qemu-devel] [PATCH] Fix symbol lookup for mips64* targets Stefan Weil
2008-10-02 19:53 ` Blue Swirl
2008-10-16 19:57   ` [Qemu-devel] [PATCH] Improve symbol lookup (was: Re: [Qemu-devel] [PATCH] Fix symbol lookup for mips64* targets) Stefan Weil
2008-10-16 20:32     ` [Qemu-devel] [PATCH] Improve symbol lookup Stefan Weil
2008-10-16 20:41       ` Laurent Desnogues
2008-10-17 17:28       ` [Qemu-devel] [PATCH] Improve symbol lookup for system and user mode Stefan Weil
2008-10-20 17:16         ` Blue Swirl
2008-10-16 20:38     ` [Qemu-devel] [PATCH] Improve symbol lookup (was: Re: [Qemu-devel] [PATCH] Fix symbol lookup for mips64* targets) Laurent Desnogues
2008-10-02 21:52 ` [Qemu-devel] [PATCH] Fix symbol lookup for mips64* targets Thiemo Seufer
2008-10-03 10:09   ` Stefan Weil
2008-10-03 10:29     ` Laurent Desnogues
2008-10-03 17:14       ` Blue Swirl
2008-10-03 17:13     ` Blue Swirl [this message]

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=f43fc5580810031013h471c53f7vdcc3fe8378645364@mail.gmail.com \
    --to=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.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).