From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Thomas Huth" <thuth@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
libvir-list@redhat.com,
"John Paul Adrian Glaubitz" <glaubitz@physik.fu-berlin.de>,
"Richard Henderson" <richard.henderson@linaro.org>,
qemu-devel@nongnu.org, "Markus Armbruster" <armbru@redhat.com>,
"Wilfred Mallawa" <wilfred.mallawa@wdc.com>,
qemu-arm@nongnu.org, "Reinoud Zandijk" <reinoud@netbsd.org>,
xen-devel@lists.xenproject.org,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Maxim Levitsky" <mlevitsk@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [PATCH v4 2/5] docs/about/deprecated: Deprecate the qemu-system-i386 binary
Date: Mon, 6 Mar 2023 14:58:30 +0000 [thread overview]
Message-ID: <ZAX/lqu0Duuxfy/E@redhat.com> (raw)
In-Reply-To: <ZAX36kyxT2aEg4DF@redhat.com>
On Mon, Mar 06, 2023 at 02:25:46PM +0000, Daniel P. Berrangé wrote:
> On Mon, Mar 06, 2023 at 03:18:23PM +0100, Thomas Huth wrote:
> > On 06/03/2023 15.06, Daniel P. Berrangé wrote:
> > > On Mon, Mar 06, 2023 at 02:48:16PM +0100, Thomas Huth wrote:
> > > > On 06/03/2023 10.27, Daniel P. Berrangé wrote:
> > > > > On Mon, Mar 06, 2023 at 09:46:55AM +0100, Thomas Huth wrote:
> > > > > > [...] If a 32-bit CPU guest
> > > > > > +environment should be enforced, you can switch off the "long mode" CPU
> > > > > > +flag, e.g. with ``-cpu max,lm=off``.
> > > > >
> > > > > I had the idea to check this today and this is not quite sufficient,
> > > > [...]
> > > > > A further difference is that qemy-system-i686 does not appear to enable
> > > > > the 'syscall' flag, but I've not figured out where that difference is
> > > > > coming from in the code.
> > > >
> > > > I think I just spotted this by accident in target/i386/cpu.c
> > > > around line 637:
> > > >
> > > > #ifdef TARGET_X86_64
> > > > #define TCG_EXT2_X86_64_FEATURES (CPUID_EXT2_SYSCALL | CPUID_EXT2_LM)
> > > > #else
> > > > #define TCG_EXT2_X86_64_FEATURES 0
> > > > #endif
> > >
> > > Hmm, so right now the difference between qemu-system-i386 and
> > > qemu-system-x86_64 is based on compile time conditionals. So we
> > > have the burden of building everything twice and also a burden
> > > of testing everything twice.
> > >
> > > If we eliminate qemu-system-i386 we get rid of our own burden,
> > > but users/mgmt apps need to adapt to force qemu-system-x86_64
> > > to present a 32-bit system.
> > >
> > > What about if we had qemu-system-i386 be a hardlink to
> > > qemu-system-x86_64, and then changed behaviour based off the
> > > executed binary name ?
> >
> > We could also simply provide a shell script that runs:
> >
> > qemu-system-x86_64 -cpu qemu32 $*
> >
> > ... that'd sounds like the simplest solution to me.
>
> That woudn't do the right thing if the user ran 'qemu-system-i386 -cpu max'
> because their '-cpu max' would override the -cpu arg in the shell script
> that forced 32-bit mode.
It would also fail to work with SELinux, because policy restrictions
doesn't allow for an intermediate wrapper script to exec binaries.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2023-03-06 14:59 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-06 8:46 [PATCH v4 0/5] Deprecate system emulation support for 32-bit x86 and arm hosts Thomas Huth
2023-03-06 8:46 ` [PATCH v4 1/5] docs/about/deprecated: Deprecate 32-bit x86 hosts for system emulation Thomas Huth
2023-03-06 8:46 ` [PATCH v4 2/5] docs/about/deprecated: Deprecate the qemu-system-i386 binary Thomas Huth
2023-03-06 9:27 ` Daniel P. Berrangé
2023-03-06 9:54 ` Thomas Huth
2023-03-06 9:58 ` Daniel P. Berrangé
2023-03-06 13:48 ` Thomas Huth
2023-03-06 14:06 ` Daniel P. Berrangé
2023-03-06 14:18 ` Thomas Huth
2023-03-06 14:25 ` Daniel P. Berrangé
2023-03-06 14:58 ` Daniel P. Berrangé [this message]
2023-03-06 14:56 ` Philippe Mathieu-Daudé
2023-03-06 8:46 ` [PATCH v4 3/5] gitlab-ci.d/crossbuilds: Drop the i386 system emulation job Thomas Huth
2023-03-06 9:19 ` Philippe Mathieu-Daudé
2023-03-06 8:46 ` [PATCH v4 4/5] docs/about/deprecated: Deprecate 32-bit arm hosts for system emulation Thomas Huth
2023-03-06 9:23 ` Philippe Mathieu-Daudé
2023-03-07 2:43 ` Richard Henderson
2023-03-06 8:46 ` [PATCH v4 5/5] gitlab-ci.d/crossbuilds: Drop the 32-bit arm system emulation jobs Thomas Huth
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=ZAX/lqu0Duuxfy/E@redhat.com \
--to=berrange@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=armbru@redhat.com \
--cc=glaubitz@physik.fu-berlin.de \
--cc=libvir-list@redhat.com \
--cc=mlevitsk@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=reinoud@netbsd.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
--cc=wilfred.mallawa@wdc.com \
--cc=xen-devel@lists.xenproject.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).