#
0cc3a351 |
| 22-Feb-2025 |
Sean Christopherson <seanjc@google.com> |
lib: Use __ASSEMBLER__ instead of __ASSEMBLY__
Convert all non-x86 #ifdefs from __ASSEMBLY__ to __ASSEMBLER__, and remove all manual __ASSEMBLY__ #defines. __ASSEMBLY_ was inherited blindly from th
lib: Use __ASSEMBLER__ instead of __ASSEMBLY__
Convert all non-x86 #ifdefs from __ASSEMBLY__ to __ASSEMBLER__, and remove all manual __ASSEMBLY__ #defines. __ASSEMBLY_ was inherited blindly from the Linux kernel, and must be manually defined, e.g. through build rules or with the aforementioned explicit #defines in assembly code.
__ASSEMBLER__ on the other hand is automatically defined by the compiler when preprocessing assembly, i.e. doesn't require manually #defines for the code to function correctly.
Ignore x86, as x86 doesn't actually rely on __ASSEMBLY__ at the moment, and is undergoing a parallel cleanup.
Signed-off-by: Sean Christopherson <seanjc@google.com> Reviewed-by: Andrew Jones <andrew.jones@linux.dev> Message-ID: <20250222014526.2302653-1-seanjc@google.com> [thuth: Fix three more occurances in libfdt.h and sbi-tests.h] Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
#
3064cb57 |
| 23-Oct-2024 |
Andrew Jones <andrew.jones@linux.dev> |
lib/report: Return pass/fail result from report
A nice pattern to use in order to try and maintain parsable reports, but also output unexpected values, is
if (!report(value == expected_value, "
lib/report: Return pass/fail result from report
A nice pattern to use in order to try and maintain parsable reports, but also output unexpected values, is
if (!report(value == expected_value, "my test")) { report_info("failure due to unexpected value (received %d, expected %d)", value, expected_value); }
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Signed-off-by: Andrew Jones <andrew.jones@linux.dev>
show more ...
|
#
30f161db |
| 22-Oct-2024 |
Andrew Jones <andrew.jones@linux.dev> |
Merge branch 'riscv/sbi' into 'master'
riscv: Collect some patches supporting SBI tests
See merge request kvm-unit-tests/kvm-unit-tests!68
|
#
b2a8279b |
| 10-Sep-2024 |
James Raphael Tiovalen <jamestiotio@gmail.com> |
lib/report: Add helper method to clear multiple prefixes
Add a method to pop a specified number of prefixes. This method is useful when tests want to clear multiple prefixes at once.
Suggested-by:
lib/report: Add helper method to clear multiple prefixes
Add a method to pop a specified number of prefixes. This method is useful when tests want to clear multiple prefixes at once.
Suggested-by: Andrew Jones <andrew.jones@linux.dev> Signed-off-by: James Raphael Tiovalen <jamestiotio@gmail.com> Signed-off-by: Andrew Jones <andrew.jones@linux.dev>
show more ...
|
#
95a94088 |
| 04-May-2024 |
Nicholas Piggin <npiggin@gmail.com> |
lib: Use vmalloc.h for setup_mmu definition
There is no good reason to put setup_vm in libcflat.h when it's defined in vmalloc.h.
Acked-by: Andrew Jones <andrew.jones@linux.dev> Signed-off-by: Nich
lib: Use vmalloc.h for setup_mmu definition
There is no good reason to put setup_vm in libcflat.h when it's defined in vmalloc.h.
Acked-by: Andrew Jones <andrew.jones@linux.dev> Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Message-ID: <20240504122841.1177683-24-npiggin@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
#
7cd02206 |
| 04-May-2024 |
Nicholas Piggin <npiggin@gmail.com> |
report: Add known failure reporting option
There are times we would like to test a function that is known to fail in some conditions due to a bug in implementation (QEMU, KVM, or even hardware). It
report: Add known failure reporting option
There are times we would like to test a function that is known to fail in some conditions due to a bug in implementation (QEMU, KVM, or even hardware). It would be nice to count these as known failures and not report a summary failure.
xfail is not the same thing, xfail means failure is required and a pass causes the test to fail. So add kfail for known failures.
Mark the failing ppc64 h_cede_tm and spapr_vpa tests as kfail.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20240504122841.1177683-3-npiggin@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
#
e526bc78 |
| 01-Jul-2023 |
Andrew Jones <andrew.jones@linux.dev> |
Merge branch 'arm/queue' into 'master'
arm/arm64: EFI support, arm64 backtrace support, PMU test improvements, and more
See merge request kvm-unit-tests/kvm-unit-tests!43
|
#
13182cd7 |
| 30-May-2023 |
Nikos Nikoleris <nikos.nikoleris@arm.com> |
arm64: Add support for gic initialization through ACPI
In systems with ACPI support and when a DT is not provided, we can use the MADTs to figure out if it implements a GICv2 or a GICv3 and discover
arm64: Add support for gic initialization through ACPI
In systems with ACPI support and when a DT is not provided, we can use the MADTs to figure out if it implements a GICv2 or a GICv3 and discover the GIC parameters. This change implements this but retains the default behavior; we check if a valid DT is provided, if not, we try to discover the cores in the system using ACPI.
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Signed-off-by: Andrew Jones <andrew.jones@linux.dev>
show more ...
|
#
f3e081d7 |
| 10-Nov-2021 |
Aaron Lewis <aaronlewis@google.com> |
x86: Look up the PTEs rather than assuming them
Rather than assuming which PTEs the SMEP test runs on, look them up to ensure they are correct. If this test were to run on a different page table (i
x86: Look up the PTEs rather than assuming them
Rather than assuming which PTEs the SMEP test runs on, look them up to ensure they are correct. If this test were to run on a different page table (ie: run in an L2 test) the wrong PTEs would be set. Switch to looking up the PTEs to avoid this from happening.
Signed-off-by: Aaron Lewis <aaronlewis@google.com> Message-Id: <20211110212001.3745914-11-aaronlewis@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
7b18fa38 |
| 05-Oct-2021 |
Janis Schoetterl-Glausch <scgl@linux.ibm.com> |
lib: Introduce report_pass and report_fail
These functions can be used instead of report(1/true/0/false, ...) and read a bit nicer.
Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com> Mess
lib: Introduce report_pass and report_fail
These functions can be used instead of report(1/true/0/false, ...) and read a bit nicer.
Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com> Message-Id: <20211005090921.1816373-4-scgl@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
#
a9d450af |
| 09-Sep-2021 |
Sean Christopherson <seanjc@google.com> |
lib: Move __unused attribute macro to compiler.h
Move the __unused macro to linux/compiler.h to co-locate it with the other macros that provide syntactic sugar around __attribute__.
No functional c
lib: Move __unused attribute macro to compiler.h
Move the __unused macro to linux/compiler.h to co-locate it with the other macros that provide syntactic sugar around __attribute__.
No functional change intended.
Signed-off-by: Sean Christopherson <seanjc@google.com> Message-Id: <20210909183207.2228273-4-seanjc@google.com> Reviewed-by: Jim Mattson <jmattson@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
7dfe5473 |
| 09-Sep-2021 |
Sean Christopherson <seanjc@google.com> |
lib: Drop x86/processor.h's barrier() in favor of compiler.h version
Drop x86's duplicate version of barrier() in favor of the generic #define provided by linux/compiler.h. Include compiler.h in th
lib: Drop x86/processor.h's barrier() in favor of compiler.h version
Drop x86's duplicate version of barrier() in favor of the generic #define provided by linux/compiler.h. Include compiler.h in the all-encompassing libcflat.h to pick up barrier() and other future goodies, e.g. new attributes defines.
Signed-off-by: Sean Christopherson <seanjc@google.com> Message-Id: <20210909183207.2228273-2-seanjc@google.com> Reviewed-by: Jim Mattson <jmattson@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
d4123fdd |
| 22-Jun-2021 |
Paolo Bonzini <bonzini@gnu.org> |
Merge branch 's390x-pull-2021-22-06' into 'master'
s390x-pull-2021-22-06
See merge request kvm-unit-tests/kvm-unit-tests!11
|
#
cb8f060d |
| 11-Jun-2021 |
Claudio Imbrenda <imbrenda@linux.ibm.com> |
libcflat: add SZ_1M and SZ_2G
Add SZ_1M and SZ_2G to libcflat.h
s390x needs those for large/huge pages
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Reviewed-by: Thomas Huth <thuth@redh
libcflat: add SZ_1M and SZ_2G
Add SZ_1M and SZ_2G to libcflat.h
s390x needs those for large/huge pages
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20210611140705.553307-3-imbrenda@linux.ibm.com> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
show more ...
|
#
9f0ae301 |
| 09-Jun-2021 |
Cornelia Huck <cohuck@redhat.com> |
lib: unify header guards
Standardize header guards to _LIB_HEADER_H_.
Signed-off-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: David Hildenbrand <david@redhat.com> Message-Id: <20210609143712.
lib: unify header guards
Standardize header guards to _LIB_HEADER_H_.
Signed-off-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: David Hildenbrand <david@redhat.com> Message-Id: <20210609143712.60933-3-cohuck@redhat.com>
show more ...
|
#
1a00120a |
| 11-Nov-2020 |
Andrew Jones <drjones@redhat.com> |
Merge branch 'arm-pull-11-11-2020' into 'master'
Arm pull 11.11.2020
See merge request kvm-unit-tests/kvm-unit-tests!2
|
#
a2d06852 |
| 04-Nov-2020 |
Nikos Nikoleris <nikos.nikoleris@arm.com> |
arm64: Add support for configuring the translation granule
Make the translation granule configurable for arm64. arm64 supports page sizes of 4K, 16K and 64K. By default, arm64 is configured with 64K
arm64: Add support for configuring the translation granule
Make the translation granule configurable for arm64. arm64 supports page sizes of 4K, 16K and 64K. By default, arm64 is configured with 64K pages. configure has been extended with a new argument:
--page-size=PAGE_SIZE
which allows the user to set the page shift and therefore the page size for arm64. Using the --page-size for any other architecture results an error message.
In addition, bump the VA size from 42 to 48 bits. To enable 48 bit VAs for all translation granules, add support for 4-level and 3-level page tables. At compile time, we determine how many levels in the page tables we needed.
Reviewed-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com> Tested-by: Alexandru Elisei <alexandru.elisei@arm.com> Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Signed-off-by: Andrew Jones <drjones@redhat.com>
show more ...
|
#
9e801bd9 |
| 06-Jul-2020 |
Claudio Imbrenda <imbrenda@linux.ibm.com> |
lib/alloc_page: move get_order and is_power_of_2 to a bitops.h
The functions get_order and is_power_of_2 are simple and should probably be in a header, like similar simple functions in bitops.h
Sin
lib/alloc_page: move get_order and is_power_of_2 to a bitops.h
The functions get_order and is_power_of_2 are simple and should probably be in a header, like similar simple functions in bitops.h
Since they concern bit manipulation, the logical place for them is in bitops.h
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Message-Id: <20200706164324.81123-4-imbrenda@linux.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
3251672a |
| 02-Apr-2020 |
Eric Auger <eric.auger@redhat.com> |
libcflat: Add other size defines
Introduce additional SZ_256, SZ_8K, SZ_16K macros that will be used by ITS tests.
Signed-off-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Thomas Huth <thuth@
libcflat: Add other size defines
Introduce additional SZ_256, SZ_8K, SZ_16K macros that will be used by ITS tests.
Signed-off-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Andrew Jones <drjones@redhat.com>
show more ...
|
#
a299895b |
| 06-Dec-2019 |
Thomas Huth <thuth@redhat.com> |
Switch the order of the parameters in report() and report_xfail()
Commit c09c54c66b1df ("lib: use an argument which doesn't require default argument promotion") fixed a warning that occurs with Clan
Switch the order of the parameters in report() and report_xfail()
Commit c09c54c66b1df ("lib: use an argument which doesn't require default argument promotion") fixed a warning that occurs with Clang, but introduced a regression: If the "pass" parameter is a value which has only set the condition bits in the upper 32 bits of a 64 bit value, the condition is now false since the value is truncated to "unsigned int" so that the upper bits are simply discarded.
We fixed it by reverting the commit, but that of course also means trouble with Clang again. We can not use "bool" if it is the last parameter before the variable argument list. The proper fix is to swap the parameters around and make the format string the last parameter.
This patch (except the changes in lib/libcflat.h and lib/report.c and some rebase conflicts along the way) has basically been created with following coccinelle script (with some additional manual tweaking of long and disabled lines afterwards):
@@ expression fmt; expression pass; expression list args; @@ report( -fmt, pass +pass, fmt , args);
@@ expression fmt; expression pass; expression list args; @@ report_xfail( -fmt, xfail, pass +xfail, pass, fmt , args);
Tested-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <20191206113102.14914-1-thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
ac033c9a |
| 23-Oct-2019 |
Paolo Bonzini <pbonzini@redhat.com> |
Revert "lib: use an argument which doesn't require default argument promotion"
This reverts commit c09c54c66b1df63cd11a75859cf53527d1c6e959. The s390x selftest, for example, passes a uintptr_t whose
Revert "lib: use an argument which doesn't require default argument promotion"
This reverts commit c09c54c66b1df63cd11a75859cf53527d1c6e959. The s390x selftest, for example, passes a uintptr_t whose nonzero bits are all above bit 31. Therefore, the argument is truncated to zero if it is unsigned rather than bool.
Reported-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
c09c54c6 |
| 09-Sep-2019 |
Bill Wendling <morbo@google.com> |
lib: use an argument which doesn't require default argument promotion
Clang warns that passing an object that undergoes default argument promotion to "va_start" is undefined behavior:
lib/report.c:
lib: use an argument which doesn't require default argument promotion
Clang warns that passing an object that undergoes default argument promotion to "va_start" is undefined behavior:
lib/report.c:106:15: error: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Werror,-Wvarargs] va_start(va, pass);
Using an "unsigned" type removes the need for argument promotion.
Signed-off-by: Bill Wendling <morbo@google.com> Message-Id: <CAGG=3QUL_OrjaWn+gF4z-R8brR2=3661hGk0uUAK2y8Dff7Mvg@mail.gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
6e44b71e |
| 28-Jun-2019 |
Nadav Amit <nadav.amit@gmail.com> |
libcflat: use stdbool
To avoid any future build errors, using stdbool instead of defining bool.
Signed-off-by: Nadav Amit <nadav.amit@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
#
497d0f12 |
| 21-Sep-2018 |
Paolo Bonzini <pbonzini@redhat.com> |
Merge tag 'for-master' of https://github.com/rhdrjones/kvm-unit-tests into HEAD
arm/arm64 patches ready for master
|
#
96d79976 |
| 20-Jul-2018 |
Andre Przywara <andre.przywara@arm.com> |
mark exit() and abort() as non-returning functions
exit() and abort() are functions that never return, and (at least) GCC has an attribute to flag those functions accordingly. This allows the compil
mark exit() and abort() as non-returning functions
exit() and abort() are functions that never return, and (at least) GCC has an attribute to flag those functions accordingly. This allows the compiler to do further optimizations and to omit various warnings about uninitialized variables, for instance. Since the actual "play-dead" function is in (inline) assembly, the compiler does not recognize its fatal nature, so help it with the __builtin_unreachable() hint. Flag the prototypes of our fatal functions accordingly.
Signed-off-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andrew Jones <drjones@redhat.com>
show more ...
|