From: Johannes Berg <johannes@sipsolutions.net>
To: "Maciej Żenczykowski" <maze@google.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Richard Weinberger <richard@nod.at>,
Anton Ivanov <anton.ivanov@cambridgegreys.com>,
linux-um@lists.infradead.org, x86@kernel.org
Subject: Re: [PATCH] um: make personality(PER_LINUX32) work on x86_64
Date: Wed, 28 Aug 2024 14:58:43 +0200 [thread overview]
Message-ID: <d66103380179771d0655288a4d0d95e990876132.camel@sipsolutions.net> (raw)
In-Reply-To: <CANP3RGdxrKHsERYG+yW5fpRUrahkBJbHCKD24v182ZNKuJgfwg@mail.gmail.com>
On Mon, 2024-08-19 at 11:46 -0700, Maciej Żenczykowski wrote:
> On Mon, Aug 19, 2024 at 5:23 AM Johannes Berg <johannes@sipsolutions.net> wrote:
> >
> > On Tue, 2024-08-13 at 16:47 -0700, Maciej Żenczykowski wrote:
> > > Without this patch:
> > > #!/usr/bin/python3
> > > import ctypes
> > > import os
> > > personality = ctypes.CDLL(None).personality
> > > personality.restype = ctypes.c_int
> > > personality.argtypes = [ctypes.c_ulong]
> > > PER_LINUX32=8
> > > personality(PER_LINUX32)
> > > print(os.uname().machine)
> > > returns:
> > > x86_64
> > > instead of the desired:
> > > i686
> > >
> >
> > But ... why should it work? UML has no 32-bit compat support anyway.
>
> Well, that's certainly a fair point.
> On 'native' x86_64 this works even for 64-bit processes though.
> I wonder if that, in itself, is a feature or a bug...
>
> In my case I was writing some debug code (to print the environment
> some test code is running in, since I think it was failing due to
> running 32-bit code in PER_LINUX32 on 64-bit arm) and testing (the
> test code) on x86_64 UML. I was surprised to discover the difference
> in UML vs my host desktop.
>
Alright, I have no idea. This doesn't really seem to do anything else,
so I'm not sure what the point is... It _was_ introduced for compat
though, but obviously the binary doesn't suddenly change to a 32-bit
binary when you do this :)
Maybe the x86 maintainers have any other comments?
johannes
prev parent reply other threads:[~2024-08-28 12:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-13 23:47 Maciej Żenczykowski
2024-08-19 12:23 ` Johannes Berg
2024-08-19 18:46 ` Maciej Żenczykowski
2024-08-28 12:58 ` Johannes Berg [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=d66103380179771d0655288a4d0d95e990876132.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=anton.ivanov@cambridgegreys.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-um@lists.infradead.org \
--cc=maze@google.com \
--cc=richard@nod.at \
--cc=x86@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
all inboxes | Powered by JetHome®