Skip to contentSkip to conversation

tools/configure: Honour XEN_COMPILE_ARCH and _TARGET_ for shim

PATCH In review Ian Jackson 6 participants 8 messages Oct 29, 2019 – Nov 19, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/configure: Honour XEN_COMPILE_ARCH and _TARGET_ for shim

The pvshim can only be built 64-bit because the hypervisor is only 64-bit nowadays. The hypervisor build supports XEN_COMPILE_ARCH and XEN_TARGET_ARCH which override the information from uname. The pvshim build runs out of the tools/ directory but calls the hypervisor build system.

If one runs in a Linux 32-bit userland with a 64-bit kernel, one used to be able to set XEN_COMPILE_ARCH. But nowadays this does not work. configure sees the target cpu as 64-bit and tries to build pvshim. The build prints
echo "*** Xen x86/32 target no longer supported!"
and doesn't build anything. Then the subsequent Makefiles try to install the non-built pieces.

Fix this anomaly by causing configure to honour the Xen hypervisor way of setting the target architecture.

In principle this user behaviour is not handled quite right, because configure will still see 64-bit and so all the autoconf-based architecture testing will see 64-bit rather than 32-bit x86. But the tools are in fact generally quite portable: this particular location in configure{.ac,} is the only place in tools/ where 64-bit x86 is treated differently from 32-bit x86, so the fix is sufficient and correct for this use case.

It remains the case that XEN_COMPILE_ARCH or XEN_TARGET_ARCH to a non-x86 architecture, when configure thinks things are x86, or vice versa, will not work right.

I have rerun autogen.sh, so this patch contains the fix to configure as well as the source fix to configure.ac.

---
 tools/configure    | 2 +-
 tools/configure.ac | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
tools/configure +1 -1
index 82947ad308..d9ccce6d2b 100755
@@ -9711,7 +9711,7 @@ fi
 else
 
     cpu=`test -z "$target_cpu" && echo "$host_cpu" || echo "$target_cpu"`
-    case "$cpu" in
+    case "${XEN_COMPILE_ARCH-${XEN_TARGET_ARCH-$cpu}}" in
         x86_64)
            pvshim="y";;
         *) pvshim="n";;
tools/configure.ac +1 -1
index 674bd5809d..a8d8ce5ffe 100644
@@ -479,7 +479,7 @@ AC_ARG_ENABLE([pvshim],
                    [Disable pvshim build (enabled by default on 64bit x86)]),
     [AS_IF([test "x$enable_pvshim" = "xno"], [pvshim=n], [pvshim=y])], [
     cpu=`test -z "$target_cpu" && echo "$host_cpu" || echo "$target_cpu"`
-    case "$cpu" in
+    case "${XEN_COMPILE_ARCH-${XEN_TARGET_ARCH-$cpu}}" in
         x86_64)
            pvshim="y";;
         *) pvshim="n";;
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw
Quoted 8 lines · Ian Jackson

The pvshim can only be built 64-bit because the hypervisor is only 64-bit nowadays. The hypervisor build supports XEN_COMPILE_ARCH and XEN_TARGET_ARCH which override the information from uname. The pvshim build runs out of the tools/ directory but calls the hypervisor build system.

If one runs in a Linux 32-bit userland with a 64-bit kernel, one used to be able to set XEN_COMPILE_ARCH. But nowadays this does not work.

This looks to be a bugfix to 8845155c831c59e867ee3dd31ee63e0cc6c7dcf2 ?

In particular, this deleted the logic to only build the shim for XEN_TARGET_ARCH != x86_32.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#2 lore raw

Andrew Cooper writes ("Re: [Xen-devel] [XEN PATCH for-4.13] tools/configure: Honour XEN_COMPILE_ARCH and _TARGET_ for shim"):

Quoted 7 lines · Ian Jackson
Quoted 6 lines

The pvshim can only be built 64-bit because the hypervisor is only 64-bit nowadays. The hypervisor build supports XEN_COMPILE_ARCH and XEN_TARGET_ARCH which override the information from uname. The pvshim build runs out of the tools/ directory but calls the hypervisor build system.

