Skip to contentSkip to conversation

next try for disabling build of qemu-trad

PATCH Superseded Juergen Gross 3 participants 5 messages Nov 4, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover next try for disabling build of qemu-trad

Another try to disable building qemu-traditional per default.

Juergen Gross (2):
configure: modify default of building rombios
tools: disable building qemu-trad per default

 CHANGELOG.md         |   3 +
 stubdom/configure    |   8 ---
 stubdom/configure.ac |   8 +--
 tools/configure      | 131 ++++++++++++++++++-------------------------
 tools/configure.ac   |  80 +++++++++++---------------
 5 files changed, 92 insertions(+), 138 deletions(-)
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/2 configure: modify default of building rombios

The tools/configure script will default to build rombios if qemu traditional is enabled. If rombios is being built, ipxe will be built per default, too.

This results in rombios and ipxe no longer being built per default when disabling qemu traditional.

Fix that be rearranging the dependencies:

- build ipxe per default
- build rombios per default if either ipxe or qemu traditional are being built

This modification prepares not building qemu traditional per default without affecting build of rombios and ipxe.

---
 tools/configure    | 116 +++++++++++++++++++++------------------------
 tools/configure.ac |  67 +++++++++++++-------------
 2 files changed, 86 insertions(+), 97 deletions(-)
tools/configure +54 -62
index 33814b24b3..7b62b3cdd8 100755
@@ -698,7 +698,6 @@ APPEND_INCLUDES
 PREPEND_LIB
 PREPEND_INCLUDES
 EXTRA_QEMUU_CONFIGURE_ARGS
-ipxe
 qemu_xen_systemd
 qemu_xen_path
 qemu_xen
@@ -706,6 +705,7 @@ rombios
 BCC
 LD86
 AS86
+ipxe
 qemu_traditional
 LINUX_BACKEND_MODULES
 golang
@@ -815,13 +815,13 @@ enable_seabios
 enable_golang
 with_linux_backend_modules
 enable_qemu_traditional
+enable_ipxe
+with_system_ipxe
 enable_rombios
 with_system_qemu
 with_stubdom_qmp_proxy
 with_system_seabios
 with_system_ovmf
-enable_ipxe
-with_system_ipxe
 with_extra_qemuu_configure_args
 with_xenstored
 enable_systemd
@@ -1504,10 +1504,10 @@ Optional Features:
   --enable-qemu-traditional
                           Enable qemu traditional device model, (DEFAULT is on
                           for Linux or NetBSD x86, otherwise off)
+  --enable-ipxe           Enable in-tree IPXE, (DEFAULT is on for x86,
+                          otherwise off, see also --with-system-ipxe)
   --enable-rombios        Enable ROMBIOS, (DEFAULT is on if qemu-traditional
-                          is enabled, otherwise off)
-  --disable-ipxe          Enable in-tree IPXE, (DEFAULT is on if rombios is
-                          enabled, otherwise off, see also --with-system-ipxe)
+                          or ipxe is enabled, otherwise off)
   --enable-systemd        Enable systemd support (default is DISABLED)
   --enable-9pfs           Explicitly enable 9pfs support in QEMU build
                           (default is to defer to QEMU configure default)
@@ -1538,6 +1538,12 @@ Optional Packages:
   --with-linux-backend-modules="mod1 mod2"
                           List of Linux backend module or modalias names to be
                           autoloaded on startup.
+  --with-system-ipxe[=PATH]
+                          Use system supplied IPXE PATH instead of building
+                          and installing our own version, it takes precedence
+                          over --{en,dis}able-ipxe and is bound by the
+                          presence of rombios, --without-system-ipxe is an
+                          error
   --with-system-qemu[=PATH]
                           Use system supplied qemu PATH or qemu (taken from
                           $PATH) as qemu-xen device model instead of building
@@ -1551,12 +1557,6 @@ Optional Packages:
   --with-system-ovmf[=PATH]
                           Use system supplied OVMF PATH instead of building
                           and installing our own version
-  --with-system-ipxe[=PATH]
-                          Use system supplied IPXE PATH instead of building
-                          and installing our own version, it takes precedence
-                          over --{en,dis}able-ipxe and is bound by the
-                          presence of rombios, --without-system-ipxe is an
-                          error
   --with-extra-qemuu-configure-args[="--ARG1 ..."]
                           List of additional configure options for upstream
                           qemu
@@ -4314,13 +4314,54 @@ else
 
 fi
 
