* [Qemu-devel] [PATCH 1/1] Support ppc64le binfmt registration
@ 2014-08-27 17:55 Serge E. Hallyn
2014-08-27 18:20 ` Peter Maydell
0 siblings, 1 reply; 10+ messages in thread
From: Serge E. Hallyn @ 2014-08-27 17:55 UTC (permalink / raw)
To: qemu-devel
This is a part of a patch proposed by jaejunh at
https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1358268
which enables running ppc64le binaries through qemu-user.
Not sure if it's the right way to do it, but it does allow
me to chroot into a ppc64el rootfs on amd64 host.
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
---
configure | 7 +++++++
default-configs/ppcle-linux-user.mak | 2 ++
linux-user/ppc/syscall.h | 4 ++++
3 files changed, 13 insertions(+)
create mode 100644 default-configs/ppcle-linux-user.mak
diff --git a/configure b/configure
index 2063cf6..0c52a3e 100755
--- a/configure
+++ b/configure
@@ -5070,6 +5070,13 @@ case "$target_name" in
TARGET_ABI_DIR=ppc
gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
;;
+ ppcle)
+ TARGET_ARCH=ppc64
+ TARGET_BASE_ARCH=ppc
+ TARGET_ABI_DIR=ppc
+ echo "TARGET_ABI32=y" >> $config_target_mak
+ gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
+ ;;
ppc64abi32)
TARGET_ARCH=ppc64
TARGET_BASE_ARCH=ppc
diff --git a/default-configs/ppcle-linux-user.mak b/default-configs/ppcle-linux-user.mak
new file mode 100644
index 0000000..aa09263
--- /dev/null
+++ b/default-configs/ppcle-linux-user.mak
@@ -0,0 +1,2 @@
+# Default configuration for ppcle-linux-user
+CONFIG_LIBDECNUMBER=y
diff --git a/linux-user/ppc/syscall.h b/linux-user/ppc/syscall.h
index 0daf5cd..a033323 100644
--- a/linux-user/ppc/syscall.h
+++ b/linux-user/ppc/syscall.h
@@ -64,7 +64,11 @@ struct target_revectored_struct {
#define UNAME_MACHINE "ppc64le"
#endif
#else
+#ifdef TARGET_WORDS_BIGENDIAN
#define UNAME_MACHINE "ppc"
+#else
+#define UNAME_MACHINE "ppcle"
+#endif
#endif
#define UNAME_MINIMUM_RELEASE "2.6.32"
--
2.1.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] Support ppc64le binfmt registration
2014-08-27 17:55 [Qemu-devel] [PATCH 1/1] Support ppc64le binfmt registration Serge E. Hallyn
@ 2014-08-27 18:20 ` Peter Maydell
2014-08-27 18:45 ` Serge E. Hallyn
0 siblings, 1 reply; 10+ messages in thread
From: Peter Maydell @ 2014-08-27 18:20 UTC (permalink / raw)
To: Serge E. Hallyn; +Cc: QEMU Developers
On 27 August 2014 18:55, Serge E. Hallyn <serge@hallyn.com> wrote:
> This is a part of a patch proposed by jaejunh at
> https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1358268
> which enables running ppc64le binaries through qemu-user.
I'm confused -- wouldn't these be handled by the existing
"ppc64le" support?
-- PMM
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] Support ppc64le binfmt registration
2014-08-27 18:20 ` Peter Maydell
@ 2014-08-27 18:45 ` Serge E. Hallyn
2014-08-27 19:01 ` Peter Maydell
0 siblings, 1 reply; 10+ messages in thread
From: Serge E. Hallyn @ 2014-08-27 18:45 UTC (permalink / raw)
To: Peter Maydell; +Cc: QEMU Developers, Serge E. Hallyn
Quoting Peter Maydell (peter.maydell@linaro.org):
> On 27 August 2014 18:55, Serge E. Hallyn <serge@hallyn.com> wrote:
> > This is a part of a patch proposed by jaejunh at
> > https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1358268
> > which enables running ppc64le binaries through qemu-user.
>
> I'm confused -- wouldn't these be handled by the existing
> "ppc64le" support?
>
> -- PMM
It looks to me like the point was to add a TARGET_ABI32=y
version (and I dunno, something about CONFIG_LIBDECNUMBER=y
for 32-bit).
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] Support ppc64le binfmt registration
2014-08-27 18:45 ` Serge E. Hallyn
@ 2014-08-27 19:01 ` Peter Maydell
2014-08-27 21:30 ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
0 siblings, 1 reply; 10+ messages in thread
From: Peter Maydell @ 2014-08-27 19:01 UTC (permalink / raw)
To: Serge E. Hallyn; +Cc: qemu-ppc@nongnu.org, QEMU Developers
[adding qemu-ppc]
On 27 August 2014 19:45, Serge E. Hallyn <serge@hallyn.com> wrote:
> Quoting Peter Maydell (peter.maydell@linaro.org):
>> On 27 August 2014 18:55, Serge E. Hallyn <serge@hallyn.com> wrote:
>> > This is a part of a patch proposed by jaejunh at
>> > https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1358268
>> > which enables running ppc64le binaries through qemu-user.
>>
>> I'm confused -- wouldn't these be handled by the existing
>> "ppc64le" support?
> It looks to me like the point was to add a TARGET_ABI32=y
> version (and I dunno, something about CONFIG_LIBDECNUMBER=y
> for 32-bit).
Wouldn't that be a "ppc64leabi32" target? (something of a
mouthful, admittedly). In any case I wouldn't expect it
to be used by a ppc64le chroot as you suggest. Conversely,
a "ppcle" ought to be a 32-bit little endian PPC, not a "32
bit ABI on 64 bit CPUs" variant. Anyway, this should be driven
by "what are the ABIs that the kernel provides", on which
question I defer to the PPC folks.
(It looks like some of this confusion stems from the original
bug report being actually two separate bugs. The ppc64le
related part is purely "ubuntu isn't registering the binfmt",
which isn't an upstream issue at all.)
thanks
-- PMM
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH 1/1] Support ppc64le binfmt registration
2014-08-27 19:01 ` Peter Maydell
@ 2014-08-27 21:30 ` Alexander Graf
2014-08-27 21:35 ` Peter Maydell
0 siblings, 1 reply; 10+ messages in thread
From: Alexander Graf @ 2014-08-27 21:30 UTC (permalink / raw)
To: Peter Maydell, Serge E. Hallyn; +Cc: qemu-ppc@nongnu.org, QEMU Developers
On 27.08.14 21:01, Peter Maydell wrote:
> [adding qemu-ppc]
>
> On 27 August 2014 19:45, Serge E. Hallyn <serge@hallyn.com> wrote:
>> Quoting Peter Maydell (peter.maydell@linaro.org):
>>> On 27 August 2014 18:55, Serge E. Hallyn <serge@hallyn.com> wrote:
>>>> This is a part of a patch proposed by jaejunh at
>>>> https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1358268
>>>> which enables running ppc64le binaries through qemu-user.
>>>
>>> I'm confused -- wouldn't these be handled by the existing
>>> "ppc64le" support?
>
>> It looks to me like the point was to add a TARGET_ABI32=y
>> version (and I dunno, something about CONFIG_LIBDECNUMBER=y
>> for 32-bit).
>
> Wouldn't that be a "ppc64leabi32" target?
There is no LE support for 32bit on PPC :).
Alex
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH 1/1] Support ppc64le binfmt registration
2014-08-27 21:30 ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
@ 2014-08-27 21:35 ` Peter Maydell
2014-08-27 22:40 ` Alexander Graf
0 siblings, 1 reply; 10+ messages in thread
From: Peter Maydell @ 2014-08-27 21:35 UTC (permalink / raw)
To: Alexander Graf; +Cc: qemu-ppc@nongnu.org, QEMU Developers, Serge E. Hallyn
On 27 August 2014 22:30, Alexander Graf <agraf@suse.de> wrote:
>
>
> On 27.08.14 21:01, Peter Maydell wrote:
>> [adding qemu-ppc]
>>
>> On 27 August 2014 19:45, Serge E. Hallyn <serge@hallyn.com> wrote:
>>> Quoting Peter Maydell (peter.maydell@linaro.org):
>>>> On 27 August 2014 18:55, Serge E. Hallyn <serge@hallyn.com> wrote:
>>>>> This is a part of a patch proposed by jaejunh at
>>>>> https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1358268
>>>>> which enables running ppc64le binaries through qemu-user.
>>>>
>>>> I'm confused -- wouldn't these be handled by the existing
>>>> "ppc64le" support?
>>
>>> It looks to me like the point was to add a TARGET_ABI32=y
>>> version (and I dunno, something about CONFIG_LIBDECNUMBER=y
>>> for 32-bit).
>>
>> Wouldn't that be a "ppc64leabi32" target?
>
> There is no LE support for 32bit on PPC :).
...in that case what is the original bug reporter actually
asking for?
-- PMM
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH 1/1] Support ppc64le binfmt registration
2014-08-27 21:35 ` Peter Maydell
@ 2014-08-27 22:40 ` Alexander Graf
2014-08-27 23:05 ` Serge E. Hallyn
0 siblings, 1 reply; 10+ messages in thread
From: Alexander Graf @ 2014-08-27 22:40 UTC (permalink / raw)
To: Peter Maydell
Cc: Benjamin Herrenschmidt, qemu-ppc@nongnu.org, QEMU Developers,
Serge E. Hallyn
On 27.08.14 23:35, Peter Maydell wrote:
> On 27 August 2014 22:30, Alexander Graf <agraf@suse.de> wrote:
>>
>>
>> On 27.08.14 21:01, Peter Maydell wrote:
>>> [adding qemu-ppc]
>>>
>>> On 27 August 2014 19:45, Serge E. Hallyn <serge@hallyn.com> wrote:
>>>> Quoting Peter Maydell (peter.maydell@linaro.org):
>>>>> On 27 August 2014 18:55, Serge E. Hallyn <serge@hallyn.com> wrote:
>>>>>> This is a part of a patch proposed by jaejunh at
>>>>>> https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1358268
>>>>>> which enables running ppc64le binaries through qemu-user.
>>>>>
>>>>> I'm confused -- wouldn't these be handled by the existing
>>>>> "ppc64le" support?
>>>
>>>> It looks to me like the point was to add a TARGET_ABI32=y
>>>> version (and I dunno, something about CONFIG_LIBDECNUMBER=y
>>>> for 32-bit).
>>>
>>> Wouldn't that be a "ppc64leabi32" target?
>>
>> There is no LE support for 32bit on PPC :).
>
> ...in that case what is the original bug reporter actually
> asking for?
Not sure - the only thing that remotely resembles what he's describing
would be if you enable the 32bit personality:
$ /uname-a.sh
Linux tempranillo 3.17.0-rc1-2-default+ #1 SMP Thu Jan 1 01:04:00 CET
1970 ppc64le ppc64le ppc64le GNU/Linux
$ perl -e 'syscall(136, 8); exec "/uname-a.sh"'
Linux tempranillo 3.17.0-rc1-2-default+ #1 SMP Thu Jan 1 01:04:00 CET
1970 ppcle ppcle ppcle GNU/Linux
but that doesn't mean that there is an actual ABI change. The ABI is
still ppc64le, as all binaries are still running in 64bit mode.
So before we add anything to QEMU, I would like to first see someone
point me to kernel patches that actually enable LE on Linux for 32bit
user space. So far I'm not aware of any (and I doubt it makes much sense).
Alex
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH 1/1] Support ppc64le binfmt registration
2014-08-27 22:40 ` Alexander Graf
@ 2014-08-27 23:05 ` Serge E. Hallyn
2014-08-27 23:09 ` Serge E. Hallyn
0 siblings, 1 reply; 10+ messages in thread
From: Serge E. Hallyn @ 2014-08-27 23:05 UTC (permalink / raw)
To: Alexander Graf
Cc: Peter Maydell, Benjamin Herrenschmidt, qemu-ppc@nongnu.org,
QEMU Developers, Serge E. Hallyn
Quoting Alexander Graf (agraf@suse.de):
>
>
> On 27.08.14 23:35, Peter Maydell wrote:
> > On 27 August 2014 22:30, Alexander Graf <agraf@suse.de> wrote:
> >>
> >>
> >> On 27.08.14 21:01, Peter Maydell wrote:
> >>> [adding qemu-ppc]
> >>>
> >>> On 27 August 2014 19:45, Serge E. Hallyn <serge@hallyn.com> wrote:
> >>>> Quoting Peter Maydell (peter.maydell@linaro.org):
> >>>>> On 27 August 2014 18:55, Serge E. Hallyn <serge@hallyn.com> wrote:
> >>>>>> This is a part of a patch proposed by jaejunh at
> >>>>>> https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1358268
> >>>>>> which enables running ppc64le binaries through qemu-user.
> >>>>>
> >>>>> I'm confused -- wouldn't these be handled by the existing
> >>>>> "ppc64le" support?
> >>>
> >>>> It looks to me like the point was to add a TARGET_ABI32=y
> >>>> version (and I dunno, something about CONFIG_LIBDECNUMBER=y
> >>>> for 32-bit).
> >>>
> >>> Wouldn't that be a "ppc64leabi32" target?
> >>
> >> There is no LE support for 32bit on PPC :).
> >
> > ...in that case what is the original bug reporter actually
> > asking for?
>
> Not sure - the only thing that remotely resembles what he's describing
> would be if you enable the 32bit personality:
>
> $ /uname-a.sh
> Linux tempranillo 3.17.0-rc1-2-default+ #1 SMP Thu Jan 1 01:04:00 CET
> 1970 ppc64le ppc64le ppc64le GNU/Linux
>
> $ perl -e 'syscall(136, 8); exec "/uname-a.sh"'
> Linux tempranillo 3.17.0-rc1-2-default+ #1 SMP Thu Jan 1 01:04:00 CET
> 1970 ppcle ppcle ppcle GNU/Linux
>
> but that doesn't mean that there is an actual ABI change. The ABI is
> still ppc64le, as all binaries are still running in 64bit mode.
>
> So before we add anything to QEMU, I would like to first see someone
> point me to kernel patches that actually enable LE on Linux for 32bit
> user space. So far I'm not aware of any (and I doubt it makes much sense).
Thanks, guys, I'll ping him for that.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH 1/1] Support ppc64le binfmt registration
2014-08-27 23:05 ` Serge E. Hallyn
@ 2014-08-27 23:09 ` Serge E. Hallyn
2014-08-28 7:42 ` Peter Maydell
0 siblings, 1 reply; 10+ messages in thread
From: Serge E. Hallyn @ 2014-08-27 23:09 UTC (permalink / raw)
To: Serge E. Hallyn
Cc: Peter Maydell, Benjamin Herrenschmidt, qemu-ppc@nongnu.org,
Alexander Graf, QEMU Developers
Quoting Serge E. Hallyn (serge@hallyn.com):
> Quoting Alexander Graf (agraf@suse.de):
> >
> >
> > On 27.08.14 23:35, Peter Maydell wrote:
> > > On 27 August 2014 22:30, Alexander Graf <agraf@suse.de> wrote:
> > >>
> > >>
> > >> On 27.08.14 21:01, Peter Maydell wrote:
> > >>> [adding qemu-ppc]
> > >>>
> > >>> On 27 August 2014 19:45, Serge E. Hallyn <serge@hallyn.com> wrote:
> > >>>> Quoting Peter Maydell (peter.maydell@linaro.org):
> > >>>>> On 27 August 2014 18:55, Serge E. Hallyn <serge@hallyn.com> wrote:
> > >>>>>> This is a part of a patch proposed by jaejunh at
> > >>>>>> https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1358268
> > >>>>>> which enables running ppc64le binaries through qemu-user.
> > >>>>>
> > >>>>> I'm confused -- wouldn't these be handled by the existing
> > >>>>> "ppc64le" support?
> > >>>
> > >>>> It looks to me like the point was to add a TARGET_ABI32=y
> > >>>> version (and I dunno, something about CONFIG_LIBDECNUMBER=y
> > >>>> for 32-bit).
> > >>>
> > >>> Wouldn't that be a "ppc64leabi32" target?
> > >>
> > >> There is no LE support for 32bit on PPC :).
> > >
> > > ...in that case what is the original bug reporter actually
> > > asking for?
> >
> > Not sure - the only thing that remotely resembles what he's describing
> > would be if you enable the 32bit personality:
> >
> > $ /uname-a.sh
> > Linux tempranillo 3.17.0-rc1-2-default+ #1 SMP Thu Jan 1 01:04:00 CET
> > 1970 ppc64le ppc64le ppc64le GNU/Linux
> >
> > $ perl -e 'syscall(136, 8); exec "/uname-a.sh"'
> > Linux tempranillo 3.17.0-rc1-2-default+ #1 SMP Thu Jan 1 01:04:00 CET
> > 1970 ppcle ppcle ppcle GNU/Linux
> >
> > but that doesn't mean that there is an actual ABI change. The ABI is
> > still ppc64le, as all binaries are still running in 64bit mode.
> >
> > So before we add anything to QEMU, I would like to first see someone
> > point me to kernel patches that actually enable LE on Linux for 32bit
> > user space. So far I'm not aware of any (and I doubt it makes much sense).
>
> Thanks, guys, I'll ping him for that.
(Fwiw my reading of the original bug description is that in fact he
is working on the kernel patch in question)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH 1/1] Support ppc64le binfmt registration
2014-08-27 23:09 ` Serge E. Hallyn
@ 2014-08-28 7:42 ` Peter Maydell
0 siblings, 0 replies; 10+ messages in thread
From: Peter Maydell @ 2014-08-28 7:42 UTC (permalink / raw)
To: Serge E. Hallyn
Cc: Benjamin Herrenschmidt, qemu-ppc@nongnu.org, Alexander Graf,
QEMU Developers
On 28 August 2014 00:09, Serge E. Hallyn <serge@hallyn.com> wrote:
> Quoting Serge E. Hallyn (serge@hallyn.com):
>> Quoting Alexander Graf (agraf@suse.de):
>> > So before we add anything to QEMU, I would like to first see someone
>> > point me to kernel patches that actually enable LE on Linux for 32bit
>> > user space. So far I'm not aware of any (and I doubt it makes much sense).
>>
>> Thanks, guys, I'll ping him for that.
>
> (Fwiw my reading of the original bug description is that in fact he
> is working on the kernel patch in question)
My take on that would be that we would want to wait for
kernel work to hit mainline before taking the corresponding
QEMU changes. (In particular there's always the possibility
of ABI changes like syscall numbering or struct layout
being required as part of the kernel patch review process.
We made this mistake before in letting the unicore support
get in when it wasn't the upstream kernel ABI.)
-- PMM
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2014-08-28 7:43 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-27 17:55 [Qemu-devel] [PATCH 1/1] Support ppc64le binfmt registration Serge E. Hallyn
2014-08-27 18:20 ` Peter Maydell
2014-08-27 18:45 ` Serge E. Hallyn
2014-08-27 19:01 ` Peter Maydell
2014-08-27 21:30 ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
2014-08-27 21:35 ` Peter Maydell
2014-08-27 22:40 ` Alexander Graf
2014-08-27 23:05 ` Serge E. Hallyn
2014-08-27 23:09 ` Serge E. Hallyn
2014-08-28 7:42 ` Peter Maydell
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).