Quoted 7 lines
Quoted 2 lines

If one runs in a Linux 32-bit userland with a 64-bit kernel, one used to be able to set XEN_COMPILE_ARCH. But nowadays this does not work.

This looks to be a bugfix to 8845155c831c59e867ee3dd31ee63e0cc6c7dcf2 ?

In particular, this deleted the logic to only build the shim for XEN_TARGET_ARCH != x86_32.

Yes. I have added a note about that to the commit message (stealing your text, thanks) and now I am CCing the author and requester of that commit, for form's sake.

Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#3 lore raw

Ian Jackson writes ("Re: [Xen-devel] [XEN PATCH for-4.13] tools/configure: Honour XEN_COMPILE_ARCH and _TARGET_ for shim"):

Quoted 11 lines

Andrew Cooper writes ("Re: [Xen-devel] [XEN PATCH for-4.13] tools/configure: Honour XEN_COMPILE_ARCH and _TARGET_ for shim"):

Quoted 10 lines · Ian Jackson
Quoted 8 lines

The pvshim can only be built 64-bit because the hypervisor is only 64-bit nowadays. The hypervisor build supports XEN_COMPILE_ARCH and XEN_TARGET_ARCH which override the information from uname. The pvshim build runs out of the tools/ directory but calls the hypervisor build system.

If one runs in a Linux 32-bit userland with a 64-bit kernel, one used to be able to set XEN_COMPILE_ARCH. But nowadays this does not work.

Quoted 8 lines
Quoted 4 lines

This looks to be a bugfix to 8845155c831c59e867ee3dd31ee63e0cc6c7dcf2 ?

In particular, this deleted the logic to only build the shim for XEN_TARGET_ARCH != x86_32.

Yes. I have added a note about that to the commit message (stealing your text, thanks) and now I am CCing the author and requester of that commit, for form's sake.

Andrew, did you want to ack this ? Or do you have further comments ? I have a release-ack...

Thanks,
Ian.

From 1a8de36699b9042c30797e05f7a5f4313d7f7ad1 Mon Sep 17 00:00:00 2001
From: Ian Jackson <[email protected]>
Date: Tue, 29 Oct 2019 17:45:30 +0000
Subject: [PATCH] tools/configure: Honour XEN_COMPILE_ARCH and _TARGET_ for
shim
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The pvshim can only be built 64-bit because the hypervisor is only 64-bit nowadays. The hypervisor build supports XEN_COMPILE_ARCH and XEN_TARGET_ARCH which override the information from uname. The pvshim build runs out of the tools/ directory but calls the hypervisor build system.

If one runs in a Linux 32-bit userland with a 64-bit kernel, one used to be able to set XEN_COMPILE_ARCH. But nowadays this does not work. configure sees the target cpu as 64-bit and tries to build pvshim. The build prints
echo "*** Xen x86/32 target no longer supported!"
and doesn't build anything. Then the subsequent Makefiles try to install the non-built pieces.

Fix this anomaly by causing configure to honour the Xen hypervisor way of setting the target architecture.

In principle this user behaviour is not handled quite right, because configure will still see 64-bit and so all the autoconf-based architecture testing will see 64-bit rather than 32-bit x86. But the tools are in fact generally quite portable: this particular location in configure{.ac,} is the only place in tools/ where 64-bit x86 is treated differently from 32-bit x86, so the fix is sufficient and correct for this use case.

It remains the case that XEN_COMPILE_ARCH or XEN_TARGET_ARCH to a non-x86 architecture, when configure thinks things are x86, or vice versa, will not work right.

(This is a bugfix to 8845155c831c
pvshim: make PV shim build selectable from configure
which inadvertantly deleted the logic to only build the shim for XEN_TARGET_ARCH != x86_32.)

I have rerun autogen.sh, so this patch contains the fix to configure as well as the source fix to configure.ac.

Fixes 8845155c831c59e867ee3dd31ee63e0cc6c7dcf2
CC Olaf Hering <[email protected]>
CC Roger Pau Monné <[email protected]>
---
 tools/configure    | 2 +-
 tools/configure.ac | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
tools/configure +1 -1
index 82947ad308..d9ccce6d2b 100755
@@ -9711,7 +9711,7 @@ fi
 else
 
     cpu=`test -z "$target_cpu" && echo "$host_cpu" || echo "$target_cpu"`
-    case "$cpu" in
+    case "${XEN_COMPILE_ARCH-${XEN_TARGET_ARCH-$cpu}}" in
         x86_64)
            pvshim="y";;
         *) pvshim="n";;
tools/configure.ac +1 -1
index 674bd5809d..a8d8ce5ffe 100644
@@ -479,7 +479,7 @@ AC_ARG_ENABLE([pvshim],
                    [Disable pvshim build (enabled by default on 64bit x86)]),
     [AS_IF([test "x$enable_pvshim" = "xno"], [pvshim=n], [pvshim=y])], [
     cpu=`test -z "$target_cpu" && echo "$host_cpu" || echo "$target_cpu"`
-    case "$cpu" in
+    case "${XEN_COMPILE_ARCH-${XEN_TARGET_ARCH-$cpu}}" in
         x86_64)
            pvshim="y";;
         *) pvshim="n";;
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#4 lore raw

Ian Jackson writes ("Re: [Xen-devel] [XEN PATCH for-4.13] tools/configure: Honour XEN_COMPILE_ARCH and _TARGET_ for shim"):

Quoted 2 lines

Andrew, did you want to ack this ? Or do you have further comments ? I have a release-ack...

Hrm. get_maintainer thinks this is for Wei. CC'd.

Ian.

Quoted 85 lines
Quoted 1 line

From 1a8de36699b9042c30797e05f7a5f4313d7f7ad1 Mon Sep 17 00:00:00 2001

From: Ian Jackson <[email protected]>
Date: Tue, 29 Oct 2019 17:45:30 +0000
Subject: [PATCH] tools/configure: Honour XEN_COMPILE_ARCH and _TARGET_ for
shim
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The pvshim can only be built 64-bit because the hypervisor is only 64-bit nowadays. The hypervisor build supports XEN_COMPILE_ARCH and XEN_TARGET_ARCH which override the information from uname. The pvshim build runs out of the tools/ directory but calls the hypervisor build system.

If one runs in a Linux 32-bit userland with a 64-bit kernel, one used to be able to set XEN_COMPILE_ARCH. But nowadays this does not work. configure sees the target cpu as 64-bit and tries to build pvshim. The build prints
echo "*** Xen x86/32 target no longer supported!"
and doesn't build anything. Then the subsequent Makefiles try to install the non-built pieces.

Fix this anomaly by causing configure to honour the Xen hypervisor way of setting the target architecture.

In principle this user behaviour is not handled quite right, because configure will still see 64-bit and so all the autoconf-based architecture testing will see 64-bit rather than 32-bit x86. But the tools are in fact generally quite portable: this particular location in configure{.ac,} is the only place in tools/ where 64-bit x86 is treated differently from 32-bit x86, so the fix is sufficient and correct for this use case.

It remains the case that XEN_COMPILE_ARCH or XEN_TARGET_ARCH to a non-x86 architecture, when configure thinks things are x86, or vice versa, will not work right.

(This is a bugfix to 8845155c831c
pvshim: make PV shim build selectable from configure
which inadvertantly deleted the logic to only build the shim for XEN_TARGET_ARCH != x86_32.)

I have rerun autogen.sh, so this patch contains the fix to configure as well as the source fix to configure.ac.

Fixes 8845155c831c59e867ee3dd31ee63e0cc6c7dcf2
CC Olaf Hering <[email protected]>
CC Roger Pau Monné <[email protected]>
---
 tools/configure    | 2 +-
 tools/configure.ac | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
tools/configure +1 -1
index 82947ad308..d9ccce6d2b 100755
@@ -9711,7 +9711,7 @@ fi
 else
 
     cpu=`test -z "$target_cpu" && echo "$host_cpu" || echo "$target_cpu"`
-    case "$cpu" in
+    case "${XEN_COMPILE_ARCH-${XEN_TARGET_ARCH-$cpu}}" in
         x86_64)
            pvshim="y";;
         *) pvshim="n";;