+if test "x$enable_ipxe" = "xno"; then :
+  ipxe=n
+else
+  ipxe=y
+fi
+
+# Check whether --enable-ipxe was given.
+if test "${enable_ipxe+set}" = set; then :
+  enableval=$enable_ipxe;
+else
+
+    case "$host_cpu" in
+        i[3456]86|x86_64)
+           enable_ipxe="yes";;
+        *) enable_ipxe="no";;
+    esac
+
+fi
+
+
+# Check whether --with-system-ipxe was given.
+if test "${with_system_ipxe+set}" = set; then :
+  withval=$with_system_ipxe;
+    case $withval in
+        no) as_fn_error $? "--without-system-ipxe has no effect" "$LINENO" 5 ;;
+        /*)  ipxe_path=$withval; ipxe=n ;;
+        *) as_fn_error $? "IPXE specified, but is not an absolute path" "$LINENO" 5 ;;
+    esac
+
+fi
+
+if test "x$ipxe" = "xy" -o -n "$ipxe_path" ; then :
+
+
+cat >>confdefs.h <<_ACEOF
+#define IPXE_PATH "${ipxe_path:-$XENFIRMWAREDIR/ipxe.bin}"
+_ACEOF
+
+
+fi
+
 
 # Check whether --enable-rombios was given.
 if test "${enable_rombios+set}" = set; then :
   enableval=$enable_rombios;
 else
 
-    if test "x$enable_qemu_traditional" = "xyes"; then :
+    if test "x$enable_qemu_traditional" = "xyes" -o "x$enable_ipxe" = "xyes"; then :
 
         enable_rombios="yes"
 
@@ -4635,55 +4676,6 @@ _ACEOF
 
 fi
 
-# Check whether --enable-ipxe was given.
-if test "${enable_ipxe+set}" = set; then :
-  enableval=$enable_ipxe;
-     if test "x$enable_ipxe" = "xno"; then :
-  ipxe=n
-else
-  ipxe=y
-fi
-
-else
-
-    if test "x$enable_rombios" = "xno"; then :
-  ipxe=n
-else
-  ipxe=y
-fi
-
-fi
-
-
-# Check whether --with-system-ipxe was given.
-if test "${with_system_ipxe+set}" = set; then :
-  withval=$with_system_ipxe;
-    case $withval in
-        no) as_fn_error $? "--without-system-ipxe has no effect" "$LINENO" 5 ;;
-        /*)  ipxe_path=$withval; ipxe=n ;;
-        *) as_fn_error $? "IPXE specified, but is not an absolute path" "$LINENO" 5 ;;
-    esac
-
-fi
-
-if test "x$ipxe" = "xy" -o -n "$ipxe_path" ; then :
-
-
-    if test "x$enable_rombios" = "xno"; then :
-
-        as_fn_error $? "Rombios is required to use IPXE" "$LINENO" 5
-
-fi
-
-
-cat >>confdefs.h <<_ACEOF
-#define IPXE_PATH "${ipxe_path:-$XENFIRMWAREDIR/ipxe.bin}"
-_ACEOF
-
-
-fi
-
-
 
 # Check whether --with-extra-qemuu-configure-args was given.
 if test "${with_extra_qemuu_configure_args+set}" = set; then :
tools/configure.ac +32 -35

81 lines not on this page · raw message

Signature · 1 line
2.26.2
#2 lore raw

PATCH 1/2 configure: modify default of building rombios

Juergen Gross writes ("[PATCH-for-4.16 1/2] configure: modify default of building rombios"):

Quoted 7 lines

The tools/configure script will default to build rombios if qemu traditional is enabled. If rombios is being built, ipxe will be built per default, too.

This results in rombios and ipxe no longer being built per default when disabling qemu traditional.

Quoted 8 lines

Fix that be rearranging the dependencies:

- build ipxe per default
- build rombios per default if either ipxe or qemu traditional are being built

This modification prepares not building qemu traditional per default without affecting build of rombios and ipxe.

Thanks. We had a conversation on irc about this. In summary:

Discussion:

Both before and after this patch --with-system-ipxe --disable-ipxe (or --with-system-ipxe on arm) would set IPXE_PATH but not cause ipxe to be actually built. I think that is correct.

We discussed the linkage between rombios and ipxe. Our understanding is that thbe intent was to support two configurations:
qemu-trad + {hvmloader, rombios, ipxe}
qemu-upstraem + {hvmloader, seabios, pxe rom provided by qemu}

Before this patch, --disable-rombios --enable-ipxe would be an error. After this patch, it is tolerated (and indeed, it might occur with only one of those options due to defaulting). But we think that there is no actual functional link between these pieces: ie, nothing will actually go wrong. You just might not have ipxe support since you wouldn't be using trad at all.

We think that someone who explicitly manipulates the --en/disable-rombios and --en/disable-ipxe options so as to construct such a situation ought to know what they are doing and should get what the asked for.

Most people will controlling this via --en/disable-qemu-trad, which will do a plausible. thing.

I think *this* patch is a bugfix, although to rather obscure configure behaviour. I am inclined to release ack both this and the followup, for the reasons I gave previously.

Comments (especially, anything to contradict what I wrote above) ASAP please.

Thanks,
Ian.

#3 lore raw

Re: [PATCH-for-4.16 1/2] configure: modify default of building rombios

Quoted 48 lines · Ian Jackson

Juergen Gross writes ("[PATCH-for-4.16 1/2] configure: modify default of building rombios"):

Quoted 7 lines

The tools/configure script will default to build rombios if qemu traditional is enabled. If rombios is being built, ipxe will be built per default, too.

This results in rombios and ipxe no longer being built per default when disabling qemu traditional.

Quoted 8 lines

Fix that be rearranging the dependencies:

- build ipxe per default
- build rombios per default if either ipxe or qemu traditional are being built

This modification prepares not building qemu traditional per default without affecting build of rombios and ipxe.

Thanks. We had a conversation on irc about this. In summary:

Discussion:

Both before and after this patch --with-system-ipxe --disable-ipxe (or --with-system-ipxe on arm) would set IPXE_PATH but not cause ipxe to be actually built. I think that is correct.

We discussed the linkage between rombios and ipxe. Our understanding is that thbe intent was to support two configurations:
qemu-trad + {hvmloader, rombios, ipxe}
qemu-upstraem + {hvmloader, seabios, pxe rom provided by qemu}

Before this patch, --disable-rombios --enable-ipxe would be an error. After this patch, it is tolerated (and indeed, it might occur with only one of those options due to defaulting). But we think that there is no actual functional link between these pieces: ie, nothing will actually go wrong. You just might not have ipxe support since you wouldn't be using trad at all.

We think that someone who explicitly manipulates the --en/disable-rombios and --en/disable-ipxe options so as to construct such a situation ought to know what they are doing and should get what the asked for.

Most people will controlling this via --en/disable-qemu-trad, which will do a plausible. thing.

Quoted 6 lines

I think *this* patch is a bugfix, although to rather obscure configure behaviour. I am inclined to release ack both this and the followup, for the reasons I gave previously.

Comments (especially, anything to contradict what I wrote above) ASAP please.

I think the patch will fix the problem from CI.  And from that point of view it is an improvement.

However,  I don't think the help text is correct any more.  Specifically:

+       [Use system supplied IPXE PATH instead of building and installing +        our own version, it takes precedence over --{en,dis}able-ipxe and is
+        bound by the presence of rombios, --without-system-ipxe is an error]),[

and the binding to RomBIOS is no longer true AFAICT.  At a minimum, I think the wording there needs tweaking.

If tweaking is going on, then "per default" in the commit message feels a little awkward, and would more normally be "by default".

Otherwise, LGTM.

~Andrew

#4 lore raw

PATCH 2/2 tools: disable building qemu-trad per default

In reply to Juergen Gross

Using qemu-traditional as device model is deprecated for some time now.

So change the default for building it to "disable". This will affect ioemu-stubdom, too, as there is a direct dependency between the two.

Today it is possible to use a PVH/HVM Linux-based stubdom as device model. Additionally using ioemu-stubdom isn't really helping for security, as it requires to run a very old and potentially buggy qemu version in a PV domain. This is adding probably more security problems than it is removing by using a stubdom.

---
This is a resend of my original patch after that has been reverted due to dependencies to ipxe and rombios. Those have been dealt with in the first patch of this series.

---
 CHANGELOG.md         |  3 +++
 stubdom/configure    |  8 --------
 stubdom/configure.ac |  8 +-------
 tools/configure      | 17 ++---------------
 tools/configure.ac   | 13 +------------
 5 files changed, 7 insertions(+), 42 deletions(-)
CHANGELOG.md +3 -0
index e7107ac3de..e5ab49e779 100644
@@ -18,6 +18,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
    or by passing "iommu=quarantine=scratch-page" on the hypervisor command line.
  - pv-grub stubdoms will no longer be built per default. In order to be able to use pv-grub
    configure needs to be called with "--enable-pv-grub" as parameter.
+ - qemu-traditional based device models (both, qemu-traditional and ioemu-stubdom) will
+   no longer be built per default. In order to be able to use those, configure needs to
+   be called with "--enable-qemu-traditional" as parameter.
 
 ## [4.15.0 UNRELEASED](https://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.15.0) - TBD
 
stubdom/configure +0 -8
index df31532abb..07b709f998 100755
@@ -2286,14 +2286,6 @@ fi
 # Check whether --enable-qemu-traditional was given.
 if test "${enable_qemu_traditional+set}" = set; then :
   enableval=$enable_qemu_traditional;
-else
-
-    case "$host_cpu" in
-        i[3456]86|x86_64)
-           enable_qemu_traditional="yes";;
-        *) enable_qemu_traditional="no";;
-    esac
-
 fi
 
 if test "x$enable_qemu_traditional" = "xyes"; then :
stubdom/configure.ac +1 -7
index a07a1edae5..e20d99edac 100644
@@ -27,13 +27,7 @@ AX_STUBDOM_DEFAULT_ENABLE([xenstorepvh-stubdom], [xenstorepvh])
 AX_STUBDOM_CONDITIONAL([vtpm-stubdom], [vtpm])
 AX_STUBDOM_CONDITIONAL([vtpmmgr-stubdom], [vtpmmgr])
 
-AC_ARG_ENABLE([qemu-traditional],,,[
-    case "$host_cpu" in
-        i[[3456]]86|x86_64)
-           enable_qemu_traditional="yes";;
-        *) enable_qemu_traditional="no";;
-    esac
-])
+AC_ARG_ENABLE([qemu-traditional])
 AS_IF([test "x$enable_qemu_traditional" = "xyes"], [
     qemu_traditional=y],[
     qemu_traditional=n
tools/configure +2 -15
index 7b62b3cdd8..eb4ab9d723 100755
@@ -1502,8 +1502,8 @@ Optional Features:
   --disable-seabios       Disable SeaBIOS (default is ENABLED)
   --disable-golang        Disable Go tools (default is ENABLED)
   --enable-qemu-traditional
-                          Enable qemu traditional device model, (DEFAULT is on
-                          for Linux or NetBSD x86, otherwise off)
+                          Enable qemu traditional device model, (DEFAULT is
+                          off)
   --enable-ipxe           Enable in-tree IPXE, (DEFAULT is on for x86,
                           otherwise off, see also --with-system-ipxe)
   --enable-rombios        Enable ROMBIOS, (DEFAULT is on if qemu-traditional
@@ -4287,19 +4287,6 @@ LINUX_BACKEND_MODULES="`eval echo $LINUX_BACKEND_MODULES`"
 # Check whether --enable-qemu-traditional was given.
 if test "${enable_qemu_traditional+set}" = set; then :
   enableval=$enable_qemu_traditional;
-else
-
-    case "$host_cpu" in
-        i[3456]86|x86_64)
-           enable_qemu_traditional="yes";;
-        *) enable_qemu_traditional="no";;
-    esac
-    case "$host_os" in
-        freebsd*)
-           enable_qemu_traditional="no";;
-    esac
-
-
 fi
 
 if test "x$enable_qemu_traditional" = "xyes"; then :
tools/configure.ac +1 -12
index 4be3138cb3..02f310ce6c 100644
@@ -120,18 +120,7 @@ AC_SUBST(LINUX_BACKEND_MODULES)
 
 AC_ARG_ENABLE([qemu-traditional],
     AS_HELP_STRING([--enable-qemu-traditional],
-                   [Enable qemu traditional device model, (DEFAULT is on for Linux or NetBSD x86, otherwise off)]),,[
-    case "$host_cpu" in
-        i[[3456]]86|x86_64)
-           enable_qemu_traditional="yes";;
-        *) enable_qemu_traditional="no";;
-    esac
-    case "$host_os" in
-        freebsd*)
-           enable_qemu_traditional="no";;
-    esac
-
-])
+                   [Enable qemu traditional device model, (DEFAULT is off)]))
 AS_IF([test "x$enable_qemu_traditional" = "xyes"], [
 AC_DEFINE([HAVE_QEMU_TRADITIONAL], [1], [Qemu traditional enabled])
     qemu_traditional=y],[
Signature · 1 line
2.26.2