* [kvm-unit-tests PATCH 24/32] common/sieve: Use vmalloc.h for setup_mmu definition
[not found] <20240226101218.1472843-1-npiggin@gmail.com>
@ 2024-02-26 10:12 ` Nicholas Piggin
2024-02-28 12:03 ` Andrew Jones
2024-02-26 10:12 ` [kvm-unit-tests PATCH 29/32] configure: Fail on unknown arch Nicholas Piggin
2024-02-26 10:12 ` [kvm-unit-tests PATCH 30/32] configure: Make arch_libdir a first-class entity Nicholas Piggin
2 siblings, 1 reply; 6+ messages in thread
From: Nicholas Piggin @ 2024-02-26 10:12 UTC (permalink / raw)
To: Thomas Huth
Cc: Nicholas Piggin, Laurent Vivier, Andrew Jones, Paolo Bonzini,
Joel Stanley, linuxppc-dev, kvm, Janosch Frank, Claudio Imbrenda,
Nico Böhr, David Hildenbrand, linux-s390
There is no good reason to put setup_vm in libcflat.h when it's
defined in vmalloc.h.
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Cc: Andrew Jones <andrew.jones@linux.dev>
Cc: Janosch Frank <frankja@linux.ibm.com>
Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
Cc: Nico Böhr <nrb@linux.ibm.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: kvm@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
common/sieve.c | 1 +
lib/libcflat.h | 2 --
lib/s390x/io.c | 1 +
lib/s390x/uv.h | 1 +
lib/x86/vm.h | 1 +
s390x/mvpg.c | 1 +
s390x/selftest.c | 1 +
x86/pmu.c | 1 +
x86/pmu_lbr.c | 1 +
x86/vmexit.c | 1 +
x86/vmware_backdoors.c | 1 +
11 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/common/sieve.c b/common/sieve.c
index 8150f2d98..8fe05ef13 100644
--- a/common/sieve.c
+++ b/common/sieve.c
@@ -1,5 +1,6 @@
#include "alloc.h"
#include "libcflat.h"
+#include "vmalloc.h"
static int sieve(char* data, int size)
{
diff --git a/lib/libcflat.h b/lib/libcflat.h
index 700f43527..8c8dd0286 100644
--- a/lib/libcflat.h
+++ b/lib/libcflat.h
@@ -152,8 +152,6 @@ do { \
void binstr(unsigned long x, char out[BINSTR_SZ]);
void print_binstr(unsigned long x);
-extern void setup_vm(void);
-
#endif /* !__ASSEMBLY__ */
#define SZ_256 (1 << 8)
diff --git a/lib/s390x/io.c b/lib/s390x/io.c
index fb7b7ddaa..2b28ccaa0 100644
--- a/lib/s390x/io.c
+++ b/lib/s390x/io.c
@@ -10,6 +10,7 @@
*/
#include <libcflat.h>
#include <argv.h>
+#include <vmalloc.h>
#include <asm/spinlock.h>
#include <asm/facility.h>
#include <asm/sigp.h>
diff --git a/lib/s390x/uv.h b/lib/s390x/uv.h
index 286933caa..00a370410 100644
--- a/lib/s390x/uv.h
+++ b/lib/s390x/uv.h
@@ -4,6 +4,7 @@
#include <sie.h>
#include <asm/pgtable.h>
+#include <vmalloc.h>
bool uv_os_is_guest(void);
bool uv_os_is_host(void);
diff --git a/lib/x86/vm.h b/lib/x86/vm.h
index 4b714bad7..cf39787aa 100644
--- a/lib/x86/vm.h
+++ b/lib/x86/vm.h
@@ -2,6 +2,7 @@
#define _X86_VM_H_
#include "processor.h"
+#include "vmalloc.h"
#include "asm/page.h"
#include "asm/io.h"
#include "asm/bitops.h"
diff --git a/s390x/mvpg.c b/s390x/mvpg.c
index 296338d4f..a0cfc575a 100644
--- a/s390x/mvpg.c
+++ b/s390x/mvpg.c
@@ -15,6 +15,7 @@
#include <asm/page.h>
#include <asm/facility.h>
#include <asm/mem.h>
+#include <vmalloc.h>
#include <alloc_page.h>
#include <bitops.h>
#include <hardware.h>
diff --git a/s390x/selftest.c b/s390x/selftest.c
index 92ed4e5d3..3eaae9b06 100644
--- a/s390x/selftest.c
+++ b/s390x/selftest.c
@@ -9,6 +9,7 @@
#include <libcflat.h>
#include <util.h>
#include <alloc.h>
+#include <vmalloc.h>
#include <asm/interrupt.h>
#include <asm/barrier.h>
#include <asm/pgtable.h>
diff --git a/x86/pmu.c b/x86/pmu.c
index 47a1a602a..7062c1ad9 100644
--- a/x86/pmu.c
+++ b/x86/pmu.c
@@ -6,6 +6,7 @@
#include "x86/apic.h"
#include "x86/desc.h"
#include "x86/isr.h"
+#include "vmalloc.h"
#include "alloc.h"
#include "libcflat.h"
diff --git a/x86/pmu_lbr.c b/x86/pmu_lbr.c
index 40b63fa3d..c6f010847 100644
--- a/x86/pmu_lbr.c
+++ b/x86/pmu_lbr.c
@@ -2,6 +2,7 @@
#include "x86/processor.h"
#include "x86/pmu.h"
#include "x86/desc.h"
+#include "vmalloc.h"
#define N 1000000
diff --git a/x86/vmexit.c b/x86/vmexit.c
index eb5d3023a..48a38f60f 100644
--- a/x86/vmexit.c
+++ b/x86/vmexit.c
@@ -1,6 +1,7 @@
#include "libcflat.h"
#include "acpi.h"
#include "smp.h"
+#include "vmalloc.h"
#include "pci.h"
#include "x86/vm.h"
#include "x86/desc.h"
diff --git a/x86/vmware_backdoors.c b/x86/vmware_backdoors.c
index bc1002056..f8cf7ecb1 100644
--- a/x86/vmware_backdoors.c
+++ b/x86/vmware_backdoors.c
@@ -6,6 +6,7 @@
#include "x86/desc.h"
#include "x86/isr.h"
#include "alloc.h"
+#include "vmalloc.h"
#include "setjmp.h"
#include "usermode.h"
#include "fault_test.h"
--
2.42.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [kvm-unit-tests PATCH 29/32] configure: Fail on unknown arch
[not found] <20240226101218.1472843-1-npiggin@gmail.com>
2024-02-26 10:12 ` [kvm-unit-tests PATCH 24/32] common/sieve: Use vmalloc.h for setup_mmu definition Nicholas Piggin
@ 2024-02-26 10:12 ` Nicholas Piggin
2024-02-28 12:08 ` Andrew Jones
2024-02-26 10:12 ` [kvm-unit-tests PATCH 30/32] configure: Make arch_libdir a first-class entity Nicholas Piggin
2 siblings, 1 reply; 6+ messages in thread
From: Nicholas Piggin @ 2024-02-26 10:12 UTC (permalink / raw)
To: Thomas Huth
Cc: Nicholas Piggin, Laurent Vivier, Andrew Jones, Paolo Bonzini,
Joel Stanley, linuxppc-dev, kvm, Alexandru Elisei,
Claudio Imbrenda, David Hildenbrand, Eric Auger, Janosch Frank,
Nico Böhr, linux-s390, kvmarm, kvm-riscv
configure will accept an unknown arch, and if it is the name of a
directory in the source tree the command will silently succeed. Make
it only accept supported arch names.
Also print the full path of a missing test directory to disambiguate
the error in out of tree builds.
Cc: Alexandru Elisei <alexandru.elisei@arm.com>
Cc: Andrew Jones <andrew.jones@linux.dev>
Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Eric Auger <eric.auger@redhat.com>
Cc: Janosch Frank <frankja@linux.ibm.com>
Cc: Laurent Vivier <lvivier@redhat.com>
Cc: Nico Böhr <nrb@linux.ibm.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Cc: kvm@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Cc: kvmarm@lists.linux.dev
Cc: kvm-riscv@lists.infradead.org
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
configure | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
index 6907ccbbb..ae522c556 100755
--- a/configure
+++ b/configure
@@ -45,7 +45,8 @@ usage() {
Usage: $0 [options]
Options include:
- --arch=ARCH architecture to compile for ($arch)
+ --arch=ARCH architecture to compile for ($arch). ARCH can be one of:
+ arm, arm64, i386, ppc64, riscv32, riscv64, s390x, x86_64
--processor=PROCESSOR processor to compile for ($arch)
--target=TARGET target platform that the tests will be running on (qemu or
kvmtool, default is qemu) (arm/arm64 only)
@@ -321,11 +322,15 @@ elif [ "$arch" = "ppc64" ]; then
elif [ "$arch" = "riscv32" ] || [ "$arch" = "riscv64" ]; then
testdir=riscv
arch_libdir=riscv
+elif [ "$arch" = "s390x" ]; then
+ testdir=s390x
else
- testdir=$arch
+ echo "arch $arch is not supported!"
+ arch=
+ usage
fi
if [ ! -d "$srcdir/$testdir" ]; then
- echo "$testdir does not exist!"
+ echo "$srcdir/$testdir does not exist!"
exit 1
fi
--
2.42.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [kvm-unit-tests PATCH 30/32] configure: Make arch_libdir a first-class entity
[not found] <20240226101218.1472843-1-npiggin@gmail.com>
2024-02-26 10:12 ` [kvm-unit-tests PATCH 24/32] common/sieve: Use vmalloc.h for setup_mmu definition Nicholas Piggin
2024-02-26 10:12 ` [kvm-unit-tests PATCH 29/32] configure: Fail on unknown arch Nicholas Piggin
@ 2024-02-26 10:12 ` Nicholas Piggin
2024-02-28 12:13 ` Andrew Jones
2 siblings, 1 reply; 6+ messages in thread
From: Nicholas Piggin @ 2024-02-26 10:12 UTC (permalink / raw)
To: Thomas Huth
Cc: Nicholas Piggin, Laurent Vivier, Andrew Jones, Paolo Bonzini,
Joel Stanley, linuxppc-dev, kvm, Alexandru Elisei,
Claudio Imbrenda, David Hildenbrand, Eric Auger, Janosch Frank,
Nico Böhr, linux-s390, kvmarm, kvm-riscv
arch_libdir was brought in to improve the heuristic determination of
the lib/ directory based on arch and testdir names, but it did not
entirely clean that mess up.
Remove the arch_libdir->arch->testdir heuristic and just require
everybody sets arch_libdir correctly. Fail if the lib/arch or
lib/arch/asm directories can not be found.
Cc: Alexandru Elisei <alexandru.elisei@arm.com>
Cc: Andrew Jones <andrew.jones@linux.dev>
Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Eric Auger <eric.auger@redhat.com>
Cc: Janosch Frank <frankja@linux.ibm.com>
Cc: Laurent Vivier <lvivier@redhat.com>
Cc: Nico Böhr <nrb@linux.ibm.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Cc: kvm@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Cc: kvmarm@lists.linux.dev
Cc: kvm-riscv@lists.infradead.org
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
Makefile | 2 +-
configure | 18 +++++++++++++-----
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index 4f35fffc6..4e0f54543 100644
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,7 @@ include config.mak
VPATH = $(SRCDIR)
libdirs-get = $(shell [ -d "lib/$(1)" ] && echo "lib/$(1) lib/$(1)/asm")
-ARCH_LIBDIRS := $(call libdirs-get,$(ARCH_LIBDIR)) $(call libdirs-get,$(TEST_DIR))
+ARCH_LIBDIRS := $(call libdirs-get,$(ARCH_LIBDIR))
OBJDIRS := $(ARCH_LIBDIRS)
DESTDIR := $(PREFIX)/share/kvm-unit-tests/
diff --git a/configure b/configure
index ae522c556..8c0e3506f 100755
--- a/configure
+++ b/configure
@@ -199,7 +199,6 @@ fi
arch_name=$arch
[ "$arch" = "aarch64" ] && arch="arm64"
[ "$arch_name" = "arm64" ] && arch_name="aarch64"
-arch_libdir=$arch
if [ "$arch" = "riscv" ]; then
echo "riscv32 or riscv64 must be specified"
@@ -264,8 +263,10 @@ fi
if [ "$arch" = "i386" ] || [ "$arch" = "x86_64" ]; then
testdir=x86
+ arch_libdir=x86
elif [ "$arch" = "arm" ] || [ "$arch" = "arm64" ]; then
testdir=arm
+ arch_libdir=$arch
if [ "$target" = "qemu" ]; then
arm_uart_early_addr=0x09000000
elif [ "$target" = "kvmtool" ]; then
@@ -314,6 +315,7 @@ elif [ "$arch" = "arm" ] || [ "$arch" = "arm64" ]; then
fi
elif [ "$arch" = "ppc64" ]; then
testdir=powerpc
+ arch_libdir=ppc64
firmware="$testdir/boot_rom.bin"
if [ "$endian" != "little" ] && [ "$endian" != "big" ]; then
echo "You must provide endianness (big or little)!"
@@ -324,6 +326,7 @@ elif [ "$arch" = "riscv32" ] || [ "$arch" = "riscv64" ]; then
arch_libdir=riscv
elif [ "$arch" = "s390x" ]; then
testdir=s390x
+ arch_libdir=s390x
else
echo "arch $arch is not supported!"
arch=
@@ -333,6 +336,10 @@ if [ ! -d "$srcdir/$testdir" ]; then
echo "$srcdir/$testdir does not exist!"
exit 1
fi
+if [ ! -d "$srcdir/lib/$arch_libdir" ]; then
+ echo "$srcdir/lib/$arch_libdir does not exist!"
+ exit 1
+fi
if [ "$efi" = "y" ] && [ -f "$srcdir/$testdir/efi/run" ]; then
ln -fs "$srcdir/$testdir/efi/run" $testdir-run
@@ -395,10 +402,11 @@ fi
# link lib/asm for the architecture
rm -f lib/asm
asm="asm-generic"
-if [ -d "$srcdir/lib/$arch/asm" ]; then
- asm="$srcdir/lib/$arch/asm"
-elif [ -d "$srcdir/lib/$testdir/asm" ]; then
- asm="$srcdir/lib/$testdir/asm"
+if [ -d "$srcdir/lib/$arch_libdir/asm" ]; then
+ asm="$srcdir/lib/$arch_libdir/asm"
+else
+ echo "$srcdir/lib/$arch_libdir/asm does not exist"
+ exit 1
fi
mkdir -p lib
ln -sf "$asm" lib/asm
--
2.42.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [kvm-unit-tests PATCH 24/32] common/sieve: Use vmalloc.h for setup_mmu definition
2024-02-26 10:12 ` [kvm-unit-tests PATCH 24/32] common/sieve: Use vmalloc.h for setup_mmu definition Nicholas Piggin
@ 2024-02-28 12:03 ` Andrew Jones
0 siblings, 0 replies; 6+ messages in thread
From: Andrew Jones @ 2024-02-28 12:03 UTC (permalink / raw)
To: Nicholas Piggin
Cc: Thomas Huth, Laurent Vivier, Paolo Bonzini, Joel Stanley,
linuxppc-dev, kvm, Janosch Frank, Claudio Imbrenda,
Nico Böhr, David Hildenbrand, linux-s390
On Mon, Feb 26, 2024 at 08:12:10PM +1000, Nicholas Piggin wrote:
> There is no good reason to put setup_vm in libcflat.h when it's
> defined in vmalloc.h.
>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Thomas Huth <thuth@redhat.com>
> Cc: Andrew Jones <andrew.jones@linux.dev>
> Cc: Janosch Frank <frankja@linux.ibm.com>
> Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
> Cc: Nico Böhr <nrb@linux.ibm.com>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: kvm@vger.kernel.org
> Cc: linux-s390@vger.kernel.org
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
> common/sieve.c | 1 +
> lib/libcflat.h | 2 --
> lib/s390x/io.c | 1 +
> lib/s390x/uv.h | 1 +
> lib/x86/vm.h | 1 +
> s390x/mvpg.c | 1 +
> s390x/selftest.c | 1 +
> x86/pmu.c | 1 +
> x86/pmu_lbr.c | 1 +
> x86/vmexit.c | 1 +
> x86/vmware_backdoors.c | 1 +
> 11 files changed, 10 insertions(+), 2 deletions(-)
>
Acked-by: Andrew Jones <andrew.jones@linux.dev>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [kvm-unit-tests PATCH 29/32] configure: Fail on unknown arch
2024-02-26 10:12 ` [kvm-unit-tests PATCH 29/32] configure: Fail on unknown arch Nicholas Piggin
@ 2024-02-28 12:08 ` Andrew Jones
0 siblings, 0 replies; 6+ messages in thread
From: Andrew Jones @ 2024-02-28 12:08 UTC (permalink / raw)
To: Nicholas Piggin
Cc: Thomas Huth, Laurent Vivier, Paolo Bonzini, Joel Stanley,
linuxppc-dev, kvm, Alexandru Elisei, Claudio Imbrenda,
David Hildenbrand, Eric Auger, Janosch Frank, Nico Böhr,
linux-s390, kvmarm, kvm-riscv
On Mon, Feb 26, 2024 at 08:12:15PM +1000, Nicholas Piggin wrote:
> configure will accept an unknown arch, and if it is the name of a
> directory in the source tree the command will silently succeed. Make
> it only accept supported arch names.
>
> Also print the full path of a missing test directory to disambiguate
> the error in out of tree builds.
>
> Cc: Alexandru Elisei <alexandru.elisei@arm.com>
> Cc: Andrew Jones <andrew.jones@linux.dev>
> Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Eric Auger <eric.auger@redhat.com>
> Cc: Janosch Frank <frankja@linux.ibm.com>
> Cc: Laurent Vivier <lvivier@redhat.com>
> Cc: Nico Böhr <nrb@linux.ibm.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Thomas Huth <thuth@redhat.com>
> Cc: kvm@vger.kernel.org
> Cc: linux-s390@vger.kernel.org
> Cc: kvmarm@lists.linux.dev
> Cc: kvm-riscv@lists.infradead.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
> configure | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/configure b/configure
> index 6907ccbbb..ae522c556 100755
> --- a/configure
> +++ b/configure
> @@ -45,7 +45,8 @@ usage() {
> Usage: $0 [options]
>
> Options include:
> - --arch=ARCH architecture to compile for ($arch)
> + --arch=ARCH architecture to compile for ($arch). ARCH can be one of:
> + arm, arm64, i386, ppc64, riscv32, riscv64, s390x, x86_64
> --processor=PROCESSOR processor to compile for ($arch)
> --target=TARGET target platform that the tests will be running on (qemu or
> kvmtool, default is qemu) (arm/arm64 only)
> @@ -321,11 +322,15 @@ elif [ "$arch" = "ppc64" ]; then
> elif [ "$arch" = "riscv32" ] || [ "$arch" = "riscv64" ]; then
> testdir=riscv
> arch_libdir=riscv
> +elif [ "$arch" = "s390x" ]; then
> + testdir=s390x
> else
> - testdir=$arch
> + echo "arch $arch is not supported!"
> + arch=
> + usage
> fi
> if [ ! -d "$srcdir/$testdir" ]; then
> - echo "$testdir does not exist!"
> + echo "$srcdir/$testdir does not exist!"
> exit 1
> fi
>
> --
> 2.42.0
>
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [kvm-unit-tests PATCH 30/32] configure: Make arch_libdir a first-class entity
2024-02-26 10:12 ` [kvm-unit-tests PATCH 30/32] configure: Make arch_libdir a first-class entity Nicholas Piggin
@ 2024-02-28 12:13 ` Andrew Jones
0 siblings, 0 replies; 6+ messages in thread
From: Andrew Jones @ 2024-02-28 12:13 UTC (permalink / raw)
To: Nicholas Piggin
Cc: Thomas Huth, Laurent Vivier, Paolo Bonzini, Joel Stanley,
linuxppc-dev, kvm, Alexandru Elisei, Claudio Imbrenda,
David Hildenbrand, Eric Auger, Janosch Frank, Nico Böhr,
linux-s390, kvmarm, kvm-riscv
On Mon, Feb 26, 2024 at 08:12:16PM +1000, Nicholas Piggin wrote:
> arch_libdir was brought in to improve the heuristic determination of
> the lib/ directory based on arch and testdir names, but it did not
> entirely clean that mess up.
>
> Remove the arch_libdir->arch->testdir heuristic and just require
> everybody sets arch_libdir correctly. Fail if the lib/arch or
> lib/arch/asm directories can not be found.
>
> Cc: Alexandru Elisei <alexandru.elisei@arm.com>
> Cc: Andrew Jones <andrew.jones@linux.dev>
> Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Eric Auger <eric.auger@redhat.com>
> Cc: Janosch Frank <frankja@linux.ibm.com>
> Cc: Laurent Vivier <lvivier@redhat.com>
> Cc: Nico Böhr <nrb@linux.ibm.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Thomas Huth <thuth@redhat.com>
> Cc: kvm@vger.kernel.org
> Cc: linux-s390@vger.kernel.org
> Cc: kvmarm@lists.linux.dev
> Cc: kvm-riscv@lists.infradead.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
> Makefile | 2 +-
> configure | 18 +++++++++++++-----
> 2 files changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 4f35fffc6..4e0f54543 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -10,7 +10,7 @@ include config.mak
> VPATH = $(SRCDIR)
>
> libdirs-get = $(shell [ -d "lib/$(1)" ] && echo "lib/$(1) lib/$(1)/asm")
> -ARCH_LIBDIRS := $(call libdirs-get,$(ARCH_LIBDIR)) $(call libdirs-get,$(TEST_DIR))
> +ARCH_LIBDIRS := $(call libdirs-get,$(ARCH_LIBDIR))
> OBJDIRS := $(ARCH_LIBDIRS)
>
> DESTDIR := $(PREFIX)/share/kvm-unit-tests/
> diff --git a/configure b/configure
> index ae522c556..8c0e3506f 100755
> --- a/configure
> +++ b/configure
> @@ -199,7 +199,6 @@ fi
> arch_name=$arch
> [ "$arch" = "aarch64" ] && arch="arm64"
> [ "$arch_name" = "arm64" ] && arch_name="aarch64"
> -arch_libdir=$arch
>
> if [ "$arch" = "riscv" ]; then
> echo "riscv32 or riscv64 must be specified"
> @@ -264,8 +263,10 @@ fi
>
> if [ "$arch" = "i386" ] || [ "$arch" = "x86_64" ]; then
> testdir=x86
> + arch_libdir=x86
> elif [ "$arch" = "arm" ] || [ "$arch" = "arm64" ]; then
> testdir=arm
> + arch_libdir=$arch
> if [ "$target" = "qemu" ]; then
> arm_uart_early_addr=0x09000000
> elif [ "$target" = "kvmtool" ]; then
> @@ -314,6 +315,7 @@ elif [ "$arch" = "arm" ] || [ "$arch" = "arm64" ]; then
> fi
> elif [ "$arch" = "ppc64" ]; then
> testdir=powerpc
> + arch_libdir=ppc64
> firmware="$testdir/boot_rom.bin"
> if [ "$endian" != "little" ] && [ "$endian" != "big" ]; then
> echo "You must provide endianness (big or little)!"
> @@ -324,6 +326,7 @@ elif [ "$arch" = "riscv32" ] || [ "$arch" = "riscv64" ]; then
> arch_libdir=riscv
> elif [ "$arch" = "s390x" ]; then
> testdir=s390x
> + arch_libdir=s390x
Probably could have left the arch_libdir=$arch above and only added the
ppc64 line, but either way.
> else
> echo "arch $arch is not supported!"
> arch=
> @@ -333,6 +336,10 @@ if [ ! -d "$srcdir/$testdir" ]; then
> echo "$srcdir/$testdir does not exist!"
> exit 1
> fi
> +if [ ! -d "$srcdir/lib/$arch_libdir" ]; then
> + echo "$srcdir/lib/$arch_libdir does not exist!"
> + exit 1
> +fi
>
> if [ "$efi" = "y" ] && [ -f "$srcdir/$testdir/efi/run" ]; then
> ln -fs "$srcdir/$testdir/efi/run" $testdir-run
> @@ -395,10 +402,11 @@ fi
> # link lib/asm for the architecture
> rm -f lib/asm
> asm="asm-generic"
> -if [ -d "$srcdir/lib/$arch/asm" ]; then
> - asm="$srcdir/lib/$arch/asm"
> -elif [ -d "$srcdir/lib/$testdir/asm" ]; then
> - asm="$srcdir/lib/$testdir/asm"
> +if [ -d "$srcdir/lib/$arch_libdir/asm" ]; then
> + asm="$srcdir/lib/$arch_libdir/asm"
> +else
> + echo "$srcdir/lib/$arch_libdir/asm does not exist"
> + exit 1
> fi
> mkdir -p lib
> ln -sf "$asm" lib/asm
> --
> 2.42.0
>
>
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
Thanks,
drew
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-02-28 12:13 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20240226101218.1472843-1-npiggin@gmail.com>
2024-02-26 10:12 ` [kvm-unit-tests PATCH 24/32] common/sieve: Use vmalloc.h for setup_mmu definition Nicholas Piggin
2024-02-28 12:03 ` Andrew Jones
2024-02-26 10:12 ` [kvm-unit-tests PATCH 29/32] configure: Fail on unknown arch Nicholas Piggin
2024-02-28 12:08 ` Andrew Jones
2024-02-26 10:12 ` [kvm-unit-tests PATCH 30/32] configure: Make arch_libdir a first-class entity Nicholas Piggin
2024-02-28 12:13 ` Andrew Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox