From: Peter Maydell <peter.maydell@linaro.org>
To: Yongbok Kim <yongbok.kim@imgtec.com>
Cc: Riku Voipio <riku.voipio@iki.fi>,
Leon Alrae <leon.alrae@imgtec.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] running 64 bit user mode program on 32 bit host machine
Date: Mon, 20 Apr 2015 15:17:10 +0100 [thread overview]
Message-ID: <CAFEAcA97QC+fyFWAPdPQA9nrJ-YnusJ744cetGHN7wH6Yg0HxA@mail.gmail.com> (raw)
In-Reply-To: <55350055.1070305@imgtec.com>
On 20 April 2015 at 14:34, Yongbok Kim <yongbok.kim@imgtec.com> wrote:
> Hi All,
>
> I have faced a problem to run a simple 64 bit Linux user mode application on
> 32 bit Linux host machines.
> I did some investigation and found out that the TARGET_ELF_PAGESTART macro
> in
> the linux-user/elfload.c is causing the problem.
> However I am not sure if this is the right solution as I am not familiar
> with
> the area.
> Perhaps the macro should take care of target’s bits width rather than just
> use
> unsigned long.
> Would you please confirm the change or suggest better solution?
>
> Regards,
> Yongbok
>
>
> $ ../masterbin/mips64-linux-user/qemu-mips64 -cpu MIPS64R6-generic
> ./hello_linux.elf
> qemu: uncaught target signal 11 (Segmentation fault) - core dumped
> Segmentation fault (core dumped)
>
>
> $ git diff
> diff --git a/linux-user/elfload.c b/linux-user/elfload.c
> index 399c021..d99a43b 100644
> --- a/linux-user/elfload.c
> +++ b/linux-user/elfload.c
> @@ -1227,7 +1227,7 @@ struct exec
>
> /* Necessary parameters */
> #define TARGET_ELF_EXEC_PAGESIZE TARGET_PAGE_SIZE
> -#define TARGET_ELF_PAGESTART(_v) ((_v) & ~(unsigned
> long)(TARGET_ELF_EXEC_PAGESIZE-1))
> +#define TARGET_ELF_PAGESTART(_v) ((_v) &
> ~(abi_ulong)(TARGET_ELF_EXEC_PAGESIZE-1))
> #define TARGET_ELF_PAGEOFFSET(_v) ((_v) & (TARGET_ELF_EXEC_PAGESIZE-1))
I think this is a correct change. If you want to resubmit it
as a properly formatted patch with your signed-off-by you
can add my
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
prev parent reply other threads:[~2015-04-20 14:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-20 13:34 [Qemu-devel] running 64 bit user mode program on 32 bit host machine Yongbok Kim
2015-04-20 14:17 ` Peter Maydell [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=CAFEAcA97QC+fyFWAPdPQA9nrJ-YnusJ744cetGHN7wH6Yg0HxA@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=leon.alrae@imgtec.com \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
--cc=rth@twiddle.net \
--cc=yongbok.kim@imgtec.com \
/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).