863e0b90 | 29-May-2025 |
Sean Christopherson <seanjc@google.com> |
lib: Add and use static_assert() convenience wrappers
Add static_assert() to wrap _Static_assert() with stringification of the tested expression as the assert message. In most cases, the failed exp
lib: Add and use static_assert() convenience wrappers
Add static_assert() to wrap _Static_assert() with stringification of the tested expression as the assert message. In most cases, the failed expression is far more helpful than a human-generated message (usually because the developer is forced to add _something_ for the message).
For API consistency, provide a double-underscore variant for specifying a custom message.
Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com> Reviewed-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Andrew Jones <andrew.jones@linux.dev> Link: https://lore.kernel.org/r/20250529221929.3807680-2-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
show more ...
|
c6798030 | 06-Aug-2024 |
Janosch Frank <frankja@linux.ibm.com> |
lib: s390x: Split SIE fw structs from lib structs
The SIE control block is huge and takes up too much space.
Let's split the hardware definitions from sie.h into its own header, so that sie.h will
lib: s390x: Split SIE fw structs from lib structs
The SIE control block is huge and takes up too much space.
Let's split the hardware definitions from sie.h into its own header, so that sie.h will only contain library functions and structs
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Christoph Schlameuss <schlameuss@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Link: https://lore.kernel.org/r/20240806084409.169039-5-frankja@linux.ibm.com Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
show more ...
|
708ec6db | 16-Oct-2024 |
Nina Schoetterl-Glausch <nsg@linux.ibm.com> |
s390x: Add test for STFLE interpretive execution (format-0)
The STFLE instruction indicates installed facilities. SIE can interpretively execute STFLE. Use a snippet guest executing STFLE to get the
s390x: Add test for STFLE interpretive execution (format-0)
The STFLE instruction indicates installed facilities. SIE can interpretively execute STFLE. Use a snippet guest executing STFLE to get the result of interpretive execution and check the result.
Signed-off-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com> Link: https://lore.kernel.org/r/20241016180320.686132-7-nsg@linux.ibm.com [ nrb: fixup minor checkpatch issues ] Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
show more ...
|
da49e291 | 16-Oct-2024 |
Nina Schoetterl-Glausch <nsg@linux.ibm.com> |
s390x: Add library functions for exiting from snippet
It is useful to be able to force an exit to the host from the snippet, as well as do so while returning a value. Add this functionality, also ad
s390x: Add library functions for exiting from snippet
It is useful to be able to force an exit to the host from the snippet, as well as do so while returning a value. Add this functionality, also add helper functions for the host to check for an exit and get or check the value. Use diag 0x44 and 0x9c for this. Add a guest specific snippet header file and rename snippet.h to reflect that it is host specific.
Signed-off-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com> Link: https://lore.kernel.org/r/20241016180320.686132-5-nsg@linux.ibm.com [ nrb: fix out-of-tree builds ] Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
show more ...
|
638bbf66 | 10-Oct-2024 |
Nico Boehr <nrb@linux.ibm.com> |
s390x: edat: move LC_SIZE to arch_def.h
struct lowcore is defined in arch_def.h and LC_SIZE is useful to other tests as well, therefore move it to arch_def.h.
Reviewed-by: Claudio Imbrenda <imbrend
s390x: edat: move LC_SIZE to arch_def.h
struct lowcore is defined in arch_def.h and LC_SIZE is useful to other tests as well, therefore move it to arch_def.h.
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Link: https://lore.kernel.org/r/20241010071228.565038-2-nrb@linux.ibm.com Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
show more ...
|
6b32c6d5 | 21-Jun-2024 |
Nina Schoetterl-Glausch <nsg@linux.ibm.com> |
s390x: Split and rework cpacf query functions
Cherry-pick 830999bd7e72 ("s390/cpacf: Split and rework cpacf query functions") from the kernel:
Rework the cpacf query functions to use the correc
s390x: Split and rework cpacf query functions
Cherry-pick 830999bd7e72 ("s390/cpacf: Split and rework cpacf query functions") from the kernel:
Rework the cpacf query functions to use the correct RRE or RRF instruction formats and set register fields within instructions correctly.
Fixes: a555dc6b16bf ("s390x: add cpacf.h from Linux") Signed-off-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com> Reviewed-by: Nico Boehr <nrb@linux.ibm.com> Link: https://lore.kernel.org/r/20240621102212.3311494-1-nsg@linux.ibm.com Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
show more ...
|
40e2c619 | 01-Feb-2024 |
Janosch Frank <frankja@linux.ibm.com> |
lib: s390x: sigp: Name inline assembly arguments
Less need to count the operands makes the code easier to read.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Claudio Imbrenda <i
lib: s390x: sigp: Name inline assembly arguments
Less need to count the operands makes the code easier to read.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
show more ...
|
eb547ec7 | 31-Jan-2024 |
Janosch Frank <frankja@linux.ibm.com> |
lib: s390x: uv: Dirty CC before uvc execution
Dirtying the CC allows us to find missing CC changes.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linu
lib: s390x: uv: Dirty CC before uvc execution
Dirtying the CC allows us to find missing CC changes.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Link: https://lore.kernel.org/r/20240131074427.70871-3-frankja@linux.ibm.com Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
show more ...
|
3dbf3c40 | 31-Jan-2024 |
Janosch Frank <frankja@linux.ibm.com> |
lib: s390x: sigp: Dirty CC before sigp execution
Dirtying the CC allows us to find missing CC changes when sigp is emulated.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Claudi
lib: s390x: sigp: Dirty CC before sigp execution
Dirtying the CC allows us to find missing CC changes when sigp is emulated.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Link: https://lore.kernel.org/r/20240131074427.70871-2-frankja@linux.ibm.com Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
show more ...
|
30f9c804 | 06-Nov-2023 |
Nico Boehr <nrb@linux.ibm.com> |
lib: s390x: cpacf: move kernel-doc comment to correct function
The kernel-doc comment seems to describe a different function further at the bottom of the file; move the comment there and adjust the
lib: s390x: cpacf: move kernel-doc comment to correct function
The kernel-doc comment seems to describe a different function further at the bottom of the file; move the comment there and adjust the comment accordingly.
Signed-off-by: Nico Boehr <nrb@linux.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20231106125352.859992-4-nrb@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
bb88caef | 06-Nov-2023 |
Nico Boehr <nrb@linux.ibm.com> |
lib: s390x: interrupt: remove TEID_ASCE defines
These defines were - I can only guess - meant for the asce_id field. Since print_decode_teid() used AS_PRIM and friends instead, I see little benefit
lib: s390x: interrupt: remove TEID_ASCE defines
These defines were - I can only guess - meant for the asce_id field. Since print_decode_teid() used AS_PRIM and friends instead, I see little benefit in keeping these around.
Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Reviewed-by: Janosch Frank <frankja@linux.ibm.com> Link: https://lore.kernel.org/r/20231106163738.1116942-9-nrb@linux.ibm.com Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
show more ...
|
54674bae | 06-Nov-2023 |
Nico Boehr <nrb@linux.ibm.com> |
s390x: lib: sie: don't reenter SIE on pgm int
At the moment, when a PGM int occurs while in SIE, we will just reenter SIE after the interrupt handler was called.
This is because sie() has a loop wh
s390x: lib: sie: don't reenter SIE on pgm int
At the moment, when a PGM int occurs while in SIE, we will just reenter SIE after the interrupt handler was called.
This is because sie() has a loop which checks icptcode and re-enters SIE if it is zero.
However, this behaviour is quite undesirable for SIE tests, since it doesn't give the host the chance to assert on the PGM int. Instead, we will just re-enter SIE, on nullifing conditions even causing the exception again.
In sie(), check whether a pgm int code is set in lowcore. If it has, exit the loop so the test can react to the interrupt. Add a new function read_pgm_int_code() to obtain the interrupt code.
Note that this introduces a slight oddity with sie and pgm int in certain cases: If a PGM int occurs between a expect_pgm_int() and sie(), we will now never enter SIE until the pgm_int_code is cleared by e.g. clear_pgm_int().
Also add missing include of facility.h to mem.h.
Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Reviewed-by: Janosch Frank <frankja@linux.ibm.com> Link: https://lore.kernel.org/r/20231106163738.1116942-6-nrb@linux.ibm.com Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
show more ...
|
4e8880d6 | 06-Nov-2023 |
Nico Boehr <nrb@linux.ibm.com> |
s390x: sie: switch to home space mode before entering SIE
This is to prepare for running guests without MSO/MSL, which is currently not possible.
We already have code in sie64a to setup a guest pri
s390x: sie: switch to home space mode before entering SIE
This is to prepare for running guests without MSO/MSL, which is currently not possible.
We already have code in sie64a to setup a guest primary ASCE before entering SIE, so we can in theory switch to the page tables which translate gpa to hpa.
But the host is running in primary space mode already, so changing the primary ASCE before entering SIE will also affect the host's code and data.
To make this switch useful, the host should run in a different address space mode. Hence, set up and change to home address space mode before installing the guest ASCE.
The home space ASCE is just copied over from the primary space ASCE, so no functional change is intended, also for tests that want to use MSO/MSL. If a test intends to use a different primary space ASCE, it can now just set the guest.asce in the save_area.
Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Link: https://lore.kernel.org/r/20231106163738.1116942-4-nrb@linux.ibm.com Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
show more ...
|
fedfd112 | 06-Nov-2023 |
Nico Boehr <nrb@linux.ibm.com> |
s390x: add function to set DAT mode for all interrupts
When toggling DAT or switch address space modes, it is likely that interrupts should be handled in the same DAT or address space mode.
Add a f
s390x: add function to set DAT mode for all interrupts
When toggling DAT or switch address space modes, it is likely that interrupts should be handled in the same DAT or address space mode.
Add a function which toggles DAT and address space mode for all interruptions, except restart interrupts.
Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Link: https://lore.kernel.org/r/20231106163738.1116942-3-nrb@linux.ibm.com Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
show more ...
|
f0721060 | 06-Nov-2023 |
Nico Boehr <nrb@linux.ibm.com> |
lib: s390x: introduce bitfield for PSW mask
Changing the PSW mask is currently little clumsy, since there is only the PSW_MASK_* defines. This makes it hard to change e.g. only the address space in
lib: s390x: introduce bitfield for PSW mask
Changing the PSW mask is currently little clumsy, since there is only the PSW_MASK_* defines. This makes it hard to change e.g. only the address space in the current PSW without a lot of bit fiddling.
Introduce a bitfield for the PSW mask. This makes this kind of modifications much simpler and easier to read.
Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Reviewed-by: Janosch Frank <frankja@linux.ibm.com> Link: https://lore.kernel.org/r/20231106163738.1116942-2-nrb@linux.ibm.com Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
show more ...
|
484ab8dc | 22-Jun-2023 |
Janosch Frank <frankja@linux.ibm.com> |
s390x: uv-host: Properly handle config creation errors
If the first bit is set on a error rc, the hypervisor will need to destroy the config before trying again. Let's properly handle those cases so
s390x: uv-host: Properly handle config creation errors
If the first bit is set on a error rc, the hypervisor will need to destroy the config before trying again. Let's properly handle those cases so we're not using stale data.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Nico Boehr <nrb@linux.ibm.com> Link: https://lore.kernel.org/r/20230622075054.3190-7-frankja@linux.ibm.com Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
show more ...
|
03dca0b5 | 30-Nov-2022 |
Claudio Imbrenda <imbrenda@linux.ibm.com> |
lib: s390x: add PSW and PSW_WITH_CUR_MASK macros
Since a lot of code starts new CPUs using the current PSW mask, add two macros to streamline the creation of generic PSWs and PSWs with the current p
lib: s390x: add PSW and PSW_WITH_CUR_MASK macros
Since a lot of code starts new CPUs using the current PSW mask, add two macros to streamline the creation of generic PSWs and PSWs with the current program mask.
Reviewed-by: Nico Boehr <nrb@linux.ibm.com> Reviewed-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com> Reviewed-by: Janosch Frank <frankja@linux.ibm.com> Link: https://lore.kernel.org/r/20221130154038.70492-2-imbrenda@linux.ibm.com Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Message-Id: <20221130154038.70492-2-imbrenda@linux.ibm.com>
show more ...
|
89ce5095 | 28-Sep-2022 |
Claudio Imbrenda <imbrenda@linux.ibm.com> |
lib: s390x: terminate if PGM interrupt in interrupt handler
If a program interrupt is received while in an interrupt handler, terminate immediately, stopping all CPUs and leaving the last CPU in dis
lib: s390x: terminate if PGM interrupt in interrupt handler
If a program interrupt is received while in an interrupt handler, terminate immediately, stopping all CPUs and leaving the last CPU in disabled wait with a specific PSW code.
This will aid debugging by not cluttering the output, avoiding further interrupts (that would be needed to write to the output), and providing an indication of the cause of the termination.
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Message-Id: <20221020123143.213778-2-imbrenda@linux.ibm.com> Reviewed-by: Nico Boehr <nrb@linux.ibm.com>
show more ...
|
282f2efa | 11-Oct-2022 |
Nico Boehr <nrb@linux.ibm.com> |
lib/s390x: move TOD clock related functions to library
The TOD-clock related functions can be useful for other tests beside the sck test, hence move them to the library.
While at it, add a wrapper
lib/s390x: move TOD clock related functions to library
The TOD-clock related functions can be useful for other tests beside the sck test, hence move them to the library.
While at it, add a wrapper for stckf, express get_clock_us() with stck() and remove an unneeded memory clobber.
Signed-off-by: Nico Boehr <nrb@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Message-Id: <20221011170024.972135-2-nrb@linux.ibm.com> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
show more ...
|
fb955075 | 01-Oct-2021 |
Janis Schoetterl-Glausch <scgl@linux.ibm.com> |
s390x: Test specification exceptions during transaction
Program interruptions during transactional execution cause other interruption codes. Check that we see the expected code for (some) specificat
s390x: Test specification exceptions during transaction
Program interruptions during transactional execution cause other interruption codes. Check that we see the expected code for (some) specification exceptions.
Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com> Reviewed-by: Nico Boehr <nrb@linux.ibm.com> Acked-by: Janosch Frank <frankja@linux.ibm.com> Message-Id: <20220928201710.3185449-3-scgl@linux.ibm.com> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
show more ...
|
e08c4f5e | 30-Jun-2021 |
Janis Schoetterl-Glausch <scgl@linux.ibm.com> |
s390x: Add specification exception test
Generate specification exceptions and check that they occur.
Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com> Reviewed-by: Nico Boehr <nrb@linux.
s390x: Add specification exception test
Generate specification exceptions and check that they occur.
Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com> Reviewed-by: Nico Boehr <nrb@linux.ibm.com> Reviewed-by: Janosch Frank <frankja@linux.ibm.com> Message-Id: <20220928201710.3185449-2-scgl@linux.ibm.com> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
show more ...
|
08a584f7 | 23-Aug-2022 |
Nico Boehr <nrb@linux.ibm.com> |
lib/s390x: add CPU timer related defines and functions
Upcoming changes will make use of the CPU timer, so add some defines and functions to work with the CPU timer.
Since shifts for both CPU timer
lib/s390x: add CPU timer related defines and functions
Upcoming changes will make use of the CPU timer, so add some defines and functions to work with the CPU timer.
Since shifts for both CPU timer and TOD clock are the same, introduce a new constant S390_CLOCK_SHIFT_US for this value. The respective shifts for CPU timer and TOD clock reference it, so the semantic difference between the two defines is kept.
Also add a constant for the CPU timer subclass mask.
Signed-off-by: Nico Boehr <nrb@linux.ibm.com> Reviewed-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Link: https://lore.kernel.org/r/20220823103833.156942-3-nrb@linux.ibm.com Message-Id: <20220823103833.156942-3-nrb@linux.ibm.com> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
show more ...
|
4e5dd758 | 21-Feb-2022 |
Claudio Imbrenda <imbrenda@linux.ibm.com> |
lib: s390x: better smp interrupt checks
Use per-CPU flags and callbacks for Program and Extern interrupts, instead of global variables.
This allows for more accurate error handling; a CPU waiting f
lib: s390x: better smp interrupt checks
Use per-CPU flags and callbacks for Program and Extern interrupts, instead of global variables.
This allows for more accurate error handling; a CPU waiting for an interrupt will not have it "stolen" by a different CPU that was not supposed to wait for one, and now two CPUs can wait for interrupts at the same time.
This will significantly improve error reporting and debugging when things go wrong.
Both program interrupts and external interrupts are now CPU-bound, even though some external interrupts are floating (notably, the SCLP interrupt). In those cases, the testcases should mask interrupts and/or expect them appropriately according to need.
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
show more ...
|
086985a3 | 23-Jun-2022 |
Claudio Imbrenda <imbrenda@linux.ibm.com> |
lib: s390x: add functions to set and clear PSW bits
Add some functions to set and/or clear bits in the PSW.
Also introduce PSW_MASK_KEY and re-order the PSW_MASK_* constants so they are descending
lib: s390x: add functions to set and clear PSW bits
Add some functions to set and/or clear bits in the PSW.
Also introduce PSW_MASK_KEY and re-order the PSW_MASK_* constants so they are descending in value.
This should improve code readability.
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
show more ...
|
c2c1663a | 21-Jun-2022 |
Janis Schoetterl-Glausch <scgl@linux.ibm.com> |
s390x: Rework TEID decoding and usage
The translation-exception identification (TEID) contains information to identify the cause of certain program exceptions, including translation exceptions occur
s390x: Rework TEID decoding and usage
The translation-exception identification (TEID) contains information to identify the cause of certain program exceptions, including translation exceptions occurring during dynamic address translation, as well as protection exceptions. The meaning of fields in the TEID is complex, depending on the exception occurring and various potentially installed facilities.
Rework the type describing the TEID, in order to ease decoding. Change the existing code interpreting the TEID and extend it to take the installed suppression-on-protection facility into account.
Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com> Message-Id: <20220621143015.748290-4-scgl@linux.ibm.com> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
show more ...
|