* [PATCH 00/14] KVM: selftests: Clang fixes, Makefile cleanup
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Fix a variety of KVM selftests issues exposed by clang, and rework the
Makefile and .gitignore to reduce the maintenance burden of selftests.
For the Makefile, programmatically generate the list of targets by
looking for .c files, and opt-out via a dummy macro in the source
instead of forcing architectures to opt-in. The opt-out approach is
less error prone (harder to forget to add an arch), doesn't generate
unnecessary conflicts if multiple tests are added simultanesouly, and
makes it much easier to understand which tests aren't supported, e.g.
$ git grep TEST_UNSUPPORTED | grep aarch64
hardware_disable_test.c:TEST_UNSUPPORTED(aarch64);
max_guest_memory_test.c:TEST_UNSUPPORTED(aarch64);
system_counter_offset_test.c:TEST_UNSUPPORTED(aarch64);
This all started when trying to reproduce clang build errors reported by
Raghu and Aaron that were introduced by commit 6b6f71484bf4 ("KVM:
selftests: Implement memcmp(), memcpy(), and memset() for guest use").
Just getting selftests to compile with clang was a nightmare, as it took
me several hours to realize that "CC=clang make" and "make CC=clang"
aren't equivalent, and that the "include ../lib.mak" buried halfway through
the Makefile was overriding "CC=clang make".
After too many hours fighting to get clang working, my frustration with
the Makefile boiled over a bit...
Note, I have fixes for the RISC-V RSEQ bugs (outside of selftests/kvm) that
I'll post separately.
Tested on x86 and arm, build tested on s390x and RISC-V, all with both gcc
and clang.
Sean Christopherson (14):
KVM: selftests: Define literal to asm constraint in aarch64 as
unsigned long
KVM: selftests: Delete dead code in x86_64/vmx_tsc_adjust_test.c
KVM: selftests: Fix divide-by-zero bug in memslot_perf_test
KVM: selftests: Use pattern matching in .gitignore
KVM: selftests: Fix a typo in x86-64's kvm_get_cpu_address_width()
KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86
KVM: selftests: Use proper function prototypes in probing code
KVM: selftests: Probe -no-pie with actual CFLAGS used to compile
KVM: selftests: Explicitly disable builtins for mem*() overrides
KVM: selftests: Include lib.mk before consuming $(CC)
KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning
KVM: selftests: Use wildcards to find library source files
KVM: selftests: Use wildcards to find targets and test source files
KVM: selftests: Enable RSEQ test for RISC-V
tools/testing/selftests/kvm/.gitignore | 91 +------
tools/testing/selftests/kvm/Makefile | 229 +++---------------
.../selftests/kvm/aarch64/page_fault_test.c | 2 +-
.../selftests/kvm/access_tracking_perf_test.c | 3 +
.../selftests/kvm/dirty_log_perf_test.c | 3 +
.../selftests/kvm/hardware_disable_test.c | 4 +
.../testing/selftests/kvm/include/test_util.h | 11 +
.../selftests/kvm/lib/x86_64/processor.c | 2 +-
.../selftests/kvm/max_guest_memory_test.c | 4 +
.../kvm/memslot_modification_stress_test.c | 3 +
.../testing/selftests/kvm/memslot_perf_test.c | 6 +
tools/testing/selftests/kvm/steal_time.c | 3 +
.../kvm/system_counter_offset_test.c | 4 +
.../kvm/x86_64/vmx_tsc_adjust_test.c | 5 -
14 files changed, 80 insertions(+), 290 deletions(-)
base-commit: f1a1d3aff0cc2e68a9ebbd8810d7dcd8cfe2714b
--
2.39.0.rc1.256.g54fd8350bd-goog
^ permalink raw reply [flat|nested] 115+ messages in thread
* [PATCH 00/14] KVM: selftests: Clang fixes, Makefile cleanup
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Fix a variety of KVM selftests issues exposed by clang, and rework the
Makefile and .gitignore to reduce the maintenance burden of selftests.
For the Makefile, programmatically generate the list of targets by
looking for .c files, and opt-out via a dummy macro in the source
instead of forcing architectures to opt-in. The opt-out approach is
less error prone (harder to forget to add an arch), doesn't generate
unnecessary conflicts if multiple tests are added simultanesouly, and
makes it much easier to understand which tests aren't supported, e.g.
$ git grep TEST_UNSUPPORTED | grep aarch64
hardware_disable_test.c:TEST_UNSUPPORTED(aarch64);
max_guest_memory_test.c:TEST_UNSUPPORTED(aarch64);
system_counter_offset_test.c:TEST_UNSUPPORTED(aarch64);
This all started when trying to reproduce clang build errors reported by
Raghu and Aaron that were introduced by commit 6b6f71484bf4 ("KVM:
selftests: Implement memcmp(), memcpy(), and memset() for guest use").
Just getting selftests to compile with clang was a nightmare, as it took
me several hours to realize that "CC=clang make" and "make CC=clang"
aren't equivalent, and that the "include ../lib.mak" buried halfway through
the Makefile was overriding "CC=clang make".
After too many hours fighting to get clang working, my frustration with
the Makefile boiled over a bit...
Note, I have fixes for the RISC-V RSEQ bugs (outside of selftests/kvm) that
I'll post separately.
Tested on x86 and arm, build tested on s390x and RISC-V, all with both gcc
and clang.
Sean Christopherson (14):
KVM: selftests: Define literal to asm constraint in aarch64 as
unsigned long
KVM: selftests: Delete dead code in x86_64/vmx_tsc_adjust_test.c
KVM: selftests: Fix divide-by-zero bug in memslot_perf_test
KVM: selftests: Use pattern matching in .gitignore
KVM: selftests: Fix a typo in x86-64's kvm_get_cpu_address_width()
KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86
KVM: selftests: Use proper function prototypes in probing code
KVM: selftests: Probe -no-pie with actual CFLAGS used to compile
KVM: selftests: Explicitly disable builtins for mem*() overrides
KVM: selftests: Include lib.mk before consuming $(CC)
KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning
KVM: selftests: Use wildcards to find library source files
KVM: selftests: Use wildcards to find targets and test source files
KVM: selftests: Enable RSEQ test for RISC-V
tools/testing/selftests/kvm/.gitignore | 91 +------
tools/testing/selftests/kvm/Makefile | 229 +++---------------
.../selftests/kvm/aarch64/page_fault_test.c | 2 +-
.../selftests/kvm/access_tracking_perf_test.c | 3 +
.../selftests/kvm/dirty_log_perf_test.c | 3 +
.../selftests/kvm/hardware_disable_test.c | 4 +
.../testing/selftests/kvm/include/test_util.h | 11 +
.../selftests/kvm/lib/x86_64/processor.c | 2 +-
.../selftests/kvm/max_guest_memory_test.c | 4 +
.../kvm/memslot_modification_stress_test.c | 3 +
.../testing/selftests/kvm/memslot_perf_test.c | 6 +
tools/testing/selftests/kvm/steal_time.c | 3 +
.../kvm/system_counter_offset_test.c | 4 +
.../kvm/x86_64/vmx_tsc_adjust_test.c | 5 -
14 files changed, 80 insertions(+), 290 deletions(-)
base-commit: f1a1d3aff0cc2e68a9ebbd8810d7dcd8cfe2714b
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 115+ messages in thread
* [PATCH 00/14] KVM: selftests: Clang fixes, Makefile cleanup
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: Aaron Lewis, kvm, Tom Rix, llvm, linux-kernel, kvmarm,
linux-riscv, kvmarm, linux-arm-kernel
Fix a variety of KVM selftests issues exposed by clang, and rework the
Makefile and .gitignore to reduce the maintenance burden of selftests.
For the Makefile, programmatically generate the list of targets by
looking for .c files, and opt-out via a dummy macro in the source
instead of forcing architectures to opt-in. The opt-out approach is
less error prone (harder to forget to add an arch), doesn't generate
unnecessary conflicts if multiple tests are added simultanesouly, and
makes it much easier to understand which tests aren't supported, e.g.
$ git grep TEST_UNSUPPORTED | grep aarch64
hardware_disable_test.c:TEST_UNSUPPORTED(aarch64);
max_guest_memory_test.c:TEST_UNSUPPORTED(aarch64);
system_counter_offset_test.c:TEST_UNSUPPORTED(aarch64);
This all started when trying to reproduce clang build errors reported by
Raghu and Aaron that were introduced by commit 6b6f71484bf4 ("KVM:
selftests: Implement memcmp(), memcpy(), and memset() for guest use").
Just getting selftests to compile with clang was a nightmare, as it took
me several hours to realize that "CC=clang make" and "make CC=clang"
aren't equivalent, and that the "include ../lib.mak" buried halfway through
the Makefile was overriding "CC=clang make".
After too many hours fighting to get clang working, my frustration with
the Makefile boiled over a bit...
Note, I have fixes for the RISC-V RSEQ bugs (outside of selftests/kvm) that
I'll post separately.
Tested on x86 and arm, build tested on s390x and RISC-V, all with both gcc
and clang.
Sean Christopherson (14):
KVM: selftests: Define literal to asm constraint in aarch64 as
unsigned long
KVM: selftests: Delete dead code in x86_64/vmx_tsc_adjust_test.c
KVM: selftests: Fix divide-by-zero bug in memslot_perf_test
KVM: selftests: Use pattern matching in .gitignore
KVM: selftests: Fix a typo in x86-64's kvm_get_cpu_address_width()
KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86
KVM: selftests: Use proper function prototypes in probing code
KVM: selftests: Probe -no-pie with actual CFLAGS used to compile
KVM: selftests: Explicitly disable builtins for mem*() overrides
KVM: selftests: Include lib.mk before consuming $(CC)
KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning
KVM: selftests: Use wildcards to find library source files
KVM: selftests: Use wildcards to find targets and test source files
KVM: selftests: Enable RSEQ test for RISC-V
tools/testing/selftests/kvm/.gitignore | 91 +------
tools/testing/selftests/kvm/Makefile | 229 +++---------------
.../selftests/kvm/aarch64/page_fault_test.c | 2 +-
.../selftests/kvm/access_tracking_perf_test.c | 3 +
.../selftests/kvm/dirty_log_perf_test.c | 3 +
.../selftests/kvm/hardware_disable_test.c | 4 +
.../testing/selftests/kvm/include/test_util.h | 11 +
.../selftests/kvm/lib/x86_64/processor.c | 2 +-
.../selftests/kvm/max_guest_memory_test.c | 4 +
.../kvm/memslot_modification_stress_test.c | 3 +
.../testing/selftests/kvm/memslot_perf_test.c | 6 +
tools/testing/selftests/kvm/steal_time.c | 3 +
.../kvm/system_counter_offset_test.c | 4 +
.../kvm/x86_64/vmx_tsc_adjust_test.c | 5 -
14 files changed, 80 insertions(+), 290 deletions(-)
base-commit: f1a1d3aff0cc2e68a9ebbd8810d7dcd8cfe2714b
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply [flat|nested] 115+ messages in thread
* [PATCH 00/14] KVM: selftests: Clang fixes, Makefile cleanup
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Fix a variety of KVM selftests issues exposed by clang, and rework the
Makefile and .gitignore to reduce the maintenance burden of selftests.
For the Makefile, programmatically generate the list of targets by
looking for .c files, and opt-out via a dummy macro in the source
instead of forcing architectures to opt-in. The opt-out approach is
less error prone (harder to forget to add an arch), doesn't generate
unnecessary conflicts if multiple tests are added simultanesouly, and
makes it much easier to understand which tests aren't supported, e.g.
$ git grep TEST_UNSUPPORTED | grep aarch64
hardware_disable_test.c:TEST_UNSUPPORTED(aarch64);
max_guest_memory_test.c:TEST_UNSUPPORTED(aarch64);
system_counter_offset_test.c:TEST_UNSUPPORTED(aarch64);
This all started when trying to reproduce clang build errors reported by
Raghu and Aaron that were introduced by commit 6b6f71484bf4 ("KVM:
selftests: Implement memcmp(), memcpy(), and memset() for guest use").
Just getting selftests to compile with clang was a nightmare, as it took
me several hours to realize that "CC=clang make" and "make CC=clang"
aren't equivalent, and that the "include ../lib.mak" buried halfway through
the Makefile was overriding "CC=clang make".
After too many hours fighting to get clang working, my frustration with
the Makefile boiled over a bit...
Note, I have fixes for the RISC-V RSEQ bugs (outside of selftests/kvm) that
I'll post separately.
Tested on x86 and arm, build tested on s390x and RISC-V, all with both gcc
and clang.
Sean Christopherson (14):
KVM: selftests: Define literal to asm constraint in aarch64 as
unsigned long
KVM: selftests: Delete dead code in x86_64/vmx_tsc_adjust_test.c
KVM: selftests: Fix divide-by-zero bug in memslot_perf_test
KVM: selftests: Use pattern matching in .gitignore
KVM: selftests: Fix a typo in x86-64's kvm_get_cpu_address_width()
KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86
KVM: selftests: Use proper function prototypes in probing code
KVM: selftests: Probe -no-pie with actual CFLAGS used to compile
KVM: selftests: Explicitly disable builtins for mem*() overrides
KVM: selftests: Include lib.mk before consuming $(CC)
KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning
KVM: selftests: Use wildcards to find library source files
KVM: selftests: Use wildcards to find targets and test source files
KVM: selftests: Enable RSEQ test for RISC-V
tools/testing/selftests/kvm/.gitignore | 91 +------
tools/testing/selftests/kvm/Makefile | 229 +++---------------
.../selftests/kvm/aarch64/page_fault_test.c | 2 +-
.../selftests/kvm/access_tracking_perf_test.c | 3 +
.../selftests/kvm/dirty_log_perf_test.c | 3 +
.../selftests/kvm/hardware_disable_test.c | 4 +
.../testing/selftests/kvm/include/test_util.h | 11 +
.../selftests/kvm/lib/x86_64/processor.c | 2 +-
.../selftests/kvm/max_guest_memory_test.c | 4 +
.../kvm/memslot_modification_stress_test.c | 3 +
.../testing/selftests/kvm/memslot_perf_test.c | 6 +
tools/testing/selftests/kvm/steal_time.c | 3 +
.../kvm/system_counter_offset_test.c | 4 +
.../kvm/x86_64/vmx_tsc_adjust_test.c | 5 -
14 files changed, 80 insertions(+), 290 deletions(-)
base-commit: f1a1d3aff0cc2e68a9ebbd8810d7dcd8cfe2714b
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 115+ messages in thread
* [PATCH 01/14] KVM: selftests: Define literal to asm constraint in aarch64 as unsigned long
2022-12-13 0:16 ` Sean Christopherson
(?)
(?)
@ 2022-12-13 0:16 ` Sean Christopherson
-1 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Define a literal '0' asm input constraint to aarch64/page_fault_test's
guest_cas() as an unsigned long to make clang happy.
tools/testing/selftests/kvm/aarch64/page_fault_test.c:120:16: error:
value size does not match register size specified by the constraint
and modifier [-Werror,-Wasm-operand-widths]
:: "r" (0), "r" (TEST_DATA), "r" (guest_test_memory));
^
tools/testing/selftests/kvm/aarch64/page_fault_test.c:119:15: note:
use constraint modifier "w"
"casal %0, %1, [%2]\n"
^~
%w0
Fixes: 35c581015712 ("KVM: selftests: aarch64: Add aarch64/page_fault_test")
Cc: Ricardo Koller <ricarkol@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/aarch64/page_fault_test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kvm/aarch64/page_fault_test.c b/tools/testing/selftests/kvm/aarch64/page_fault_test.c
index 95d22cfb7b41..beb944fa6fd4 100644
--- a/tools/testing/selftests/kvm/aarch64/page_fault_test.c
+++ b/tools/testing/selftests/kvm/aarch64/page_fault_test.c
@@ -117,7 +117,7 @@ static void guest_cas(void)
GUEST_ASSERT(guest_check_lse());
asm volatile(".arch_extension lse\n"
"casal %0, %1, [%2]\n"
- :: "r" (0), "r" (TEST_DATA), "r" (guest_test_memory));
+ :: "r" (0ul), "r" (TEST_DATA), "r" (guest_test_memory));
val = READ_ONCE(*guest_test_memory);
GUEST_ASSERT_EQ(val, TEST_DATA);
}
--
2.39.0.rc1.256.g54fd8350bd-goog
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 01/14] KVM: selftests: Define literal to asm constraint in aarch64 as unsigned long
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: Aaron Lewis, kvm, Tom Rix, llvm, linux-kernel, kvmarm,
linux-riscv, kvmarm, linux-arm-kernel
Define a literal '0' asm input constraint to aarch64/page_fault_test's
guest_cas() as an unsigned long to make clang happy.
tools/testing/selftests/kvm/aarch64/page_fault_test.c:120:16: error:
value size does not match register size specified by the constraint
and modifier [-Werror,-Wasm-operand-widths]
:: "r" (0), "r" (TEST_DATA), "r" (guest_test_memory));
^
tools/testing/selftests/kvm/aarch64/page_fault_test.c:119:15: note:
use constraint modifier "w"
"casal %0, %1, [%2]\n"
^~
%w0
Fixes: 35c581015712 ("KVM: selftests: aarch64: Add aarch64/page_fault_test")
Cc: Ricardo Koller <ricarkol@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/aarch64/page_fault_test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kvm/aarch64/page_fault_test.c b/tools/testing/selftests/kvm/aarch64/page_fault_test.c
index 95d22cfb7b41..beb944fa6fd4 100644
--- a/tools/testing/selftests/kvm/aarch64/page_fault_test.c
+++ b/tools/testing/selftests/kvm/aarch64/page_fault_test.c
@@ -117,7 +117,7 @@ static void guest_cas(void)
GUEST_ASSERT(guest_check_lse());
asm volatile(".arch_extension lse\n"
"casal %0, %1, [%2]\n"
- :: "r" (0), "r" (TEST_DATA), "r" (guest_test_memory));
+ :: "r" (0ul), "r" (TEST_DATA), "r" (guest_test_memory));
val = READ_ONCE(*guest_test_memory);
GUEST_ASSERT_EQ(val, TEST_DATA);
}
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 01/14] KVM: selftests: Define literal to asm constraint in aarch64 as unsigned long
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Define a literal '0' asm input constraint to aarch64/page_fault_test's
guest_cas() as an unsigned long to make clang happy.
tools/testing/selftests/kvm/aarch64/page_fault_test.c:120:16: error:
value size does not match register size specified by the constraint
and modifier [-Werror,-Wasm-operand-widths]
:: "r" (0), "r" (TEST_DATA), "r" (guest_test_memory));
^
tools/testing/selftests/kvm/aarch64/page_fault_test.c:119:15: note:
use constraint modifier "w"
"casal %0, %1, [%2]\n"
^~
%w0
Fixes: 35c581015712 ("KVM: selftests: aarch64: Add aarch64/page_fault_test")
Cc: Ricardo Koller <ricarkol@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/aarch64/page_fault_test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kvm/aarch64/page_fault_test.c b/tools/testing/selftests/kvm/aarch64/page_fault_test.c
index 95d22cfb7b41..beb944fa6fd4 100644
--- a/tools/testing/selftests/kvm/aarch64/page_fault_test.c
+++ b/tools/testing/selftests/kvm/aarch64/page_fault_test.c
@@ -117,7 +117,7 @@ static void guest_cas(void)
GUEST_ASSERT(guest_check_lse());
asm volatile(".arch_extension lse\n"
"casal %0, %1, [%2]\n"
- :: "r" (0), "r" (TEST_DATA), "r" (guest_test_memory));
+ :: "r" (0ul), "r" (TEST_DATA), "r" (guest_test_memory));
val = READ_ONCE(*guest_test_memory);
GUEST_ASSERT_EQ(val, TEST_DATA);
}
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 01/14] KVM: selftests: Define literal to asm constraint in aarch64 as unsigned long
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Define a literal '0' asm input constraint to aarch64/page_fault_test's
guest_cas() as an unsigned long to make clang happy.
tools/testing/selftests/kvm/aarch64/page_fault_test.c:120:16: error:
value size does not match register size specified by the constraint
and modifier [-Werror,-Wasm-operand-widths]
:: "r" (0), "r" (TEST_DATA), "r" (guest_test_memory));
^
tools/testing/selftests/kvm/aarch64/page_fault_test.c:119:15: note:
use constraint modifier "w"
"casal %0, %1, [%2]\n"
^~
%w0
Fixes: 35c581015712 ("KVM: selftests: aarch64: Add aarch64/page_fault_test")
Cc: Ricardo Koller <ricarkol@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/aarch64/page_fault_test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kvm/aarch64/page_fault_test.c b/tools/testing/selftests/kvm/aarch64/page_fault_test.c
index 95d22cfb7b41..beb944fa6fd4 100644
--- a/tools/testing/selftests/kvm/aarch64/page_fault_test.c
+++ b/tools/testing/selftests/kvm/aarch64/page_fault_test.c
@@ -117,7 +117,7 @@ static void guest_cas(void)
GUEST_ASSERT(guest_check_lse());
asm volatile(".arch_extension lse\n"
"casal %0, %1, [%2]\n"
- :: "r" (0), "r" (TEST_DATA), "r" (guest_test_memory));
+ :: "r" (0ul), "r" (TEST_DATA), "r" (guest_test_memory));
val = READ_ONCE(*guest_test_memory);
GUEST_ASSERT_EQ(val, TEST_DATA);
}
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 02/14] KVM: selftests: Delete dead code in x86_64/vmx_tsc_adjust_test.c
2022-12-13 0:16 ` Sean Christopherson
(?)
(?)
@ 2022-12-13 0:16 ` Sean Christopherson
-1 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Delete an unused struct definition in x86_64/vmx_tsc_adjust_test.c.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c b/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c
index 5943187e8594..ff8ecdf32ae0 100644
--- a/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c
+++ b/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c
@@ -49,11 +49,6 @@ enum {
NUM_VMX_PAGES,
};
-struct kvm_single_msr {
- struct kvm_msrs header;
- struct kvm_msr_entry entry;
-} __attribute__((packed));
-
/* The virtual machine object. */
static struct kvm_vm *vm;
--
2.39.0.rc1.256.g54fd8350bd-goog
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 02/14] KVM: selftests: Delete dead code in x86_64/vmx_tsc_adjust_test.c
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: Aaron Lewis, kvm, Tom Rix, llvm, linux-kernel, kvmarm,
linux-riscv, kvmarm, linux-arm-kernel
Delete an unused struct definition in x86_64/vmx_tsc_adjust_test.c.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c b/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c
index 5943187e8594..ff8ecdf32ae0 100644
--- a/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c
+++ b/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c
@@ -49,11 +49,6 @@ enum {
NUM_VMX_PAGES,
};
-struct kvm_single_msr {
- struct kvm_msrs header;
- struct kvm_msr_entry entry;
-} __attribute__((packed));
-
/* The virtual machine object. */
static struct kvm_vm *vm;
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 02/14] KVM: selftests: Delete dead code in x86_64/vmx_tsc_adjust_test.c
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Delete an unused struct definition in x86_64/vmx_tsc_adjust_test.c.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c b/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c
index 5943187e8594..ff8ecdf32ae0 100644
--- a/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c
+++ b/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c
@@ -49,11 +49,6 @@ enum {
NUM_VMX_PAGES,
};
-struct kvm_single_msr {
- struct kvm_msrs header;
- struct kvm_msr_entry entry;
-} __attribute__((packed));
-
/* The virtual machine object. */
static struct kvm_vm *vm;
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 02/14] KVM: selftests: Delete dead code in x86_64/vmx_tsc_adjust_test.c
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Delete an unused struct definition in x86_64/vmx_tsc_adjust_test.c.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c b/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c
index 5943187e8594..ff8ecdf32ae0 100644
--- a/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c
+++ b/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c
@@ -49,11 +49,6 @@ enum {
NUM_VMX_PAGES,
};
-struct kvm_single_msr {
- struct kvm_msrs header;
- struct kvm_msr_entry entry;
-} __attribute__((packed));
-
/* The virtual machine object. */
static struct kvm_vm *vm;
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 03/14] KVM: selftests: Fix divide-by-zero bug in memslot_perf_test
2022-12-13 0:16 ` Sean Christopherson
(?)
(?)
@ 2022-12-13 0:16 ` Sean Christopherson
-1 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Check that the number of pages per slot is non-zero in get_max_slots()
prior to computing the remaining number of pages. clang generates code
that uses an actual DIV for calculating the remaining, which causes a #DE
if the total number of pages is less than the number of slots.
traps: memslot_perf_te[97611] trap divide error ip:4030c4 sp:7ffd18ae58f0
error:0 in memslot_perf_test[401000+cb000]
Fixes: a69170c65acd ("KVM: selftests: memslot_perf_test: Report optimal memory slots")
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/memslot_perf_test.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/testing/selftests/kvm/memslot_perf_test.c b/tools/testing/selftests/kvm/memslot_perf_test.c
index e698306bf49d..e6587e193490 100644
--- a/tools/testing/selftests/kvm/memslot_perf_test.c
+++ b/tools/testing/selftests/kvm/memslot_perf_test.c
@@ -265,6 +265,9 @@ static uint64_t get_max_slots(struct vm_data *data, uint32_t host_page_size)
slots = data->nslots;
while (--slots > 1) {
pages_per_slot = mempages / slots;
+ if (!pages_per_slot)
+ continue;
+
rempages = mempages % pages_per_slot;
if (check_slot_pages(host_page_size, guest_page_size,
pages_per_slot, rempages))
--
2.39.0.rc1.256.g54fd8350bd-goog
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 03/14] KVM: selftests: Fix divide-by-zero bug in memslot_perf_test
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: Aaron Lewis, kvm, Tom Rix, llvm, linux-kernel, kvmarm,
linux-riscv, kvmarm, linux-arm-kernel
Check that the number of pages per slot is non-zero in get_max_slots()
prior to computing the remaining number of pages. clang generates code
that uses an actual DIV for calculating the remaining, which causes a #DE
if the total number of pages is less than the number of slots.
traps: memslot_perf_te[97611] trap divide error ip:4030c4 sp:7ffd18ae58f0
error:0 in memslot_perf_test[401000+cb000]
Fixes: a69170c65acd ("KVM: selftests: memslot_perf_test: Report optimal memory slots")
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/memslot_perf_test.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/testing/selftests/kvm/memslot_perf_test.c b/tools/testing/selftests/kvm/memslot_perf_test.c
index e698306bf49d..e6587e193490 100644
--- a/tools/testing/selftests/kvm/memslot_perf_test.c
+++ b/tools/testing/selftests/kvm/memslot_perf_test.c
@@ -265,6 +265,9 @@ static uint64_t get_max_slots(struct vm_data *data, uint32_t host_page_size)
slots = data->nslots;
while (--slots > 1) {
pages_per_slot = mempages / slots;
+ if (!pages_per_slot)
+ continue;
+
rempages = mempages % pages_per_slot;
if (check_slot_pages(host_page_size, guest_page_size,
pages_per_slot, rempages))
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 03/14] KVM: selftests: Fix divide-by-zero bug in memslot_perf_test
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Check that the number of pages per slot is non-zero in get_max_slots()
prior to computing the remaining number of pages. clang generates code
that uses an actual DIV for calculating the remaining, which causes a #DE
if the total number of pages is less than the number of slots.
traps: memslot_perf_te[97611] trap divide error ip:4030c4 sp:7ffd18ae58f0
error:0 in memslot_perf_test[401000+cb000]
Fixes: a69170c65acd ("KVM: selftests: memslot_perf_test: Report optimal memory slots")
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/memslot_perf_test.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/testing/selftests/kvm/memslot_perf_test.c b/tools/testing/selftests/kvm/memslot_perf_test.c
index e698306bf49d..e6587e193490 100644
--- a/tools/testing/selftests/kvm/memslot_perf_test.c
+++ b/tools/testing/selftests/kvm/memslot_perf_test.c
@@ -265,6 +265,9 @@ static uint64_t get_max_slots(struct vm_data *data, uint32_t host_page_size)
slots = data->nslots;
while (--slots > 1) {
pages_per_slot = mempages / slots;
+ if (!pages_per_slot)
+ continue;
+
rempages = mempages % pages_per_slot;
if (check_slot_pages(host_page_size, guest_page_size,
pages_per_slot, rempages))
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 03/14] KVM: selftests: Fix divide-by-zero bug in memslot_perf_test
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Check that the number of pages per slot is non-zero in get_max_slots()
prior to computing the remaining number of pages. clang generates code
that uses an actual DIV for calculating the remaining, which causes a #DE
if the total number of pages is less than the number of slots.
traps: memslot_perf_te[97611] trap divide error ip:4030c4 sp:7ffd18ae58f0
error:0 in memslot_perf_test[401000+cb000]
Fixes: a69170c65acd ("KVM: selftests: memslot_perf_test: Report optimal memory slots")
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/memslot_perf_test.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/testing/selftests/kvm/memslot_perf_test.c b/tools/testing/selftests/kvm/memslot_perf_test.c
index e698306bf49d..e6587e193490 100644
--- a/tools/testing/selftests/kvm/memslot_perf_test.c
+++ b/tools/testing/selftests/kvm/memslot_perf_test.c
@@ -265,6 +265,9 @@ static uint64_t get_max_slots(struct vm_data *data, uint32_t host_page_size)
slots = data->nslots;
while (--slots > 1) {
pages_per_slot = mempages / slots;
+ if (!pages_per_slot)
+ continue;
+
rempages = mempages % pages_per_slot;
if (check_slot_pages(host_page_size, guest_page_size,
pages_per_slot, rempages))
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 04/14] KVM: selftests: Use pattern matching in .gitignore
2022-12-13 0:16 ` Sean Christopherson
(?)
(?)
@ 2022-12-13 0:16 ` Sean Christopherson
-1 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Use pattern matching to exclude everything except .c, .h, .S, and .sh
files from Git. Manually adding every test target has an absurd
maintenance cost, is comically error prone, and leads to bikeshedding
over whether or not the targets should be listed in alphabetical order.
Deliberately do not include the one-off assets, e.g. config, settings,
.gitignore itself, etc as Git doesn't ignore files that are already in
the repository. Adding the one-off assets won't prevent mistakes where
developers forget to --force add files that don't match the "allowed".
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/.gitignore | 91 ++------------------------
1 file changed, 6 insertions(+), 85 deletions(-)
diff --git a/tools/testing/selftests/kvm/.gitignore b/tools/testing/selftests/kvm/.gitignore
index 6ce8c488d62e..6d9381d60172 100644
--- a/tools/testing/selftests/kvm/.gitignore
+++ b/tools/testing/selftests/kvm/.gitignore
@@ -1,86 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-only
-/aarch64/aarch32_id_regs
-/aarch64/arch_timer
-/aarch64/debug-exceptions
-/aarch64/get-reg-list
-/aarch64/hypercalls
-/aarch64/page_fault_test
-/aarch64/psci_test
-/aarch64/vcpu_width_config
-/aarch64/vgic_init
-/aarch64/vgic_irq
-/s390x/memop
-/s390x/resets
-/s390x/sync_regs_test
-/s390x/tprot
-/x86_64/amx_test
-/x86_64/cpuid_test
-/x86_64/cr4_cpuid_sync_test
-/x86_64/debug_regs
-/x86_64/exit_on_emulation_failure_test
-/x86_64/fix_hypercall_test
-/x86_64/get_msr_index_features
-/x86_64/kvm_clock_test
-/x86_64/kvm_pv_test
-/x86_64/hyperv_clock
-/x86_64/hyperv_cpuid
-/x86_64/hyperv_evmcs
-/x86_64/hyperv_features
-/x86_64/hyperv_ipi
-/x86_64/hyperv_svm_test
-/x86_64/hyperv_tlb_flush
-/x86_64/max_vcpuid_cap_test
-/x86_64/mmio_warning_test
-/x86_64/monitor_mwait_test
-/x86_64/nested_exceptions_test
-/x86_64/nx_huge_pages_test
-/x86_64/platform_info_test
-/x86_64/pmu_event_filter_test
-/x86_64/set_boot_cpu_id
-/x86_64/set_sregs_test
-/x86_64/sev_migrate_tests
-/x86_64/smaller_maxphyaddr_emulation_test
-/x86_64/smm_test
-/x86_64/state_test
-/x86_64/svm_vmcall_test
-/x86_64/svm_int_ctl_test
-/x86_64/svm_nested_soft_inject_test
-/x86_64/svm_nested_shutdown_test
-/x86_64/sync_regs_test
-/x86_64/tsc_msrs_test
-/x86_64/tsc_scaling_sync
-/x86_64/ucna_injection_test
-/x86_64/userspace_io_test
-/x86_64/userspace_msr_exit_test
-/x86_64/vmx_apic_access_test
-/x86_64/vmx_close_while_nested_test
-/x86_64/vmx_dirty_log_test
-/x86_64/vmx_exception_with_invalid_guest_state
-/x86_64/vmx_invalid_nested_guest_state
-/x86_64/vmx_msrs_test
-/x86_64/vmx_preemption_timer_test
-/x86_64/vmx_set_nested_state_test
-/x86_64/vmx_tsc_adjust_test
-/x86_64/vmx_nested_tsc_scaling_test
-/x86_64/xapic_ipi_test
-/x86_64/xapic_state_test
-/x86_64/xen_shinfo_test
-/x86_64/xen_vmcall_test
-/x86_64/xss_msr_test
-/x86_64/vmx_pmu_caps_test
-/x86_64/triple_fault_event_test
-/access_tracking_perf_test
-/demand_paging_test
-/dirty_log_test
-/dirty_log_perf_test
-/hardware_disable_test
-/kvm_create_max_vcpus
-/kvm_page_table_test
-/max_guest_memory_test
-/memslot_modification_stress_test
-/memslot_perf_test
-/rseq_test
-/set_memory_region_test
-/steal_time
-/kvm_binary_stats_test
-/system_counter_offset_test
+*
+!/**/
+!*.c
+!*.h
+!*.S
+!*.sh
--
2.39.0.rc1.256.g54fd8350bd-goog
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 04/14] KVM: selftests: Use pattern matching in .gitignore
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: Aaron Lewis, kvm, Tom Rix, llvm, linux-kernel, kvmarm,
linux-riscv, kvmarm, linux-arm-kernel
Use pattern matching to exclude everything except .c, .h, .S, and .sh
files from Git. Manually adding every test target has an absurd
maintenance cost, is comically error prone, and leads to bikeshedding
over whether or not the targets should be listed in alphabetical order.
Deliberately do not include the one-off assets, e.g. config, settings,
.gitignore itself, etc as Git doesn't ignore files that are already in
the repository. Adding the one-off assets won't prevent mistakes where
developers forget to --force add files that don't match the "allowed".
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/.gitignore | 91 ++------------------------
1 file changed, 6 insertions(+), 85 deletions(-)
diff --git a/tools/testing/selftests/kvm/.gitignore b/tools/testing/selftests/kvm/.gitignore
index 6ce8c488d62e..6d9381d60172 100644
--- a/tools/testing/selftests/kvm/.gitignore
+++ b/tools/testing/selftests/kvm/.gitignore
@@ -1,86 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-only
-/aarch64/aarch32_id_regs
-/aarch64/arch_timer
-/aarch64/debug-exceptions
-/aarch64/get-reg-list
-/aarch64/hypercalls
-/aarch64/page_fault_test
-/aarch64/psci_test
-/aarch64/vcpu_width_config
-/aarch64/vgic_init
-/aarch64/vgic_irq
-/s390x/memop
-/s390x/resets
-/s390x/sync_regs_test
-/s390x/tprot
-/x86_64/amx_test
-/x86_64/cpuid_test
-/x86_64/cr4_cpuid_sync_test
-/x86_64/debug_regs
-/x86_64/exit_on_emulation_failure_test
-/x86_64/fix_hypercall_test
-/x86_64/get_msr_index_features
-/x86_64/kvm_clock_test
-/x86_64/kvm_pv_test
-/x86_64/hyperv_clock
-/x86_64/hyperv_cpuid
-/x86_64/hyperv_evmcs
-/x86_64/hyperv_features
-/x86_64/hyperv_ipi
-/x86_64/hyperv_svm_test
-/x86_64/hyperv_tlb_flush
-/x86_64/max_vcpuid_cap_test
-/x86_64/mmio_warning_test
-/x86_64/monitor_mwait_test
-/x86_64/nested_exceptions_test
-/x86_64/nx_huge_pages_test
-/x86_64/platform_info_test
-/x86_64/pmu_event_filter_test
-/x86_64/set_boot_cpu_id
-/x86_64/set_sregs_test
-/x86_64/sev_migrate_tests
-/x86_64/smaller_maxphyaddr_emulation_test
-/x86_64/smm_test
-/x86_64/state_test
-/x86_64/svm_vmcall_test
-/x86_64/svm_int_ctl_test
-/x86_64/svm_nested_soft_inject_test
-/x86_64/svm_nested_shutdown_test
-/x86_64/sync_regs_test
-/x86_64/tsc_msrs_test
-/x86_64/tsc_scaling_sync
-/x86_64/ucna_injection_test
-/x86_64/userspace_io_test
-/x86_64/userspace_msr_exit_test
-/x86_64/vmx_apic_access_test
-/x86_64/vmx_close_while_nested_test
-/x86_64/vmx_dirty_log_test
-/x86_64/vmx_exception_with_invalid_guest_state
-/x86_64/vmx_invalid_nested_guest_state
-/x86_64/vmx_msrs_test
-/x86_64/vmx_preemption_timer_test
-/x86_64/vmx_set_nested_state_test
-/x86_64/vmx_tsc_adjust_test
-/x86_64/vmx_nested_tsc_scaling_test
-/x86_64/xapic_ipi_test
-/x86_64/xapic_state_test
-/x86_64/xen_shinfo_test
-/x86_64/xen_vmcall_test
-/x86_64/xss_msr_test
-/x86_64/vmx_pmu_caps_test
-/x86_64/triple_fault_event_test
-/access_tracking_perf_test
-/demand_paging_test
-/dirty_log_test
-/dirty_log_perf_test
-/hardware_disable_test
-/kvm_create_max_vcpus
-/kvm_page_table_test
-/max_guest_memory_test
-/memslot_modification_stress_test
-/memslot_perf_test
-/rseq_test
-/set_memory_region_test
-/steal_time
-/kvm_binary_stats_test
-/system_counter_offset_test
+*
+!/**/
+!*.c
+!*.h
+!*.S
+!*.sh
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 04/14] KVM: selftests: Use pattern matching in .gitignore
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Use pattern matching to exclude everything except .c, .h, .S, and .sh
files from Git. Manually adding every test target has an absurd
maintenance cost, is comically error prone, and leads to bikeshedding
over whether or not the targets should be listed in alphabetical order.
Deliberately do not include the one-off assets, e.g. config, settings,
.gitignore itself, etc as Git doesn't ignore files that are already in
the repository. Adding the one-off assets won't prevent mistakes where
developers forget to --force add files that don't match the "allowed".
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/.gitignore | 91 ++------------------------
1 file changed, 6 insertions(+), 85 deletions(-)
diff --git a/tools/testing/selftests/kvm/.gitignore b/tools/testing/selftests/kvm/.gitignore
index 6ce8c488d62e..6d9381d60172 100644
--- a/tools/testing/selftests/kvm/.gitignore
+++ b/tools/testing/selftests/kvm/.gitignore
@@ -1,86 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-only
-/aarch64/aarch32_id_regs
-/aarch64/arch_timer
-/aarch64/debug-exceptions
-/aarch64/get-reg-list
-/aarch64/hypercalls
-/aarch64/page_fault_test
-/aarch64/psci_test
-/aarch64/vcpu_width_config
-/aarch64/vgic_init
-/aarch64/vgic_irq
-/s390x/memop
-/s390x/resets
-/s390x/sync_regs_test
-/s390x/tprot
-/x86_64/amx_test
-/x86_64/cpuid_test
-/x86_64/cr4_cpuid_sync_test
-/x86_64/debug_regs
-/x86_64/exit_on_emulation_failure_test
-/x86_64/fix_hypercall_test
-/x86_64/get_msr_index_features
-/x86_64/kvm_clock_test
-/x86_64/kvm_pv_test
-/x86_64/hyperv_clock
-/x86_64/hyperv_cpuid
-/x86_64/hyperv_evmcs
-/x86_64/hyperv_features
-/x86_64/hyperv_ipi
-/x86_64/hyperv_svm_test
-/x86_64/hyperv_tlb_flush
-/x86_64/max_vcpuid_cap_test
-/x86_64/mmio_warning_test
-/x86_64/monitor_mwait_test
-/x86_64/nested_exceptions_test
-/x86_64/nx_huge_pages_test
-/x86_64/platform_info_test
-/x86_64/pmu_event_filter_test
-/x86_64/set_boot_cpu_id
-/x86_64/set_sregs_test
-/x86_64/sev_migrate_tests
-/x86_64/smaller_maxphyaddr_emulation_test
-/x86_64/smm_test
-/x86_64/state_test
-/x86_64/svm_vmcall_test
-/x86_64/svm_int_ctl_test
-/x86_64/svm_nested_soft_inject_test
-/x86_64/svm_nested_shutdown_test
-/x86_64/sync_regs_test
-/x86_64/tsc_msrs_test
-/x86_64/tsc_scaling_sync
-/x86_64/ucna_injection_test
-/x86_64/userspace_io_test
-/x86_64/userspace_msr_exit_test
-/x86_64/vmx_apic_access_test
-/x86_64/vmx_close_while_nested_test
-/x86_64/vmx_dirty_log_test
-/x86_64/vmx_exception_with_invalid_guest_state
-/x86_64/vmx_invalid_nested_guest_state
-/x86_64/vmx_msrs_test
-/x86_64/vmx_preemption_timer_test
-/x86_64/vmx_set_nested_state_test
-/x86_64/vmx_tsc_adjust_test
-/x86_64/vmx_nested_tsc_scaling_test
-/x86_64/xapic_ipi_test
-/x86_64/xapic_state_test
-/x86_64/xen_shinfo_test
-/x86_64/xen_vmcall_test
-/x86_64/xss_msr_test
-/x86_64/vmx_pmu_caps_test
-/x86_64/triple_fault_event_test
-/access_tracking_perf_test
-/demand_paging_test
-/dirty_log_test
-/dirty_log_perf_test
-/hardware_disable_test
-/kvm_create_max_vcpus
-/kvm_page_table_test
-/max_guest_memory_test
-/memslot_modification_stress_test
-/memslot_perf_test
-/rseq_test
-/set_memory_region_test
-/steal_time
-/kvm_binary_stats_test
-/system_counter_offset_test
+*
+!/**/
+!*.c
+!*.h
+!*.S
+!*.sh
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 04/14] KVM: selftests: Use pattern matching in .gitignore
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Use pattern matching to exclude everything except .c, .h, .S, and .sh
files from Git. Manually adding every test target has an absurd
maintenance cost, is comically error prone, and leads to bikeshedding
over whether or not the targets should be listed in alphabetical order.
Deliberately do not include the one-off assets, e.g. config, settings,
.gitignore itself, etc as Git doesn't ignore files that are already in
the repository. Adding the one-off assets won't prevent mistakes where
developers forget to --force add files that don't match the "allowed".
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/.gitignore | 91 ++------------------------
1 file changed, 6 insertions(+), 85 deletions(-)
diff --git a/tools/testing/selftests/kvm/.gitignore b/tools/testing/selftests/kvm/.gitignore
index 6ce8c488d62e..6d9381d60172 100644
--- a/tools/testing/selftests/kvm/.gitignore
+++ b/tools/testing/selftests/kvm/.gitignore
@@ -1,86 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-only
-/aarch64/aarch32_id_regs
-/aarch64/arch_timer
-/aarch64/debug-exceptions
-/aarch64/get-reg-list
-/aarch64/hypercalls
-/aarch64/page_fault_test
-/aarch64/psci_test
-/aarch64/vcpu_width_config
-/aarch64/vgic_init
-/aarch64/vgic_irq
-/s390x/memop
-/s390x/resets
-/s390x/sync_regs_test
-/s390x/tprot
-/x86_64/amx_test
-/x86_64/cpuid_test
-/x86_64/cr4_cpuid_sync_test
-/x86_64/debug_regs
-/x86_64/exit_on_emulation_failure_test
-/x86_64/fix_hypercall_test
-/x86_64/get_msr_index_features
-/x86_64/kvm_clock_test
-/x86_64/kvm_pv_test
-/x86_64/hyperv_clock
-/x86_64/hyperv_cpuid
-/x86_64/hyperv_evmcs
-/x86_64/hyperv_features
-/x86_64/hyperv_ipi
-/x86_64/hyperv_svm_test
-/x86_64/hyperv_tlb_flush
-/x86_64/max_vcpuid_cap_test
-/x86_64/mmio_warning_test
-/x86_64/monitor_mwait_test
-/x86_64/nested_exceptions_test
-/x86_64/nx_huge_pages_test
-/x86_64/platform_info_test
-/x86_64/pmu_event_filter_test
-/x86_64/set_boot_cpu_id
-/x86_64/set_sregs_test
-/x86_64/sev_migrate_tests
-/x86_64/smaller_maxphyaddr_emulation_test
-/x86_64/smm_test
-/x86_64/state_test
-/x86_64/svm_vmcall_test
-/x86_64/svm_int_ctl_test
-/x86_64/svm_nested_soft_inject_test
-/x86_64/svm_nested_shutdown_test
-/x86_64/sync_regs_test
-/x86_64/tsc_msrs_test
-/x86_64/tsc_scaling_sync
-/x86_64/ucna_injection_test
-/x86_64/userspace_io_test
-/x86_64/userspace_msr_exit_test
-/x86_64/vmx_apic_access_test
-/x86_64/vmx_close_while_nested_test
-/x86_64/vmx_dirty_log_test
-/x86_64/vmx_exception_with_invalid_guest_state
-/x86_64/vmx_invalid_nested_guest_state
-/x86_64/vmx_msrs_test
-/x86_64/vmx_preemption_timer_test
-/x86_64/vmx_set_nested_state_test
-/x86_64/vmx_tsc_adjust_test
-/x86_64/vmx_nested_tsc_scaling_test
-/x86_64/xapic_ipi_test
-/x86_64/xapic_state_test
-/x86_64/xen_shinfo_test
-/x86_64/xen_vmcall_test
-/x86_64/xss_msr_test
-/x86_64/vmx_pmu_caps_test
-/x86_64/triple_fault_event_test
-/access_tracking_perf_test
-/demand_paging_test
-/dirty_log_test
-/dirty_log_perf_test
-/hardware_disable_test
-/kvm_create_max_vcpus
-/kvm_page_table_test
-/max_guest_memory_test
-/memslot_modification_stress_test
-/memslot_perf_test
-/rseq_test
-/set_memory_region_test
-/steal_time
-/kvm_binary_stats_test
-/system_counter_offset_test
+*
+!/**/
+!*.c
+!*.h
+!*.S
+!*.sh
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 05/14] KVM: selftests: Fix a typo in x86-64's kvm_get_cpu_address_width()
2022-12-13 0:16 ` Sean Christopherson
(?)
(?)
@ 2022-12-13 0:16 ` Sean Christopherson
-1 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Fix a == vs. = typo in kvm_get_cpu_address_width() that results in
@pa_bits being left unset if the CPU doesn't support enumerating its
MAX_PHY_ADDR. Flagged by clang's unusued-value warning.
lib/x86_64/processor.c:1034:51: warning: expression result unused [-Wunused-value]
*pa_bits == kvm_cpu_has(X86_FEATURE_PAE) ? 36 : 32;
Fixes: 3bd396353d18 ("KVM: selftests: Add X86_FEATURE_PAE and use it calc "fallback" MAXPHYADDR")
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/lib/x86_64/processor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kvm/lib/x86_64/processor.c b/tools/testing/selftests/kvm/lib/x86_64/processor.c
index c4d368d56cfe..acfa1d01e7df 100644
--- a/tools/testing/selftests/kvm/lib/x86_64/processor.c
+++ b/tools/testing/selftests/kvm/lib/x86_64/processor.c
@@ -1031,7 +1031,7 @@ bool is_amd_cpu(void)
void kvm_get_cpu_address_width(unsigned int *pa_bits, unsigned int *va_bits)
{
if (!kvm_cpu_has_p(X86_PROPERTY_MAX_PHY_ADDR)) {
- *pa_bits == kvm_cpu_has(X86_FEATURE_PAE) ? 36 : 32;
+ *pa_bits = kvm_cpu_has(X86_FEATURE_PAE) ? 36 : 32;
*va_bits = 32;
} else {
*pa_bits = kvm_cpu_property(X86_PROPERTY_MAX_PHY_ADDR);
--
2.39.0.rc1.256.g54fd8350bd-goog
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 05/14] KVM: selftests: Fix a typo in x86-64's kvm_get_cpu_address_width()
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Fix a == vs. = typo in kvm_get_cpu_address_width() that results in
@pa_bits being left unset if the CPU doesn't support enumerating its
MAX_PHY_ADDR. Flagged by clang's unusued-value warning.
lib/x86_64/processor.c:1034:51: warning: expression result unused [-Wunused-value]
*pa_bits == kvm_cpu_has(X86_FEATURE_PAE) ? 36 : 32;
Fixes: 3bd396353d18 ("KVM: selftests: Add X86_FEATURE_PAE and use it calc "fallback" MAXPHYADDR")
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/lib/x86_64/processor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kvm/lib/x86_64/processor.c b/tools/testing/selftests/kvm/lib/x86_64/processor.c
index c4d368d56cfe..acfa1d01e7df 100644
--- a/tools/testing/selftests/kvm/lib/x86_64/processor.c
+++ b/tools/testing/selftests/kvm/lib/x86_64/processor.c
@@ -1031,7 +1031,7 @@ bool is_amd_cpu(void)
void kvm_get_cpu_address_width(unsigned int *pa_bits, unsigned int *va_bits)
{
if (!kvm_cpu_has_p(X86_PROPERTY_MAX_PHY_ADDR)) {
- *pa_bits == kvm_cpu_has(X86_FEATURE_PAE) ? 36 : 32;
+ *pa_bits = kvm_cpu_has(X86_FEATURE_PAE) ? 36 : 32;
*va_bits = 32;
} else {
*pa_bits = kvm_cpu_property(X86_PROPERTY_MAX_PHY_ADDR);
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 05/14] KVM: selftests: Fix a typo in x86-64's kvm_get_cpu_address_width()
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: Aaron Lewis, kvm, Tom Rix, llvm, linux-kernel, kvmarm,
linux-riscv, kvmarm, linux-arm-kernel
Fix a == vs. = typo in kvm_get_cpu_address_width() that results in
@pa_bits being left unset if the CPU doesn't support enumerating its
MAX_PHY_ADDR. Flagged by clang's unusued-value warning.
lib/x86_64/processor.c:1034:51: warning: expression result unused [-Wunused-value]
*pa_bits == kvm_cpu_has(X86_FEATURE_PAE) ? 36 : 32;
Fixes: 3bd396353d18 ("KVM: selftests: Add X86_FEATURE_PAE and use it calc "fallback" MAXPHYADDR")
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/lib/x86_64/processor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kvm/lib/x86_64/processor.c b/tools/testing/selftests/kvm/lib/x86_64/processor.c
index c4d368d56cfe..acfa1d01e7df 100644
--- a/tools/testing/selftests/kvm/lib/x86_64/processor.c
+++ b/tools/testing/selftests/kvm/lib/x86_64/processor.c
@@ -1031,7 +1031,7 @@ bool is_amd_cpu(void)
void kvm_get_cpu_address_width(unsigned int *pa_bits, unsigned int *va_bits)
{
if (!kvm_cpu_has_p(X86_PROPERTY_MAX_PHY_ADDR)) {
- *pa_bits == kvm_cpu_has(X86_FEATURE_PAE) ? 36 : 32;
+ *pa_bits = kvm_cpu_has(X86_FEATURE_PAE) ? 36 : 32;
*va_bits = 32;
} else {
*pa_bits = kvm_cpu_property(X86_PROPERTY_MAX_PHY_ADDR);
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 05/14] KVM: selftests: Fix a typo in x86-64's kvm_get_cpu_address_width()
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Fix a == vs. = typo in kvm_get_cpu_address_width() that results in
@pa_bits being left unset if the CPU doesn't support enumerating its
MAX_PHY_ADDR. Flagged by clang's unusued-value warning.
lib/x86_64/processor.c:1034:51: warning: expression result unused [-Wunused-value]
*pa_bits == kvm_cpu_has(X86_FEATURE_PAE) ? 36 : 32;
Fixes: 3bd396353d18 ("KVM: selftests: Add X86_FEATURE_PAE and use it calc "fallback" MAXPHYADDR")
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/lib/x86_64/processor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kvm/lib/x86_64/processor.c b/tools/testing/selftests/kvm/lib/x86_64/processor.c
index c4d368d56cfe..acfa1d01e7df 100644
--- a/tools/testing/selftests/kvm/lib/x86_64/processor.c
+++ b/tools/testing/selftests/kvm/lib/x86_64/processor.c
@@ -1031,7 +1031,7 @@ bool is_amd_cpu(void)
void kvm_get_cpu_address_width(unsigned int *pa_bits, unsigned int *va_bits)
{
if (!kvm_cpu_has_p(X86_PROPERTY_MAX_PHY_ADDR)) {
- *pa_bits == kvm_cpu_has(X86_FEATURE_PAE) ? 36 : 32;
+ *pa_bits = kvm_cpu_has(X86_FEATURE_PAE) ? 36 : 32;
*va_bits = 32;
} else {
*pa_bits = kvm_cpu_property(X86_PROPERTY_MAX_PHY_ADDR);
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 06/14] KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86
2022-12-13 0:16 ` Sean Christopherson
(?)
(?)
@ 2022-12-13 0:16 ` Sean Christopherson
-1 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Rename UNAME_M to ARCH_DIR and explicitly set it directly for x86. At
this point, the name of the arch directory really doesn't have anything
to do with `uname -m`, and UNAME_M is unnecessarily confusing given that
its purpose is purely to identify the arch specific directory.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 49 +++++++++-------------------
1 file changed, 15 insertions(+), 34 deletions(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index 947676983da1..d761a77c3a80 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -7,35 +7,16 @@ top_srcdir = ../../../..
include $(top_srcdir)/scripts/subarch.include
ARCH ?= $(SUBARCH)
-# For cross-builds to work, UNAME_M has to map to ARCH and arch specific
-# directories and targets in this Makefile. "uname -m" doesn't map to
-# arch specific sub-directory names.
-#
-# UNAME_M variable to used to run the compiles pointing to the right arch
-# directories and build the right targets for these supported architectures.
-#
-# TEST_GEN_PROGS and LIBKVM are set using UNAME_M variable.
-# LINUX_TOOL_ARCH_INCLUDE is set using ARCH variable.
-#
-# x86_64 targets are named to include x86_64 as a suffix and directories
-# for includes are in x86_64 sub-directory. s390x and aarch64 follow the
-# same convention. "uname -m" doesn't result in the correct mapping for
-# s390x and aarch64.
-#
-# No change necessary for x86_64
-UNAME_M := $(shell uname -m)
-
-# Set UNAME_M for arm64 compile/install to work
-ifeq ($(ARCH),arm64)
- UNAME_M := aarch64
-endif
-# Set UNAME_M s390x compile/install to work
-ifeq ($(ARCH),s390)
- UNAME_M := s390x
-endif
-# Set UNAME_M riscv compile/install to work
-ifeq ($(ARCH),riscv)
- UNAME_M := riscv
+ifeq ($(ARCH),x86)
+ ARCH_DIR := x86_64
+else ifeq ($(ARCH),arm64)
+ ARCH_DIR := aarch64
+else ifeq ($(ARCH),s390)
+ ARCH_DIR := s390x
+else ifeq ($(ARCH),riscv)
+ ARCH_DIR := riscv
+else
+$(error Unknown architecture '$(ARCH)')
endif
LIBKVM += lib/assert.c
@@ -196,10 +177,10 @@ TEST_GEN_PROGS_riscv += kvm_page_table_test
TEST_GEN_PROGS_riscv += set_memory_region_test
TEST_GEN_PROGS_riscv += kvm_binary_stats_test
-TEST_PROGS += $(TEST_PROGS_$(UNAME_M))
-TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(UNAME_M))
-TEST_GEN_PROGS_EXTENDED += $(TEST_GEN_PROGS_EXTENDED_$(UNAME_M))
-LIBKVM += $(LIBKVM_$(UNAME_M))
+TEST_PROGS += $(TEST_PROGS_$(ARCH_DIR))
+TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(ARCH_DIR))
+TEST_GEN_PROGS_EXTENDED += $(TEST_GEN_PROGS_EXTENDED_$(ARCH_DIR))
+LIBKVM += $(LIBKVM_$(ARCH_DIR))
INSTALL_HDR_PATH = $(top_srcdir)/usr
LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/
@@ -212,7 +193,7 @@ endif
CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
-fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \
-I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \
- -I$(<D) -Iinclude/$(UNAME_M) -I ../rseq -I.. $(EXTRA_CFLAGS) \
+ -I$(<D) -Iinclude/$(ARCH_DIR) -I ../rseq -I.. $(EXTRA_CFLAGS) \
$(KHDR_INCLUDES)
no-pie-option := $(call try-run, echo 'int main() { return 0; }' | \
--
2.39.0.rc1.256.g54fd8350bd-goog
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 06/14] KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Rename UNAME_M to ARCH_DIR and explicitly set it directly for x86. At
this point, the name of the arch directory really doesn't have anything
to do with `uname -m`, and UNAME_M is unnecessarily confusing given that
its purpose is purely to identify the arch specific directory.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 49 +++++++++-------------------
1 file changed, 15 insertions(+), 34 deletions(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index 947676983da1..d761a77c3a80 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -7,35 +7,16 @@ top_srcdir = ../../../..
include $(top_srcdir)/scripts/subarch.include
ARCH ?= $(SUBARCH)
-# For cross-builds to work, UNAME_M has to map to ARCH and arch specific
-# directories and targets in this Makefile. "uname -m" doesn't map to
-# arch specific sub-directory names.
-#
-# UNAME_M variable to used to run the compiles pointing to the right arch
-# directories and build the right targets for these supported architectures.
-#
-# TEST_GEN_PROGS and LIBKVM are set using UNAME_M variable.
-# LINUX_TOOL_ARCH_INCLUDE is set using ARCH variable.
-#
-# x86_64 targets are named to include x86_64 as a suffix and directories
-# for includes are in x86_64 sub-directory. s390x and aarch64 follow the
-# same convention. "uname -m" doesn't result in the correct mapping for
-# s390x and aarch64.
-#
-# No change necessary for x86_64
-UNAME_M := $(shell uname -m)
-
-# Set UNAME_M for arm64 compile/install to work
-ifeq ($(ARCH),arm64)
- UNAME_M := aarch64
-endif
-# Set UNAME_M s390x compile/install to work
-ifeq ($(ARCH),s390)
- UNAME_M := s390x
-endif
-# Set UNAME_M riscv compile/install to work
-ifeq ($(ARCH),riscv)
- UNAME_M := riscv
+ifeq ($(ARCH),x86)
+ ARCH_DIR := x86_64
+else ifeq ($(ARCH),arm64)
+ ARCH_DIR := aarch64
+else ifeq ($(ARCH),s390)
+ ARCH_DIR := s390x
+else ifeq ($(ARCH),riscv)
+ ARCH_DIR := riscv
+else
+$(error Unknown architecture '$(ARCH)')
endif
LIBKVM += lib/assert.c
@@ -196,10 +177,10 @@ TEST_GEN_PROGS_riscv += kvm_page_table_test
TEST_GEN_PROGS_riscv += set_memory_region_test
TEST_GEN_PROGS_riscv += kvm_binary_stats_test
-TEST_PROGS += $(TEST_PROGS_$(UNAME_M))
-TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(UNAME_M))
-TEST_GEN_PROGS_EXTENDED += $(TEST_GEN_PROGS_EXTENDED_$(UNAME_M))
-LIBKVM += $(LIBKVM_$(UNAME_M))
+TEST_PROGS += $(TEST_PROGS_$(ARCH_DIR))
+TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(ARCH_DIR))
+TEST_GEN_PROGS_EXTENDED += $(TEST_GEN_PROGS_EXTENDED_$(ARCH_DIR))
+LIBKVM += $(LIBKVM_$(ARCH_DIR))
INSTALL_HDR_PATH = $(top_srcdir)/usr
LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/
@@ -212,7 +193,7 @@ endif
CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
-fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \
-I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \
- -I$(<D) -Iinclude/$(UNAME_M) -I ../rseq -I.. $(EXTRA_CFLAGS) \
+ -I$(<D) -Iinclude/$(ARCH_DIR) -I ../rseq -I.. $(EXTRA_CFLAGS) \
$(KHDR_INCLUDES)
no-pie-option := $(call try-run, echo 'int main() { return 0; }' | \
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 06/14] KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: Aaron Lewis, kvm, Tom Rix, llvm, linux-kernel, kvmarm,
linux-riscv, kvmarm, linux-arm-kernel
Rename UNAME_M to ARCH_DIR and explicitly set it directly for x86. At
this point, the name of the arch directory really doesn't have anything
to do with `uname -m`, and UNAME_M is unnecessarily confusing given that
its purpose is purely to identify the arch specific directory.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 49 +++++++++-------------------
1 file changed, 15 insertions(+), 34 deletions(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index 947676983da1..d761a77c3a80 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -7,35 +7,16 @@ top_srcdir = ../../../..
include $(top_srcdir)/scripts/subarch.include
ARCH ?= $(SUBARCH)
-# For cross-builds to work, UNAME_M has to map to ARCH and arch specific
-# directories and targets in this Makefile. "uname -m" doesn't map to
-# arch specific sub-directory names.
-#
-# UNAME_M variable to used to run the compiles pointing to the right arch
-# directories and build the right targets for these supported architectures.
-#
-# TEST_GEN_PROGS and LIBKVM are set using UNAME_M variable.
-# LINUX_TOOL_ARCH_INCLUDE is set using ARCH variable.
-#
-# x86_64 targets are named to include x86_64 as a suffix and directories
-# for includes are in x86_64 sub-directory. s390x and aarch64 follow the
-# same convention. "uname -m" doesn't result in the correct mapping for
-# s390x and aarch64.
-#
-# No change necessary for x86_64
-UNAME_M := $(shell uname -m)
-
-# Set UNAME_M for arm64 compile/install to work
-ifeq ($(ARCH),arm64)
- UNAME_M := aarch64
-endif
-# Set UNAME_M s390x compile/install to work
-ifeq ($(ARCH),s390)
- UNAME_M := s390x
-endif
-# Set UNAME_M riscv compile/install to work
-ifeq ($(ARCH),riscv)
- UNAME_M := riscv
+ifeq ($(ARCH),x86)
+ ARCH_DIR := x86_64
+else ifeq ($(ARCH),arm64)
+ ARCH_DIR := aarch64
+else ifeq ($(ARCH),s390)
+ ARCH_DIR := s390x
+else ifeq ($(ARCH),riscv)
+ ARCH_DIR := riscv
+else
+$(error Unknown architecture '$(ARCH)')
endif
LIBKVM += lib/assert.c
@@ -196,10 +177,10 @@ TEST_GEN_PROGS_riscv += kvm_page_table_test
TEST_GEN_PROGS_riscv += set_memory_region_test
TEST_GEN_PROGS_riscv += kvm_binary_stats_test
-TEST_PROGS += $(TEST_PROGS_$(UNAME_M))
-TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(UNAME_M))
-TEST_GEN_PROGS_EXTENDED += $(TEST_GEN_PROGS_EXTENDED_$(UNAME_M))
-LIBKVM += $(LIBKVM_$(UNAME_M))
+TEST_PROGS += $(TEST_PROGS_$(ARCH_DIR))
+TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(ARCH_DIR))
+TEST_GEN_PROGS_EXTENDED += $(TEST_GEN_PROGS_EXTENDED_$(ARCH_DIR))
+LIBKVM += $(LIBKVM_$(ARCH_DIR))
INSTALL_HDR_PATH = $(top_srcdir)/usr
LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/
@@ -212,7 +193,7 @@ endif
CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
-fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \
-I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \
- -I$(<D) -Iinclude/$(UNAME_M) -I ../rseq -I.. $(EXTRA_CFLAGS) \
+ -I$(<D) -Iinclude/$(ARCH_DIR) -I ../rseq -I.. $(EXTRA_CFLAGS) \
$(KHDR_INCLUDES)
no-pie-option := $(call try-run, echo 'int main() { return 0; }' | \
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 06/14] KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Rename UNAME_M to ARCH_DIR and explicitly set it directly for x86. At
this point, the name of the arch directory really doesn't have anything
to do with `uname -m`, and UNAME_M is unnecessarily confusing given that
its purpose is purely to identify the arch specific directory.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 49 +++++++++-------------------
1 file changed, 15 insertions(+), 34 deletions(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index 947676983da1..d761a77c3a80 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -7,35 +7,16 @@ top_srcdir = ../../../..
include $(top_srcdir)/scripts/subarch.include
ARCH ?= $(SUBARCH)
-# For cross-builds to work, UNAME_M has to map to ARCH and arch specific
-# directories and targets in this Makefile. "uname -m" doesn't map to
-# arch specific sub-directory names.
-#
-# UNAME_M variable to used to run the compiles pointing to the right arch
-# directories and build the right targets for these supported architectures.
-#
-# TEST_GEN_PROGS and LIBKVM are set using UNAME_M variable.
-# LINUX_TOOL_ARCH_INCLUDE is set using ARCH variable.
-#
-# x86_64 targets are named to include x86_64 as a suffix and directories
-# for includes are in x86_64 sub-directory. s390x and aarch64 follow the
-# same convention. "uname -m" doesn't result in the correct mapping for
-# s390x and aarch64.
-#
-# No change necessary for x86_64
-UNAME_M := $(shell uname -m)
-
-# Set UNAME_M for arm64 compile/install to work
-ifeq ($(ARCH),arm64)
- UNAME_M := aarch64
-endif
-# Set UNAME_M s390x compile/install to work
-ifeq ($(ARCH),s390)
- UNAME_M := s390x
-endif
-# Set UNAME_M riscv compile/install to work
-ifeq ($(ARCH),riscv)
- UNAME_M := riscv
+ifeq ($(ARCH),x86)
+ ARCH_DIR := x86_64
+else ifeq ($(ARCH),arm64)
+ ARCH_DIR := aarch64
+else ifeq ($(ARCH),s390)
+ ARCH_DIR := s390x
+else ifeq ($(ARCH),riscv)
+ ARCH_DIR := riscv
+else
+$(error Unknown architecture '$(ARCH)')
endif
LIBKVM += lib/assert.c
@@ -196,10 +177,10 @@ TEST_GEN_PROGS_riscv += kvm_page_table_test
TEST_GEN_PROGS_riscv += set_memory_region_test
TEST_GEN_PROGS_riscv += kvm_binary_stats_test
-TEST_PROGS += $(TEST_PROGS_$(UNAME_M))
-TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(UNAME_M))
-TEST_GEN_PROGS_EXTENDED += $(TEST_GEN_PROGS_EXTENDED_$(UNAME_M))
-LIBKVM += $(LIBKVM_$(UNAME_M))
+TEST_PROGS += $(TEST_PROGS_$(ARCH_DIR))
+TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(ARCH_DIR))
+TEST_GEN_PROGS_EXTENDED += $(TEST_GEN_PROGS_EXTENDED_$(ARCH_DIR))
+LIBKVM += $(LIBKVM_$(ARCH_DIR))
INSTALL_HDR_PATH = $(top_srcdir)/usr
LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/
@@ -212,7 +193,7 @@ endif
CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
-fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \
-I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \
- -I$(<D) -Iinclude/$(UNAME_M) -I ../rseq -I.. $(EXTRA_CFLAGS) \
+ -I$(<D) -Iinclude/$(ARCH_DIR) -I ../rseq -I.. $(EXTRA_CFLAGS) \
$(KHDR_INCLUDES)
no-pie-option := $(call try-run, echo 'int main() { return 0; }' | \
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 07/14] KVM: selftests: Use proper function prototypes in probing code
2022-12-13 0:16 ` Sean Christopherson
(?)
(?)
@ 2022-12-13 0:16 ` Sean Christopherson
-1 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Make the main() functions in the probing code proper prototypes so that
compiling the probing code with more strict flags won't generate false
negatives.
<stdin>:1:5: error: function declaration isn’t a prototype [-Werror=strict-prototypes]
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index d761a77c3a80..c22c3002492d 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -196,11 +196,11 @@ CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
-I$(<D) -Iinclude/$(ARCH_DIR) -I ../rseq -I.. $(EXTRA_CFLAGS) \
$(KHDR_INCLUDES)
-no-pie-option := $(call try-run, echo 'int main() { return 0; }' | \
+no-pie-option := $(call try-run, echo 'int main(void) { return 0; }' | \
$(CC) -Werror -no-pie -x c - -o "$$TMP", -no-pie)
# On s390, build the testcases KVM-enabled
-pgste-option = $(call try-run, echo 'int main() { return 0; }' | \
+pgste-option = $(call try-run, echo 'int main(void) { return 0; }' | \
$(CC) -Werror -Wl$(comma)--s390-pgste -x c - -o "$$TMP",-Wl$(comma)--s390-pgste)
LDLIBS += -ldl
--
2.39.0.rc1.256.g54fd8350bd-goog
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 07/14] KVM: selftests: Use proper function prototypes in probing code
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: Aaron Lewis, kvm, Tom Rix, llvm, linux-kernel, kvmarm,
linux-riscv, kvmarm, linux-arm-kernel
Make the main() functions in the probing code proper prototypes so that
compiling the probing code with more strict flags won't generate false
negatives.
<stdin>:1:5: error: function declaration isn’t a prototype [-Werror=strict-prototypes]
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index d761a77c3a80..c22c3002492d 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -196,11 +196,11 @@ CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
-I$(<D) -Iinclude/$(ARCH_DIR) -I ../rseq -I.. $(EXTRA_CFLAGS) \
$(KHDR_INCLUDES)
-no-pie-option := $(call try-run, echo 'int main() { return 0; }' | \
+no-pie-option := $(call try-run, echo 'int main(void) { return 0; }' | \
$(CC) -Werror -no-pie -x c - -o "$$TMP", -no-pie)
# On s390, build the testcases KVM-enabled
-pgste-option = $(call try-run, echo 'int main() { return 0; }' | \
+pgste-option = $(call try-run, echo 'int main(void) { return 0; }' | \
$(CC) -Werror -Wl$(comma)--s390-pgste -x c - -o "$$TMP",-Wl$(comma)--s390-pgste)
LDLIBS += -ldl
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 07/14] KVM: selftests: Use proper function prototypes in probing code
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Make the main() functions in the probing code proper prototypes so that
compiling the probing code with more strict flags won't generate false
negatives.
<stdin>:1:5: error: function declaration isn’t a prototype [-Werror=strict-prototypes]
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index d761a77c3a80..c22c3002492d 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -196,11 +196,11 @@ CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
-I$(<D) -Iinclude/$(ARCH_DIR) -I ../rseq -I.. $(EXTRA_CFLAGS) \
$(KHDR_INCLUDES)
-no-pie-option := $(call try-run, echo 'int main() { return 0; }' | \
+no-pie-option := $(call try-run, echo 'int main(void) { return 0; }' | \
$(CC) -Werror -no-pie -x c - -o "$$TMP", -no-pie)
# On s390, build the testcases KVM-enabled
-pgste-option = $(call try-run, echo 'int main() { return 0; }' | \
+pgste-option = $(call try-run, echo 'int main(void) { return 0; }' | \
$(CC) -Werror -Wl$(comma)--s390-pgste -x c - -o "$$TMP",-Wl$(comma)--s390-pgste)
LDLIBS += -ldl
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 07/14] KVM: selftests: Use proper function prototypes in probing code
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Make the main() functions in the probing code proper prototypes so that
compiling the probing code with more strict flags won't generate false
negatives.
<stdin>:1:5: error: function declaration isn’t a prototype [-Werror=strict-prototypes]
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index d761a77c3a80..c22c3002492d 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -196,11 +196,11 @@ CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
-I$(<D) -Iinclude/$(ARCH_DIR) -I ../rseq -I.. $(EXTRA_CFLAGS) \
$(KHDR_INCLUDES)
-no-pie-option := $(call try-run, echo 'int main() { return 0; }' | \
+no-pie-option := $(call try-run, echo 'int main(void) { return 0; }' | \
$(CC) -Werror -no-pie -x c - -o "$$TMP", -no-pie)
# On s390, build the testcases KVM-enabled
-pgste-option = $(call try-run, echo 'int main() { return 0; }' | \
+pgste-option = $(call try-run, echo 'int main(void) { return 0; }' | \
$(CC) -Werror -Wl$(comma)--s390-pgste -x c - -o "$$TMP",-Wl$(comma)--s390-pgste)
LDLIBS += -ldl
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 08/14] KVM: selftests: Probe -no-pie with actual CFLAGS used to compile
2022-12-13 0:16 ` Sean Christopherson
(?)
(?)
@ 2022-12-13 0:16 ` Sean Christopherson
-1 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Probe -no-pie with the actual set of CFLAGS used to compile the tests,
clang whines about -no-pie being unused if the tests are compiled with
-static.
clang: warning: argument unused during compilation: '-no-pie'
[-Wunused-command-line-argument]
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index c22c3002492d..a6050dcc381a 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -197,7 +197,7 @@ CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
$(KHDR_INCLUDES)
no-pie-option := $(call try-run, echo 'int main(void) { return 0; }' | \
- $(CC) -Werror -no-pie -x c - -o "$$TMP", -no-pie)
+ $(CC) -Werror $(CFLAGS) -no-pie -x c - -o "$$TMP", -no-pie)
# On s390, build the testcases KVM-enabled
pgste-option = $(call try-run, echo 'int main(void) { return 0; }' | \
--
2.39.0.rc1.256.g54fd8350bd-goog
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 08/14] KVM: selftests: Probe -no-pie with actual CFLAGS used to compile
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: Aaron Lewis, kvm, Tom Rix, llvm, linux-kernel, kvmarm,
linux-riscv, kvmarm, linux-arm-kernel
Probe -no-pie with the actual set of CFLAGS used to compile the tests,
clang whines about -no-pie being unused if the tests are compiled with
-static.
clang: warning: argument unused during compilation: '-no-pie'
[-Wunused-command-line-argument]
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index c22c3002492d..a6050dcc381a 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -197,7 +197,7 @@ CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
$(KHDR_INCLUDES)
no-pie-option := $(call try-run, echo 'int main(void) { return 0; }' | \
- $(CC) -Werror -no-pie -x c - -o "$$TMP", -no-pie)
+ $(CC) -Werror $(CFLAGS) -no-pie -x c - -o "$$TMP", -no-pie)
# On s390, build the testcases KVM-enabled
pgste-option = $(call try-run, echo 'int main(void) { return 0; }' | \
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 08/14] KVM: selftests: Probe -no-pie with actual CFLAGS used to compile
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Probe -no-pie with the actual set of CFLAGS used to compile the tests,
clang whines about -no-pie being unused if the tests are compiled with
-static.
clang: warning: argument unused during compilation: '-no-pie'
[-Wunused-command-line-argument]
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index c22c3002492d..a6050dcc381a 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -197,7 +197,7 @@ CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
$(KHDR_INCLUDES)
no-pie-option := $(call try-run, echo 'int main(void) { return 0; }' | \
- $(CC) -Werror -no-pie -x c - -o "$$TMP", -no-pie)
+ $(CC) -Werror $(CFLAGS) -no-pie -x c - -o "$$TMP", -no-pie)
# On s390, build the testcases KVM-enabled
pgste-option = $(call try-run, echo 'int main(void) { return 0; }' | \
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 08/14] KVM: selftests: Probe -no-pie with actual CFLAGS used to compile
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Probe -no-pie with the actual set of CFLAGS used to compile the tests,
clang whines about -no-pie being unused if the tests are compiled with
-static.
clang: warning: argument unused during compilation: '-no-pie'
[-Wunused-command-line-argument]
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index c22c3002492d..a6050dcc381a 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -197,7 +197,7 @@ CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
$(KHDR_INCLUDES)
no-pie-option := $(call try-run, echo 'int main(void) { return 0; }' | \
- $(CC) -Werror -no-pie -x c - -o "$$TMP", -no-pie)
+ $(CC) -Werror $(CFLAGS) -no-pie -x c - -o "$$TMP", -no-pie)
# On s390, build the testcases KVM-enabled
pgste-option = $(call try-run, echo 'int main(void) { return 0; }' | \
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 09/14] KVM: selftests: Explicitly disable builtins for mem*() overrides
2022-12-13 0:16 ` Sean Christopherson
(?)
(?)
@ 2022-12-13 0:16 ` Sean Christopherson
-1 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Explicitly disable the compiler's builtin memcmp(), memcpy(), and
memset(). Because only lib/string_override.c is built with -ffreestanding,
the compiler reserves the right to do what it wants and can try to link the
non-freestanding code to its own crud.
/usr/bin/x86_64-linux-gnu-ld: /lib/x86_64-linux-gnu/libc.a(memcmp.o): in function `memcmp_ifunc':
(.text+0x0): multiple definition of `memcmp'; tools/testing/selftests/kvm/lib/string_override.o:
tools/testing/selftests/kvm/lib/string_override.c:15: first defined here
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Fixes: 6b6f71484bf4 ("KVM: selftests: Implement memcmp(), memcpy(), and memset() for guest use")
Reported-by: Aaron Lewis <aaronlewis@google.com>
Reported-by: Raghavendra Rao Ananta <rananta@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index a6050dcc381a..6594ed51eeea 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -191,6 +191,7 @@ else
LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include
endif
CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
+ -fno-builtin-memcmp -fno-builtin-memcpy -fno-builtin-memset \
-fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \
-I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \
-I$(<D) -Iinclude/$(ARCH_DIR) -I ../rseq -I.. $(EXTRA_CFLAGS) \
--
2.39.0.rc1.256.g54fd8350bd-goog
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 09/14] KVM: selftests: Explicitly disable builtins for mem*() overrides
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: Aaron Lewis, kvm, Tom Rix, llvm, linux-kernel, kvmarm,
linux-riscv, kvmarm, linux-arm-kernel
Explicitly disable the compiler's builtin memcmp(), memcpy(), and
memset(). Because only lib/string_override.c is built with -ffreestanding,
the compiler reserves the right to do what it wants and can try to link the
non-freestanding code to its own crud.
/usr/bin/x86_64-linux-gnu-ld: /lib/x86_64-linux-gnu/libc.a(memcmp.o): in function `memcmp_ifunc':
(.text+0x0): multiple definition of `memcmp'; tools/testing/selftests/kvm/lib/string_override.o:
tools/testing/selftests/kvm/lib/string_override.c:15: first defined here
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Fixes: 6b6f71484bf4 ("KVM: selftests: Implement memcmp(), memcpy(), and memset() for guest use")
Reported-by: Aaron Lewis <aaronlewis@google.com>
Reported-by: Raghavendra Rao Ananta <rananta@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index a6050dcc381a..6594ed51eeea 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -191,6 +191,7 @@ else
LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include
endif
CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
+ -fno-builtin-memcmp -fno-builtin-memcpy -fno-builtin-memset \
-fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \
-I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \
-I$(<D) -Iinclude/$(ARCH_DIR) -I ../rseq -I.. $(EXTRA_CFLAGS) \
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 09/14] KVM: selftests: Explicitly disable builtins for mem*() overrides
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Explicitly disable the compiler's builtin memcmp(), memcpy(), and
memset(). Because only lib/string_override.c is built with -ffreestanding,
the compiler reserves the right to do what it wants and can try to link the
non-freestanding code to its own crud.
/usr/bin/x86_64-linux-gnu-ld: /lib/x86_64-linux-gnu/libc.a(memcmp.o): in function `memcmp_ifunc':
(.text+0x0): multiple definition of `memcmp'; tools/testing/selftests/kvm/lib/string_override.o:
tools/testing/selftests/kvm/lib/string_override.c:15: first defined here
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Fixes: 6b6f71484bf4 ("KVM: selftests: Implement memcmp(), memcpy(), and memset() for guest use")
Reported-by: Aaron Lewis <aaronlewis@google.com>
Reported-by: Raghavendra Rao Ananta <rananta@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index a6050dcc381a..6594ed51eeea 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -191,6 +191,7 @@ else
LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include
endif
CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
+ -fno-builtin-memcmp -fno-builtin-memcpy -fno-builtin-memset \
-fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \
-I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \
-I$(<D) -Iinclude/$(ARCH_DIR) -I ../rseq -I.. $(EXTRA_CFLAGS) \
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 09/14] KVM: selftests: Explicitly disable builtins for mem*() overrides
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Explicitly disable the compiler's builtin memcmp(), memcpy(), and
memset(). Because only lib/string_override.c is built with -ffreestanding,
the compiler reserves the right to do what it wants and can try to link the
non-freestanding code to its own crud.
/usr/bin/x86_64-linux-gnu-ld: /lib/x86_64-linux-gnu/libc.a(memcmp.o): in function `memcmp_ifunc':
(.text+0x0): multiple definition of `memcmp'; tools/testing/selftests/kvm/lib/string_override.o:
tools/testing/selftests/kvm/lib/string_override.c:15: first defined here
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Fixes: 6b6f71484bf4 ("KVM: selftests: Implement memcmp(), memcpy(), and memset() for guest use")
Reported-by: Aaron Lewis <aaronlewis@google.com>
Reported-by: Raghavendra Rao Ananta <rananta@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index a6050dcc381a..6594ed51eeea 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -191,6 +191,7 @@ else
LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include
endif
CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
+ -fno-builtin-memcmp -fno-builtin-memcpy -fno-builtin-memset \
-fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \
-I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \
-I$(<D) -Iinclude/$(ARCH_DIR) -I ../rseq -I.. $(EXTRA_CFLAGS) \
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 10/14] KVM: selftests: Include lib.mk before consuming $(CC)
2022-12-13 0:16 ` Sean Christopherson
(?)
(?)
@ 2022-12-13 0:16 ` Sean Christopherson
-1 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Include lib.mk before consuming $(CC) and document that lib.mk overwrites
$(CC) unless make was invoked with -e or $(CC) was specified after make
(which apparently makes the environment override the Makefile?!?!).
Including lib.mk after using it for probing, e.g. for -no-pie, can lead
to weirdness.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index 6594ed51eeea..2487db21b177 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -182,6 +182,11 @@ TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(ARCH_DIR))
TEST_GEN_PROGS_EXTENDED += $(TEST_GEN_PROGS_EXTENDED_$(ARCH_DIR))
LIBKVM += $(LIBKVM_$(ARCH_DIR))
+# lib.mak defines $(OUTPUT), prepends $(OUTPUT)/ to $(TEST_GEN_PROGS), and most
+# importantly defines, i.e. overwrites, $(CC) (unless `make -e` or `make CC=`,
+# which causes the environment variable to override the makefile).
+include ../lib.mk
+
INSTALL_HDR_PATH = $(top_srcdir)/usr
LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/
LINUX_TOOL_INCLUDE = $(top_srcdir)/tools/include
@@ -207,10 +212,6 @@ pgste-option = $(call try-run, echo 'int main(void) { return 0; }' | \
LDLIBS += -ldl
LDFLAGS += -pthread $(no-pie-option) $(pgste-option)
-# After inclusion, $(OUTPUT) is defined and
-# $(TEST_GEN_PROGS) starts with $(OUTPUT)/
-include ../lib.mk
-
LIBKVM_C := $(filter %.c,$(LIBKVM))
LIBKVM_S := $(filter %.S,$(LIBKVM))
LIBKVM_C_OBJ := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBKVM_C))
--
2.39.0.rc1.256.g54fd8350bd-goog
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 10/14] KVM: selftests: Include lib.mk before consuming $(CC)
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: Aaron Lewis, kvm, Tom Rix, llvm, linux-kernel, kvmarm,
linux-riscv, kvmarm, linux-arm-kernel
Include lib.mk before consuming $(CC) and document that lib.mk overwrites
$(CC) unless make was invoked with -e or $(CC) was specified after make
(which apparently makes the environment override the Makefile?!?!).
Including lib.mk after using it for probing, e.g. for -no-pie, can lead
to weirdness.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index 6594ed51eeea..2487db21b177 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -182,6 +182,11 @@ TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(ARCH_DIR))
TEST_GEN_PROGS_EXTENDED += $(TEST_GEN_PROGS_EXTENDED_$(ARCH_DIR))
LIBKVM += $(LIBKVM_$(ARCH_DIR))
+# lib.mak defines $(OUTPUT), prepends $(OUTPUT)/ to $(TEST_GEN_PROGS), and most
+# importantly defines, i.e. overwrites, $(CC) (unless `make -e` or `make CC=`,
+# which causes the environment variable to override the makefile).
+include ../lib.mk
+
INSTALL_HDR_PATH = $(top_srcdir)/usr
LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/
LINUX_TOOL_INCLUDE = $(top_srcdir)/tools/include
@@ -207,10 +212,6 @@ pgste-option = $(call try-run, echo 'int main(void) { return 0; }' | \
LDLIBS += -ldl
LDFLAGS += -pthread $(no-pie-option) $(pgste-option)
-# After inclusion, $(OUTPUT) is defined and
-# $(TEST_GEN_PROGS) starts with $(OUTPUT)/
-include ../lib.mk
-
LIBKVM_C := $(filter %.c,$(LIBKVM))
LIBKVM_S := $(filter %.S,$(LIBKVM))
LIBKVM_C_OBJ := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBKVM_C))
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 10/14] KVM: selftests: Include lib.mk before consuming $(CC)
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Include lib.mk before consuming $(CC) and document that lib.mk overwrites
$(CC) unless make was invoked with -e or $(CC) was specified after make
(which apparently makes the environment override the Makefile?!?!).
Including lib.mk after using it for probing, e.g. for -no-pie, can lead
to weirdness.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index 6594ed51eeea..2487db21b177 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -182,6 +182,11 @@ TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(ARCH_DIR))
TEST_GEN_PROGS_EXTENDED += $(TEST_GEN_PROGS_EXTENDED_$(ARCH_DIR))
LIBKVM += $(LIBKVM_$(ARCH_DIR))
+# lib.mak defines $(OUTPUT), prepends $(OUTPUT)/ to $(TEST_GEN_PROGS), and most
+# importantly defines, i.e. overwrites, $(CC) (unless `make -e` or `make CC=`,
+# which causes the environment variable to override the makefile).
+include ../lib.mk
+
INSTALL_HDR_PATH = $(top_srcdir)/usr
LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/
LINUX_TOOL_INCLUDE = $(top_srcdir)/tools/include
@@ -207,10 +212,6 @@ pgste-option = $(call try-run, echo 'int main(void) { return 0; }' | \
LDLIBS += -ldl
LDFLAGS += -pthread $(no-pie-option) $(pgste-option)
-# After inclusion, $(OUTPUT) is defined and
-# $(TEST_GEN_PROGS) starts with $(OUTPUT)/
-include ../lib.mk
-
LIBKVM_C := $(filter %.c,$(LIBKVM))
LIBKVM_S := $(filter %.S,$(LIBKVM))
LIBKVM_C_OBJ := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBKVM_C))
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 10/14] KVM: selftests: Include lib.mk before consuming $(CC)
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Include lib.mk before consuming $(CC) and document that lib.mk overwrites
$(CC) unless make was invoked with -e or $(CC) was specified after make
(which apparently makes the environment override the Makefile?!?!).
Including lib.mk after using it for probing, e.g. for -no-pie, can lead
to weirdness.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index 6594ed51eeea..2487db21b177 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -182,6 +182,11 @@ TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(ARCH_DIR))
TEST_GEN_PROGS_EXTENDED += $(TEST_GEN_PROGS_EXTENDED_$(ARCH_DIR))
LIBKVM += $(LIBKVM_$(ARCH_DIR))
+# lib.mak defines $(OUTPUT), prepends $(OUTPUT)/ to $(TEST_GEN_PROGS), and most
+# importantly defines, i.e. overwrites, $(CC) (unless `make -e` or `make CC=`,
+# which causes the environment variable to override the makefile).
+include ../lib.mk
+
INSTALL_HDR_PATH = $(top_srcdir)/usr
LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/
LINUX_TOOL_INCLUDE = $(top_srcdir)/tools/include
@@ -207,10 +212,6 @@ pgste-option = $(call try-run, echo 'int main(void) { return 0; }' | \
LDLIBS += -ldl
LDFLAGS += -pthread $(no-pie-option) $(pgste-option)
-# After inclusion, $(OUTPUT) is defined and
-# $(TEST_GEN_PROGS) starts with $(OUTPUT)/
-include ../lib.mk
-
LIBKVM_C := $(filter %.c,$(LIBKVM))
LIBKVM_S := $(filter %.S,$(LIBKVM))
LIBKVM_C_OBJ := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBKVM_C))
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 11/14] KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning
2022-12-13 0:16 ` Sean Christopherson
(?)
(?)
@ 2022-12-13 0:16 ` Sean Christopherson
-1 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: Aaron Lewis, kvm, Tom Rix, llvm, linux-kernel, kvmarm,
linux-riscv, kvmarm, linux-arm-kernel
Disable gnu-variable-sized-type-not-at-end so that tests and libraries
can create overlays of variable sized arrays at the end of structs when
using a fixed number of entries, e.g. to get/set a single MSR.
It's possible to fudge around the warning, e.g. by defining a custom
struct that hardcodes the number of entries, but that is a burden for
both developers and readers of the code.
lib/x86_64/processor.c:664:19: warning: field 'header' with variable sized type 'struct kvm_msrs'
not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
struct kvm_msrs header;
^
lib/x86_64/processor.c:772:19: warning: field 'header' with variable sized type 'struct kvm_msrs'
not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
struct kvm_msrs header;
^
lib/x86_64/processor.c:787:19: warning: field 'header' with variable sized type 'struct kvm_msrs'
not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
struct kvm_msrs header;
^
3 warnings generated.
x86_64/hyperv_tlb_flush.c:54:18: warning: field 'hv_vp_set' with variable sized type 'struct hv_vpset'
not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
struct hv_vpset hv_vp_set;
^
1 warning generated.
x86_64/xen_shinfo_test.c:137:25: warning: field 'info' with variable sized type 'struct kvm_irq_routing'
not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
struct kvm_irq_routing info;
^
1 warning generated.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index 2487db21b177..9cff99a1cb2e 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -196,6 +196,7 @@ else
LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include
endif
CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
+ -Wno-gnu-variable-sized-type-not-at-end \
-fno-builtin-memcmp -fno-builtin-memcpy -fno-builtin-memset \
-fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \
-I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 11/14] KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Disable gnu-variable-sized-type-not-at-end so that tests and libraries
can create overlays of variable sized arrays at the end of structs when
using a fixed number of entries, e.g. to get/set a single MSR.
It's possible to fudge around the warning, e.g. by defining a custom
struct that hardcodes the number of entries, but that is a burden for
both developers and readers of the code.
lib/x86_64/processor.c:664:19: warning: field 'header' with variable sized type 'struct kvm_msrs'
not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
struct kvm_msrs header;
^
lib/x86_64/processor.c:772:19: warning: field 'header' with variable sized type 'struct kvm_msrs'
not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
struct kvm_msrs header;
^
lib/x86_64/processor.c:787:19: warning: field 'header' with variable sized type 'struct kvm_msrs'
not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
struct kvm_msrs header;
^
3 warnings generated.
x86_64/hyperv_tlb_flush.c:54:18: warning: field 'hv_vp_set' with variable sized type 'struct hv_vpset'
not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
struct hv_vpset hv_vp_set;
^
1 warning generated.
x86_64/xen_shinfo_test.c:137:25: warning: field 'info' with variable sized type 'struct kvm_irq_routing'
not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
struct kvm_irq_routing info;
^
1 warning generated.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index 2487db21b177..9cff99a1cb2e 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -196,6 +196,7 @@ else
LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include
endif
CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
+ -Wno-gnu-variable-sized-type-not-at-end \
-fno-builtin-memcmp -fno-builtin-memcpy -fno-builtin-memset \
-fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \
-I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \
--
2.39.0.rc1.256.g54fd8350bd-goog
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 11/14] KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Disable gnu-variable-sized-type-not-at-end so that tests and libraries
can create overlays of variable sized arrays at the end of structs when
using a fixed number of entries, e.g. to get/set a single MSR.
It's possible to fudge around the warning, e.g. by defining a custom
struct that hardcodes the number of entries, but that is a burden for
both developers and readers of the code.
lib/x86_64/processor.c:664:19: warning: field 'header' with variable sized type 'struct kvm_msrs'
not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
struct kvm_msrs header;
^
lib/x86_64/processor.c:772:19: warning: field 'header' with variable sized type 'struct kvm_msrs'
not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
struct kvm_msrs header;
^
lib/x86_64/processor.c:787:19: warning: field 'header' with variable sized type 'struct kvm_msrs'
not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
struct kvm_msrs header;
^
3 warnings generated.
x86_64/hyperv_tlb_flush.c:54:18: warning: field 'hv_vp_set' with variable sized type 'struct hv_vpset'
not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
struct hv_vpset hv_vp_set;
^
1 warning generated.
x86_64/xen_shinfo_test.c:137:25: warning: field 'info' with variable sized type 'struct kvm_irq_routing'
not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
struct kvm_irq_routing info;
^
1 warning generated.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index 2487db21b177..9cff99a1cb2e 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -196,6 +196,7 @@ else
LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include
endif
CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
+ -Wno-gnu-variable-sized-type-not-at-end \
-fno-builtin-memcmp -fno-builtin-memcpy -fno-builtin-memset \
-fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \
-I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 11/14] KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Disable gnu-variable-sized-type-not-at-end so that tests and libraries
can create overlays of variable sized arrays at the end of structs when
using a fixed number of entries, e.g. to get/set a single MSR.
It's possible to fudge around the warning, e.g. by defining a custom
struct that hardcodes the number of entries, but that is a burden for
both developers and readers of the code.
lib/x86_64/processor.c:664:19: warning: field 'header' with variable sized type 'struct kvm_msrs'
not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
struct kvm_msrs header;
^
lib/x86_64/processor.c:772:19: warning: field 'header' with variable sized type 'struct kvm_msrs'
not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
struct kvm_msrs header;
^
lib/x86_64/processor.c:787:19: warning: field 'header' with variable sized type 'struct kvm_msrs'
not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
struct kvm_msrs header;
^
3 warnings generated.
x86_64/hyperv_tlb_flush.c:54:18: warning: field 'hv_vp_set' with variable sized type 'struct hv_vpset'
not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
struct hv_vpset hv_vp_set;
^
1 warning generated.
x86_64/xen_shinfo_test.c:137:25: warning: field 'info' with variable sized type 'struct kvm_irq_routing'
not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
struct kvm_irq_routing info;
^
1 warning generated.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index 2487db21b177..9cff99a1cb2e 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -196,6 +196,7 @@ else
LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include
endif
CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
+ -Wno-gnu-variable-sized-type-not-at-end \
-fno-builtin-memcmp -fno-builtin-memcpy -fno-builtin-memset \
-fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \
-I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 12/14] KVM: selftests: Use wildcards to find library source files
2022-12-13 0:16 ` Sean Christopherson
(?)
(?)
@ 2022-12-13 0:16 ` Sean Christopherson
-1 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: Aaron Lewis, kvm, Tom Rix, llvm, linux-kernel, kvmarm,
linux-riscv, kvmarm, linux-arm-kernel
Use $(wildcard ...) to find the library source files instead of manually
defining the inputs, which is a maintenance burden and error prone.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 45 ++++------------------------
1 file changed, 5 insertions(+), 40 deletions(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index 9cff99a1cb2e..a9930e9197da 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -19,44 +19,6 @@ else
$(error Unknown architecture '$(ARCH)')
endif
-LIBKVM += lib/assert.c
-LIBKVM += lib/elf.c
-LIBKVM += lib/guest_modes.c
-LIBKVM += lib/io.c
-LIBKVM += lib/kvm_util.c
-LIBKVM += lib/memstress.c
-LIBKVM += lib/rbtree.c
-LIBKVM += lib/sparsebit.c
-LIBKVM += lib/test_util.c
-LIBKVM += lib/ucall_common.c
-LIBKVM += lib/userfaultfd_util.c
-
-LIBKVM_STRING += lib/string_override.c
-
-LIBKVM_x86_64 += lib/x86_64/apic.c
-LIBKVM_x86_64 += lib/x86_64/handlers.S
-LIBKVM_x86_64 += lib/x86_64/hyperv.c
-LIBKVM_x86_64 += lib/x86_64/memstress.c
-LIBKVM_x86_64 += lib/x86_64/processor.c
-LIBKVM_x86_64 += lib/x86_64/svm.c
-LIBKVM_x86_64 += lib/x86_64/ucall.c
-LIBKVM_x86_64 += lib/x86_64/vmx.c
-
-LIBKVM_aarch64 += lib/aarch64/gic.c
-LIBKVM_aarch64 += lib/aarch64/gic_v3.c
-LIBKVM_aarch64 += lib/aarch64/handlers.S
-LIBKVM_aarch64 += lib/aarch64/processor.c
-LIBKVM_aarch64 += lib/aarch64/spinlock.c
-LIBKVM_aarch64 += lib/aarch64/ucall.c
-LIBKVM_aarch64 += lib/aarch64/vgic.c
-
-LIBKVM_s390x += lib/s390x/diag318_test_handler.c
-LIBKVM_s390x += lib/s390x/processor.c
-LIBKVM_s390x += lib/s390x/ucall.c
-
-LIBKVM_riscv += lib/riscv/processor.c
-LIBKVM_riscv += lib/riscv/ucall.c
-
# Non-compiled test targets
TEST_PROGS_x86_64 += x86_64/nx_huge_pages_test.sh
@@ -213,10 +175,13 @@ pgste-option = $(call try-run, echo 'int main(void) { return 0; }' | \
LDLIBS += -ldl
LDFLAGS += -pthread $(no-pie-option) $(pgste-option)
-LIBKVM_C := $(filter %.c,$(LIBKVM))
-LIBKVM_S := $(filter %.S,$(LIBKVM))
+LIBKVM_C := $(filter-out lib/string_override.c,$(wildcard lib/*.c))
+LIBKVM_C += $(wildcard lib/$(ARCH_DIR)/*.c)
+LIBKVM_S := $(wildcard lib/*.S)
+LIBKVM_S += $(wildcard lib/$(ARCH_DIR)/*.S)
LIBKVM_C_OBJ := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBKVM_C))
LIBKVM_S_OBJ := $(patsubst %.S, $(OUTPUT)/%.o, $(LIBKVM_S))
+LIBKVM_STRING := lib/string_override.c
LIBKVM_STRING_OBJ := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBKVM_STRING))
LIBKVM_OBJS = $(LIBKVM_C_OBJ) $(LIBKVM_S_OBJ) $(LIBKVM_STRING_OBJ)
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 12/14] KVM: selftests: Use wildcards to find library source files
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Use $(wildcard ...) to find the library source files instead of manually
defining the inputs, which is a maintenance burden and error prone.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 45 ++++------------------------
1 file changed, 5 insertions(+), 40 deletions(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index 9cff99a1cb2e..a9930e9197da 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -19,44 +19,6 @@ else
$(error Unknown architecture '$(ARCH)')
endif
-LIBKVM += lib/assert.c
-LIBKVM += lib/elf.c
-LIBKVM += lib/guest_modes.c
-LIBKVM += lib/io.c
-LIBKVM += lib/kvm_util.c
-LIBKVM += lib/memstress.c
-LIBKVM += lib/rbtree.c
-LIBKVM += lib/sparsebit.c
-LIBKVM += lib/test_util.c
-LIBKVM += lib/ucall_common.c
-LIBKVM += lib/userfaultfd_util.c
-
-LIBKVM_STRING += lib/string_override.c
-
-LIBKVM_x86_64 += lib/x86_64/apic.c
-LIBKVM_x86_64 += lib/x86_64/handlers.S
-LIBKVM_x86_64 += lib/x86_64/hyperv.c
-LIBKVM_x86_64 += lib/x86_64/memstress.c
-LIBKVM_x86_64 += lib/x86_64/processor.c
-LIBKVM_x86_64 += lib/x86_64/svm.c
-LIBKVM_x86_64 += lib/x86_64/ucall.c
-LIBKVM_x86_64 += lib/x86_64/vmx.c
-
-LIBKVM_aarch64 += lib/aarch64/gic.c
-LIBKVM_aarch64 += lib/aarch64/gic_v3.c
-LIBKVM_aarch64 += lib/aarch64/handlers.S
-LIBKVM_aarch64 += lib/aarch64/processor.c
-LIBKVM_aarch64 += lib/aarch64/spinlock.c
-LIBKVM_aarch64 += lib/aarch64/ucall.c
-LIBKVM_aarch64 += lib/aarch64/vgic.c
-
-LIBKVM_s390x += lib/s390x/diag318_test_handler.c
-LIBKVM_s390x += lib/s390x/processor.c
-LIBKVM_s390x += lib/s390x/ucall.c
-
-LIBKVM_riscv += lib/riscv/processor.c
-LIBKVM_riscv += lib/riscv/ucall.c
-
# Non-compiled test targets
TEST_PROGS_x86_64 += x86_64/nx_huge_pages_test.sh
@@ -213,10 +175,13 @@ pgste-option = $(call try-run, echo 'int main(void) { return 0; }' | \
LDLIBS += -ldl
LDFLAGS += -pthread $(no-pie-option) $(pgste-option)
-LIBKVM_C := $(filter %.c,$(LIBKVM))
-LIBKVM_S := $(filter %.S,$(LIBKVM))
+LIBKVM_C := $(filter-out lib/string_override.c,$(wildcard lib/*.c))
+LIBKVM_C += $(wildcard lib/$(ARCH_DIR)/*.c)
+LIBKVM_S := $(wildcard lib/*.S)
+LIBKVM_S += $(wildcard lib/$(ARCH_DIR)/*.S)
LIBKVM_C_OBJ := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBKVM_C))
LIBKVM_S_OBJ := $(patsubst %.S, $(OUTPUT)/%.o, $(LIBKVM_S))
+LIBKVM_STRING := lib/string_override.c
LIBKVM_STRING_OBJ := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBKVM_STRING))
LIBKVM_OBJS = $(LIBKVM_C_OBJ) $(LIBKVM_S_OBJ) $(LIBKVM_STRING_OBJ)
--
2.39.0.rc1.256.g54fd8350bd-goog
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 12/14] KVM: selftests: Use wildcards to find library source files
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Use $(wildcard ...) to find the library source files instead of manually
defining the inputs, which is a maintenance burden and error prone.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 45 ++++------------------------
1 file changed, 5 insertions(+), 40 deletions(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index 9cff99a1cb2e..a9930e9197da 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -19,44 +19,6 @@ else
$(error Unknown architecture '$(ARCH)')
endif
-LIBKVM += lib/assert.c
-LIBKVM += lib/elf.c
-LIBKVM += lib/guest_modes.c
-LIBKVM += lib/io.c
-LIBKVM += lib/kvm_util.c
-LIBKVM += lib/memstress.c
-LIBKVM += lib/rbtree.c
-LIBKVM += lib/sparsebit.c
-LIBKVM += lib/test_util.c
-LIBKVM += lib/ucall_common.c
-LIBKVM += lib/userfaultfd_util.c
-
-LIBKVM_STRING += lib/string_override.c
-
-LIBKVM_x86_64 += lib/x86_64/apic.c
-LIBKVM_x86_64 += lib/x86_64/handlers.S
-LIBKVM_x86_64 += lib/x86_64/hyperv.c
-LIBKVM_x86_64 += lib/x86_64/memstress.c
-LIBKVM_x86_64 += lib/x86_64/processor.c
-LIBKVM_x86_64 += lib/x86_64/svm.c
-LIBKVM_x86_64 += lib/x86_64/ucall.c
-LIBKVM_x86_64 += lib/x86_64/vmx.c
-
-LIBKVM_aarch64 += lib/aarch64/gic.c
-LIBKVM_aarch64 += lib/aarch64/gic_v3.c
-LIBKVM_aarch64 += lib/aarch64/handlers.S
-LIBKVM_aarch64 += lib/aarch64/processor.c
-LIBKVM_aarch64 += lib/aarch64/spinlock.c
-LIBKVM_aarch64 += lib/aarch64/ucall.c
-LIBKVM_aarch64 += lib/aarch64/vgic.c
-
-LIBKVM_s390x += lib/s390x/diag318_test_handler.c
-LIBKVM_s390x += lib/s390x/processor.c
-LIBKVM_s390x += lib/s390x/ucall.c
-
-LIBKVM_riscv += lib/riscv/processor.c
-LIBKVM_riscv += lib/riscv/ucall.c
-
# Non-compiled test targets
TEST_PROGS_x86_64 += x86_64/nx_huge_pages_test.sh
@@ -213,10 +175,13 @@ pgste-option = $(call try-run, echo 'int main(void) { return 0; }' | \
LDLIBS += -ldl
LDFLAGS += -pthread $(no-pie-option) $(pgste-option)
-LIBKVM_C := $(filter %.c,$(LIBKVM))
-LIBKVM_S := $(filter %.S,$(LIBKVM))
+LIBKVM_C := $(filter-out lib/string_override.c,$(wildcard lib/*.c))
+LIBKVM_C += $(wildcard lib/$(ARCH_DIR)/*.c)
+LIBKVM_S := $(wildcard lib/*.S)
+LIBKVM_S += $(wildcard lib/$(ARCH_DIR)/*.S)
LIBKVM_C_OBJ := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBKVM_C))
LIBKVM_S_OBJ := $(patsubst %.S, $(OUTPUT)/%.o, $(LIBKVM_S))
+LIBKVM_STRING := lib/string_override.c
LIBKVM_STRING_OBJ := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBKVM_STRING))
LIBKVM_OBJS = $(LIBKVM_C_OBJ) $(LIBKVM_S_OBJ) $(LIBKVM_STRING_OBJ)
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 12/14] KVM: selftests: Use wildcards to find library source files
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Use $(wildcard ...) to find the library source files instead of manually
defining the inputs, which is a maintenance burden and error prone.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 45 ++++------------------------
1 file changed, 5 insertions(+), 40 deletions(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index 9cff99a1cb2e..a9930e9197da 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -19,44 +19,6 @@ else
$(error Unknown architecture '$(ARCH)')
endif
-LIBKVM += lib/assert.c
-LIBKVM += lib/elf.c
-LIBKVM += lib/guest_modes.c
-LIBKVM += lib/io.c
-LIBKVM += lib/kvm_util.c
-LIBKVM += lib/memstress.c
-LIBKVM += lib/rbtree.c
-LIBKVM += lib/sparsebit.c
-LIBKVM += lib/test_util.c
-LIBKVM += lib/ucall_common.c
-LIBKVM += lib/userfaultfd_util.c
-
-LIBKVM_STRING += lib/string_override.c
-
-LIBKVM_x86_64 += lib/x86_64/apic.c
-LIBKVM_x86_64 += lib/x86_64/handlers.S
-LIBKVM_x86_64 += lib/x86_64/hyperv.c
-LIBKVM_x86_64 += lib/x86_64/memstress.c
-LIBKVM_x86_64 += lib/x86_64/processor.c
-LIBKVM_x86_64 += lib/x86_64/svm.c
-LIBKVM_x86_64 += lib/x86_64/ucall.c
-LIBKVM_x86_64 += lib/x86_64/vmx.c
-
-LIBKVM_aarch64 += lib/aarch64/gic.c
-LIBKVM_aarch64 += lib/aarch64/gic_v3.c
-LIBKVM_aarch64 += lib/aarch64/handlers.S
-LIBKVM_aarch64 += lib/aarch64/processor.c
-LIBKVM_aarch64 += lib/aarch64/spinlock.c
-LIBKVM_aarch64 += lib/aarch64/ucall.c
-LIBKVM_aarch64 += lib/aarch64/vgic.c
-
-LIBKVM_s390x += lib/s390x/diag318_test_handler.c
-LIBKVM_s390x += lib/s390x/processor.c
-LIBKVM_s390x += lib/s390x/ucall.c
-
-LIBKVM_riscv += lib/riscv/processor.c
-LIBKVM_riscv += lib/riscv/ucall.c
-
# Non-compiled test targets
TEST_PROGS_x86_64 += x86_64/nx_huge_pages_test.sh
@@ -213,10 +175,13 @@ pgste-option = $(call try-run, echo 'int main(void) { return 0; }' | \
LDLIBS += -ldl
LDFLAGS += -pthread $(no-pie-option) $(pgste-option)
-LIBKVM_C := $(filter %.c,$(LIBKVM))
-LIBKVM_S := $(filter %.S,$(LIBKVM))
+LIBKVM_C := $(filter-out lib/string_override.c,$(wildcard lib/*.c))
+LIBKVM_C += $(wildcard lib/$(ARCH_DIR)/*.c)
+LIBKVM_S := $(wildcard lib/*.S)
+LIBKVM_S += $(wildcard lib/$(ARCH_DIR)/*.S)
LIBKVM_C_OBJ := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBKVM_C))
LIBKVM_S_OBJ := $(patsubst %.S, $(OUTPUT)/%.o, $(LIBKVM_S))
+LIBKVM_STRING := lib/string_override.c
LIBKVM_STRING_OBJ := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBKVM_STRING))
LIBKVM_OBJS = $(LIBKVM_C_OBJ) $(LIBKVM_S_OBJ) $(LIBKVM_STRING_OBJ)
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 13/14] KVM: selftests: Use wildcards to find targets and test source files
2022-12-13 0:16 ` Sean Christopherson
(?)
(?)
@ 2022-12-13 0:16 ` Sean Christopherson
-1 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: Aaron Lewis, kvm, Tom Rix, llvm, linux-kernel, kvmarm,
linux-riscv, kvmarm, linux-arm-kernel
Use $(wildcard ...) to find the test targets (.sh files) and test source
files (.c and .S) instead of manually adding files/targets for every
architecture, which is a maintenance burden and error prone, e.g. RISC-V
supports RSEQ but doesn't build the test for reasons unknown.
To deal with common tests that are only supported on a subset of
architectures, add a dummy macro TEST_UNSUPPORTED() that tests can use
to declare the test as unsupported for a given architecture, and filter
out unsupported tests for the target architecture via grep. As a bonus,
explicitly naming unsupported architectures will also force developers to
opt-out of architectures (or opt-out of tests when adding a new arch).
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 128 +-----------------
.../selftests/kvm/access_tracking_perf_test.c | 3 +
.../selftests/kvm/dirty_log_perf_test.c | 3 +
.../selftests/kvm/hardware_disable_test.c | 4 +
.../testing/selftests/kvm/include/test_util.h | 11 ++
.../selftests/kvm/max_guest_memory_test.c | 4 +
.../kvm/memslot_modification_stress_test.c | 3 +
.../testing/selftests/kvm/memslot_perf_test.c | 3 +
tools/testing/selftests/kvm/rseq_test.c | 2 +
tools/testing/selftests/kvm/steal_time.c | 3 +
.../kvm/system_counter_offset_test.c | 4 +
11 files changed, 46 insertions(+), 122 deletions(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index a9930e9197da..76382850a28f 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -19,130 +19,14 @@ else
$(error Unknown architecture '$(ARCH)')
endif
-# Non-compiled test targets
-TEST_PROGS_x86_64 += x86_64/nx_huge_pages_test.sh
+TESTS_SRC := $(shell grep -L TEST_UNSUPPORTED\($(ARCH_DIR)\) *.c)
+TESTS_SRC += $(wildcard $(ARCH_DIR)/*.c)
-# Compiled test targets
-TEST_GEN_PROGS_x86_64 = x86_64/cpuid_test
-TEST_GEN_PROGS_x86_64 += x86_64/cr4_cpuid_sync_test
-TEST_GEN_PROGS_x86_64 += x86_64/get_msr_index_features
-TEST_GEN_PROGS_x86_64 += x86_64/exit_on_emulation_failure_test
-TEST_GEN_PROGS_x86_64 += x86_64/fix_hypercall_test
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_clock
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_cpuid
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_evmcs
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_features
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_ipi
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_svm_test
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_tlb_flush
-TEST_GEN_PROGS_x86_64 += x86_64/kvm_clock_test
-TEST_GEN_PROGS_x86_64 += x86_64/kvm_pv_test
-TEST_GEN_PROGS_x86_64 += x86_64/mmio_warning_test
-TEST_GEN_PROGS_x86_64 += x86_64/monitor_mwait_test
-TEST_GEN_PROGS_x86_64 += x86_64/nested_exceptions_test
-TEST_GEN_PROGS_x86_64 += x86_64/platform_info_test
-TEST_GEN_PROGS_x86_64 += x86_64/pmu_event_filter_test
-TEST_GEN_PROGS_x86_64 += x86_64/set_boot_cpu_id
-TEST_GEN_PROGS_x86_64 += x86_64/set_sregs_test
-TEST_GEN_PROGS_x86_64 += x86_64/smaller_maxphyaddr_emulation_test
-TEST_GEN_PROGS_x86_64 += x86_64/smm_test
-TEST_GEN_PROGS_x86_64 += x86_64/state_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_preemption_timer_test
-TEST_GEN_PROGS_x86_64 += x86_64/svm_vmcall_test
-TEST_GEN_PROGS_x86_64 += x86_64/svm_int_ctl_test
-TEST_GEN_PROGS_x86_64 += x86_64/svm_nested_shutdown_test
-TEST_GEN_PROGS_x86_64 += x86_64/svm_nested_soft_inject_test
-TEST_GEN_PROGS_x86_64 += x86_64/tsc_scaling_sync
-TEST_GEN_PROGS_x86_64 += x86_64/sync_regs_test
-TEST_GEN_PROGS_x86_64 += x86_64/ucna_injection_test
-TEST_GEN_PROGS_x86_64 += x86_64/userspace_io_test
-TEST_GEN_PROGS_x86_64 += x86_64/userspace_msr_exit_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_apic_access_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_close_while_nested_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_dirty_log_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_exception_with_invalid_guest_state
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_msrs_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_invalid_nested_guest_state
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_set_nested_state_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_tsc_adjust_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_nested_tsc_scaling_test
-TEST_GEN_PROGS_x86_64 += x86_64/xapic_ipi_test
-TEST_GEN_PROGS_x86_64 += x86_64/xapic_state_test
-TEST_GEN_PROGS_x86_64 += x86_64/xss_msr_test
-TEST_GEN_PROGS_x86_64 += x86_64/debug_regs
-TEST_GEN_PROGS_x86_64 += x86_64/tsc_msrs_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_pmu_caps_test
-TEST_GEN_PROGS_x86_64 += x86_64/xen_shinfo_test
-TEST_GEN_PROGS_x86_64 += x86_64/xen_vmcall_test
-TEST_GEN_PROGS_x86_64 += x86_64/sev_migrate_tests
-TEST_GEN_PROGS_x86_64 += x86_64/amx_test
-TEST_GEN_PROGS_x86_64 += x86_64/max_vcpuid_cap_test
-TEST_GEN_PROGS_x86_64 += x86_64/triple_fault_event_test
-TEST_GEN_PROGS_x86_64 += access_tracking_perf_test
-TEST_GEN_PROGS_x86_64 += demand_paging_test
-TEST_GEN_PROGS_x86_64 += dirty_log_test
-TEST_GEN_PROGS_x86_64 += dirty_log_perf_test
-TEST_GEN_PROGS_x86_64 += hardware_disable_test
-TEST_GEN_PROGS_x86_64 += kvm_create_max_vcpus
-TEST_GEN_PROGS_x86_64 += kvm_page_table_test
-TEST_GEN_PROGS_x86_64 += max_guest_memory_test
-TEST_GEN_PROGS_x86_64 += memslot_modification_stress_test
-TEST_GEN_PROGS_x86_64 += memslot_perf_test
-TEST_GEN_PROGS_x86_64 += rseq_test
-TEST_GEN_PROGS_x86_64 += set_memory_region_test
-TEST_GEN_PROGS_x86_64 += steal_time
-TEST_GEN_PROGS_x86_64 += kvm_binary_stats_test
-TEST_GEN_PROGS_x86_64 += system_counter_offset_test
+TEST_PROGS := $(wildcard *.sh)
+TEST_PROGS += $(wildcard $(ARCH_DIR)/*.sh)
-# Compiled outputs used by test targets
-TEST_GEN_PROGS_EXTENDED_x86_64 += x86_64/nx_huge_pages_test
-
-TEST_GEN_PROGS_aarch64 += aarch64/aarch32_id_regs
-TEST_GEN_PROGS_aarch64 += aarch64/arch_timer
-TEST_GEN_PROGS_aarch64 += aarch64/debug-exceptions
-TEST_GEN_PROGS_aarch64 += aarch64/get-reg-list
-TEST_GEN_PROGS_aarch64 += aarch64/hypercalls
-TEST_GEN_PROGS_aarch64 += aarch64/page_fault_test
-TEST_GEN_PROGS_aarch64 += aarch64/psci_test
-TEST_GEN_PROGS_aarch64 += aarch64/vcpu_width_config
-TEST_GEN_PROGS_aarch64 += aarch64/vgic_init
-TEST_GEN_PROGS_aarch64 += aarch64/vgic_irq
-TEST_GEN_PROGS_aarch64 += access_tracking_perf_test
-TEST_GEN_PROGS_aarch64 += demand_paging_test
-TEST_GEN_PROGS_aarch64 += dirty_log_test
-TEST_GEN_PROGS_aarch64 += dirty_log_perf_test
-TEST_GEN_PROGS_aarch64 += kvm_create_max_vcpus
-TEST_GEN_PROGS_aarch64 += kvm_page_table_test
-TEST_GEN_PROGS_aarch64 += memslot_modification_stress_test
-TEST_GEN_PROGS_aarch64 += memslot_perf_test
-TEST_GEN_PROGS_aarch64 += rseq_test
-TEST_GEN_PROGS_aarch64 += set_memory_region_test
-TEST_GEN_PROGS_aarch64 += steal_time
-TEST_GEN_PROGS_aarch64 += kvm_binary_stats_test
-
-TEST_GEN_PROGS_s390x = s390x/memop
-TEST_GEN_PROGS_s390x += s390x/resets
-TEST_GEN_PROGS_s390x += s390x/sync_regs_test
-TEST_GEN_PROGS_s390x += s390x/tprot
-TEST_GEN_PROGS_s390x += demand_paging_test
-TEST_GEN_PROGS_s390x += dirty_log_test
-TEST_GEN_PROGS_s390x += kvm_create_max_vcpus
-TEST_GEN_PROGS_s390x += kvm_page_table_test
-TEST_GEN_PROGS_s390x += rseq_test
-TEST_GEN_PROGS_s390x += set_memory_region_test
-TEST_GEN_PROGS_s390x += kvm_binary_stats_test
-
-TEST_GEN_PROGS_riscv += demand_paging_test
-TEST_GEN_PROGS_riscv += dirty_log_test
-TEST_GEN_PROGS_riscv += kvm_create_max_vcpus
-TEST_GEN_PROGS_riscv += kvm_page_table_test
-TEST_GEN_PROGS_riscv += set_memory_region_test
-TEST_GEN_PROGS_riscv += kvm_binary_stats_test
-
-TEST_PROGS += $(TEST_PROGS_$(ARCH_DIR))
-TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(ARCH_DIR))
-TEST_GEN_PROGS_EXTENDED += $(TEST_GEN_PROGS_EXTENDED_$(ARCH_DIR))
-LIBKVM += $(LIBKVM_$(ARCH_DIR))
+TEST_GEN_PROGS := $(patsubst %.c, %, $(filter-out $(TEST_PROGS),$(TESTS_SRC)))
+TEST_GEN_PROGS_EXTENDED := $(patsubst %.c, %, $(filter $(TEST_PROGS),$(TESTS_SRC)))
# lib.mak defines $(OUTPUT), prepends $(OUTPUT)/ to $(TEST_GEN_PROGS), and most
# importantly defines, i.e. overwrites, $(CC) (unless `make -e` or `make CC=`,
diff --git a/tools/testing/selftests/kvm/access_tracking_perf_test.c b/tools/testing/selftests/kvm/access_tracking_perf_test.c
index 3c7defd34f56..a6e20103116e 100644
--- a/tools/testing/selftests/kvm/access_tracking_perf_test.c
+++ b/tools/testing/selftests/kvm/access_tracking_perf_test.c
@@ -48,6 +48,9 @@
#include "guest_modes.h"
#include "processor.h"
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
/* Global variable used to synchronize all of the vCPU threads. */
static int iteration;
diff --git a/tools/testing/selftests/kvm/dirty_log_perf_test.c b/tools/testing/selftests/kvm/dirty_log_perf_test.c
index e9d6d1aecf89..65ef1e1ddab9 100644
--- a/tools/testing/selftests/kvm/dirty_log_perf_test.c
+++ b/tools/testing/selftests/kvm/dirty_log_perf_test.c
@@ -19,6 +19,9 @@
#include "memstress.h"
#include "guest_modes.h"
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
#ifdef __aarch64__
#include "aarch64/vgic.h"
diff --git a/tools/testing/selftests/kvm/hardware_disable_test.c b/tools/testing/selftests/kvm/hardware_disable_test.c
index f5d59b9934f1..f844cdb93611 100644
--- a/tools/testing/selftests/kvm/hardware_disable_test.c
+++ b/tools/testing/selftests/kvm/hardware_disable_test.c
@@ -19,6 +19,10 @@
#include "kvm_util.h"
+TEST_UNSUPPORTED(aarch64);
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
#define VCPU_NUM 4
#define SLEEPING_THREAD_NUM (1 << 4)
#define FORK_NUM (1ULL << 9)
diff --git a/tools/testing/selftests/kvm/include/test_util.h b/tools/testing/selftests/kvm/include/test_util.h
index 80d6416f3012..fd94e94dfb78 100644
--- a/tools/testing/selftests/kvm/include/test_util.h
+++ b/tools/testing/selftests/kvm/include/test_util.h
@@ -20,6 +20,17 @@
#include <sys/mman.h>
#include "kselftest.h"
+/*
+ * Flags a common test as unsupported for a given architecture. Parsed during
+ * the build by the Makefile to filter out the test as appropriate.
+ */
+#define TEST_UNSUPPORTED(arch) \
+ static_assert(!strcmp(#arch, "aarch64") || \
+ !strcmp(#arch, "s390x") || \
+ !strcmp(#arch, "riscv") || \
+ !strcmp(#arch, "x86_64"), \
+ "Unsupported architecture: " #arch)
+
static inline int _no_printf(const char *format, ...) { return 0; }
#ifdef DEBUG
diff --git a/tools/testing/selftests/kvm/max_guest_memory_test.c b/tools/testing/selftests/kvm/max_guest_memory_test.c
index feaf2be20ff2..d5bc0cce1e36 100644
--- a/tools/testing/selftests/kvm/max_guest_memory_test.c
+++ b/tools/testing/selftests/kvm/max_guest_memory_test.c
@@ -18,6 +18,10 @@
#include "guest_modes.h"
#include "processor.h"
+TEST_UNSUPPORTED(aarch64);
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
static void guest_code(uint64_t start_gpa, uint64_t end_gpa, uint64_t stride)
{
uint64_t gpa;
diff --git a/tools/testing/selftests/kvm/memslot_modification_stress_test.c b/tools/testing/selftests/kvm/memslot_modification_stress_test.c
index 9855c41ca811..b9bdbde664f4 100644
--- a/tools/testing/selftests/kvm/memslot_modification_stress_test.c
+++ b/tools/testing/selftests/kvm/memslot_modification_stress_test.c
@@ -26,6 +26,9 @@
#include "test_util.h"
#include "guest_modes.h"
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
#define DUMMY_MEMSLOT_INDEX 7
#define DEFAULT_MEMSLOT_MODIFICATION_ITERATIONS 10
diff --git a/tools/testing/selftests/kvm/memslot_perf_test.c b/tools/testing/selftests/kvm/memslot_perf_test.c
index e6587e193490..37085d2c2a03 100644
--- a/tools/testing/selftests/kvm/memslot_perf_test.c
+++ b/tools/testing/selftests/kvm/memslot_perf_test.c
@@ -26,6 +26,9 @@
#include <kvm_util.h>
#include <processor.h>
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
#define MEM_EXTRA_SIZE SZ_64K
#define MEM_SIZE (SZ_512M + MEM_EXTRA_SIZE)
diff --git a/tools/testing/selftests/kvm/rseq_test.c b/tools/testing/selftests/kvm/rseq_test.c
index 3045fdf9bdf5..34c3df9b4e81 100644
--- a/tools/testing/selftests/kvm/rseq_test.c
+++ b/tools/testing/selftests/kvm/rseq_test.c
@@ -22,6 +22,8 @@
#include "../rseq/rseq.c"
+TEST_UNSUPPORTED(riscv);
+
/*
* Any bug related to task migration is likely to be timing-dependent; perform
* a large number of migrations to reduce the odds of a false negative.
diff --git a/tools/testing/selftests/kvm/steal_time.c b/tools/testing/selftests/kvm/steal_time.c
index c87f38712073..66f873ea8a73 100644
--- a/tools/testing/selftests/kvm/steal_time.c
+++ b/tools/testing/selftests/kvm/steal_time.c
@@ -17,6 +17,9 @@
#include "kvm_util.h"
#include "processor.h"
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
#define NR_VCPUS 4
#define ST_GPA_BASE (1 << 30)
diff --git a/tools/testing/selftests/kvm/system_counter_offset_test.c b/tools/testing/selftests/kvm/system_counter_offset_test.c
index 7f5b330b6a1b..dc7f5dc5fbcc 100644
--- a/tools/testing/selftests/kvm/system_counter_offset_test.c
+++ b/tools/testing/selftests/kvm/system_counter_offset_test.c
@@ -14,6 +14,10 @@
#include "kvm_util.h"
#include "processor.h"
+TEST_UNSUPPORTED(aarch64);
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
#ifdef __x86_64__
struct test_case {
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 13/14] KVM: selftests: Use wildcards to find targets and test source files
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Use $(wildcard ...) to find the test targets (.sh files) and test source
files (.c and .S) instead of manually adding files/targets for every
architecture, which is a maintenance burden and error prone, e.g. RISC-V
supports RSEQ but doesn't build the test for reasons unknown.
To deal with common tests that are only supported on a subset of
architectures, add a dummy macro TEST_UNSUPPORTED() that tests can use
to declare the test as unsupported for a given architecture, and filter
out unsupported tests for the target architecture via grep. As a bonus,
explicitly naming unsupported architectures will also force developers to
opt-out of architectures (or opt-out of tests when adding a new arch).
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 128 +-----------------
.../selftests/kvm/access_tracking_perf_test.c | 3 +
.../selftests/kvm/dirty_log_perf_test.c | 3 +
.../selftests/kvm/hardware_disable_test.c | 4 +
.../testing/selftests/kvm/include/test_util.h | 11 ++
.../selftests/kvm/max_guest_memory_test.c | 4 +
.../kvm/memslot_modification_stress_test.c | 3 +
.../testing/selftests/kvm/memslot_perf_test.c | 3 +
tools/testing/selftests/kvm/rseq_test.c | 2 +
tools/testing/selftests/kvm/steal_time.c | 3 +
.../kvm/system_counter_offset_test.c | 4 +
11 files changed, 46 insertions(+), 122 deletions(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index a9930e9197da..76382850a28f 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -19,130 +19,14 @@ else
$(error Unknown architecture '$(ARCH)')
endif
-# Non-compiled test targets
-TEST_PROGS_x86_64 += x86_64/nx_huge_pages_test.sh
+TESTS_SRC := $(shell grep -L TEST_UNSUPPORTED\($(ARCH_DIR)\) *.c)
+TESTS_SRC += $(wildcard $(ARCH_DIR)/*.c)
-# Compiled test targets
-TEST_GEN_PROGS_x86_64 = x86_64/cpuid_test
-TEST_GEN_PROGS_x86_64 += x86_64/cr4_cpuid_sync_test
-TEST_GEN_PROGS_x86_64 += x86_64/get_msr_index_features
-TEST_GEN_PROGS_x86_64 += x86_64/exit_on_emulation_failure_test
-TEST_GEN_PROGS_x86_64 += x86_64/fix_hypercall_test
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_clock
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_cpuid
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_evmcs
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_features
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_ipi
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_svm_test
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_tlb_flush
-TEST_GEN_PROGS_x86_64 += x86_64/kvm_clock_test
-TEST_GEN_PROGS_x86_64 += x86_64/kvm_pv_test
-TEST_GEN_PROGS_x86_64 += x86_64/mmio_warning_test
-TEST_GEN_PROGS_x86_64 += x86_64/monitor_mwait_test
-TEST_GEN_PROGS_x86_64 += x86_64/nested_exceptions_test
-TEST_GEN_PROGS_x86_64 += x86_64/platform_info_test
-TEST_GEN_PROGS_x86_64 += x86_64/pmu_event_filter_test
-TEST_GEN_PROGS_x86_64 += x86_64/set_boot_cpu_id
-TEST_GEN_PROGS_x86_64 += x86_64/set_sregs_test
-TEST_GEN_PROGS_x86_64 += x86_64/smaller_maxphyaddr_emulation_test
-TEST_GEN_PROGS_x86_64 += x86_64/smm_test
-TEST_GEN_PROGS_x86_64 += x86_64/state_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_preemption_timer_test
-TEST_GEN_PROGS_x86_64 += x86_64/svm_vmcall_test
-TEST_GEN_PROGS_x86_64 += x86_64/svm_int_ctl_test
-TEST_GEN_PROGS_x86_64 += x86_64/svm_nested_shutdown_test
-TEST_GEN_PROGS_x86_64 += x86_64/svm_nested_soft_inject_test
-TEST_GEN_PROGS_x86_64 += x86_64/tsc_scaling_sync
-TEST_GEN_PROGS_x86_64 += x86_64/sync_regs_test
-TEST_GEN_PROGS_x86_64 += x86_64/ucna_injection_test
-TEST_GEN_PROGS_x86_64 += x86_64/userspace_io_test
-TEST_GEN_PROGS_x86_64 += x86_64/userspace_msr_exit_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_apic_access_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_close_while_nested_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_dirty_log_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_exception_with_invalid_guest_state
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_msrs_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_invalid_nested_guest_state
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_set_nested_state_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_tsc_adjust_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_nested_tsc_scaling_test
-TEST_GEN_PROGS_x86_64 += x86_64/xapic_ipi_test
-TEST_GEN_PROGS_x86_64 += x86_64/xapic_state_test
-TEST_GEN_PROGS_x86_64 += x86_64/xss_msr_test
-TEST_GEN_PROGS_x86_64 += x86_64/debug_regs
-TEST_GEN_PROGS_x86_64 += x86_64/tsc_msrs_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_pmu_caps_test
-TEST_GEN_PROGS_x86_64 += x86_64/xen_shinfo_test
-TEST_GEN_PROGS_x86_64 += x86_64/xen_vmcall_test
-TEST_GEN_PROGS_x86_64 += x86_64/sev_migrate_tests
-TEST_GEN_PROGS_x86_64 += x86_64/amx_test
-TEST_GEN_PROGS_x86_64 += x86_64/max_vcpuid_cap_test
-TEST_GEN_PROGS_x86_64 += x86_64/triple_fault_event_test
-TEST_GEN_PROGS_x86_64 += access_tracking_perf_test
-TEST_GEN_PROGS_x86_64 += demand_paging_test
-TEST_GEN_PROGS_x86_64 += dirty_log_test
-TEST_GEN_PROGS_x86_64 += dirty_log_perf_test
-TEST_GEN_PROGS_x86_64 += hardware_disable_test
-TEST_GEN_PROGS_x86_64 += kvm_create_max_vcpus
-TEST_GEN_PROGS_x86_64 += kvm_page_table_test
-TEST_GEN_PROGS_x86_64 += max_guest_memory_test
-TEST_GEN_PROGS_x86_64 += memslot_modification_stress_test
-TEST_GEN_PROGS_x86_64 += memslot_perf_test
-TEST_GEN_PROGS_x86_64 += rseq_test
-TEST_GEN_PROGS_x86_64 += set_memory_region_test
-TEST_GEN_PROGS_x86_64 += steal_time
-TEST_GEN_PROGS_x86_64 += kvm_binary_stats_test
-TEST_GEN_PROGS_x86_64 += system_counter_offset_test
+TEST_PROGS := $(wildcard *.sh)
+TEST_PROGS += $(wildcard $(ARCH_DIR)/*.sh)
-# Compiled outputs used by test targets
-TEST_GEN_PROGS_EXTENDED_x86_64 += x86_64/nx_huge_pages_test
-
-TEST_GEN_PROGS_aarch64 += aarch64/aarch32_id_regs
-TEST_GEN_PROGS_aarch64 += aarch64/arch_timer
-TEST_GEN_PROGS_aarch64 += aarch64/debug-exceptions
-TEST_GEN_PROGS_aarch64 += aarch64/get-reg-list
-TEST_GEN_PROGS_aarch64 += aarch64/hypercalls
-TEST_GEN_PROGS_aarch64 += aarch64/page_fault_test
-TEST_GEN_PROGS_aarch64 += aarch64/psci_test
-TEST_GEN_PROGS_aarch64 += aarch64/vcpu_width_config
-TEST_GEN_PROGS_aarch64 += aarch64/vgic_init
-TEST_GEN_PROGS_aarch64 += aarch64/vgic_irq
-TEST_GEN_PROGS_aarch64 += access_tracking_perf_test
-TEST_GEN_PROGS_aarch64 += demand_paging_test
-TEST_GEN_PROGS_aarch64 += dirty_log_test
-TEST_GEN_PROGS_aarch64 += dirty_log_perf_test
-TEST_GEN_PROGS_aarch64 += kvm_create_max_vcpus
-TEST_GEN_PROGS_aarch64 += kvm_page_table_test
-TEST_GEN_PROGS_aarch64 += memslot_modification_stress_test
-TEST_GEN_PROGS_aarch64 += memslot_perf_test
-TEST_GEN_PROGS_aarch64 += rseq_test
-TEST_GEN_PROGS_aarch64 += set_memory_region_test
-TEST_GEN_PROGS_aarch64 += steal_time
-TEST_GEN_PROGS_aarch64 += kvm_binary_stats_test
-
-TEST_GEN_PROGS_s390x = s390x/memop
-TEST_GEN_PROGS_s390x += s390x/resets
-TEST_GEN_PROGS_s390x += s390x/sync_regs_test
-TEST_GEN_PROGS_s390x += s390x/tprot
-TEST_GEN_PROGS_s390x += demand_paging_test
-TEST_GEN_PROGS_s390x += dirty_log_test
-TEST_GEN_PROGS_s390x += kvm_create_max_vcpus
-TEST_GEN_PROGS_s390x += kvm_page_table_test
-TEST_GEN_PROGS_s390x += rseq_test
-TEST_GEN_PROGS_s390x += set_memory_region_test
-TEST_GEN_PROGS_s390x += kvm_binary_stats_test
-
-TEST_GEN_PROGS_riscv += demand_paging_test
-TEST_GEN_PROGS_riscv += dirty_log_test
-TEST_GEN_PROGS_riscv += kvm_create_max_vcpus
-TEST_GEN_PROGS_riscv += kvm_page_table_test
-TEST_GEN_PROGS_riscv += set_memory_region_test
-TEST_GEN_PROGS_riscv += kvm_binary_stats_test
-
-TEST_PROGS += $(TEST_PROGS_$(ARCH_DIR))
-TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(ARCH_DIR))
-TEST_GEN_PROGS_EXTENDED += $(TEST_GEN_PROGS_EXTENDED_$(ARCH_DIR))
-LIBKVM += $(LIBKVM_$(ARCH_DIR))
+TEST_GEN_PROGS := $(patsubst %.c, %, $(filter-out $(TEST_PROGS),$(TESTS_SRC)))
+TEST_GEN_PROGS_EXTENDED := $(patsubst %.c, %, $(filter $(TEST_PROGS),$(TESTS_SRC)))
# lib.mak defines $(OUTPUT), prepends $(OUTPUT)/ to $(TEST_GEN_PROGS), and most
# importantly defines, i.e. overwrites, $(CC) (unless `make -e` or `make CC=`,
diff --git a/tools/testing/selftests/kvm/access_tracking_perf_test.c b/tools/testing/selftests/kvm/access_tracking_perf_test.c
index 3c7defd34f56..a6e20103116e 100644
--- a/tools/testing/selftests/kvm/access_tracking_perf_test.c
+++ b/tools/testing/selftests/kvm/access_tracking_perf_test.c
@@ -48,6 +48,9 @@
#include "guest_modes.h"
#include "processor.h"
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
/* Global variable used to synchronize all of the vCPU threads. */
static int iteration;
diff --git a/tools/testing/selftests/kvm/dirty_log_perf_test.c b/tools/testing/selftests/kvm/dirty_log_perf_test.c
index e9d6d1aecf89..65ef1e1ddab9 100644
--- a/tools/testing/selftests/kvm/dirty_log_perf_test.c
+++ b/tools/testing/selftests/kvm/dirty_log_perf_test.c
@@ -19,6 +19,9 @@
#include "memstress.h"
#include "guest_modes.h"
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
#ifdef __aarch64__
#include "aarch64/vgic.h"
diff --git a/tools/testing/selftests/kvm/hardware_disable_test.c b/tools/testing/selftests/kvm/hardware_disable_test.c
index f5d59b9934f1..f844cdb93611 100644
--- a/tools/testing/selftests/kvm/hardware_disable_test.c
+++ b/tools/testing/selftests/kvm/hardware_disable_test.c
@@ -19,6 +19,10 @@
#include "kvm_util.h"
+TEST_UNSUPPORTED(aarch64);
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
#define VCPU_NUM 4
#define SLEEPING_THREAD_NUM (1 << 4)
#define FORK_NUM (1ULL << 9)
diff --git a/tools/testing/selftests/kvm/include/test_util.h b/tools/testing/selftests/kvm/include/test_util.h
index 80d6416f3012..fd94e94dfb78 100644
--- a/tools/testing/selftests/kvm/include/test_util.h
+++ b/tools/testing/selftests/kvm/include/test_util.h
@@ -20,6 +20,17 @@
#include <sys/mman.h>
#include "kselftest.h"
+/*
+ * Flags a common test as unsupported for a given architecture. Parsed during
+ * the build by the Makefile to filter out the test as appropriate.
+ */
+#define TEST_UNSUPPORTED(arch) \
+ static_assert(!strcmp(#arch, "aarch64") || \
+ !strcmp(#arch, "s390x") || \
+ !strcmp(#arch, "riscv") || \
+ !strcmp(#arch, "x86_64"), \
+ "Unsupported architecture: " #arch)
+
static inline int _no_printf(const char *format, ...) { return 0; }
#ifdef DEBUG
diff --git a/tools/testing/selftests/kvm/max_guest_memory_test.c b/tools/testing/selftests/kvm/max_guest_memory_test.c
index feaf2be20ff2..d5bc0cce1e36 100644
--- a/tools/testing/selftests/kvm/max_guest_memory_test.c
+++ b/tools/testing/selftests/kvm/max_guest_memory_test.c
@@ -18,6 +18,10 @@
#include "guest_modes.h"
#include "processor.h"
+TEST_UNSUPPORTED(aarch64);
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
static void guest_code(uint64_t start_gpa, uint64_t end_gpa, uint64_t stride)
{
uint64_t gpa;
diff --git a/tools/testing/selftests/kvm/memslot_modification_stress_test.c b/tools/testing/selftests/kvm/memslot_modification_stress_test.c
index 9855c41ca811..b9bdbde664f4 100644
--- a/tools/testing/selftests/kvm/memslot_modification_stress_test.c
+++ b/tools/testing/selftests/kvm/memslot_modification_stress_test.c
@@ -26,6 +26,9 @@
#include "test_util.h"
#include "guest_modes.h"
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
#define DUMMY_MEMSLOT_INDEX 7
#define DEFAULT_MEMSLOT_MODIFICATION_ITERATIONS 10
diff --git a/tools/testing/selftests/kvm/memslot_perf_test.c b/tools/testing/selftests/kvm/memslot_perf_test.c
index e6587e193490..37085d2c2a03 100644
--- a/tools/testing/selftests/kvm/memslot_perf_test.c
+++ b/tools/testing/selftests/kvm/memslot_perf_test.c
@@ -26,6 +26,9 @@
#include <kvm_util.h>
#include <processor.h>
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
#define MEM_EXTRA_SIZE SZ_64K
#define MEM_SIZE (SZ_512M + MEM_EXTRA_SIZE)
diff --git a/tools/testing/selftests/kvm/rseq_test.c b/tools/testing/selftests/kvm/rseq_test.c
index 3045fdf9bdf5..34c3df9b4e81 100644
--- a/tools/testing/selftests/kvm/rseq_test.c
+++ b/tools/testing/selftests/kvm/rseq_test.c
@@ -22,6 +22,8 @@
#include "../rseq/rseq.c"
+TEST_UNSUPPORTED(riscv);
+
/*
* Any bug related to task migration is likely to be timing-dependent; perform
* a large number of migrations to reduce the odds of a false negative.
diff --git a/tools/testing/selftests/kvm/steal_time.c b/tools/testing/selftests/kvm/steal_time.c
index c87f38712073..66f873ea8a73 100644
--- a/tools/testing/selftests/kvm/steal_time.c
+++ b/tools/testing/selftests/kvm/steal_time.c
@@ -17,6 +17,9 @@
#include "kvm_util.h"
#include "processor.h"
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
#define NR_VCPUS 4
#define ST_GPA_BASE (1 << 30)
diff --git a/tools/testing/selftests/kvm/system_counter_offset_test.c b/tools/testing/selftests/kvm/system_counter_offset_test.c
index 7f5b330b6a1b..dc7f5dc5fbcc 100644
--- a/tools/testing/selftests/kvm/system_counter_offset_test.c
+++ b/tools/testing/selftests/kvm/system_counter_offset_test.c
@@ -14,6 +14,10 @@
#include "kvm_util.h"
#include "processor.h"
+TEST_UNSUPPORTED(aarch64);
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
#ifdef __x86_64__
struct test_case {
--
2.39.0.rc1.256.g54fd8350bd-goog
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 13/14] KVM: selftests: Use wildcards to find targets and test source files
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Use $(wildcard ...) to find the test targets (.sh files) and test source
files (.c and .S) instead of manually adding files/targets for every
architecture, which is a maintenance burden and error prone, e.g. RISC-V
supports RSEQ but doesn't build the test for reasons unknown.
To deal with common tests that are only supported on a subset of
architectures, add a dummy macro TEST_UNSUPPORTED() that tests can use
to declare the test as unsupported for a given architecture, and filter
out unsupported tests for the target architecture via grep. As a bonus,
explicitly naming unsupported architectures will also force developers to
opt-out of architectures (or opt-out of tests when adding a new arch).
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 128 +-----------------
.../selftests/kvm/access_tracking_perf_test.c | 3 +
.../selftests/kvm/dirty_log_perf_test.c | 3 +
.../selftests/kvm/hardware_disable_test.c | 4 +
.../testing/selftests/kvm/include/test_util.h | 11 ++
.../selftests/kvm/max_guest_memory_test.c | 4 +
.../kvm/memslot_modification_stress_test.c | 3 +
.../testing/selftests/kvm/memslot_perf_test.c | 3 +
tools/testing/selftests/kvm/rseq_test.c | 2 +
tools/testing/selftests/kvm/steal_time.c | 3 +
.../kvm/system_counter_offset_test.c | 4 +
11 files changed, 46 insertions(+), 122 deletions(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index a9930e9197da..76382850a28f 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -19,130 +19,14 @@ else
$(error Unknown architecture '$(ARCH)')
endif
-# Non-compiled test targets
-TEST_PROGS_x86_64 += x86_64/nx_huge_pages_test.sh
+TESTS_SRC := $(shell grep -L TEST_UNSUPPORTED\($(ARCH_DIR)\) *.c)
+TESTS_SRC += $(wildcard $(ARCH_DIR)/*.c)
-# Compiled test targets
-TEST_GEN_PROGS_x86_64 = x86_64/cpuid_test
-TEST_GEN_PROGS_x86_64 += x86_64/cr4_cpuid_sync_test
-TEST_GEN_PROGS_x86_64 += x86_64/get_msr_index_features
-TEST_GEN_PROGS_x86_64 += x86_64/exit_on_emulation_failure_test
-TEST_GEN_PROGS_x86_64 += x86_64/fix_hypercall_test
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_clock
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_cpuid
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_evmcs
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_features
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_ipi
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_svm_test
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_tlb_flush
-TEST_GEN_PROGS_x86_64 += x86_64/kvm_clock_test
-TEST_GEN_PROGS_x86_64 += x86_64/kvm_pv_test
-TEST_GEN_PROGS_x86_64 += x86_64/mmio_warning_test
-TEST_GEN_PROGS_x86_64 += x86_64/monitor_mwait_test
-TEST_GEN_PROGS_x86_64 += x86_64/nested_exceptions_test
-TEST_GEN_PROGS_x86_64 += x86_64/platform_info_test
-TEST_GEN_PROGS_x86_64 += x86_64/pmu_event_filter_test
-TEST_GEN_PROGS_x86_64 += x86_64/set_boot_cpu_id
-TEST_GEN_PROGS_x86_64 += x86_64/set_sregs_test
-TEST_GEN_PROGS_x86_64 += x86_64/smaller_maxphyaddr_emulation_test
-TEST_GEN_PROGS_x86_64 += x86_64/smm_test
-TEST_GEN_PROGS_x86_64 += x86_64/state_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_preemption_timer_test
-TEST_GEN_PROGS_x86_64 += x86_64/svm_vmcall_test
-TEST_GEN_PROGS_x86_64 += x86_64/svm_int_ctl_test
-TEST_GEN_PROGS_x86_64 += x86_64/svm_nested_shutdown_test
-TEST_GEN_PROGS_x86_64 += x86_64/svm_nested_soft_inject_test
-TEST_GEN_PROGS_x86_64 += x86_64/tsc_scaling_sync
-TEST_GEN_PROGS_x86_64 += x86_64/sync_regs_test
-TEST_GEN_PROGS_x86_64 += x86_64/ucna_injection_test
-TEST_GEN_PROGS_x86_64 += x86_64/userspace_io_test
-TEST_GEN_PROGS_x86_64 += x86_64/userspace_msr_exit_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_apic_access_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_close_while_nested_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_dirty_log_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_exception_with_invalid_guest_state
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_msrs_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_invalid_nested_guest_state
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_set_nested_state_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_tsc_adjust_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_nested_tsc_scaling_test
-TEST_GEN_PROGS_x86_64 += x86_64/xapic_ipi_test
-TEST_GEN_PROGS_x86_64 += x86_64/xapic_state_test
-TEST_GEN_PROGS_x86_64 += x86_64/xss_msr_test
-TEST_GEN_PROGS_x86_64 += x86_64/debug_regs
-TEST_GEN_PROGS_x86_64 += x86_64/tsc_msrs_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_pmu_caps_test
-TEST_GEN_PROGS_x86_64 += x86_64/xen_shinfo_test
-TEST_GEN_PROGS_x86_64 += x86_64/xen_vmcall_test
-TEST_GEN_PROGS_x86_64 += x86_64/sev_migrate_tests
-TEST_GEN_PROGS_x86_64 += x86_64/amx_test
-TEST_GEN_PROGS_x86_64 += x86_64/max_vcpuid_cap_test
-TEST_GEN_PROGS_x86_64 += x86_64/triple_fault_event_test
-TEST_GEN_PROGS_x86_64 += access_tracking_perf_test
-TEST_GEN_PROGS_x86_64 += demand_paging_test
-TEST_GEN_PROGS_x86_64 += dirty_log_test
-TEST_GEN_PROGS_x86_64 += dirty_log_perf_test
-TEST_GEN_PROGS_x86_64 += hardware_disable_test
-TEST_GEN_PROGS_x86_64 += kvm_create_max_vcpus
-TEST_GEN_PROGS_x86_64 += kvm_page_table_test
-TEST_GEN_PROGS_x86_64 += max_guest_memory_test
-TEST_GEN_PROGS_x86_64 += memslot_modification_stress_test
-TEST_GEN_PROGS_x86_64 += memslot_perf_test
-TEST_GEN_PROGS_x86_64 += rseq_test
-TEST_GEN_PROGS_x86_64 += set_memory_region_test
-TEST_GEN_PROGS_x86_64 += steal_time
-TEST_GEN_PROGS_x86_64 += kvm_binary_stats_test
-TEST_GEN_PROGS_x86_64 += system_counter_offset_test
+TEST_PROGS := $(wildcard *.sh)
+TEST_PROGS += $(wildcard $(ARCH_DIR)/*.sh)
-# Compiled outputs used by test targets
-TEST_GEN_PROGS_EXTENDED_x86_64 += x86_64/nx_huge_pages_test
-
-TEST_GEN_PROGS_aarch64 += aarch64/aarch32_id_regs
-TEST_GEN_PROGS_aarch64 += aarch64/arch_timer
-TEST_GEN_PROGS_aarch64 += aarch64/debug-exceptions
-TEST_GEN_PROGS_aarch64 += aarch64/get-reg-list
-TEST_GEN_PROGS_aarch64 += aarch64/hypercalls
-TEST_GEN_PROGS_aarch64 += aarch64/page_fault_test
-TEST_GEN_PROGS_aarch64 += aarch64/psci_test
-TEST_GEN_PROGS_aarch64 += aarch64/vcpu_width_config
-TEST_GEN_PROGS_aarch64 += aarch64/vgic_init
-TEST_GEN_PROGS_aarch64 += aarch64/vgic_irq
-TEST_GEN_PROGS_aarch64 += access_tracking_perf_test
-TEST_GEN_PROGS_aarch64 += demand_paging_test
-TEST_GEN_PROGS_aarch64 += dirty_log_test
-TEST_GEN_PROGS_aarch64 += dirty_log_perf_test
-TEST_GEN_PROGS_aarch64 += kvm_create_max_vcpus
-TEST_GEN_PROGS_aarch64 += kvm_page_table_test
-TEST_GEN_PROGS_aarch64 += memslot_modification_stress_test
-TEST_GEN_PROGS_aarch64 += memslot_perf_test
-TEST_GEN_PROGS_aarch64 += rseq_test
-TEST_GEN_PROGS_aarch64 += set_memory_region_test
-TEST_GEN_PROGS_aarch64 += steal_time
-TEST_GEN_PROGS_aarch64 += kvm_binary_stats_test
-
-TEST_GEN_PROGS_s390x = s390x/memop
-TEST_GEN_PROGS_s390x += s390x/resets
-TEST_GEN_PROGS_s390x += s390x/sync_regs_test
-TEST_GEN_PROGS_s390x += s390x/tprot
-TEST_GEN_PROGS_s390x += demand_paging_test
-TEST_GEN_PROGS_s390x += dirty_log_test
-TEST_GEN_PROGS_s390x += kvm_create_max_vcpus
-TEST_GEN_PROGS_s390x += kvm_page_table_test
-TEST_GEN_PROGS_s390x += rseq_test
-TEST_GEN_PROGS_s390x += set_memory_region_test
-TEST_GEN_PROGS_s390x += kvm_binary_stats_test
-
-TEST_GEN_PROGS_riscv += demand_paging_test
-TEST_GEN_PROGS_riscv += dirty_log_test
-TEST_GEN_PROGS_riscv += kvm_create_max_vcpus
-TEST_GEN_PROGS_riscv += kvm_page_table_test
-TEST_GEN_PROGS_riscv += set_memory_region_test
-TEST_GEN_PROGS_riscv += kvm_binary_stats_test
-
-TEST_PROGS += $(TEST_PROGS_$(ARCH_DIR))
-TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(ARCH_DIR))
-TEST_GEN_PROGS_EXTENDED += $(TEST_GEN_PROGS_EXTENDED_$(ARCH_DIR))
-LIBKVM += $(LIBKVM_$(ARCH_DIR))
+TEST_GEN_PROGS := $(patsubst %.c, %, $(filter-out $(TEST_PROGS),$(TESTS_SRC)))
+TEST_GEN_PROGS_EXTENDED := $(patsubst %.c, %, $(filter $(TEST_PROGS),$(TESTS_SRC)))
# lib.mak defines $(OUTPUT), prepends $(OUTPUT)/ to $(TEST_GEN_PROGS), and most
# importantly defines, i.e. overwrites, $(CC) (unless `make -e` or `make CC=`,
diff --git a/tools/testing/selftests/kvm/access_tracking_perf_test.c b/tools/testing/selftests/kvm/access_tracking_perf_test.c
index 3c7defd34f56..a6e20103116e 100644
--- a/tools/testing/selftests/kvm/access_tracking_perf_test.c
+++ b/tools/testing/selftests/kvm/access_tracking_perf_test.c
@@ -48,6 +48,9 @@
#include "guest_modes.h"
#include "processor.h"
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
/* Global variable used to synchronize all of the vCPU threads. */
static int iteration;
diff --git a/tools/testing/selftests/kvm/dirty_log_perf_test.c b/tools/testing/selftests/kvm/dirty_log_perf_test.c
index e9d6d1aecf89..65ef1e1ddab9 100644
--- a/tools/testing/selftests/kvm/dirty_log_perf_test.c
+++ b/tools/testing/selftests/kvm/dirty_log_perf_test.c
@@ -19,6 +19,9 @@
#include "memstress.h"
#include "guest_modes.h"
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
#ifdef __aarch64__
#include "aarch64/vgic.h"
diff --git a/tools/testing/selftests/kvm/hardware_disable_test.c b/tools/testing/selftests/kvm/hardware_disable_test.c
index f5d59b9934f1..f844cdb93611 100644
--- a/tools/testing/selftests/kvm/hardware_disable_test.c
+++ b/tools/testing/selftests/kvm/hardware_disable_test.c
@@ -19,6 +19,10 @@
#include "kvm_util.h"
+TEST_UNSUPPORTED(aarch64);
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
#define VCPU_NUM 4
#define SLEEPING_THREAD_NUM (1 << 4)
#define FORK_NUM (1ULL << 9)
diff --git a/tools/testing/selftests/kvm/include/test_util.h b/tools/testing/selftests/kvm/include/test_util.h
index 80d6416f3012..fd94e94dfb78 100644
--- a/tools/testing/selftests/kvm/include/test_util.h
+++ b/tools/testing/selftests/kvm/include/test_util.h
@@ -20,6 +20,17 @@
#include <sys/mman.h>
#include "kselftest.h"
+/*
+ * Flags a common test as unsupported for a given architecture. Parsed during
+ * the build by the Makefile to filter out the test as appropriate.
+ */
+#define TEST_UNSUPPORTED(arch) \
+ static_assert(!strcmp(#arch, "aarch64") || \
+ !strcmp(#arch, "s390x") || \
+ !strcmp(#arch, "riscv") || \
+ !strcmp(#arch, "x86_64"), \
+ "Unsupported architecture: " #arch)
+
static inline int _no_printf(const char *format, ...) { return 0; }
#ifdef DEBUG
diff --git a/tools/testing/selftests/kvm/max_guest_memory_test.c b/tools/testing/selftests/kvm/max_guest_memory_test.c
index feaf2be20ff2..d5bc0cce1e36 100644
--- a/tools/testing/selftests/kvm/max_guest_memory_test.c
+++ b/tools/testing/selftests/kvm/max_guest_memory_test.c
@@ -18,6 +18,10 @@
#include "guest_modes.h"
#include "processor.h"
+TEST_UNSUPPORTED(aarch64);
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
static void guest_code(uint64_t start_gpa, uint64_t end_gpa, uint64_t stride)
{
uint64_t gpa;
diff --git a/tools/testing/selftests/kvm/memslot_modification_stress_test.c b/tools/testing/selftests/kvm/memslot_modification_stress_test.c
index 9855c41ca811..b9bdbde664f4 100644
--- a/tools/testing/selftests/kvm/memslot_modification_stress_test.c
+++ b/tools/testing/selftests/kvm/memslot_modification_stress_test.c
@@ -26,6 +26,9 @@
#include "test_util.h"
#include "guest_modes.h"
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
#define DUMMY_MEMSLOT_INDEX 7
#define DEFAULT_MEMSLOT_MODIFICATION_ITERATIONS 10
diff --git a/tools/testing/selftests/kvm/memslot_perf_test.c b/tools/testing/selftests/kvm/memslot_perf_test.c
index e6587e193490..37085d2c2a03 100644
--- a/tools/testing/selftests/kvm/memslot_perf_test.c
+++ b/tools/testing/selftests/kvm/memslot_perf_test.c
@@ -26,6 +26,9 @@
#include <kvm_util.h>
#include <processor.h>
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
#define MEM_EXTRA_SIZE SZ_64K
#define MEM_SIZE (SZ_512M + MEM_EXTRA_SIZE)
diff --git a/tools/testing/selftests/kvm/rseq_test.c b/tools/testing/selftests/kvm/rseq_test.c
index 3045fdf9bdf5..34c3df9b4e81 100644
--- a/tools/testing/selftests/kvm/rseq_test.c
+++ b/tools/testing/selftests/kvm/rseq_test.c
@@ -22,6 +22,8 @@
#include "../rseq/rseq.c"
+TEST_UNSUPPORTED(riscv);
+
/*
* Any bug related to task migration is likely to be timing-dependent; perform
* a large number of migrations to reduce the odds of a false negative.
diff --git a/tools/testing/selftests/kvm/steal_time.c b/tools/testing/selftests/kvm/steal_time.c
index c87f38712073..66f873ea8a73 100644
--- a/tools/testing/selftests/kvm/steal_time.c
+++ b/tools/testing/selftests/kvm/steal_time.c
@@ -17,6 +17,9 @@
#include "kvm_util.h"
#include "processor.h"
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
#define NR_VCPUS 4
#define ST_GPA_BASE (1 << 30)
diff --git a/tools/testing/selftests/kvm/system_counter_offset_test.c b/tools/testing/selftests/kvm/system_counter_offset_test.c
index 7f5b330b6a1b..dc7f5dc5fbcc 100644
--- a/tools/testing/selftests/kvm/system_counter_offset_test.c
+++ b/tools/testing/selftests/kvm/system_counter_offset_test.c
@@ -14,6 +14,10 @@
#include "kvm_util.h"
#include "processor.h"
+TEST_UNSUPPORTED(aarch64);
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
#ifdef __x86_64__
struct test_case {
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 13/14] KVM: selftests: Use wildcards to find targets and test source files
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Use $(wildcard ...) to find the test targets (.sh files) and test source
files (.c and .S) instead of manually adding files/targets for every
architecture, which is a maintenance burden and error prone, e.g. RISC-V
supports RSEQ but doesn't build the test for reasons unknown.
To deal with common tests that are only supported on a subset of
architectures, add a dummy macro TEST_UNSUPPORTED() that tests can use
to declare the test as unsupported for a given architecture, and filter
out unsupported tests for the target architecture via grep. As a bonus,
explicitly naming unsupported architectures will also force developers to
opt-out of architectures (or opt-out of tests when adding a new arch).
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 128 +-----------------
.../selftests/kvm/access_tracking_perf_test.c | 3 +
.../selftests/kvm/dirty_log_perf_test.c | 3 +
.../selftests/kvm/hardware_disable_test.c | 4 +
.../testing/selftests/kvm/include/test_util.h | 11 ++
.../selftests/kvm/max_guest_memory_test.c | 4 +
.../kvm/memslot_modification_stress_test.c | 3 +
.../testing/selftests/kvm/memslot_perf_test.c | 3 +
tools/testing/selftests/kvm/rseq_test.c | 2 +
tools/testing/selftests/kvm/steal_time.c | 3 +
.../kvm/system_counter_offset_test.c | 4 +
11 files changed, 46 insertions(+), 122 deletions(-)
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index a9930e9197da..76382850a28f 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -19,130 +19,14 @@ else
$(error Unknown architecture '$(ARCH)')
endif
-# Non-compiled test targets
-TEST_PROGS_x86_64 += x86_64/nx_huge_pages_test.sh
+TESTS_SRC := $(shell grep -L TEST_UNSUPPORTED\($(ARCH_DIR)\) *.c)
+TESTS_SRC += $(wildcard $(ARCH_DIR)/*.c)
-# Compiled test targets
-TEST_GEN_PROGS_x86_64 = x86_64/cpuid_test
-TEST_GEN_PROGS_x86_64 += x86_64/cr4_cpuid_sync_test
-TEST_GEN_PROGS_x86_64 += x86_64/get_msr_index_features
-TEST_GEN_PROGS_x86_64 += x86_64/exit_on_emulation_failure_test
-TEST_GEN_PROGS_x86_64 += x86_64/fix_hypercall_test
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_clock
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_cpuid
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_evmcs
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_features
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_ipi
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_svm_test
-TEST_GEN_PROGS_x86_64 += x86_64/hyperv_tlb_flush
-TEST_GEN_PROGS_x86_64 += x86_64/kvm_clock_test
-TEST_GEN_PROGS_x86_64 += x86_64/kvm_pv_test
-TEST_GEN_PROGS_x86_64 += x86_64/mmio_warning_test
-TEST_GEN_PROGS_x86_64 += x86_64/monitor_mwait_test
-TEST_GEN_PROGS_x86_64 += x86_64/nested_exceptions_test
-TEST_GEN_PROGS_x86_64 += x86_64/platform_info_test
-TEST_GEN_PROGS_x86_64 += x86_64/pmu_event_filter_test
-TEST_GEN_PROGS_x86_64 += x86_64/set_boot_cpu_id
-TEST_GEN_PROGS_x86_64 += x86_64/set_sregs_test
-TEST_GEN_PROGS_x86_64 += x86_64/smaller_maxphyaddr_emulation_test
-TEST_GEN_PROGS_x86_64 += x86_64/smm_test
-TEST_GEN_PROGS_x86_64 += x86_64/state_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_preemption_timer_test
-TEST_GEN_PROGS_x86_64 += x86_64/svm_vmcall_test
-TEST_GEN_PROGS_x86_64 += x86_64/svm_int_ctl_test
-TEST_GEN_PROGS_x86_64 += x86_64/svm_nested_shutdown_test
-TEST_GEN_PROGS_x86_64 += x86_64/svm_nested_soft_inject_test
-TEST_GEN_PROGS_x86_64 += x86_64/tsc_scaling_sync
-TEST_GEN_PROGS_x86_64 += x86_64/sync_regs_test
-TEST_GEN_PROGS_x86_64 += x86_64/ucna_injection_test
-TEST_GEN_PROGS_x86_64 += x86_64/userspace_io_test
-TEST_GEN_PROGS_x86_64 += x86_64/userspace_msr_exit_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_apic_access_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_close_while_nested_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_dirty_log_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_exception_with_invalid_guest_state
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_msrs_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_invalid_nested_guest_state
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_set_nested_state_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_tsc_adjust_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_nested_tsc_scaling_test
-TEST_GEN_PROGS_x86_64 += x86_64/xapic_ipi_test
-TEST_GEN_PROGS_x86_64 += x86_64/xapic_state_test
-TEST_GEN_PROGS_x86_64 += x86_64/xss_msr_test
-TEST_GEN_PROGS_x86_64 += x86_64/debug_regs
-TEST_GEN_PROGS_x86_64 += x86_64/tsc_msrs_test
-TEST_GEN_PROGS_x86_64 += x86_64/vmx_pmu_caps_test
-TEST_GEN_PROGS_x86_64 += x86_64/xen_shinfo_test
-TEST_GEN_PROGS_x86_64 += x86_64/xen_vmcall_test
-TEST_GEN_PROGS_x86_64 += x86_64/sev_migrate_tests
-TEST_GEN_PROGS_x86_64 += x86_64/amx_test
-TEST_GEN_PROGS_x86_64 += x86_64/max_vcpuid_cap_test
-TEST_GEN_PROGS_x86_64 += x86_64/triple_fault_event_test
-TEST_GEN_PROGS_x86_64 += access_tracking_perf_test
-TEST_GEN_PROGS_x86_64 += demand_paging_test
-TEST_GEN_PROGS_x86_64 += dirty_log_test
-TEST_GEN_PROGS_x86_64 += dirty_log_perf_test
-TEST_GEN_PROGS_x86_64 += hardware_disable_test
-TEST_GEN_PROGS_x86_64 += kvm_create_max_vcpus
-TEST_GEN_PROGS_x86_64 += kvm_page_table_test
-TEST_GEN_PROGS_x86_64 += max_guest_memory_test
-TEST_GEN_PROGS_x86_64 += memslot_modification_stress_test
-TEST_GEN_PROGS_x86_64 += memslot_perf_test
-TEST_GEN_PROGS_x86_64 += rseq_test
-TEST_GEN_PROGS_x86_64 += set_memory_region_test
-TEST_GEN_PROGS_x86_64 += steal_time
-TEST_GEN_PROGS_x86_64 += kvm_binary_stats_test
-TEST_GEN_PROGS_x86_64 += system_counter_offset_test
+TEST_PROGS := $(wildcard *.sh)
+TEST_PROGS += $(wildcard $(ARCH_DIR)/*.sh)
-# Compiled outputs used by test targets
-TEST_GEN_PROGS_EXTENDED_x86_64 += x86_64/nx_huge_pages_test
-
-TEST_GEN_PROGS_aarch64 += aarch64/aarch32_id_regs
-TEST_GEN_PROGS_aarch64 += aarch64/arch_timer
-TEST_GEN_PROGS_aarch64 += aarch64/debug-exceptions
-TEST_GEN_PROGS_aarch64 += aarch64/get-reg-list
-TEST_GEN_PROGS_aarch64 += aarch64/hypercalls
-TEST_GEN_PROGS_aarch64 += aarch64/page_fault_test
-TEST_GEN_PROGS_aarch64 += aarch64/psci_test
-TEST_GEN_PROGS_aarch64 += aarch64/vcpu_width_config
-TEST_GEN_PROGS_aarch64 += aarch64/vgic_init
-TEST_GEN_PROGS_aarch64 += aarch64/vgic_irq
-TEST_GEN_PROGS_aarch64 += access_tracking_perf_test
-TEST_GEN_PROGS_aarch64 += demand_paging_test
-TEST_GEN_PROGS_aarch64 += dirty_log_test
-TEST_GEN_PROGS_aarch64 += dirty_log_perf_test
-TEST_GEN_PROGS_aarch64 += kvm_create_max_vcpus
-TEST_GEN_PROGS_aarch64 += kvm_page_table_test
-TEST_GEN_PROGS_aarch64 += memslot_modification_stress_test
-TEST_GEN_PROGS_aarch64 += memslot_perf_test
-TEST_GEN_PROGS_aarch64 += rseq_test
-TEST_GEN_PROGS_aarch64 += set_memory_region_test
-TEST_GEN_PROGS_aarch64 += steal_time
-TEST_GEN_PROGS_aarch64 += kvm_binary_stats_test
-
-TEST_GEN_PROGS_s390x = s390x/memop
-TEST_GEN_PROGS_s390x += s390x/resets
-TEST_GEN_PROGS_s390x += s390x/sync_regs_test
-TEST_GEN_PROGS_s390x += s390x/tprot
-TEST_GEN_PROGS_s390x += demand_paging_test
-TEST_GEN_PROGS_s390x += dirty_log_test
-TEST_GEN_PROGS_s390x += kvm_create_max_vcpus
-TEST_GEN_PROGS_s390x += kvm_page_table_test
-TEST_GEN_PROGS_s390x += rseq_test
-TEST_GEN_PROGS_s390x += set_memory_region_test
-TEST_GEN_PROGS_s390x += kvm_binary_stats_test
-
-TEST_GEN_PROGS_riscv += demand_paging_test
-TEST_GEN_PROGS_riscv += dirty_log_test
-TEST_GEN_PROGS_riscv += kvm_create_max_vcpus
-TEST_GEN_PROGS_riscv += kvm_page_table_test
-TEST_GEN_PROGS_riscv += set_memory_region_test
-TEST_GEN_PROGS_riscv += kvm_binary_stats_test
-
-TEST_PROGS += $(TEST_PROGS_$(ARCH_DIR))
-TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(ARCH_DIR))
-TEST_GEN_PROGS_EXTENDED += $(TEST_GEN_PROGS_EXTENDED_$(ARCH_DIR))
-LIBKVM += $(LIBKVM_$(ARCH_DIR))
+TEST_GEN_PROGS := $(patsubst %.c, %, $(filter-out $(TEST_PROGS),$(TESTS_SRC)))
+TEST_GEN_PROGS_EXTENDED := $(patsubst %.c, %, $(filter $(TEST_PROGS),$(TESTS_SRC)))
# lib.mak defines $(OUTPUT), prepends $(OUTPUT)/ to $(TEST_GEN_PROGS), and most
# importantly defines, i.e. overwrites, $(CC) (unless `make -e` or `make CC=`,
diff --git a/tools/testing/selftests/kvm/access_tracking_perf_test.c b/tools/testing/selftests/kvm/access_tracking_perf_test.c
index 3c7defd34f56..a6e20103116e 100644
--- a/tools/testing/selftests/kvm/access_tracking_perf_test.c
+++ b/tools/testing/selftests/kvm/access_tracking_perf_test.c
@@ -48,6 +48,9 @@
#include "guest_modes.h"
#include "processor.h"
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
/* Global variable used to synchronize all of the vCPU threads. */
static int iteration;
diff --git a/tools/testing/selftests/kvm/dirty_log_perf_test.c b/tools/testing/selftests/kvm/dirty_log_perf_test.c
index e9d6d1aecf89..65ef1e1ddab9 100644
--- a/tools/testing/selftests/kvm/dirty_log_perf_test.c
+++ b/tools/testing/selftests/kvm/dirty_log_perf_test.c
@@ -19,6 +19,9 @@
#include "memstress.h"
#include "guest_modes.h"
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
#ifdef __aarch64__
#include "aarch64/vgic.h"
diff --git a/tools/testing/selftests/kvm/hardware_disable_test.c b/tools/testing/selftests/kvm/hardware_disable_test.c
index f5d59b9934f1..f844cdb93611 100644
--- a/tools/testing/selftests/kvm/hardware_disable_test.c
+++ b/tools/testing/selftests/kvm/hardware_disable_test.c
@@ -19,6 +19,10 @@
#include "kvm_util.h"
+TEST_UNSUPPORTED(aarch64);
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
#define VCPU_NUM 4
#define SLEEPING_THREAD_NUM (1 << 4)
#define FORK_NUM (1ULL << 9)
diff --git a/tools/testing/selftests/kvm/include/test_util.h b/tools/testing/selftests/kvm/include/test_util.h
index 80d6416f3012..fd94e94dfb78 100644
--- a/tools/testing/selftests/kvm/include/test_util.h
+++ b/tools/testing/selftests/kvm/include/test_util.h
@@ -20,6 +20,17 @@
#include <sys/mman.h>
#include "kselftest.h"
+/*
+ * Flags a common test as unsupported for a given architecture. Parsed during
+ * the build by the Makefile to filter out the test as appropriate.
+ */
+#define TEST_UNSUPPORTED(arch) \
+ static_assert(!strcmp(#arch, "aarch64") || \
+ !strcmp(#arch, "s390x") || \
+ !strcmp(#arch, "riscv") || \
+ !strcmp(#arch, "x86_64"), \
+ "Unsupported architecture: " #arch)
+
static inline int _no_printf(const char *format, ...) { return 0; }
#ifdef DEBUG
diff --git a/tools/testing/selftests/kvm/max_guest_memory_test.c b/tools/testing/selftests/kvm/max_guest_memory_test.c
index feaf2be20ff2..d5bc0cce1e36 100644
--- a/tools/testing/selftests/kvm/max_guest_memory_test.c
+++ b/tools/testing/selftests/kvm/max_guest_memory_test.c
@@ -18,6 +18,10 @@
#include "guest_modes.h"
#include "processor.h"
+TEST_UNSUPPORTED(aarch64);
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
static void guest_code(uint64_t start_gpa, uint64_t end_gpa, uint64_t stride)
{
uint64_t gpa;
diff --git a/tools/testing/selftests/kvm/memslot_modification_stress_test.c b/tools/testing/selftests/kvm/memslot_modification_stress_test.c
index 9855c41ca811..b9bdbde664f4 100644
--- a/tools/testing/selftests/kvm/memslot_modification_stress_test.c
+++ b/tools/testing/selftests/kvm/memslot_modification_stress_test.c
@@ -26,6 +26,9 @@
#include "test_util.h"
#include "guest_modes.h"
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
#define DUMMY_MEMSLOT_INDEX 7
#define DEFAULT_MEMSLOT_MODIFICATION_ITERATIONS 10
diff --git a/tools/testing/selftests/kvm/memslot_perf_test.c b/tools/testing/selftests/kvm/memslot_perf_test.c
index e6587e193490..37085d2c2a03 100644
--- a/tools/testing/selftests/kvm/memslot_perf_test.c
+++ b/tools/testing/selftests/kvm/memslot_perf_test.c
@@ -26,6 +26,9 @@
#include <kvm_util.h>
#include <processor.h>
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
#define MEM_EXTRA_SIZE SZ_64K
#define MEM_SIZE (SZ_512M + MEM_EXTRA_SIZE)
diff --git a/tools/testing/selftests/kvm/rseq_test.c b/tools/testing/selftests/kvm/rseq_test.c
index 3045fdf9bdf5..34c3df9b4e81 100644
--- a/tools/testing/selftests/kvm/rseq_test.c
+++ b/tools/testing/selftests/kvm/rseq_test.c
@@ -22,6 +22,8 @@
#include "../rseq/rseq.c"
+TEST_UNSUPPORTED(riscv);
+
/*
* Any bug related to task migration is likely to be timing-dependent; perform
* a large number of migrations to reduce the odds of a false negative.
diff --git a/tools/testing/selftests/kvm/steal_time.c b/tools/testing/selftests/kvm/steal_time.c
index c87f38712073..66f873ea8a73 100644
--- a/tools/testing/selftests/kvm/steal_time.c
+++ b/tools/testing/selftests/kvm/steal_time.c
@@ -17,6 +17,9 @@
#include "kvm_util.h"
#include "processor.h"
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
#define NR_VCPUS 4
#define ST_GPA_BASE (1 << 30)
diff --git a/tools/testing/selftests/kvm/system_counter_offset_test.c b/tools/testing/selftests/kvm/system_counter_offset_test.c
index 7f5b330b6a1b..dc7f5dc5fbcc 100644
--- a/tools/testing/selftests/kvm/system_counter_offset_test.c
+++ b/tools/testing/selftests/kvm/system_counter_offset_test.c
@@ -14,6 +14,10 @@
#include "kvm_util.h"
#include "processor.h"
+TEST_UNSUPPORTED(aarch64);
+TEST_UNSUPPORTED(s390x);
+TEST_UNSUPPORTED(riscv);
+
#ifdef __x86_64__
struct test_case {
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 14/14] KVM: selftests: Enable RSEQ test for RISC-V
2022-12-13 0:16 ` Sean Christopherson
(?)
(?)
@ 2022-12-13 0:16 ` Sean Christopherson
-1 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: Aaron Lewis, kvm, Tom Rix, llvm, linux-kernel, kvmarm,
linux-riscv, kvmarm, linux-arm-kernel
Enable the RSEQ test for RISC-V, which according to HAVE_RSEQ is supported
by the kernel and thus should be tested. The RSEQ test was added shortly
before RISC-V selftests support landed, i.e. was likely overlooked during
merging.
Note, the RSEQ test currently doesn't compile with clang due to an issue
in the base RSEQ test code. Given that clang is constantly broken for KVM
selftests, enable the RSEQ test and deal with its broken clang state in a
separate commit/series.
In file included from rseq_test.c:23:
In file included from ./../rseq/rseq.c:33:
In file included from ../rseq/rseq.h:97:
../rseq/rseq-riscv.h:657:17: error: invalid input constraint 'er' in asm
[off] "er" (off),
^
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/rseq_test.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/tools/testing/selftests/kvm/rseq_test.c b/tools/testing/selftests/kvm/rseq_test.c
index 34c3df9b4e81..3045fdf9bdf5 100644
--- a/tools/testing/selftests/kvm/rseq_test.c
+++ b/tools/testing/selftests/kvm/rseq_test.c
@@ -22,8 +22,6 @@
#include "../rseq/rseq.c"
-TEST_UNSUPPORTED(riscv);
-
/*
* Any bug related to task migration is likely to be timing-dependent; perform
* a large number of migrations to reduce the odds of a false negative.
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 14/14] KVM: selftests: Enable RSEQ test for RISC-V
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Enable the RSEQ test for RISC-V, which according to HAVE_RSEQ is supported
by the kernel and thus should be tested. The RSEQ test was added shortly
before RISC-V selftests support landed, i.e. was likely overlooked during
merging.
Note, the RSEQ test currently doesn't compile with clang due to an issue
in the base RSEQ test code. Given that clang is constantly broken for KVM
selftests, enable the RSEQ test and deal with its broken clang state in a
separate commit/series.
In file included from rseq_test.c:23:
In file included from ./../rseq/rseq.c:33:
In file included from ../rseq/rseq.h:97:
../rseq/rseq-riscv.h:657:17: error: invalid input constraint 'er' in asm
[off] "er" (off),
^
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/rseq_test.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/tools/testing/selftests/kvm/rseq_test.c b/tools/testing/selftests/kvm/rseq_test.c
index 34c3df9b4e81..3045fdf9bdf5 100644
--- a/tools/testing/selftests/kvm/rseq_test.c
+++ b/tools/testing/selftests/kvm/rseq_test.c
@@ -22,8 +22,6 @@
#include "../rseq/rseq.c"
-TEST_UNSUPPORTED(riscv);
-
/*
* Any bug related to task migration is likely to be timing-dependent; perform
* a large number of migrations to reduce the odds of a false negative.
--
2.39.0.rc1.256.g54fd8350bd-goog
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 14/14] KVM: selftests: Enable RSEQ test for RISC-V
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Enable the RSEQ test for RISC-V, which according to HAVE_RSEQ is supported
by the kernel and thus should be tested. The RSEQ test was added shortly
before RISC-V selftests support landed, i.e. was likely overlooked during
merging.
Note, the RSEQ test currently doesn't compile with clang due to an issue
in the base RSEQ test code. Given that clang is constantly broken for KVM
selftests, enable the RSEQ test and deal with its broken clang state in a
separate commit/series.
In file included from rseq_test.c:23:
In file included from ./../rseq/rseq.c:33:
In file included from ../rseq/rseq.h:97:
../rseq/rseq-riscv.h:657:17: error: invalid input constraint 'er' in asm
[off] "er" (off),
^
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/rseq_test.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/tools/testing/selftests/kvm/rseq_test.c b/tools/testing/selftests/kvm/rseq_test.c
index 34c3df9b4e81..3045fdf9bdf5 100644
--- a/tools/testing/selftests/kvm/rseq_test.c
+++ b/tools/testing/selftests/kvm/rseq_test.c
@@ -22,8 +22,6 @@
#include "../rseq/rseq.c"
-TEST_UNSUPPORTED(riscv);
-
/*
* Any bug related to task migration is likely to be timing-dependent; perform
* a large number of migrations to reduce the odds of a false negative.
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 115+ messages in thread
* [PATCH 14/14] KVM: selftests: Enable RSEQ test for RISC-V
@ 2022-12-13 0:16 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 0:16 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Sean Christopherson,
Aaron Lewis, Raghavendra Rao Ananta
Enable the RSEQ test for RISC-V, which according to HAVE_RSEQ is supported
by the kernel and thus should be tested. The RSEQ test was added shortly
before RISC-V selftests support landed, i.e. was likely overlooked during
merging.
Note, the RSEQ test currently doesn't compile with clang due to an issue
in the base RSEQ test code. Given that clang is constantly broken for KVM
selftests, enable the RSEQ test and deal with its broken clang state in a
separate commit/series.
In file included from rseq_test.c:23:
In file included from ./../rseq/rseq.c:33:
In file included from ../rseq/rseq.h:97:
../rseq/rseq-riscv.h:657:17: error: invalid input constraint 'er' in asm
[off] "er" (off),
^
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/rseq_test.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/tools/testing/selftests/kvm/rseq_test.c b/tools/testing/selftests/kvm/rseq_test.c
index 34c3df9b4e81..3045fdf9bdf5 100644
--- a/tools/testing/selftests/kvm/rseq_test.c
+++ b/tools/testing/selftests/kvm/rseq_test.c
@@ -22,8 +22,6 @@
#include "../rseq/rseq.c"
-TEST_UNSUPPORTED(riscv);
-
/*
* Any bug related to task migration is likely to be timing-dependent; perform
* a large number of migrations to reduce the odds of a false negative.
--
2.39.0.rc1.256.g54fd8350bd-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 115+ messages in thread
* Re: [PATCH 11/14] KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning
2022-12-13 0:16 ` Sean Christopherson
(?)
(?)
@ 2022-12-13 1:36 ` Nick Desaulniers
-1 siblings, 0 replies; 115+ messages in thread
From: Nick Desaulniers @ 2022-12-13 1:36 UTC (permalink / raw)
To: Sean Christopherson
Cc: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, James Morse, Alexandru Elisei,
Suzuki K Poulose, Oliver Upton, Tom Rix, kvm, linux-arm-kernel,
kvmarm, kvmarm, linux-riscv, llvm, linux-kernel, Ricardo Koller,
Aaron Lewis, Raghavendra Rao Ananta
On Mon, Dec 12, 2022 at 4:17 PM Sean Christopherson <seanjc@google.com> wrote:
>
> Disable gnu-variable-sized-type-not-at-end so that tests and libraries
> can create overlays of variable sized arrays at the end of structs when
> using a fixed number of entries, e.g. to get/set a single MSR.
>
> It's possible to fudge around the warning, e.g. by defining a custom
> struct that hardcodes the number of entries, but that is a burden for
> both developers and readers of the code.
>
> lib/x86_64/processor.c:664:19: warning: field 'header' with variable sized type 'struct kvm_msrs'
> not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> struct kvm_msrs header;
> ^
> lib/x86_64/processor.c:772:19: warning: field 'header' with variable sized type 'struct kvm_msrs'
> not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> struct kvm_msrs header;
> ^
> lib/x86_64/processor.c:787:19: warning: field 'header' with variable sized type 'struct kvm_msrs'
> not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> struct kvm_msrs header;
> ^
> 3 warnings generated.
>
> x86_64/hyperv_tlb_flush.c:54:18: warning: field 'hv_vp_set' with variable sized type 'struct hv_vpset'
> not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> struct hv_vpset hv_vp_set;
> ^
> 1 warning generated.
>
> x86_64/xen_shinfo_test.c:137:25: warning: field 'info' with variable sized type 'struct kvm_irq_routing'
> not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> struct kvm_irq_routing info;
> ^
> 1 warning generated.
>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> tools/testing/selftests/kvm/Makefile | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
> index 2487db21b177..9cff99a1cb2e 100644
> --- a/tools/testing/selftests/kvm/Makefile
> +++ b/tools/testing/selftests/kvm/Makefile
> @@ -196,6 +196,7 @@ else
> LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include
> endif
> CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
> + -Wno-gnu-variable-sized-type-not-at-end \
This is a clang-specific warning. This will need to be wrapped in a
cc-option check.
tools/build/Build.include seems to redefine that make macro, so be
sure to test it first.
> -fno-builtin-memcmp -fno-builtin-memcpy -fno-builtin-memset \
> -fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \
> -I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \
> --
> 2.39.0.rc1.256.g54fd8350bd-goog
>
>
--
Thanks,
~Nick Desaulniers
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 11/14] KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning
@ 2022-12-13 1:36 ` Nick Desaulniers
0 siblings, 0 replies; 115+ messages in thread
From: Nick Desaulniers @ 2022-12-13 1:36 UTC (permalink / raw)
To: Sean Christopherson
Cc: Albert Ou, kvm, Aaron Lewis, Marc Zyngier, llvm, Tom Rix,
linux-kernel, Nathan Chancellor, Palmer Dabbelt, Paul Walmsley,
kvmarm, Paolo Bonzini, linux-riscv, kvmarm, linux-arm-kernel
On Mon, Dec 12, 2022 at 4:17 PM Sean Christopherson <seanjc@google.com> wrote:
>
> Disable gnu-variable-sized-type-not-at-end so that tests and libraries
> can create overlays of variable sized arrays at the end of structs when
> using a fixed number of entries, e.g. to get/set a single MSR.
>
> It's possible to fudge around the warning, e.g. by defining a custom
> struct that hardcodes the number of entries, but that is a burden for
> both developers and readers of the code.
>
> lib/x86_64/processor.c:664:19: warning: field 'header' with variable sized type 'struct kvm_msrs'
> not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> struct kvm_msrs header;
> ^
> lib/x86_64/processor.c:772:19: warning: field 'header' with variable sized type 'struct kvm_msrs'
> not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> struct kvm_msrs header;
> ^
> lib/x86_64/processor.c:787:19: warning: field 'header' with variable sized type 'struct kvm_msrs'
> not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> struct kvm_msrs header;
> ^
> 3 warnings generated.
>
> x86_64/hyperv_tlb_flush.c:54:18: warning: field 'hv_vp_set' with variable sized type 'struct hv_vpset'
> not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> struct hv_vpset hv_vp_set;
> ^
> 1 warning generated.
>
> x86_64/xen_shinfo_test.c:137:25: warning: field 'info' with variable sized type 'struct kvm_irq_routing'
> not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> struct kvm_irq_routing info;
> ^
> 1 warning generated.
>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> tools/testing/selftests/kvm/Makefile | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
> index 2487db21b177..9cff99a1cb2e 100644
> --- a/tools/testing/selftests/kvm/Makefile
> +++ b/tools/testing/selftests/kvm/Makefile
> @@ -196,6 +196,7 @@ else
> LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include
> endif
> CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
> + -Wno-gnu-variable-sized-type-not-at-end \
This is a clang-specific warning. This will need to be wrapped in a
cc-option check.
tools/build/Build.include seems to redefine that make macro, so be
sure to test it first.
> -fno-builtin-memcmp -fno-builtin-memcpy -fno-builtin-memset \
> -fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \
> -I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \
> --
> 2.39.0.rc1.256.g54fd8350bd-goog
>
>
--
Thanks,
~Nick Desaulniers
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 11/14] KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning
@ 2022-12-13 1:36 ` Nick Desaulniers
0 siblings, 0 replies; 115+ messages in thread
From: Nick Desaulniers @ 2022-12-13 1:36 UTC (permalink / raw)
To: Sean Christopherson
Cc: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, James Morse, Alexandru Elisei,
Suzuki K Poulose, Oliver Upton, Tom Rix, kvm, linux-arm-kernel,
kvmarm, kvmarm, linux-riscv, llvm, linux-kernel, Ricardo Koller,
Aaron Lewis, Raghavendra Rao Ananta
On Mon, Dec 12, 2022 at 4:17 PM Sean Christopherson <seanjc@google.com> wrote:
>
> Disable gnu-variable-sized-type-not-at-end so that tests and libraries
> can create overlays of variable sized arrays at the end of structs when
> using a fixed number of entries, e.g. to get/set a single MSR.
>
> It's possible to fudge around the warning, e.g. by defining a custom
> struct that hardcodes the number of entries, but that is a burden for
> both developers and readers of the code.
>
> lib/x86_64/processor.c:664:19: warning: field 'header' with variable sized type 'struct kvm_msrs'
> not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> struct kvm_msrs header;
> ^
> lib/x86_64/processor.c:772:19: warning: field 'header' with variable sized type 'struct kvm_msrs'
> not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> struct kvm_msrs header;
> ^
> lib/x86_64/processor.c:787:19: warning: field 'header' with variable sized type 'struct kvm_msrs'
> not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> struct kvm_msrs header;
> ^
> 3 warnings generated.
>
> x86_64/hyperv_tlb_flush.c:54:18: warning: field 'hv_vp_set' with variable sized type 'struct hv_vpset'
> not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> struct hv_vpset hv_vp_set;
> ^
> 1 warning generated.
>
> x86_64/xen_shinfo_test.c:137:25: warning: field 'info' with variable sized type 'struct kvm_irq_routing'
> not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> struct kvm_irq_routing info;
> ^
> 1 warning generated.
>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> tools/testing/selftests/kvm/Makefile | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
> index 2487db21b177..9cff99a1cb2e 100644
> --- a/tools/testing/selftests/kvm/Makefile
> +++ b/tools/testing/selftests/kvm/Makefile
> @@ -196,6 +196,7 @@ else
> LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include
> endif
> CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
> + -Wno-gnu-variable-sized-type-not-at-end \
This is a clang-specific warning. This will need to be wrapped in a
cc-option check.
tools/build/Build.include seems to redefine that make macro, so be
sure to test it first.
> -fno-builtin-memcmp -fno-builtin-memcpy -fno-builtin-memset \
> -fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \
> -I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \
> --
> 2.39.0.rc1.256.g54fd8350bd-goog
>
>
--
Thanks,
~Nick Desaulniers
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 11/14] KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning
@ 2022-12-13 1:36 ` Nick Desaulniers
0 siblings, 0 replies; 115+ messages in thread
From: Nick Desaulniers @ 2022-12-13 1:36 UTC (permalink / raw)
To: Sean Christopherson
Cc: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, James Morse, Alexandru Elisei,
Suzuki K Poulose, Oliver Upton, Tom Rix, kvm, linux-arm-kernel,
kvmarm, kvmarm, linux-riscv, llvm, linux-kernel, Ricardo Koller,
Aaron Lewis, Raghavendra Rao Ananta
On Mon, Dec 12, 2022 at 4:17 PM Sean Christopherson <seanjc@google.com> wrote:
>
> Disable gnu-variable-sized-type-not-at-end so that tests and libraries
> can create overlays of variable sized arrays at the end of structs when
> using a fixed number of entries, e.g. to get/set a single MSR.
>
> It's possible to fudge around the warning, e.g. by defining a custom
> struct that hardcodes the number of entries, but that is a burden for
> both developers and readers of the code.
>
> lib/x86_64/processor.c:664:19: warning: field 'header' with variable sized type 'struct kvm_msrs'
> not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> struct kvm_msrs header;
> ^
> lib/x86_64/processor.c:772:19: warning: field 'header' with variable sized type 'struct kvm_msrs'
> not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> struct kvm_msrs header;
> ^
> lib/x86_64/processor.c:787:19: warning: field 'header' with variable sized type 'struct kvm_msrs'
> not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> struct kvm_msrs header;
> ^
> 3 warnings generated.
>
> x86_64/hyperv_tlb_flush.c:54:18: warning: field 'hv_vp_set' with variable sized type 'struct hv_vpset'
> not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> struct hv_vpset hv_vp_set;
> ^
> 1 warning generated.
>
> x86_64/xen_shinfo_test.c:137:25: warning: field 'info' with variable sized type 'struct kvm_irq_routing'
> not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> struct kvm_irq_routing info;
> ^
> 1 warning generated.
>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> tools/testing/selftests/kvm/Makefile | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
> index 2487db21b177..9cff99a1cb2e 100644
> --- a/tools/testing/selftests/kvm/Makefile
> +++ b/tools/testing/selftests/kvm/Makefile
> @@ -196,6 +196,7 @@ else
> LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include
> endif
> CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
> + -Wno-gnu-variable-sized-type-not-at-end \
This is a clang-specific warning. This will need to be wrapped in a
cc-option check.
tools/build/Build.include seems to redefine that make macro, so be
sure to test it first.
> -fno-builtin-memcmp -fno-builtin-memcpy -fno-builtin-memset \
> -fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \
> -I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \
> --
> 2.39.0.rc1.256.g54fd8350bd-goog
>
>
--
Thanks,
~Nick Desaulniers
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 11/14] KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning
2022-12-13 1:36 ` Nick Desaulniers
(?)
(?)
@ 2022-12-13 2:13 ` Sean Christopherson
-1 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 2:13 UTC (permalink / raw)
To: Nick Desaulniers
Cc: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, James Morse, Alexandru Elisei,
Suzuki K Poulose, Oliver Upton, Tom Rix, kvm, linux-arm-kernel,
kvmarm, kvmarm, linux-riscv, llvm, linux-kernel, Ricardo Koller,
Aaron Lewis, Raghavendra Rao Ananta
On Mon, Dec 12, 2022, Nick Desaulniers wrote:
> > diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
> > index 2487db21b177..9cff99a1cb2e 100644
> > --- a/tools/testing/selftests/kvm/Makefile
> > +++ b/tools/testing/selftests/kvm/Makefile
> > @@ -196,6 +196,7 @@ else
> > LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include
> > endif
> > CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
> > + -Wno-gnu-variable-sized-type-not-at-end \
>
> This is a clang-specific warning. This will need to be wrapped in a
> cc-option check.
Not that I'm against guarding this code, but I don't think cc-option() will do
anything in this case.
AFAICT, gcc stopped treating unknown "-Wno" flags as unconditional errors starting
with gcc-4.4, and the kernel's min supported version is 5.1. gcc-4.4 through
gcc-9.5 all print a mild warning if there's a different error, but otherwise
silently ignore the uknown "-Wno".
cc1: warning: unrecognized command line option '-Wno-gnu-variable-sized-type-not-at-end'
gcc-10.1 is even friendlier and notes that the unknown flag may have been related
to the error.
cc1: note: unrecognized command-line option '-Wno-gnu-variable-sized-type-not-at-end'
may have been intended to silence earlier diagnostics
Because cc-option() doesn't have errors in its probing code, it will return "true"
on gcc for literally any "-Wno-*" input that gcc deems syntacially valid, e.g.
gcc barfs on
depends on $(cc-option,-Wno-)
depends on $(cc-option,-Wno)
but happily succeeds with
depends on $(cc-option,-Wno-lol-gcc)
Various man pages suggest -Wunknown-warnings is a thing, but no gcc version
supported by godbolt recognizes it.
So unless I'm missing something, trying to detect lack of support will be non-trivial,
and the worst case scenario is that users of older gcc version will see a potentially
confusing warning when the build fails.
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 11/14] KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning
@ 2022-12-13 2:13 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 2:13 UTC (permalink / raw)
To: Nick Desaulniers
Cc: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, James Morse, Alexandru Elisei,
Suzuki K Poulose, Oliver Upton, Tom Rix, kvm, linux-arm-kernel,
kvmarm, kvmarm, linux-riscv, llvm, linux-kernel, Ricardo Koller,
Aaron Lewis, Raghavendra Rao Ananta
On Mon, Dec 12, 2022, Nick Desaulniers wrote:
> > diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
> > index 2487db21b177..9cff99a1cb2e 100644
> > --- a/tools/testing/selftests/kvm/Makefile
> > +++ b/tools/testing/selftests/kvm/Makefile
> > @@ -196,6 +196,7 @@ else
> > LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include
> > endif
> > CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
> > + -Wno-gnu-variable-sized-type-not-at-end \
>
> This is a clang-specific warning. This will need to be wrapped in a
> cc-option check.
Not that I'm against guarding this code, but I don't think cc-option() will do
anything in this case.
AFAICT, gcc stopped treating unknown "-Wno" flags as unconditional errors starting
with gcc-4.4, and the kernel's min supported version is 5.1. gcc-4.4 through
gcc-9.5 all print a mild warning if there's a different error, but otherwise
silently ignore the uknown "-Wno".
cc1: warning: unrecognized command line option '-Wno-gnu-variable-sized-type-not-at-end'
gcc-10.1 is even friendlier and notes that the unknown flag may have been related
to the error.
cc1: note: unrecognized command-line option '-Wno-gnu-variable-sized-type-not-at-end'
may have been intended to silence earlier diagnostics
Because cc-option() doesn't have errors in its probing code, it will return "true"
on gcc for literally any "-Wno-*" input that gcc deems syntacially valid, e.g.
gcc barfs on
depends on $(cc-option,-Wno-)
depends on $(cc-option,-Wno)
but happily succeeds with
depends on $(cc-option,-Wno-lol-gcc)
Various man pages suggest -Wunknown-warnings is a thing, but no gcc version
supported by godbolt recognizes it.
So unless I'm missing something, trying to detect lack of support will be non-trivial,
and the worst case scenario is that users of older gcc version will see a potentially
confusing warning when the build fails.
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 11/14] KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning
@ 2022-12-13 2:13 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 2:13 UTC (permalink / raw)
To: Nick Desaulniers
Cc: Albert Ou, kvm, Aaron Lewis, Marc Zyngier, llvm, Tom Rix,
linux-kernel, Nathan Chancellor, Palmer Dabbelt, Paul Walmsley,
kvmarm, Paolo Bonzini, linux-riscv, kvmarm, linux-arm-kernel
On Mon, Dec 12, 2022, Nick Desaulniers wrote:
> > diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
> > index 2487db21b177..9cff99a1cb2e 100644
> > --- a/tools/testing/selftests/kvm/Makefile
> > +++ b/tools/testing/selftests/kvm/Makefile
> > @@ -196,6 +196,7 @@ else
> > LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include
> > endif
> > CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
> > + -Wno-gnu-variable-sized-type-not-at-end \
>
> This is a clang-specific warning. This will need to be wrapped in a
> cc-option check.
Not that I'm against guarding this code, but I don't think cc-option() will do
anything in this case.
AFAICT, gcc stopped treating unknown "-Wno" flags as unconditional errors starting
with gcc-4.4, and the kernel's min supported version is 5.1. gcc-4.4 through
gcc-9.5 all print a mild warning if there's a different error, but otherwise
silently ignore the uknown "-Wno".
cc1: warning: unrecognized command line option '-Wno-gnu-variable-sized-type-not-at-end'
gcc-10.1 is even friendlier and notes that the unknown flag may have been related
to the error.
cc1: note: unrecognized command-line option '-Wno-gnu-variable-sized-type-not-at-end'
may have been intended to silence earlier diagnostics
Because cc-option() doesn't have errors in its probing code, it will return "true"
on gcc for literally any "-Wno-*" input that gcc deems syntacially valid, e.g.
gcc barfs on
depends on $(cc-option,-Wno-)
depends on $(cc-option,-Wno)
but happily succeeds with
depends on $(cc-option,-Wno-lol-gcc)
Various man pages suggest -Wunknown-warnings is a thing, but no gcc version
supported by godbolt recognizes it.
So unless I'm missing something, trying to detect lack of support will be non-trivial,
and the worst case scenario is that users of older gcc version will see a potentially
confusing warning when the build fails.
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 11/14] KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning
@ 2022-12-13 2:13 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 2:13 UTC (permalink / raw)
To: Nick Desaulniers
Cc: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, James Morse, Alexandru Elisei,
Suzuki K Poulose, Oliver Upton, Tom Rix, kvm, linux-arm-kernel,
kvmarm, kvmarm, linux-riscv, llvm, linux-kernel, Ricardo Koller,
Aaron Lewis, Raghavendra Rao Ananta
On Mon, Dec 12, 2022, Nick Desaulniers wrote:
> > diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
> > index 2487db21b177..9cff99a1cb2e 100644
> > --- a/tools/testing/selftests/kvm/Makefile
> > +++ b/tools/testing/selftests/kvm/Makefile
> > @@ -196,6 +196,7 @@ else
> > LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include
> > endif
> > CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
> > + -Wno-gnu-variable-sized-type-not-at-end \
>
> This is a clang-specific warning. This will need to be wrapped in a
> cc-option check.
Not that I'm against guarding this code, but I don't think cc-option() will do
anything in this case.
AFAICT, gcc stopped treating unknown "-Wno" flags as unconditional errors starting
with gcc-4.4, and the kernel's min supported version is 5.1. gcc-4.4 through
gcc-9.5 all print a mild warning if there's a different error, but otherwise
silently ignore the uknown "-Wno".
cc1: warning: unrecognized command line option '-Wno-gnu-variable-sized-type-not-at-end'
gcc-10.1 is even friendlier and notes that the unknown flag may have been related
to the error.
cc1: note: unrecognized command-line option '-Wno-gnu-variable-sized-type-not-at-end'
may have been intended to silence earlier diagnostics
Because cc-option() doesn't have errors in its probing code, it will return "true"
on gcc for literally any "-Wno-*" input that gcc deems syntacially valid, e.g.
gcc barfs on
depends on $(cc-option,-Wno-)
depends on $(cc-option,-Wno)
but happily succeeds with
depends on $(cc-option,-Wno-lol-gcc)
Various man pages suggest -Wunknown-warnings is a thing, but no gcc version
supported by godbolt recognizes it.
So unless I'm missing something, trying to detect lack of support will be non-trivial,
and the worst case scenario is that users of older gcc version will see a potentially
confusing warning when the build fails.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 03/14] KVM: selftests: Fix divide-by-zero bug in memslot_perf_test
2022-12-13 0:16 ` Sean Christopherson
(?)
(?)
@ 2022-12-13 9:46 ` Philippe Mathieu-Daudé
-1 siblings, 0 replies; 115+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-12-13 9:46 UTC (permalink / raw)
To: Sean Christopherson, Paolo Bonzini, Marc Zyngier, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On 13/12/22 01:16, Sean Christopherson wrote:
> Check that the number of pages per slot is non-zero in get_max_slots()
> prior to computing the remaining number of pages. clang generates code
> that uses an actual DIV for calculating the remaining, which causes a #DE
> if the total number of pages is less than the number of slots.
>
> traps: memslot_perf_te[97611] trap divide error ip:4030c4 sp:7ffd18ae58f0
> error:0 in memslot_perf_test[401000+cb000]
>
> Fixes: a69170c65acd ("KVM: selftests: memslot_perf_test: Report optimal memory slots")
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> tools/testing/selftests/kvm/memslot_perf_test.c | 3 +++
> 1 file changed, 3 insertions(+)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 03/14] KVM: selftests: Fix divide-by-zero bug in memslot_perf_test
@ 2022-12-13 9:46 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 115+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-12-13 9:46 UTC (permalink / raw)
To: Sean Christopherson, Paolo Bonzini, Marc Zyngier, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On 13/12/22 01:16, Sean Christopherson wrote:
> Check that the number of pages per slot is non-zero in get_max_slots()
> prior to computing the remaining number of pages. clang generates code
> that uses an actual DIV for calculating the remaining, which causes a #DE
> if the total number of pages is less than the number of slots.
>
> traps: memslot_perf_te[97611] trap divide error ip:4030c4 sp:7ffd18ae58f0
> error:0 in memslot_perf_test[401000+cb000]
>
> Fixes: a69170c65acd ("KVM: selftests: memslot_perf_test: Report optimal memory slots")
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> tools/testing/selftests/kvm/memslot_perf_test.c | 3 +++
> 1 file changed, 3 insertions(+)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 03/14] KVM: selftests: Fix divide-by-zero bug in memslot_perf_test
@ 2022-12-13 9:46 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 115+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-12-13 9:46 UTC (permalink / raw)
To: Sean Christopherson, Paolo Bonzini, Marc Zyngier, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: Aaron Lewis, kvm, Tom Rix, llvm, linux-kernel, kvmarm,
linux-riscv, kvmarm, linux-arm-kernel
On 13/12/22 01:16, Sean Christopherson wrote:
> Check that the number of pages per slot is non-zero in get_max_slots()
> prior to computing the remaining number of pages. clang generates code
> that uses an actual DIV for calculating the remaining, which causes a #DE
> if the total number of pages is less than the number of slots.
>
> traps: memslot_perf_te[97611] trap divide error ip:4030c4 sp:7ffd18ae58f0
> error:0 in memslot_perf_test[401000+cb000]
>
> Fixes: a69170c65acd ("KVM: selftests: memslot_perf_test: Report optimal memory slots")
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> tools/testing/selftests/kvm/memslot_perf_test.c | 3 +++
> 1 file changed, 3 insertions(+)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 03/14] KVM: selftests: Fix divide-by-zero bug in memslot_perf_test
@ 2022-12-13 9:46 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 115+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-12-13 9:46 UTC (permalink / raw)
To: Sean Christopherson, Paolo Bonzini, Marc Zyngier, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On 13/12/22 01:16, Sean Christopherson wrote:
> Check that the number of pages per slot is non-zero in get_max_slots()
> prior to computing the remaining number of pages. clang generates code
> that uses an actual DIV for calculating the remaining, which causes a #DE
> if the total number of pages is less than the number of slots.
>
> traps: memslot_perf_te[97611] trap divide error ip:4030c4 sp:7ffd18ae58f0
> error:0 in memslot_perf_test[401000+cb000]
>
> Fixes: a69170c65acd ("KVM: selftests: memslot_perf_test: Report optimal memory slots")
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> tools/testing/selftests/kvm/memslot_perf_test.c | 3 +++
> 1 file changed, 3 insertions(+)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 05/14] KVM: selftests: Fix a typo in x86-64's kvm_get_cpu_address_width()
2022-12-13 0:16 ` Sean Christopherson
(?)
(?)
@ 2022-12-13 9:47 ` Philippe Mathieu-Daudé
-1 siblings, 0 replies; 115+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-12-13 9:47 UTC (permalink / raw)
To: Sean Christopherson, Paolo Bonzini, Marc Zyngier, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On 13/12/22 01:16, Sean Christopherson wrote:
> Fix a == vs. = typo in kvm_get_cpu_address_width() that results in
> @pa_bits being left unset if the CPU doesn't support enumerating its
> MAX_PHY_ADDR. Flagged by clang's unusued-value warning.
>
> lib/x86_64/processor.c:1034:51: warning: expression result unused [-Wunused-value]
> *pa_bits == kvm_cpu_has(X86_FEATURE_PAE) ? 36 : 32;
>
> Fixes: 3bd396353d18 ("KVM: selftests: Add X86_FEATURE_PAE and use it calc "fallback" MAXPHYADDR")
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> tools/testing/selftests/kvm/lib/x86_64/processor.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/kvm/lib/x86_64/processor.c b/tools/testing/selftests/kvm/lib/x86_64/processor.c
> index c4d368d56cfe..acfa1d01e7df 100644
> --- a/tools/testing/selftests/kvm/lib/x86_64/processor.c
> +++ b/tools/testing/selftests/kvm/lib/x86_64/processor.c
> @@ -1031,7 +1031,7 @@ bool is_amd_cpu(void)
> void kvm_get_cpu_address_width(unsigned int *pa_bits, unsigned int *va_bits)
> {
> if (!kvm_cpu_has_p(X86_PROPERTY_MAX_PHY_ADDR)) {
> - *pa_bits == kvm_cpu_has(X86_FEATURE_PAE) ? 36 : 32;
> + *pa_bits = kvm_cpu_has(X86_FEATURE_PAE) ? 36 : 32;
:)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 05/14] KVM: selftests: Fix a typo in x86-64's kvm_get_cpu_address_width()
@ 2022-12-13 9:47 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 115+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-12-13 9:47 UTC (permalink / raw)
To: Sean Christopherson, Paolo Bonzini, Marc Zyngier, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: Aaron Lewis, kvm, Tom Rix, llvm, linux-kernel, kvmarm,
linux-riscv, kvmarm, linux-arm-kernel
On 13/12/22 01:16, Sean Christopherson wrote:
> Fix a == vs. = typo in kvm_get_cpu_address_width() that results in
> @pa_bits being left unset if the CPU doesn't support enumerating its
> MAX_PHY_ADDR. Flagged by clang's unusued-value warning.
>
> lib/x86_64/processor.c:1034:51: warning: expression result unused [-Wunused-value]
> *pa_bits == kvm_cpu_has(X86_FEATURE_PAE) ? 36 : 32;
>
> Fixes: 3bd396353d18 ("KVM: selftests: Add X86_FEATURE_PAE and use it calc "fallback" MAXPHYADDR")
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> tools/testing/selftests/kvm/lib/x86_64/processor.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/kvm/lib/x86_64/processor.c b/tools/testing/selftests/kvm/lib/x86_64/processor.c
> index c4d368d56cfe..acfa1d01e7df 100644
> --- a/tools/testing/selftests/kvm/lib/x86_64/processor.c
> +++ b/tools/testing/selftests/kvm/lib/x86_64/processor.c
> @@ -1031,7 +1031,7 @@ bool is_amd_cpu(void)
> void kvm_get_cpu_address_width(unsigned int *pa_bits, unsigned int *va_bits)
> {
> if (!kvm_cpu_has_p(X86_PROPERTY_MAX_PHY_ADDR)) {
> - *pa_bits == kvm_cpu_has(X86_FEATURE_PAE) ? 36 : 32;
> + *pa_bits = kvm_cpu_has(X86_FEATURE_PAE) ? 36 : 32;
:)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 05/14] KVM: selftests: Fix a typo in x86-64's kvm_get_cpu_address_width()
@ 2022-12-13 9:47 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 115+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-12-13 9:47 UTC (permalink / raw)
To: Sean Christopherson, Paolo Bonzini, Marc Zyngier, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On 13/12/22 01:16, Sean Christopherson wrote:
> Fix a == vs. = typo in kvm_get_cpu_address_width() that results in
> @pa_bits being left unset if the CPU doesn't support enumerating its
> MAX_PHY_ADDR. Flagged by clang's unusued-value warning.
>
> lib/x86_64/processor.c:1034:51: warning: expression result unused [-Wunused-value]
> *pa_bits == kvm_cpu_has(X86_FEATURE_PAE) ? 36 : 32;
>
> Fixes: 3bd396353d18 ("KVM: selftests: Add X86_FEATURE_PAE and use it calc "fallback" MAXPHYADDR")
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> tools/testing/selftests/kvm/lib/x86_64/processor.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/kvm/lib/x86_64/processor.c b/tools/testing/selftests/kvm/lib/x86_64/processor.c
> index c4d368d56cfe..acfa1d01e7df 100644
> --- a/tools/testing/selftests/kvm/lib/x86_64/processor.c
> +++ b/tools/testing/selftests/kvm/lib/x86_64/processor.c
> @@ -1031,7 +1031,7 @@ bool is_amd_cpu(void)
> void kvm_get_cpu_address_width(unsigned int *pa_bits, unsigned int *va_bits)
> {
> if (!kvm_cpu_has_p(X86_PROPERTY_MAX_PHY_ADDR)) {
> - *pa_bits == kvm_cpu_has(X86_FEATURE_PAE) ? 36 : 32;
> + *pa_bits = kvm_cpu_has(X86_FEATURE_PAE) ? 36 : 32;
:)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 05/14] KVM: selftests: Fix a typo in x86-64's kvm_get_cpu_address_width()
@ 2022-12-13 9:47 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 115+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-12-13 9:47 UTC (permalink / raw)
To: Sean Christopherson, Paolo Bonzini, Marc Zyngier, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On 13/12/22 01:16, Sean Christopherson wrote:
> Fix a == vs. = typo in kvm_get_cpu_address_width() that results in
> @pa_bits being left unset if the CPU doesn't support enumerating its
> MAX_PHY_ADDR. Flagged by clang's unusued-value warning.
>
> lib/x86_64/processor.c:1034:51: warning: expression result unused [-Wunused-value]
> *pa_bits == kvm_cpu_has(X86_FEATURE_PAE) ? 36 : 32;
>
> Fixes: 3bd396353d18 ("KVM: selftests: Add X86_FEATURE_PAE and use it calc "fallback" MAXPHYADDR")
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> tools/testing/selftests/kvm/lib/x86_64/processor.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/kvm/lib/x86_64/processor.c b/tools/testing/selftests/kvm/lib/x86_64/processor.c
> index c4d368d56cfe..acfa1d01e7df 100644
> --- a/tools/testing/selftests/kvm/lib/x86_64/processor.c
> +++ b/tools/testing/selftests/kvm/lib/x86_64/processor.c
> @@ -1031,7 +1031,7 @@ bool is_amd_cpu(void)
> void kvm_get_cpu_address_width(unsigned int *pa_bits, unsigned int *va_bits)
> {
> if (!kvm_cpu_has_p(X86_PROPERTY_MAX_PHY_ADDR)) {
> - *pa_bits == kvm_cpu_has(X86_FEATURE_PAE) ? 36 : 32;
> + *pa_bits = kvm_cpu_has(X86_FEATURE_PAE) ? 36 : 32;
:)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 07/14] KVM: selftests: Use proper function prototypes in probing code
2022-12-13 0:16 ` Sean Christopherson
(?)
(?)
@ 2022-12-13 9:48 ` Philippe Mathieu-Daudé
-1 siblings, 0 replies; 115+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-12-13 9:48 UTC (permalink / raw)
To: Sean Christopherson, Paolo Bonzini, Marc Zyngier, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On 13/12/22 01:16, Sean Christopherson wrote:
> Make the main() functions in the probing code proper prototypes so that
> compiling the probing code with more strict flags won't generate false
> negatives.
>
> <stdin>:1:5: error: function declaration isn’t a prototype [-Werror=strict-prototypes]
>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> tools/testing/selftests/kvm/Makefile | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 07/14] KVM: selftests: Use proper function prototypes in probing code
@ 2022-12-13 9:48 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 115+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-12-13 9:48 UTC (permalink / raw)
To: Sean Christopherson, Paolo Bonzini, Marc Zyngier, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On 13/12/22 01:16, Sean Christopherson wrote:
> Make the main() functions in the probing code proper prototypes so that
> compiling the probing code with more strict flags won't generate false
> negatives.
>
> <stdin>:1:5: error: function declaration isn’t a prototype [-Werror=strict-prototypes]
>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> tools/testing/selftests/kvm/Makefile | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 07/14] KVM: selftests: Use proper function prototypes in probing code
@ 2022-12-13 9:48 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 115+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-12-13 9:48 UTC (permalink / raw)
To: Sean Christopherson, Paolo Bonzini, Marc Zyngier, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: Aaron Lewis, kvm, Tom Rix, llvm, linux-kernel, kvmarm,
linux-riscv, kvmarm, linux-arm-kernel
On 13/12/22 01:16, Sean Christopherson wrote:
> Make the main() functions in the probing code proper prototypes so that
> compiling the probing code with more strict flags won't generate false
> negatives.
>
> <stdin>:1:5: error: function declaration isn’t a prototype [-Werror=strict-prototypes]
>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> tools/testing/selftests/kvm/Makefile | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 07/14] KVM: selftests: Use proper function prototypes in probing code
@ 2022-12-13 9:48 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 115+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-12-13 9:48 UTC (permalink / raw)
To: Sean Christopherson, Paolo Bonzini, Marc Zyngier, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On 13/12/22 01:16, Sean Christopherson wrote:
> Make the main() functions in the probing code proper prototypes so that
> compiling the probing code with more strict flags won't generate false
> negatives.
>
> <stdin>:1:5: error: function declaration isn’t a prototype [-Werror=strict-prototypes]
>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> tools/testing/selftests/kvm/Makefile | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 01/14] KVM: selftests: Define literal to asm constraint in aarch64 as unsigned long
2022-12-13 0:16 ` Sean Christopherson
(?)
(?)
@ 2022-12-13 9:51 ` Philippe Mathieu-Daudé
-1 siblings, 0 replies; 115+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-12-13 9:51 UTC (permalink / raw)
To: Sean Christopherson, Paolo Bonzini, Marc Zyngier, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On 13/12/22 01:16, Sean Christopherson wrote:
> Define a literal '0' asm input constraint to aarch64/page_fault_test's
> guest_cas() as an unsigned long to make clang happy.
>
> tools/testing/selftests/kvm/aarch64/page_fault_test.c:120:16: error:
> value size does not match register size specified by the constraint
> and modifier [-Werror,-Wasm-operand-widths]
> :: "r" (0), "r" (TEST_DATA), "r" (guest_test_memory));
> ^
> tools/testing/selftests/kvm/aarch64/page_fault_test.c:119:15: note:
> use constraint modifier "w"
> "casal %0, %1, [%2]\n"
> ^~
> %w0
>
> Fixes: 35c581015712 ("KVM: selftests: aarch64: Add aarch64/page_fault_test")
> Cc: Ricardo Koller <ricarkol@google.com>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> tools/testing/selftests/kvm/aarch64/page_fault_test.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 01/14] KVM: selftests: Define literal to asm constraint in aarch64 as unsigned long
@ 2022-12-13 9:51 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 115+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-12-13 9:51 UTC (permalink / raw)
To: Sean Christopherson, Paolo Bonzini, Marc Zyngier, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On 13/12/22 01:16, Sean Christopherson wrote:
> Define a literal '0' asm input constraint to aarch64/page_fault_test's
> guest_cas() as an unsigned long to make clang happy.
>
> tools/testing/selftests/kvm/aarch64/page_fault_test.c:120:16: error:
> value size does not match register size specified by the constraint
> and modifier [-Werror,-Wasm-operand-widths]
> :: "r" (0), "r" (TEST_DATA), "r" (guest_test_memory));
> ^
> tools/testing/selftests/kvm/aarch64/page_fault_test.c:119:15: note:
> use constraint modifier "w"
> "casal %0, %1, [%2]\n"
> ^~
> %w0
>
> Fixes: 35c581015712 ("KVM: selftests: aarch64: Add aarch64/page_fault_test")
> Cc: Ricardo Koller <ricarkol@google.com>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> tools/testing/selftests/kvm/aarch64/page_fault_test.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 01/14] KVM: selftests: Define literal to asm constraint in aarch64 as unsigned long
@ 2022-12-13 9:51 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 115+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-12-13 9:51 UTC (permalink / raw)
To: Sean Christopherson, Paolo Bonzini, Marc Zyngier, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: Aaron Lewis, kvm, Tom Rix, llvm, linux-kernel, kvmarm,
linux-riscv, kvmarm, linux-arm-kernel
On 13/12/22 01:16, Sean Christopherson wrote:
> Define a literal '0' asm input constraint to aarch64/page_fault_test's
> guest_cas() as an unsigned long to make clang happy.
>
> tools/testing/selftests/kvm/aarch64/page_fault_test.c:120:16: error:
> value size does not match register size specified by the constraint
> and modifier [-Werror,-Wasm-operand-widths]
> :: "r" (0), "r" (TEST_DATA), "r" (guest_test_memory));
> ^
> tools/testing/selftests/kvm/aarch64/page_fault_test.c:119:15: note:
> use constraint modifier "w"
> "casal %0, %1, [%2]\n"
> ^~
> %w0
>
> Fixes: 35c581015712 ("KVM: selftests: aarch64: Add aarch64/page_fault_test")
> Cc: Ricardo Koller <ricarkol@google.com>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> tools/testing/selftests/kvm/aarch64/page_fault_test.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 01/14] KVM: selftests: Define literal to asm constraint in aarch64 as unsigned long
@ 2022-12-13 9:51 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 115+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-12-13 9:51 UTC (permalink / raw)
To: Sean Christopherson, Paolo Bonzini, Marc Zyngier, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On 13/12/22 01:16, Sean Christopherson wrote:
> Define a literal '0' asm input constraint to aarch64/page_fault_test's
> guest_cas() as an unsigned long to make clang happy.
>
> tools/testing/selftests/kvm/aarch64/page_fault_test.c:120:16: error:
> value size does not match register size specified by the constraint
> and modifier [-Werror,-Wasm-operand-widths]
> :: "r" (0), "r" (TEST_DATA), "r" (guest_test_memory));
> ^
> tools/testing/selftests/kvm/aarch64/page_fault_test.c:119:15: note:
> use constraint modifier "w"
> "casal %0, %1, [%2]\n"
> ^~
> %w0
>
> Fixes: 35c581015712 ("KVM: selftests: aarch64: Add aarch64/page_fault_test")
> Cc: Ricardo Koller <ricarkol@google.com>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> tools/testing/selftests/kvm/aarch64/page_fault_test.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 06/14] KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86
2022-12-13 0:16 ` Sean Christopherson
(?)
(?)
@ 2022-12-13 20:03 ` Sean Christopherson
-1 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 20:03 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers, James Morse,
Alexandru Elisei, Suzuki K Poulose, Oliver Upton, Tom Rix, kvm,
linux-arm-kernel, kvmarm, kvmarm, linux-riscv, llvm,
linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
Cc: David Matlack
+David
On Tue, Dec 13, 2022, Sean Christopherson wrote:
> Rename UNAME_M to ARCH_DIR and explicitly set it directly for x86. At
> this point, the name of the arch directory really doesn't have anything
> to do with `uname -m`, and UNAME_M is unnecessarily confusing given that
> its purpose is purely to identify the arch specific directory.
>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> -# No change necessary for x86_64
> -UNAME_M := $(shell uname -m)
> -
> -# Set UNAME_M for arm64 compile/install to work
> -ifeq ($(ARCH),arm64)
> - UNAME_M := aarch64
> -endif
> -# Set UNAME_M s390x compile/install to work
> -ifeq ($(ARCH),s390)
> - UNAME_M := s390x
> -endif
> -# Set UNAME_M riscv compile/install to work
> -ifeq ($(ARCH),riscv)
> - UNAME_M := riscv
> +ifeq ($(ARCH),x86)
As discovered by by David, this breaks doing "ARCH=x86_64 make", which is an
allowed/supported variant in the kernel proper, so this needs to be:
ifneq (,$(filter $(ARCH),x86 x86_64))
or alternatively
ifeq ($(ARCH),x86_64)
ARCH := x86
endif
Hmm, unless there's a reason to keep ARCH=x86_64, the latter appears to be the
better option as lib.mak doesn't play nice with x86_64 either, e.g. `ARCH=x86_64
LLVM=1 make` fails. That's arguably a lib.mak bug, but it's trivial to handle
in KVM's makefile so forcing lib.mak to handle both seems unnecessary.
I'll also add a comment to call out that $(ARCH) follows the kernel's terminology
for arch/*, whereas for whatever reason KVM selftests effectively uses `uname -m`
terminology.
One last thought/question, what do y'all think about renaming directories to
follow the kernel proper? I.e. aarch64=>arm64, s390x=>s390, and x86_64=>x86.
Then $(ARCH_DIR) would go away. The churn would be unfortunate, but it would be
nice to align with arch/ and tools/arch/.
> + ARCH_DIR := x86_64
> +else ifeq ($(ARCH),arm64)
> + ARCH_DIR := aarch64
> +else ifeq ($(ARCH),s390)
> + ARCH_DIR := s390x
> +else ifeq ($(ARCH),riscv)
> + ARCH_DIR := riscv
> +else
> +$(error Unknown architecture '$(ARCH)')
> endif
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 06/14] KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86
@ 2022-12-13 20:03 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 20:03 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers, James Morse,
Alexandru Elisei, Suzuki K Poulose, Oliver Upton, Tom Rix, kvm,
linux-arm-kernel, kvmarm, kvmarm, linux-riscv, llvm,
linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
Cc: David Matlack
+David
On Tue, Dec 13, 2022, Sean Christopherson wrote:
> Rename UNAME_M to ARCH_DIR and explicitly set it directly for x86. At
> this point, the name of the arch directory really doesn't have anything
> to do with `uname -m`, and UNAME_M is unnecessarily confusing given that
> its purpose is purely to identify the arch specific directory.
>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> -# No change necessary for x86_64
> -UNAME_M := $(shell uname -m)
> -
> -# Set UNAME_M for arm64 compile/install to work
> -ifeq ($(ARCH),arm64)
> - UNAME_M := aarch64
> -endif
> -# Set UNAME_M s390x compile/install to work
> -ifeq ($(ARCH),s390)
> - UNAME_M := s390x
> -endif
> -# Set UNAME_M riscv compile/install to work
> -ifeq ($(ARCH),riscv)
> - UNAME_M := riscv
> +ifeq ($(ARCH),x86)
As discovered by by David, this breaks doing "ARCH=x86_64 make", which is an
allowed/supported variant in the kernel proper, so this needs to be:
ifneq (,$(filter $(ARCH),x86 x86_64))
or alternatively
ifeq ($(ARCH),x86_64)
ARCH := x86
endif
Hmm, unless there's a reason to keep ARCH=x86_64, the latter appears to be the
better option as lib.mak doesn't play nice with x86_64 either, e.g. `ARCH=x86_64
LLVM=1 make` fails. That's arguably a lib.mak bug, but it's trivial to handle
in KVM's makefile so forcing lib.mak to handle both seems unnecessary.
I'll also add a comment to call out that $(ARCH) follows the kernel's terminology
for arch/*, whereas for whatever reason KVM selftests effectively uses `uname -m`
terminology.
One last thought/question, what do y'all think about renaming directories to
follow the kernel proper? I.e. aarch64=>arm64, s390x=>s390, and x86_64=>x86.
Then $(ARCH_DIR) would go away. The churn would be unfortunate, but it would be
nice to align with arch/ and tools/arch/.
> + ARCH_DIR := x86_64
> +else ifeq ($(ARCH),arm64)
> + ARCH_DIR := aarch64
> +else ifeq ($(ARCH),s390)
> + ARCH_DIR := s390x
> +else ifeq ($(ARCH),riscv)
> + ARCH_DIR := riscv
> +else
> +$(error Unknown architecture '$(ARCH)')
> endif
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 06/14] KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86
@ 2022-12-13 20:03 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 20:03 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers, James Morse,
Alexandru Elisei, Suzuki K Poulose, Oliver Upton, Tom Rix, kvm,
linux-arm-kernel, kvmarm, kvmarm, linux-riscv, llvm,
linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
Cc: David Matlack
+David
On Tue, Dec 13, 2022, Sean Christopherson wrote:
> Rename UNAME_M to ARCH_DIR and explicitly set it directly for x86. At
> this point, the name of the arch directory really doesn't have anything
> to do with `uname -m`, and UNAME_M is unnecessarily confusing given that
> its purpose is purely to identify the arch specific directory.
>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> -# No change necessary for x86_64
> -UNAME_M := $(shell uname -m)
> -
> -# Set UNAME_M for arm64 compile/install to work
> -ifeq ($(ARCH),arm64)
> - UNAME_M := aarch64
> -endif
> -# Set UNAME_M s390x compile/install to work
> -ifeq ($(ARCH),s390)
> - UNAME_M := s390x
> -endif
> -# Set UNAME_M riscv compile/install to work
> -ifeq ($(ARCH),riscv)
> - UNAME_M := riscv
> +ifeq ($(ARCH),x86)
As discovered by by David, this breaks doing "ARCH=x86_64 make", which is an
allowed/supported variant in the kernel proper, so this needs to be:
ifneq (,$(filter $(ARCH),x86 x86_64))
or alternatively
ifeq ($(ARCH),x86_64)
ARCH := x86
endif
Hmm, unless there's a reason to keep ARCH=x86_64, the latter appears to be the
better option as lib.mak doesn't play nice with x86_64 either, e.g. `ARCH=x86_64
LLVM=1 make` fails. That's arguably a lib.mak bug, but it's trivial to handle
in KVM's makefile so forcing lib.mak to handle both seems unnecessary.
I'll also add a comment to call out that $(ARCH) follows the kernel's terminology
for arch/*, whereas for whatever reason KVM selftests effectively uses `uname -m`
terminology.
One last thought/question, what do y'all think about renaming directories to
follow the kernel proper? I.e. aarch64=>arm64, s390x=>s390, and x86_64=>x86.
Then $(ARCH_DIR) would go away. The churn would be unfortunate, but it would be
nice to align with arch/ and tools/arch/.
> + ARCH_DIR := x86_64
> +else ifeq ($(ARCH),arm64)
> + ARCH_DIR := aarch64
> +else ifeq ($(ARCH),s390)
> + ARCH_DIR := s390x
> +else ifeq ($(ARCH),riscv)
> + ARCH_DIR := riscv
> +else
> +$(error Unknown architecture '$(ARCH)')
> endif
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 06/14] KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86
@ 2022-12-13 20:03 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2022-12-13 20:03 UTC (permalink / raw)
To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers, James Morse,
Alexandru Elisei, Suzuki K Poulose, Oliver Upton, Tom Rix, kvm,
linux-arm-kernel, kvmarm, kvmarm, linux-riscv, llvm,
linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
Cc: David Matlack
+David
On Tue, Dec 13, 2022, Sean Christopherson wrote:
> Rename UNAME_M to ARCH_DIR and explicitly set it directly for x86. At
> this point, the name of the arch directory really doesn't have anything
> to do with `uname -m`, and UNAME_M is unnecessarily confusing given that
> its purpose is purely to identify the arch specific directory.
>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> -# No change necessary for x86_64
> -UNAME_M := $(shell uname -m)
> -
> -# Set UNAME_M for arm64 compile/install to work
> -ifeq ($(ARCH),arm64)
> - UNAME_M := aarch64
> -endif
> -# Set UNAME_M s390x compile/install to work
> -ifeq ($(ARCH),s390)
> - UNAME_M := s390x
> -endif
> -# Set UNAME_M riscv compile/install to work
> -ifeq ($(ARCH),riscv)
> - UNAME_M := riscv
> +ifeq ($(ARCH),x86)
As discovered by by David, this breaks doing "ARCH=x86_64 make", which is an
allowed/supported variant in the kernel proper, so this needs to be:
ifneq (,$(filter $(ARCH),x86 x86_64))
or alternatively
ifeq ($(ARCH),x86_64)
ARCH := x86
endif
Hmm, unless there's a reason to keep ARCH=x86_64, the latter appears to be the
better option as lib.mak doesn't play nice with x86_64 either, e.g. `ARCH=x86_64
LLVM=1 make` fails. That's arguably a lib.mak bug, but it's trivial to handle
in KVM's makefile so forcing lib.mak to handle both seems unnecessary.
I'll also add a comment to call out that $(ARCH) follows the kernel's terminology
for arch/*, whereas for whatever reason KVM selftests effectively uses `uname -m`
terminology.
One last thought/question, what do y'all think about renaming directories to
follow the kernel proper? I.e. aarch64=>arm64, s390x=>s390, and x86_64=>x86.
Then $(ARCH_DIR) would go away. The churn would be unfortunate, but it would be
nice to align with arch/ and tools/arch/.
> + ARCH_DIR := x86_64
> +else ifeq ($(ARCH),arm64)
> + ARCH_DIR := aarch64
> +else ifeq ($(ARCH),s390)
> + ARCH_DIR := s390x
> +else ifeq ($(ARCH),riscv)
> + ARCH_DIR := riscv
> +else
> +$(error Unknown architecture '$(ARCH)')
> endif
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 06/14] KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86
2022-12-13 20:03 ` Sean Christopherson
(?)
(?)
@ 2022-12-14 9:43 ` Marc Zyngier
-1 siblings, 0 replies; 115+ messages in thread
From: Marc Zyngier @ 2022-12-14 9:43 UTC (permalink / raw)
To: Sean Christopherson
Cc: Paolo Bonzini, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Nathan Chancellor, Nick Desaulniers, James Morse,
Alexandru Elisei, Suzuki K Poulose, Oliver Upton, Tom Rix, kvm,
linux-arm-kernel, kvmarm, kvmarm, linux-riscv, llvm,
linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta, David Matlack
On 2022-12-13 20:03, Sean Christopherson wrote:
> One last thought/question, what do y'all think about renaming
> directories to
> follow the kernel proper? I.e. aarch64=>arm64, s390x=>s390, and
> x86_64=>x86.
> Then $(ARCH_DIR) would go away. The churn would be unfortunate, but it
> would be
> nice to align with arch/ and tools/arch/.
aarch64->arm64 makes sense to me. Whether it is worth the churn
is another question. As long as we don't try to backport tests,
the damage should be limited to a single merge window.
M.
--
Jazz is not dead. It just smells funny...
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 06/14] KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86
@ 2022-12-14 9:43 ` Marc Zyngier
0 siblings, 0 replies; 115+ messages in thread
From: Marc Zyngier @ 2022-12-14 9:43 UTC (permalink / raw)
To: Sean Christopherson
Cc: kvm, Tom Rix, llvm, kvmarm, linux-riscv, kvmarm, Palmer Dabbelt,
Albert Ou, Aaron Lewis, Nathan Chancellor, Paul Walmsley,
David Matlack, linux-arm-kernel, Nick Desaulniers, linux-kernel,
Paolo Bonzini
On 2022-12-13 20:03, Sean Christopherson wrote:
> One last thought/question, what do y'all think about renaming
> directories to
> follow the kernel proper? I.e. aarch64=>arm64, s390x=>s390, and
> x86_64=>x86.
> Then $(ARCH_DIR) would go away. The churn would be unfortunate, but it
> would be
> nice to align with arch/ and tools/arch/.
aarch64->arm64 makes sense to me. Whether it is worth the churn
is another question. As long as we don't try to backport tests,
the damage should be limited to a single merge window.
M.
--
Jazz is not dead. It just smells funny...
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 06/14] KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86
@ 2022-12-14 9:43 ` Marc Zyngier
0 siblings, 0 replies; 115+ messages in thread
From: Marc Zyngier @ 2022-12-14 9:43 UTC (permalink / raw)
To: Sean Christopherson
Cc: Paolo Bonzini, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Nathan Chancellor, Nick Desaulniers, James Morse,
Alexandru Elisei, Suzuki K Poulose, Oliver Upton, Tom Rix, kvm,
linux-arm-kernel, kvmarm, kvmarm, linux-riscv, llvm,
linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta, David Matlack
On 2022-12-13 20:03, Sean Christopherson wrote:
> One last thought/question, what do y'all think about renaming
> directories to
> follow the kernel proper? I.e. aarch64=>arm64, s390x=>s390, and
> x86_64=>x86.
> Then $(ARCH_DIR) would go away. The churn would be unfortunate, but it
> would be
> nice to align with arch/ and tools/arch/.
aarch64->arm64 makes sense to me. Whether it is worth the churn
is another question. As long as we don't try to backport tests,
the damage should be limited to a single merge window.
M.
--
Jazz is not dead. It just smells funny...
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 06/14] KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86
@ 2022-12-14 9:43 ` Marc Zyngier
0 siblings, 0 replies; 115+ messages in thread
From: Marc Zyngier @ 2022-12-14 9:43 UTC (permalink / raw)
To: Sean Christopherson
Cc: Paolo Bonzini, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Nathan Chancellor, Nick Desaulniers, James Morse,
Alexandru Elisei, Suzuki K Poulose, Oliver Upton, Tom Rix, kvm,
linux-arm-kernel, kvmarm, kvmarm, linux-riscv, llvm,
linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta, David Matlack
On 2022-12-13 20:03, Sean Christopherson wrote:
> One last thought/question, what do y'all think about renaming
> directories to
> follow the kernel proper? I.e. aarch64=>arm64, s390x=>s390, and
> x86_64=>x86.
> Then $(ARCH_DIR) would go away. The churn would be unfortunate, but it
> would be
> nice to align with arch/ and tools/arch/.
aarch64->arm64 makes sense to me. Whether it is worth the churn
is another question. As long as we don't try to backport tests,
the damage should be limited to a single merge window.
M.
--
Jazz is not dead. It just smells funny...
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 06/14] KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86
2022-12-13 0:16 ` Sean Christopherson
(?)
(?)
@ 2022-12-24 9:12 ` Paolo Bonzini
-1 siblings, 0 replies; 115+ messages in thread
From: Paolo Bonzini @ 2022-12-24 9:12 UTC (permalink / raw)
To: Sean Christopherson, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On 12/13/22 01:16, Sean Christopherson wrote:
> -ifeq ($(ARCH),riscv)
> - UNAME_M := riscv
> +ifeq ($(ARCH),x86)
> + ARCH_DIR := x86_64
> +else ifeq ($(ARCH),arm64)
> + ARCH_DIR := aarch64
> +else ifeq ($(ARCH),s390)
> + ARCH_DIR := s390x
> +else ifeq ($(ARCH),riscv)
> + ARCH_DIR := riscv
> +else
> +$(error Unknown architecture '$(ARCH)')
> endif
$(error) would break compiling via tools/testing/selftests/Makefile, so
I am squashing this:
diff --git a/tools/testing/selftests/kvm/Makefile
b/tools/testing/selftests/kvm/Makefile
index d761a77c3a80..59f3eb53c932 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -13,10 +13,8 @@ else ifeq ($(ARCH),arm64)
ARCH_DIR := aarch64
else ifeq ($(ARCH),s390)
ARCH_DIR := s390x
-else ifeq ($(ARCH),riscv)
- ARCH_DIR := riscv
else
-$(error Unknown architecture '$(ARCH)')
+ ARCH_DIR := $(ARCH)
endif
LIBKVM += lib/assert.c
Then the aarch64 and s390x directories can be renamed---x86 too, but the
ifeq needs to stay (just changed to do x86_64->x86 instead of the other
way round).
Paolo
^ permalink raw reply related [flat|nested] 115+ messages in thread
* Re: [PATCH 06/14] KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86
@ 2022-12-24 9:12 ` Paolo Bonzini
0 siblings, 0 replies; 115+ messages in thread
From: Paolo Bonzini @ 2022-12-24 9:12 UTC (permalink / raw)
To: Sean Christopherson, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: Aaron Lewis, kvm, Tom Rix, llvm, linux-kernel, kvmarm,
linux-riscv, kvmarm, linux-arm-kernel
On 12/13/22 01:16, Sean Christopherson wrote:
> -ifeq ($(ARCH),riscv)
> - UNAME_M := riscv
> +ifeq ($(ARCH),x86)
> + ARCH_DIR := x86_64
> +else ifeq ($(ARCH),arm64)
> + ARCH_DIR := aarch64
> +else ifeq ($(ARCH),s390)
> + ARCH_DIR := s390x
> +else ifeq ($(ARCH),riscv)
> + ARCH_DIR := riscv
> +else
> +$(error Unknown architecture '$(ARCH)')
> endif
$(error) would break compiling via tools/testing/selftests/Makefile, so
I am squashing this:
diff --git a/tools/testing/selftests/kvm/Makefile
b/tools/testing/selftests/kvm/Makefile
index d761a77c3a80..59f3eb53c932 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -13,10 +13,8 @@ else ifeq ($(ARCH),arm64)
ARCH_DIR := aarch64
else ifeq ($(ARCH),s390)
ARCH_DIR := s390x
-else ifeq ($(ARCH),riscv)
- ARCH_DIR := riscv
else
-$(error Unknown architecture '$(ARCH)')
+ ARCH_DIR := $(ARCH)
endif
LIBKVM += lib/assert.c
Then the aarch64 and s390x directories can be renamed---x86 too, but the
ifeq needs to stay (just changed to do x86_64->x86 instead of the other
way round).
Paolo
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply related [flat|nested] 115+ messages in thread
* Re: [PATCH 06/14] KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86
@ 2022-12-24 9:12 ` Paolo Bonzini
0 siblings, 0 replies; 115+ messages in thread
From: Paolo Bonzini @ 2022-12-24 9:12 UTC (permalink / raw)
To: Sean Christopherson, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On 12/13/22 01:16, Sean Christopherson wrote:
> -ifeq ($(ARCH),riscv)
> - UNAME_M := riscv
> +ifeq ($(ARCH),x86)
> + ARCH_DIR := x86_64
> +else ifeq ($(ARCH),arm64)
> + ARCH_DIR := aarch64
> +else ifeq ($(ARCH),s390)
> + ARCH_DIR := s390x
> +else ifeq ($(ARCH),riscv)
> + ARCH_DIR := riscv
> +else
> +$(error Unknown architecture '$(ARCH)')
> endif
$(error) would break compiling via tools/testing/selftests/Makefile, so
I am squashing this:
diff --git a/tools/testing/selftests/kvm/Makefile
b/tools/testing/selftests/kvm/Makefile
index d761a77c3a80..59f3eb53c932 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -13,10 +13,8 @@ else ifeq ($(ARCH),arm64)
ARCH_DIR := aarch64
else ifeq ($(ARCH),s390)
ARCH_DIR := s390x
-else ifeq ($(ARCH),riscv)
- ARCH_DIR := riscv
else
-$(error Unknown architecture '$(ARCH)')
+ ARCH_DIR := $(ARCH)
endif
LIBKVM += lib/assert.c
Then the aarch64 and s390x directories can be renamed---x86 too, but the
ifeq needs to stay (just changed to do x86_64->x86 instead of the other
way round).
Paolo
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 115+ messages in thread
* Re: [PATCH 06/14] KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86
@ 2022-12-24 9:12 ` Paolo Bonzini
0 siblings, 0 replies; 115+ messages in thread
From: Paolo Bonzini @ 2022-12-24 9:12 UTC (permalink / raw)
To: Sean Christopherson, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On 12/13/22 01:16, Sean Christopherson wrote:
> -ifeq ($(ARCH),riscv)
> - UNAME_M := riscv
> +ifeq ($(ARCH),x86)
> + ARCH_DIR := x86_64
> +else ifeq ($(ARCH),arm64)
> + ARCH_DIR := aarch64
> +else ifeq ($(ARCH),s390)
> + ARCH_DIR := s390x
> +else ifeq ($(ARCH),riscv)
> + ARCH_DIR := riscv
> +else
> +$(error Unknown architecture '$(ARCH)')
> endif
$(error) would break compiling via tools/testing/selftests/Makefile, so
I am squashing this:
diff --git a/tools/testing/selftests/kvm/Makefile
b/tools/testing/selftests/kvm/Makefile
index d761a77c3a80..59f3eb53c932 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -13,10 +13,8 @@ else ifeq ($(ARCH),arm64)
ARCH_DIR := aarch64
else ifeq ($(ARCH),s390)
ARCH_DIR := s390x
-else ifeq ($(ARCH),riscv)
- ARCH_DIR := riscv
else
-$(error Unknown architecture '$(ARCH)')
+ ARCH_DIR := $(ARCH)
endif
LIBKVM += lib/assert.c
Then the aarch64 and s390x directories can be renamed---x86 too, but the
ifeq needs to stay (just changed to do x86_64->x86 instead of the other
way round).
Paolo
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 115+ messages in thread
* Re: [PATCH 09/14] KVM: selftests: Explicitly disable builtins for mem*() overrides
2022-12-13 0:16 ` Sean Christopherson
(?)
(?)
@ 2022-12-24 9:16 ` Paolo Bonzini
-1 siblings, 0 replies; 115+ messages in thread
From: Paolo Bonzini @ 2022-12-24 9:16 UTC (permalink / raw)
To: Sean Christopherson, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: Aaron Lewis, kvm, Tom Rix, llvm, linux-kernel, kvmarm,
linux-riscv, kvmarm, linux-arm-kernel
On 12/13/22 01:16, Sean Christopherson wrote:
> Explicitly disable the compiler's builtin memcmp(), memcpy(), and
> memset(). Because only lib/string_override.c is built with -ffreestanding,
> the compiler reserves the right to do what it wants and can try to link the
> non-freestanding code to its own crud.
>
> /usr/bin/x86_64-linux-gnu-ld: /lib/x86_64-linux-gnu/libc.a(memcmp.o): in function `memcmp_ifunc':
> (.text+0x0): multiple definition of `memcmp'; tools/testing/selftests/kvm/lib/string_override.o:
> tools/testing/selftests/kvm/lib/string_override.c:15: first defined here
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
Hmm, that's weird though. I think it's an effect of ifunc and maybe
even a linker bug. The patch makes sense anyway.
Paolo
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 09/14] KVM: selftests: Explicitly disable builtins for mem*() overrides
@ 2022-12-24 9:16 ` Paolo Bonzini
0 siblings, 0 replies; 115+ messages in thread
From: Paolo Bonzini @ 2022-12-24 9:16 UTC (permalink / raw)
To: Sean Christopherson, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On 12/13/22 01:16, Sean Christopherson wrote:
> Explicitly disable the compiler's builtin memcmp(), memcpy(), and
> memset(). Because only lib/string_override.c is built with -ffreestanding,
> the compiler reserves the right to do what it wants and can try to link the
> non-freestanding code to its own crud.
>
> /usr/bin/x86_64-linux-gnu-ld: /lib/x86_64-linux-gnu/libc.a(memcmp.o): in function `memcmp_ifunc':
> (.text+0x0): multiple definition of `memcmp'; tools/testing/selftests/kvm/lib/string_override.o:
> tools/testing/selftests/kvm/lib/string_override.c:15: first defined here
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
Hmm, that's weird though. I think it's an effect of ifunc and maybe
even a linker bug. The patch makes sense anyway.
Paolo
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 09/14] KVM: selftests: Explicitly disable builtins for mem*() overrides
@ 2022-12-24 9:16 ` Paolo Bonzini
0 siblings, 0 replies; 115+ messages in thread
From: Paolo Bonzini @ 2022-12-24 9:16 UTC (permalink / raw)
To: Sean Christopherson, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On 12/13/22 01:16, Sean Christopherson wrote:
> Explicitly disable the compiler's builtin memcmp(), memcpy(), and
> memset(). Because only lib/string_override.c is built with -ffreestanding,
> the compiler reserves the right to do what it wants and can try to link the
> non-freestanding code to its own crud.
>
> /usr/bin/x86_64-linux-gnu-ld: /lib/x86_64-linux-gnu/libc.a(memcmp.o): in function `memcmp_ifunc':
> (.text+0x0): multiple definition of `memcmp'; tools/testing/selftests/kvm/lib/string_override.o:
> tools/testing/selftests/kvm/lib/string_override.c:15: first defined here
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
Hmm, that's weird though. I think it's an effect of ifunc and maybe
even a linker bug. The patch makes sense anyway.
Paolo
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 09/14] KVM: selftests: Explicitly disable builtins for mem*() overrides
@ 2022-12-24 9:16 ` Paolo Bonzini
0 siblings, 0 replies; 115+ messages in thread
From: Paolo Bonzini @ 2022-12-24 9:16 UTC (permalink / raw)
To: Sean Christopherson, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On 12/13/22 01:16, Sean Christopherson wrote:
> Explicitly disable the compiler's builtin memcmp(), memcpy(), and
> memset(). Because only lib/string_override.c is built with -ffreestanding,
> the compiler reserves the right to do what it wants and can try to link the
> non-freestanding code to its own crud.
>
> /usr/bin/x86_64-linux-gnu-ld: /lib/x86_64-linux-gnu/libc.a(memcmp.o): in function `memcmp_ifunc':
> (.text+0x0): multiple definition of `memcmp'; tools/testing/selftests/kvm/lib/string_override.o:
> tools/testing/selftests/kvm/lib/string_override.c:15: first defined here
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
Hmm, that's weird though. I think it's an effect of ifunc and maybe
even a linker bug. The patch makes sense anyway.
Paolo
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 10/14] KVM: selftests: Include lib.mk before consuming $(CC)
2022-12-13 0:16 ` Sean Christopherson
(?)
(?)
@ 2022-12-24 9:18 ` Paolo Bonzini
-1 siblings, 0 replies; 115+ messages in thread
From: Paolo Bonzini @ 2022-12-24 9:18 UTC (permalink / raw)
To: Sean Christopherson, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On 12/13/22 01:16, Sean Christopherson wrote:
> Include lib.mk before consuming $(CC) and document that lib.mk overwrites
> $(CC) unless make was invoked with -e or $(CC) was specified after make
> (which apparently makes the environment override the Makefile?!?!).
Yes, it does. In projects that don't use configure or similar, you
might have seen
CFLAGS = -O2 -g
to be overridden with "make CFLAGS=-g" if optimization is undesirable.
Paolo
> Including lib.mk after using it for probing, e.g. for -no-pie, can lead
> to weirdness.
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 10/14] KVM: selftests: Include lib.mk before consuming $(CC)
@ 2022-12-24 9:18 ` Paolo Bonzini
0 siblings, 0 replies; 115+ messages in thread
From: Paolo Bonzini @ 2022-12-24 9:18 UTC (permalink / raw)
To: Sean Christopherson, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: Aaron Lewis, kvm, Tom Rix, llvm, linux-kernel, kvmarm,
linux-riscv, kvmarm, linux-arm-kernel
On 12/13/22 01:16, Sean Christopherson wrote:
> Include lib.mk before consuming $(CC) and document that lib.mk overwrites
> $(CC) unless make was invoked with -e or $(CC) was specified after make
> (which apparently makes the environment override the Makefile?!?!).
Yes, it does. In projects that don't use configure or similar, you
might have seen
CFLAGS = -O2 -g
to be overridden with "make CFLAGS=-g" if optimization is undesirable.
Paolo
> Including lib.mk after using it for probing, e.g. for -no-pie, can lead
> to weirdness.
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 10/14] KVM: selftests: Include lib.mk before consuming $(CC)
@ 2022-12-24 9:18 ` Paolo Bonzini
0 siblings, 0 replies; 115+ messages in thread
From: Paolo Bonzini @ 2022-12-24 9:18 UTC (permalink / raw)
To: Sean Christopherson, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On 12/13/22 01:16, Sean Christopherson wrote:
> Include lib.mk before consuming $(CC) and document that lib.mk overwrites
> $(CC) unless make was invoked with -e or $(CC) was specified after make
> (which apparently makes the environment override the Makefile?!?!).
Yes, it does. In projects that don't use configure or similar, you
might have seen
CFLAGS = -O2 -g
to be overridden with "make CFLAGS=-g" if optimization is undesirable.
Paolo
> Including lib.mk after using it for probing, e.g. for -no-pie, can lead
> to weirdness.
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 10/14] KVM: selftests: Include lib.mk before consuming $(CC)
@ 2022-12-24 9:18 ` Paolo Bonzini
0 siblings, 0 replies; 115+ messages in thread
From: Paolo Bonzini @ 2022-12-24 9:18 UTC (permalink / raw)
To: Sean Christopherson, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On 12/13/22 01:16, Sean Christopherson wrote:
> Include lib.mk before consuming $(CC) and document that lib.mk overwrites
> $(CC) unless make was invoked with -e or $(CC) was specified after make
> (which apparently makes the environment override the Makefile?!?!).
Yes, it does. In projects that don't use configure or similar, you
might have seen
CFLAGS = -O2 -g
to be overridden with "make CFLAGS=-g" if optimization is undesirable.
Paolo
> Including lib.mk after using it for probing, e.g. for -no-pie, can lead
> to weirdness.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 12/14] KVM: selftests: Use wildcards to find library source files
2022-12-13 0:16 ` Sean Christopherson
(?)
(?)
@ 2022-12-24 9:23 ` Paolo Bonzini
-1 siblings, 0 replies; 115+ messages in thread
From: Paolo Bonzini @ 2022-12-24 9:23 UTC (permalink / raw)
To: Sean Christopherson, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On 12/13/22 01:16, Sean Christopherson wrote:
> Use $(wildcard ...) to find the library source files instead of manually
> defining the inputs, which is a maintenance burden and error prone.
No, please don't. This leads to weird errors, for example when "git
checkout" is interrupted with ^C. I have applied patches 1-11.
Paolo
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 12/14] KVM: selftests: Use wildcards to find library source files
@ 2022-12-24 9:23 ` Paolo Bonzini
0 siblings, 0 replies; 115+ messages in thread
From: Paolo Bonzini @ 2022-12-24 9:23 UTC (permalink / raw)
To: Sean Christopherson, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: Aaron Lewis, kvm, Tom Rix, llvm, linux-kernel, kvmarm,
linux-riscv, kvmarm, linux-arm-kernel
On 12/13/22 01:16, Sean Christopherson wrote:
> Use $(wildcard ...) to find the library source files instead of manually
> defining the inputs, which is a maintenance burden and error prone.
No, please don't. This leads to weird errors, for example when "git
checkout" is interrupted with ^C. I have applied patches 1-11.
Paolo
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 12/14] KVM: selftests: Use wildcards to find library source files
@ 2022-12-24 9:23 ` Paolo Bonzini
0 siblings, 0 replies; 115+ messages in thread
From: Paolo Bonzini @ 2022-12-24 9:23 UTC (permalink / raw)
To: Sean Christopherson, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On 12/13/22 01:16, Sean Christopherson wrote:
> Use $(wildcard ...) to find the library source files instead of manually
> defining the inputs, which is a maintenance burden and error prone.
No, please don't. This leads to weird errors, for example when "git
checkout" is interrupted with ^C. I have applied patches 1-11.
Paolo
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 12/14] KVM: selftests: Use wildcards to find library source files
@ 2022-12-24 9:23 ` Paolo Bonzini
0 siblings, 0 replies; 115+ messages in thread
From: Paolo Bonzini @ 2022-12-24 9:23 UTC (permalink / raw)
To: Sean Christopherson, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Nathan Chancellor, Nick Desaulniers
Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv,
llvm, linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On 12/13/22 01:16, Sean Christopherson wrote:
> Use $(wildcard ...) to find the library source files instead of manually
> defining the inputs, which is a maintenance burden and error prone.
No, please don't. This leads to weird errors, for example when "git
checkout" is interrupted with ^C. I have applied patches 1-11.
Paolo
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 12/14] KVM: selftests: Use wildcards to find library source files
2022-12-24 9:23 ` Paolo Bonzini
(?)
(?)
@ 2023-01-04 1:09 ` Sean Christopherson
-1 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2023-01-04 1:09 UTC (permalink / raw)
To: Paolo Bonzini
Cc: Marc Zyngier, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Nathan Chancellor, Nick Desaulniers, James Morse,
Alexandru Elisei, Suzuki K Poulose, Oliver Upton, Tom Rix, kvm,
linux-arm-kernel, kvmarm, kvmarm, linux-riscv, llvm,
linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On Sat, Dec 24, 2022, Paolo Bonzini wrote:
> On 12/13/22 01:16, Sean Christopherson wrote:
> > Use $(wildcard ...) to find the library source files instead of manually
> > defining the inputs, which is a maintenance burden and error prone.
>
> No, please don't. This leads to weird errors, for example when "git
> checkout" is interrupted with ^C.
Well, don't do that ;-)
Are there concerns beyond having an incomplete and/or modified git working tree?
E.g. could we do something crazy like fail the build by default if the working
tree isn't pristine? The library files aren't terrible, but the number of tests
is getting unwieldy, to say the least.
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 12/14] KVM: selftests: Use wildcards to find library source files
@ 2023-01-04 1:09 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2023-01-04 1:09 UTC (permalink / raw)
To: Paolo Bonzini
Cc: Marc Zyngier, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Nathan Chancellor, Nick Desaulniers, James Morse,
Alexandru Elisei, Suzuki K Poulose, Oliver Upton, Tom Rix, kvm,
linux-arm-kernel, kvmarm, kvmarm, linux-riscv, llvm,
linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On Sat, Dec 24, 2022, Paolo Bonzini wrote:
> On 12/13/22 01:16, Sean Christopherson wrote:
> > Use $(wildcard ...) to find the library source files instead of manually
> > defining the inputs, which is a maintenance burden and error prone.
>
> No, please don't. This leads to weird errors, for example when "git
> checkout" is interrupted with ^C.
Well, don't do that ;-)
Are there concerns beyond having an incomplete and/or modified git working tree?
E.g. could we do something crazy like fail the build by default if the working
tree isn't pristine? The library files aren't terrible, but the number of tests
is getting unwieldy, to say the least.
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 12/14] KVM: selftests: Use wildcards to find library source files
@ 2023-01-04 1:09 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2023-01-04 1:09 UTC (permalink / raw)
To: Paolo Bonzini
Cc: Albert Ou, Aaron Lewis, kvm, Marc Zyngier, llvm,
Nick Desaulniers, linux-kernel, Nathan Chancellor, Tom Rix,
Palmer Dabbelt, Paul Walmsley, kvmarm, linux-riscv, kvmarm,
linux-arm-kernel
On Sat, Dec 24, 2022, Paolo Bonzini wrote:
> On 12/13/22 01:16, Sean Christopherson wrote:
> > Use $(wildcard ...) to find the library source files instead of manually
> > defining the inputs, which is a maintenance burden and error prone.
>
> No, please don't. This leads to weird errors, for example when "git
> checkout" is interrupted with ^C.
Well, don't do that ;-)
Are there concerns beyond having an incomplete and/or modified git working tree?
E.g. could we do something crazy like fail the build by default if the working
tree isn't pristine? The library files aren't terrible, but the number of tests
is getting unwieldy, to say the least.
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 12/14] KVM: selftests: Use wildcards to find library source files
@ 2023-01-04 1:09 ` Sean Christopherson
0 siblings, 0 replies; 115+ messages in thread
From: Sean Christopherson @ 2023-01-04 1:09 UTC (permalink / raw)
To: Paolo Bonzini
Cc: Marc Zyngier, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Nathan Chancellor, Nick Desaulniers, James Morse,
Alexandru Elisei, Suzuki K Poulose, Oliver Upton, Tom Rix, kvm,
linux-arm-kernel, kvmarm, kvmarm, linux-riscv, llvm,
linux-kernel, Ricardo Koller, Aaron Lewis,
Raghavendra Rao Ananta
On Sat, Dec 24, 2022, Paolo Bonzini wrote:
> On 12/13/22 01:16, Sean Christopherson wrote:
> > Use $(wildcard ...) to find the library source files instead of manually
> > defining the inputs, which is a maintenance burden and error prone.
>
> No, please don't. This leads to weird errors, for example when "git
> checkout" is interrupted with ^C.
Well, don't do that ;-)
Are there concerns beyond having an incomplete and/or modified git working tree?
E.g. could we do something crazy like fail the build by default if the working
tree isn't pristine? The library files aren't terrible, but the number of tests
is getting unwieldy, to say the least.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 11/14] KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning
2022-12-13 2:13 ` Sean Christopherson
(?)
@ 2023-01-11 16:23 ` Paolo Bonzini
-1 siblings, 0 replies; 115+ messages in thread
From: Paolo Bonzini @ 2023-01-11 16:23 UTC (permalink / raw)
To: Sean Christopherson, Nick Desaulniers
Cc: Marc Zyngier, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Nathan Chancellor, James Morse, Alexandru Elisei,
Suzuki K Poulose, Oliver Upton, Tom Rix, kvm, linux-arm-kernel,
kvmarm, kvmarm, linux-riscv, llvm, linux-kernel, Ricardo Koller,
Aaron Lewis, Raghavendra Rao Ananta
On 12/13/22 03:13, Sean Christopherson wrote:
> AFAICT, gcc stopped treating unknown "-Wno" flags as unconditional errors starting
> with gcc-4.4, and the kernel's min supported version is 5.1. gcc-4.4 through
> gcc-9.5 all print a mild warning if there's a different error, but otherwise
> silently ignore the uknown "-Wno".
>
> cc1: warning: unrecognized command line option '-Wno-gnu-variable-sized-type-not-at-end'
scripts/Makefile.compiler has cc-disable-warning for this, we can copy
it to tools/.
Paolo
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 11/14] KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning
@ 2023-01-11 16:23 ` Paolo Bonzini
0 siblings, 0 replies; 115+ messages in thread
From: Paolo Bonzini @ 2023-01-11 16:23 UTC (permalink / raw)
To: Sean Christopherson, Nick Desaulniers
Cc: Marc Zyngier, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Nathan Chancellor, James Morse, Alexandru Elisei,
Suzuki K Poulose, Oliver Upton, Tom Rix, kvm, linux-arm-kernel,
kvmarm, kvmarm, linux-riscv, llvm, linux-kernel, Ricardo Koller,
Aaron Lewis, Raghavendra Rao Ananta
On 12/13/22 03:13, Sean Christopherson wrote:
> AFAICT, gcc stopped treating unknown "-Wno" flags as unconditional errors starting
> with gcc-4.4, and the kernel's min supported version is 5.1. gcc-4.4 through
> gcc-9.5 all print a mild warning if there's a different error, but otherwise
> silently ignore the uknown "-Wno".
>
> cc1: warning: unrecognized command line option '-Wno-gnu-variable-sized-type-not-at-end'
scripts/Makefile.compiler has cc-disable-warning for this, we can copy
it to tools/.
Paolo
^ permalink raw reply [flat|nested] 115+ messages in thread
* Re: [PATCH 11/14] KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning
@ 2023-01-11 16:23 ` Paolo Bonzini
0 siblings, 0 replies; 115+ messages in thread
From: Paolo Bonzini @ 2023-01-11 16:23 UTC (permalink / raw)
To: Sean Christopherson, Nick Desaulniers
Cc: Marc Zyngier, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Nathan Chancellor, James Morse, Alexandru Elisei,
Suzuki K Poulose, Oliver Upton, Tom Rix, kvm, linux-arm-kernel,
kvmarm, kvmarm, linux-riscv, llvm, linux-kernel, Ricardo Koller,
Aaron Lewis, Raghavendra Rao Ananta
On 12/13/22 03:13, Sean Christopherson wrote:
> AFAICT, gcc stopped treating unknown "-Wno" flags as unconditional errors starting
> with gcc-4.4, and the kernel's min supported version is 5.1. gcc-4.4 through
> gcc-9.5 all print a mild warning if there's a different error, but otherwise
> silently ignore the uknown "-Wno".
>
> cc1: warning: unrecognized command line option '-Wno-gnu-variable-sized-type-not-at-end'
scripts/Makefile.compiler has cc-disable-warning for this, we can copy
it to tools/.
Paolo
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 115+ messages in thread
end of thread, other threads:[~2023-01-11 16:24 UTC | newest]
Thread overview: 115+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-13 0:16 [PATCH 00/14] KVM: selftests: Clang fixes, Makefile cleanup Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` [PATCH 01/14] KVM: selftests: Define literal to asm constraint in aarch64 as unsigned long Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 9:51 ` Philippe Mathieu-Daudé
2022-12-13 9:51 ` Philippe Mathieu-Daudé
2022-12-13 9:51 ` Philippe Mathieu-Daudé
2022-12-13 9:51 ` Philippe Mathieu-Daudé
2022-12-13 0:16 ` [PATCH 02/14] KVM: selftests: Delete dead code in x86_64/vmx_tsc_adjust_test.c Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` [PATCH 03/14] KVM: selftests: Fix divide-by-zero bug in memslot_perf_test Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 9:46 ` Philippe Mathieu-Daudé
2022-12-13 9:46 ` Philippe Mathieu-Daudé
2022-12-13 9:46 ` Philippe Mathieu-Daudé
2022-12-13 9:46 ` Philippe Mathieu-Daudé
2022-12-13 0:16 ` [PATCH 04/14] KVM: selftests: Use pattern matching in .gitignore Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` [PATCH 05/14] KVM: selftests: Fix a typo in x86-64's kvm_get_cpu_address_width() Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 9:47 ` Philippe Mathieu-Daudé
2022-12-13 9:47 ` Philippe Mathieu-Daudé
2022-12-13 9:47 ` Philippe Mathieu-Daudé
2022-12-13 9:47 ` Philippe Mathieu-Daudé
2022-12-13 0:16 ` [PATCH 06/14] KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86 Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 20:03 ` Sean Christopherson
2022-12-13 20:03 ` Sean Christopherson
2022-12-13 20:03 ` Sean Christopherson
2022-12-13 20:03 ` Sean Christopherson
2022-12-14 9:43 ` Marc Zyngier
2022-12-14 9:43 ` Marc Zyngier
2022-12-14 9:43 ` Marc Zyngier
2022-12-14 9:43 ` Marc Zyngier
2022-12-24 9:12 ` Paolo Bonzini
2022-12-24 9:12 ` Paolo Bonzini
2022-12-24 9:12 ` Paolo Bonzini
2022-12-24 9:12 ` Paolo Bonzini
2022-12-13 0:16 ` [PATCH 07/14] KVM: selftests: Use proper function prototypes in probing code Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 9:48 ` Philippe Mathieu-Daudé
2022-12-13 9:48 ` Philippe Mathieu-Daudé
2022-12-13 9:48 ` Philippe Mathieu-Daudé
2022-12-13 9:48 ` Philippe Mathieu-Daudé
2022-12-13 0:16 ` [PATCH 08/14] KVM: selftests: Probe -no-pie with actual CFLAGS used to compile Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` [PATCH 09/14] KVM: selftests: Explicitly disable builtins for mem*() overrides Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-24 9:16 ` Paolo Bonzini
2022-12-24 9:16 ` Paolo Bonzini
2022-12-24 9:16 ` Paolo Bonzini
2022-12-24 9:16 ` Paolo Bonzini
2022-12-13 0:16 ` [PATCH 10/14] KVM: selftests: Include lib.mk before consuming $(CC) Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-24 9:18 ` Paolo Bonzini
2022-12-24 9:18 ` Paolo Bonzini
2022-12-24 9:18 ` Paolo Bonzini
2022-12-24 9:18 ` Paolo Bonzini
2022-12-13 0:16 ` [PATCH 11/14] KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 1:36 ` Nick Desaulniers
2022-12-13 1:36 ` Nick Desaulniers
2022-12-13 1:36 ` Nick Desaulniers
2022-12-13 1:36 ` Nick Desaulniers
2022-12-13 2:13 ` Sean Christopherson
2022-12-13 2:13 ` Sean Christopherson
2022-12-13 2:13 ` Sean Christopherson
2022-12-13 2:13 ` Sean Christopherson
2023-01-11 16:23 ` Paolo Bonzini
2023-01-11 16:23 ` Paolo Bonzini
2023-01-11 16:23 ` Paolo Bonzini
2022-12-13 0:16 ` [PATCH 12/14] KVM: selftests: Use wildcards to find library source files Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-24 9:23 ` Paolo Bonzini
2022-12-24 9:23 ` Paolo Bonzini
2022-12-24 9:23 ` Paolo Bonzini
2022-12-24 9:23 ` Paolo Bonzini
2023-01-04 1:09 ` Sean Christopherson
2023-01-04 1:09 ` Sean Christopherson
2023-01-04 1:09 ` Sean Christopherson
2023-01-04 1:09 ` Sean Christopherson
2022-12-13 0:16 ` [PATCH 13/14] KVM: selftests: Use wildcards to find targets and test " Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` [PATCH 14/14] KVM: selftests: Enable RSEQ test for RISC-V Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
2022-12-13 0:16 ` Sean Christopherson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.