tools/configure.ac +1 -1
index 674bd5809d..a8d8ce5ffe 100644
@@ -479,7 +479,7 @@ AC_ARG_ENABLE([pvshim],
                    [Disable pvshim build (enabled by default on 64bit x86)]),
     [AS_IF([test "x$enable_pvshim" = "xno"], [pvshim=n], [pvshim=y])], [
     cpu=`test -z "$target_cpu" && echo "$host_cpu" || echo "$target_cpu"`
-    case "$cpu" in
+    case "${XEN_COMPILE_ARCH-${XEN_TARGET_ARCH-$cpu}}" in
         x86_64)
            pvshim="y";;
         *) pvshim="n";;
Signature · 1 line
2.11.0

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reviewed-by
#5 lore raw

On Tue, 19 Nov 2019 at 16:47, Ian Jackson <[email protected]> wrote:
[...]

Quoted 44 lines
Quoted 44 lines
Quoted 2 lines

From 1a8de36699b9042c30797e05f7a5f4313d7f7ad1 Mon Sep 17 00:00:00 2001

From: Ian Jackson <[email protected]>
Date: Tue, 29 Oct 2019 17:45:30 +0000
Subject: [PATCH] tools/configure: Honour XEN_COMPILE_ARCH and _TARGET_ for
shim
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The pvshim can only be built 64-bit because the hypervisor is only 64-bit nowadays. The hypervisor build supports XEN_COMPILE_ARCH and XEN_TARGET_ARCH which override the information from uname. The pvshim build runs out of the tools/ directory but calls the hypervisor build system.

If one runs in a Linux 32-bit userland with a 64-bit kernel, one used to be able to set XEN_COMPILE_ARCH. But nowadays this does not work. configure sees the target cpu as 64-bit and tries to build pvshim. The build prints
echo "*** Xen x86/32 target no longer supported!"
and doesn't build anything. Then the subsequent Makefiles try to install the non-built pieces.

Fix this anomaly by causing configure to honour the Xen hypervisor way of setting the target architecture.

In principle this user behaviour is not handled quite right, because configure will still see 64-bit and so all the autoconf-based architecture testing will see 64-bit rather than 32-bit x86. But the tools are in fact generally quite portable: this particular location in configure{.ac,} is the only place in tools/ where 64-bit x86 is treated differently from 32-bit x86, so the fix is sufficient and correct for this use case.

It remains the case that XEN_COMPILE_ARCH or XEN_TARGET_ARCH to a non-x86 architecture, when configure thinks things are x86, or vice versa, will not work right.

(This is a bugfix to 8845155c831c
pvshim: make PV shim build selectable from configure
which inadvertantly deleted the logic to only build the shim for XEN_TARGET_ARCH != x86_32.)

Quoted 8 lines
Quoted 8 lines

I have rerun autogen.sh, so this patch contains the fix to configure as well as the source fix to configure.ac.

Fixes 8845155c831c59e867ee3dd31ee63e0cc6c7dcf2
CC Olaf Hering <[email protected]>
CC Roger Pau Monné <[email protected]>

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reviewed-by
#6 lore raw
In reply to Ian Jackson
Quoted 70 lines · Ian Jackson

Ian Jackson writes ("Re: [Xen-devel] [XEN PATCH for-4.13] tools/configure: Honour XEN_COMPILE_ARCH and _TARGET_ for shim"):

Quoted 11 lines

Andrew Cooper writes ("Re: [Xen-devel] [XEN PATCH for-4.13] tools/configure: Honour XEN_COMPILE_ARCH and _TARGET_ for shim"):

Quoted 10 lines · Ian Jackson
Quoted 8 lines

The pvshim can only be built 64-bit because the hypervisor is only 64-bit nowadays. The hypervisor build supports XEN_COMPILE_ARCH and XEN_TARGET_ARCH which override the information from uname. The pvshim build runs out of the tools/ directory but calls the hypervisor build system.

If one runs in a Linux 32-bit userland with a 64-bit kernel, one used to be able to set XEN_COMPILE_ARCH. But nowadays this does not work.

