b8455b65 | 06-Aug-2024 |
Janosch Frank <frankja@linux.ibm.com> |
s390x/Makefile: Split snippet makefile rules into new file
It's time to move the snippet related Makefile parts into a new file to make s390x/Makefile less busy.
Signed-off-by: Janosch Frank <frank
s390x/Makefile: Split snippet makefile rules into new file
It's time to move the snippet related Makefile parts into a new file to make s390x/Makefile less busy.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Reviewed-by: Christoph Schlameuss <schlameuss@linux.ibm.com> Link: https://lore.kernel.org/r/20240806084409.169039-2-frankja@linux.ibm.com [ nrb: fix out-of-tree build ] 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 ...
|
37f185ed | 16-Oct-2024 |
Nina Schoetterl-Glausch <nsg@linux.ibm.com> |
s390x: Use library functions for snippet exit
Replace the existing code for exiting from snippets with the newly introduced library functionality.
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.
s390x: Use library functions for snippet exit
Replace the existing code for exiting from snippets with the newly introduced library functionality.
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com> Reviewed-by: Janosch Frank <frankja@linux.ibm.com> Link: https://lore.kernel.org/r/20241016180320.686132-6-nsg@linux.ibm.com 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 ...
|
9801dbbe | 02-Jun-2024 |
Nicholas Piggin <npiggin@gmail.com> |
s390x: Specify program headers with flags to avoid linker warnings
Avoid "LOAD segment with RWX permissions" warnings from new linkers by specifying program headers. See 59a797f451cde and linked com
s390x: Specify program headers with flags to avoid linker warnings
Avoid "LOAD segment with RWX permissions" warnings from new linkers by specifying program headers. See 59a797f451cde and linked commits for similar fixes for other architectures.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Message-ID: <20240602130656.120866-3-npiggin@gmail.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
c39f40c3 | 16-Feb-2024 |
Thomas Huth <thuth@redhat.com> |
s390x/snippets/c/sie-dat: Fix compiler warning with GCC 11.2
GCC 11.2.1 from RHEL 9.0 complains:
s390x/snippets/c/sie-dat.c: In function ‘main’: s390x/snippets/c/sie-dat.c:51:22: error: writing 1
s390x/snippets/c/sie-dat: Fix compiler warning with GCC 11.2
GCC 11.2.1 from RHEL 9.0 complains:
s390x/snippets/c/sie-dat.c: In function ‘main’: s390x/snippets/c/sie-dat.c:51:22: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=] 51 | *invalid_ptr = 42; | ~~~~~~~~~~~~~^~~~ cc1: all warnings being treated as errors
Let's use the OPAQUE_PTR() macro here too, which we already used in other spots to fix similar -Wstringop-overflow warnings.
Reported-by: Jan Richter <jarichte@redhat.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20240216190048.83801-1-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
2456fdf7 | 06-Nov-2023 |
Nico Boehr <nrb@linux.ibm.com> |
s390x: add a test for SIE without MSO/MSL
Since we now have the ability to run guests without MSO/MSL, add a test to make sure this doesn't break.
Reviewed-by: Thomas Huth <thuth@redhat.com> Review
s390x: add a test for SIE without MSO/MSL
Since we now have the ability to run guests without MSO/MSL, add a test to make sure this doesn't break.
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-8-nrb@linux.ibm.com [ nrb: __pa -> virt_to_pte_phys to fix incompatiblity with 2g align ] Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
show more ...
|
fb357e8f | 19-Jun-2023 |
Janosch Frank <frankja@linux.ibm.com> |
s390x: pv: Add IPL reset tests
The diag308 requires extensive cooperation between the hypervisor and the Ultravisor so the Ultravisor can make sure all necessary reset steps have been done.
Let's c
s390x: pv: Add IPL reset tests
The diag308 requires extensive cooperation between the hypervisor and the Ultravisor so the Ultravisor can make sure all necessary reset steps have been done.
Let's check if we get the correct validity errors.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Nico Boehr <nrb@linux.ibm.com> Link: https://lore.kernel.org/r/20230619083329.22680-8-frankja@linux.ibm.com Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
show more ...
|
a402fad4 | 19-Jun-2023 |
Janosch Frank <frankja@linux.ibm.com> |
s390x: pv: Add sie entry intercept and validity test
The lowcore is an important part of any s390 cpu so we need to make sure it's always available when we virtualize one. For non-PV guests that wou
s390x: pv: Add sie entry intercept and validity test
The lowcore is an important part of any s390 cpu so we need to make sure it's always available when we virtualize one. For non-PV guests that would mean ensuring that the lowcore page is read and writable by the guest.
For PV guests we additionally need to make sure that the page is owned by the guest as it is only allowed to access them if that's the case. The code 112 SIE intercept tells us if the lowcore pages aren't secure anymore.
Let's check if that intercept is reported by SIE if we export the lowcore pages. Additionally check if that's also the case if the guest shares the lowcore which will make it readable to the host but ownership of the page should not change.
Also we check for validities in these conditions: * Manipulated cpu timer * Double SIE for same vcpu * Re-use of VCPU handle from another secure configuration * ASCE re-use
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Nico Boehr <nrb@linux.ibm.com> Link: https://lore.kernel.org/r/20230619083329.22680-7-frankja@linux.ibm.com Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
show more ...
|
1d0f08f4 | 19-Jun-2023 |
Janosch Frank <frankja@linux.ibm.com> |
s390x: pv-diags: Drop snippet from snippet names
It's a bit redundant.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Acked-by: Nico Boe
s390x: pv-diags: Drop snippet from snippet names
It's a bit redundant.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Acked-by: Nico Boehr <nrb@linux.ibm.com> Link: https://lore.kernel.org/r/20230619083329.22680-5-frankja@linux.ibm.com Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
show more ...
|
796217d8 | 04-Apr-2023 |
Thomas Huth <thuth@redhat.com> |
s390x/snippets: Fix compilation with Clang 15
Clang complains:
s390x/snippets/c/cstart.S:22:13: error: invalid operand for instruction lghi %r15, stackptr ^ Let's load the address w
s390x/snippets: Fix compilation with Clang 15
Clang complains:
s390x/snippets/c/cstart.S:22:13: error: invalid operand for instruction lghi %r15, stackptr ^ Let's load the address with "larl" instead, like we already do it in s390x/cstart64.S. For this we should also switch to 64-bit mode first, then we also don't have to clear r15 right in front of this anymore.
Changing the code here triggered another problem: initial_cr0 must be aligned on a double-word boundary, otherwise the lctlg instruction will fail with an specification exception. This was just working by accident so far - add an ".align 8" now to avoid the problem.
Message-Id: <20230404101434.172721-1-thuth@redhat.com> Reviewed-by: Nico Boehr <nrb@linux.ibm.com> Reviewed-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
8e9fbb64 | 07-Mar-2023 |
Marc Hartmayer <mhartmay@linux.ibm.com> |
s390x: define a macro for the stack frame size
Define and use a macro for the stack frame size. While at it, fix whitespace in the `gs_handler_asm` block.
Signed-off-by: Marc Hartmayer <mhartmay@li
s390x: define a macro for the stack frame size
Define and use a macro for the stack frame size. While at it, fix whitespace in the `gs_handler_asm` block.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> Co-developed-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com> Reviewed-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Link: https://lore.kernel.org/r/20230307091051.13945-7-mhartmay@linux.ibm.com Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
show more ...
|
5be877f2 | 07-Mar-2023 |
Marc Hartmayer <mhartmay@linux.ibm.com> |
s390x: use preprocessor for linker script generation
The old `.lds` scripts are being renamed to `.lds.S` and the actual `.lds` scripts are being generated by the assembler preprocessor. This change
s390x: use preprocessor for linker script generation
The old `.lds` scripts are being renamed to `.lds.S` and the actual `.lds` scripts are being generated by the assembler preprocessor. This change allows us to use constants defined by macros in the `.lds.S` files.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> Reviewed-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Link: https://lore.kernel.org/r/20230307091051.13945-6-mhartmay@linux.ibm.com Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
show more ...
|
9854a09c | 12-Jan-2023 |
Janosch Frank <frankja@linux.ibm.com> |
s390x: snippets: Fix SET_PSW_NEW_ADDR macro
Let's store the psw mask instead of the address of the location where we should load the mask from.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
s390x: snippets: Fix SET_PSW_NEW_ADDR macro
Let's store the psw mask instead of the address of the location where we should load the mask from.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Nico Boehr <nrb@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Link: https://lore.kernel.org/r/20230112154548.163021-5-frankja@linux.ibm.com Message-Id: <20230112154548.163021-5-frankja@linux.ibm.com>
show more ...
|
b36f35a8 | 12-Jan-2023 |
Janosch Frank <frankja@linux.ibm.com> |
s390x: Add a linker script to assembly snippets
A linker script has a few benefits: - Random data doesn't end up in the binary breaking tests - We can easily define a lowcore and load the snippet fr
s390x: Add a linker script to assembly snippets
A linker script has a few benefits: - Random data doesn't end up in the binary breaking tests - We can easily define a lowcore and load the snippet from 0x0 instead of 0x4000 which makes asm snippets behave like c snippets - We can easily define an invalid PGM new PSW to ensure an exit on a guest PGM
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Link: https://lore.kernel.org/r/20230112154548.163021-4-frankja@linux.ibm.com Message-Id: <20230112154548.163021-4-frankja@linux.ibm.com>
show more ...
|
b7909c92 | 12-Jan-2023 |
Janosch Frank <frankja@linux.ibm.com> |
s390x: snippets: c: Cleanup flat.lds
There are a lot of things in there which we don't need for snippets and the alignments can be switched from 64K to 4K since that's the s390 page size.
Signed-of
s390x: snippets: c: Cleanup flat.lds
There are a lot of things in there which we don't need for snippets and the alignments can be switched from 64K to 4K since that's the s390 page size.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Link: https://lore.kernel.org/r/20230112154548.163021-3-frankja@linux.ibm.com Message-Id: <20230112154548.163021-3-frankja@linux.ibm.com>
show more ...
|
4c8a99ca | 21-Oct-2022 |
Janosch Frank <frankja@linux.ibm.com> |
s390x: snippets: asm: Add a macro to write an exception PSW
Setting exception new PSWs is commonly needed so let's add a macro for that.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewe
s390x: snippets: asm: Add a macro to write an exception PSW
Setting exception new PSWs is commonly needed so let's add a macro for that.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Nico Boehr <nrb@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Message-Id: <20221021063902.10878-2-frankja@linux.ibm.com> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
show more ...
|
cd719531 | 08-Jun-2022 |
Janis Schoetterl-Glausch <scgl@linux.ibm.com> |
s390x: Introduce symbol for lowcore and use it
This gets rid of bunch of pointers pointing to the lowcore used in various places and replaces it with a unified way of addressing the lowcore. The new
s390x: Introduce symbol for lowcore and use it
This gets rid of bunch of pointers pointing to the lowcore used in various places and replaces it with a unified way of addressing the lowcore. The new symbol is not a pointer. While this will lead to worse code generation (cannot use register 0 for addressing), that should not matter too much for kvm unit tests. Since the lowcore is located per definition at address 0, the symbol is defined via the linker scripts. The symbol also will be used to create pointers that the compiler cannot warn about as being outside the bounds of an array.
Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20220608122953.1051952-2-scgl@linux.ibm.com> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
show more ...
|
c604fa93 | 21-Apr-2022 |
Janosch Frank <frankja@linux.ibm.com> |
s390x: snippets: asm: Add license and copyright headers
Time for some cleanup of the snippets to make them look like any other test file.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Review
s390x: snippets: asm: Add license and copyright headers
Time for some cleanup of the snippets to make them look like any other test file.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
show more ...
|
df8d7ad7 | 31-Mar-2022 |
Janosch Frank <frankja@linux.ibm.com> |
s390x: snippets: c: Load initial cr0
As soon as we use C we need to set the AFP bit in cr0 so we can use all fprs.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Claudio Imbrenda
s390x: snippets: c: Load initial cr0
As soon as we use C we need to set the AFP bit in cr0 so we can use all fprs.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
show more ...
|
2c96b77e | 06-Aug-2021 |
Janosch Frank <frankja@linux.ibm.com> |
s390x: sie: Add PV diag test
Let's start testing the format 4 (PV) SIE via the diagnose instructions since most of them are pretty simple to handle.
The tests check for the intercept values like ip
s390x: sie: Add PV diag test
Let's start testing the format 4 (PV) SIE via the diagnose instructions since most of them are pretty simple to handle.
The tests check for the intercept values like ipa/ipb and icptcode as well as the values in the registers and handling of the exception injection.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
show more ...
|
c857dcd6 | 06-Sep-2021 |
Janosch Frank <frankja@linux.ibm.com> |
s390x: snippets: mvpg-snippet: Remove unneeded includes
None of those headers is used, let's remove them.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Signed-off-by: Claudio Imbrenda <imbre
s390x: snippets: mvpg-snippet: Remove unneeded includes
None of those headers is used, let's remove them.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
show more ...
|
49934b5a | 22-Oct-2021 |
Janis Schoetterl-Glausch <scgl@linux.ibm.com> |
s390x: Add specification exception interception test
Check that specification exceptions cause intercepts when specification exception interpretation is off. Check that specification exceptions caus
s390x: Add specification exception interception test
Check that specification exceptions cause intercepts when specification exception interpretation is off. Check that specification exceptions caused by program new PSWs cause interceptions. We cannot assert that non program new PSW specification exceptions are interpreted because whether interpretation occurs or not is configuration dependent.
Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com> Reviewed-by: Janosch Frank <frankja@de.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20211022131057.1308851-2-scgl@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
478996b1 | 08-Oct-2021 |
Thomas Huth <thuth@redhat.com> |
s390x: snippets: Define all things that are needed to link the libc
In the long run, we want to use parts of the libc like memset() etc., too. However, to be able to link it correctly, we have to pr
s390x: snippets: Define all things that are needed to link the libc
In the long run, we want to use parts of the libc like memset() etc., too. However, to be able to link it correctly, we have to provide some stub functions like puts() and exit() to avoid that too much other stuff from the lib folder gets pulled into the binaries, which we cannot provide in the snippets (like the sclp support).
Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <20211008092649.959956-1-thuth@redhat.com> Link: https://lore.kernel.org/kvm/20211008092649.959956-1-thuth@redhat.com/ Reviewed-by: Janosch Frank <frankja@linux.ibm.com> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
show more ...
|
a6c15401 | 01-Oct-2021 |
Janosch Frank <frankja@linux.ibm.com> |
s390x: snippets: Set stackptr and stacktop in cstart.S
We have a stack, so why not define it and be a step closer to include the lib into the snippets.
Signed-off-by: Janosch Frank <frankja@linux.i
s390x: snippets: Set stackptr and stacktop in cstart.S
We have a stack, so why not define it and be a step closer to include the lib into the snippets.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com>
show more ...
|