Quoted 8 lines
Quoted 4 lines

This looks to be a bugfix to 8845155c831c59e867ee3dd31ee63e0cc6c7dcf2 ?

In particular, this deleted the logic to only build the shim for XEN_TARGET_ARCH != x86_32.

Yes. I have added a note about that to the commit message (stealing your text, thanks) and now I am CCing the author and requester of that commit, for form's sake.

Andrew, did you want to ack this ? Or do you have further comments ? I have a release-ack...

Thanks,
Ian.

From 1a8de36699b9042c30797e05f7a5f4313d7f7ad1 Mon Sep 17 00:00:00 2001
From: Ian Jackson <[email protected]>
Date: Tue, 29 Oct 2019 17:45:30 +0000
Subject: [PATCH] tools/configure: Honour XEN_COMPILE_ARCH and _TARGET_ for
shim
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The pvshim can only be built 64-bit because the hypervisor is only 64-bit nowadays. The hypervisor build supports XEN_COMPILE_ARCH and XEN_TARGET_ARCH which override the information from uname. The pvshim build runs out of the tools/ directory but calls the hypervisor build system.

If one runs in a Linux 32-bit userland with a 64-bit kernel, one used to be able to set XEN_COMPILE_ARCH. But nowadays this does not work. configure sees the target cpu as 64-bit and tries to build pvshim. The build prints
echo "*** Xen x86/32 target no longer supported!"
and doesn't build anything. Then the subsequent Makefiles try to install the non-built pieces.

Fix this anomaly by causing configure to honour the Xen hypervisor way of setting the target architecture.

In principle this user behaviour is not handled quite right, because configure will still see 64-bit and so all the autoconf-based architecture testing will see 64-bit rather than 32-bit x86. But the tools are in fact generally quite portable: this particular location in configure{.ac,} is the only place in tools/ where 64-bit x86 is treated differently from 32-bit x86, so the fix is sufficient and correct for this use case.

It remains the case that XEN_COMPILE_ARCH or XEN_TARGET_ARCH to a non-x86 architecture, when configure thinks things are x86, or vice versa, will not work right.

(This is a bugfix to 8845155c831c
pvshim: make PV shim build selectable from configure
which inadvertantly deleted the logic to only build the shim for XEN_TARGET_ARCH != x86_32.)

Quoted 7 lines

I have rerun autogen.sh, so this patch contains the fix to configure as well as the source fix to configure.ac.

Fixes 8845155c831c59e867ee3dd31ee63e0cc6c7dcf2
CC Olaf Hering <[email protected]>
CC Roger Pau Monné <[email protected]>

Thanks.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#7 lore raw
In reply to Ian Jackson
Quoted 29 lines · Ian Jackson

The pvshim can only be built 64-bit because the hypervisor is only 64-bit nowadays. The hypervisor build supports XEN_COMPILE_ARCH and XEN_TARGET_ARCH which override the information from uname. The pvshim build runs out of the tools/ directory but calls the hypervisor build system.

If one runs in a Linux 32-bit userland with a 64-bit kernel, one used to be able to set XEN_COMPILE_ARCH. But nowadays this does not work. configure sees the target cpu as 64-bit and tries to build pvshim. The build prints
echo "*** Xen x86/32 target no longer supported!"
and doesn't build anything. Then the subsequent Makefiles try to install the non-built pieces.

Fix this anomaly by causing configure to honour the Xen hypervisor way of setting the target architecture.

In principle this user behaviour is not handled quite right, because configure will still see 64-bit and so all the autoconf-based architecture testing will see 64-bit rather than 32-bit x86. But the tools are in fact generally quite portable: this particular location in configure{.ac,} is the only place in tools/ where 64-bit x86 is treated differently from 32-bit x86, so the fix is sufficient and correct for this use case.

It remains the case that XEN_COMPILE_ARCH or XEN_TARGET_ARCH to a non-x86 architecture, when configure thinks things are x86, or vice versa, will not work right.

Quoted 5 lines

I have rerun autogen.sh, so this patch contains the fix to configure as well as the source fix to configure.ac.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel