Re: [PATCH v2 2/3] selftests: kvm: s390: Add uc_skey VM test case

2024-09-12 Thread Christoph Schlameuss
On Thu Sep 12, 2024 at 10:15 AM CEST, Claudio Imbrenda wrote: > On Mon, 2 Sep 2024 13:50:01 +0200 > Christoph Schlameuss wrote: > > > Add a test case manipulating s390 storage keys from within the ucontrol > > VM. > > > > Signed-off-by: Christoph Schlameuss >

[PATCH v2 3/3] selftests: kvm: s390: Verify reject memory region operations for ucontrol VMs

2024-09-02 Thread Christoph Schlameuss
eject memory region operations for ucontrol VMs") Signed-off-by: Christoph Schlameuss Reviewed-by: Janosch Frank --- .../selftests/kvm/s390x/ucontrol_test.c | 22 +++ 1 file changed, 22 insertions(+) diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c b/too

[PATCH v2 1/3] selftests: kvm: s390: Add uc_map_unmap VM test case

2024-09-02 Thread Christoph Schlameuss
. Signed-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x/ucontrol_test.c | 121 +- 1 file changed, 120 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c b/tools/testing/selftests/kvm/s390x/ucontrol_test.c index 030c59010fe1

[PATCH v2 2/3] selftests: kvm: s390: Add uc_skey VM test case

2024-09-02 Thread Christoph Schlameuss
Add a test case manipulating s390 storage keys from within the ucontrol VM. Signed-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x/ucontrol_test.c | 89 ++- 1 file changed, 88 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/s390x

[PATCH v2 0/3] selftests: kvm: s390: Add ucontrol memory selftests

2024-09-02 Thread Christoph Schlameuss
nal state assertion in the end of uc_skey - Fix some typos and white spaces. v1: - Remove segment and page table generation and disable DAT. This is not necessary to validate the KVM code. Christoph Schlameuss (3): selftests: kvm: s390: Add uc_map_unmap VM test case selftests: kvm: s390:

Re: [PATCH 2/3] selftests: kvm: s390: Add uc_skey VM test case

2024-08-30 Thread Christoph Schlameuss
On Fri Aug 23, 2024 at 9:59 AM CEST, Janosch Frank wrote: > On 8/19/24 6:00 PM, Christoph Schlameuss wrote: > > On Fri Aug 16, 2024 at 4:36 PM CEST, Janosch Frank wrote: > >> On 8/15/24 5:45 PM, Christoph Schlameuss wrote: > [...] > >>> +TEST_F(uc_kvm, uc_skey

Re: [PATCH v3 1/5] KVM: s390: selftests: Add regression tests for SORTL and DFLTCC CPU subfunctions

2024-08-23 Thread Christoph Schlameuss
This process ensures that the KVM implementation accurately reflects the > behavior of the actual CPU instructions for the tested subfunctions. > > Suggested-by: Janosch Frank > Signed-off-by: Hariharan Mari > Reviewed-by: Janosch Frank LGTM Reviewed-by: Christoph Schlameuss

Re: [PATCH v3 5/5] KVM: s390: selftests: Add regression tests for PLO subfunctions

2024-08-23 Thread Christoph Schlameuss
. > Hence it is assumed PLO is always installed in the Z Arch. > The test procedure follows the established pattern. > > Suggested-by: Janosch Frank > Signed-off-by: Hariharan Mari > Reviewed-by: Janosch Frank LGTM Reviewed-by: Christoph Schlameuss > --- > .../kvm/s39

Re: [PATCH 1/3] selftests: kvm: s390: Add uc_map_unmap VM test case

2024-08-23 Thread Christoph Schlameuss
On Fri Aug 23, 2024 at 10:02 AM CEST, Janosch Frank wrote: > On 8/19/24 6:03 PM, Christoph Schlameuss wrote: > > On Fri Aug 16, 2024 at 4:29 PM CEST, Janosch Frank wrote: > >> On 8/15/24 5:45 PM, Christoph Schlameuss wrote: > >>> Add a test case verifying basic runni

Re: [PATCH v2 5/5] KVM: s390: selftests: Add regression tests for PLO subfunctions

2024-08-21 Thread Christoph Schlameuss
. > Hence it is assumed PLO is always installed in the Z Arch. > The test procedure follows the established pattern. > > Suggested-by: Janosch Frank > Signed-off-by: Hariharan Mari > Reviewed-by: Janosch Frank LGTM (apart from the accidental whitespace) Reviewed-by: Christ

Re: [PATCH v2 4/5] KVM: s390: selftests: Add regression tests for KMAC, KMC, KM, KIMD and KLMD crypto subfunctions

2024-08-21 Thread Christoph Schlameuss
Intermediate Message Digest) and KLMD (Compute Last Message Digest) > crypto functions. > > The test procedure follows the established pattern. > > Suggested-by: Janosch Frank > Signed-off-by: Hariharan Mari > Reviewed-by: Janosch Frank LGTM Reviewed-by: Christoph Sc

Re: [PATCH v2 3/5] KVM: s390: selftests: Add regression tests for KMCTR, KMF, KMO and PCC crypto subfunctions

2024-08-21 Thread Christoph Schlameuss
ack) and PCC (Perform Cryptographic Computation) crypto functions. > > The test procedure follows the established pattern. > > Suggested-by: Janosch Frank > Signed-off-by: Hariharan Mari > Reviewed-by: Janosch Frank LGTM Reviewed-by: Christoph Schlameuss > --- > ..

Re: [PATCH v2 2/5] KVM: s390: selftests: Add regression tests for PRNO, KDSA and KMA crypto subfunctions

2024-08-21 Thread Christoph Schlameuss
gt; > Suggested-by: Janosch Frank > Signed-off-by: Hariharan Mari > Reviewed-by: Janosch Frank LGTM Reviewed-by: Christoph Schlameuss > --- > .../kvm/s390x/cpumodel_subfuncs_test.c| 51 +++ > 1 file changed, 51 insertions(+) [...]

Re: [PATCH v2 1/5] KVM: s390: selftests: Add regression tests for SORTL and DFLTCC CPU subfunctions

2024-08-21 Thread Christoph Schlameuss
This process ensures that the KVM implementation accurately reflects the > behavior of the actual CPU instructions for the tested subfunctions. > > Suggested-by: Janosch Frank > Signed-off-by: Hariharan Mari > Reviewed-by: Janosch Frank LGTM Reviewed-by: Christoph Schlameuss

Re: [PATCH v1 5/5] KVM: s390: selftests: Add regression tests for PLO subfunctions

2024-08-19 Thread Christoph Schlameuss
On Mon Aug 19, 2024 at 3:54 PM CEST, Hariharan Mari wrote: > Extend the existing regression test framework for s390x CPU subfunctions > to include tests for the Perform Locked Operation (PLO) subfunction > functions. > > PLO was introduced in the very first 64-bit machine generation. > Hence it is

Re: [PATCH 1/3] selftests: kvm: s390: Add uc_map_unmap VM test case

2024-08-19 Thread Christoph Schlameuss
On Fri Aug 16, 2024 at 4:29 PM CEST, Janosch Frank wrote: > On 8/15/24 5:45 PM, Christoph Schlameuss wrote: > > Add a test case verifying basic running and interaction of ucontrol VMs. > > Fill the segment and page tables for allocated memory and map memory on &

Re: [PATCH 2/3] selftests: kvm: s390: Add uc_skey VM test case

2024-08-19 Thread Christoph Schlameuss
On Fri Aug 16, 2024 at 4:36 PM CEST, Janosch Frank wrote: > On 8/15/24 5:45 PM, Christoph Schlameuss wrote: > > Add a test case manipulating s390 storage keys from within the ucontrol > > VM. > > > > Signed-off-by: Christoph Schlameuss > > --- > >

[PATCH 3/3] selftests: kvm: s390: Verify reject memory region operations for ucontrol VMs

2024-08-15 Thread Christoph Schlameuss
eject memory region operations for ucontrol VMs") Signed-off-by: Christoph Schlameuss Reviewed-by: Janosch Frank --- .../selftests/kvm/s390x/ucontrol_test.c | 22 +++ 1 file changed, 22 insertions(+) diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c b/too

[PATCH 2/3] selftests: kvm: s390: Add uc_skey VM test case

2024-08-15 Thread Christoph Schlameuss
Add a test case manipulating s390 storage keys from within the ucontrol VM. Signed-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x/ucontrol_test.c | 76 +++ 1 file changed, 76 insertions(+) diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c b/tools

[PATCH 0/3] selftests: kvm: s390: Add ucontrol memory selftests

2024-08-15 Thread Christoph Schlameuss
ary to validate the KVM code. Previeous series: https://lore.kernel.org/kvm/20240807154512.316936-1-schlame...@linux.ibm.com/ Also see: https://lore.kernel.org/kvm/d97f4dec-31c3-45c0-ac33-90e665eb6...@linux.ibm.com/ Christoph Schlameuss (3): selftests: kvm: s390: Add uc_map_unmap VM tes

[PATCH 1/3] selftests: kvm: s390: Add uc_map_unmap VM test case

2024-08-15 Thread Christoph Schlameuss
. Signed-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x/ucontrol_test.c | 120 +- 1 file changed, 119 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c b/tools/testing/selftests/kvm/s390x/ucontrol_test.c index 030c59010fe1

Re: [PATCH v5 07/10] selftests: kvm: s390: Add uc_map_unmap VM test case

2024-08-13 Thread Christoph Schlameuss
On Tue, Aug 13, 2024 at 09:21:12AM +0200, Janosch Frank wrote: > On 8/7/24 5:45 PM, Christoph Schlameuss wrote: > > Add a test case verifying basic running and interaction of ucontrol VMs. > > Fill the segment and page tables for allocated memory and map memory on &

[PATCH v5 00/10] selftests: kvm: s390: Add s390x ucontrol selftests

2024-08-07 Thread Christoph Schlameuss
add reference to fix verified by the test case Christoph Schlameuss (10): selftests: kvm: s390: Define page sizes in shared header selftests: kvm: s390: Add kvm_s390_sie_block definition for userspace tests selftests: kvm: s390: Add s390x ucontrol test suite with hpage test selftests:

[PATCH v5 10/10] s390: Enable KVM_S390_UCONTROL config in debug_defconfig

2024-08-07 Thread Christoph Schlameuss
To simplify testing enable UCONTROL KVM by default in debug kernels. Signed-off-by: Christoph Schlameuss Reviewed-by: Janosch Frank --- arch/s390/configs/debug_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/s390/configs/debug_defconfig b/arch/s390/configs/debug_defconfig

[PATCH v5 04/10] selftests: kvm: s390: Add test fixture and simple VM setup tests

2024-08-07 Thread Christoph Schlameuss
-off-by: Christoph Schlameuss Reviewed-by: Claudio Imbrenda --- .../selftests/kvm/s390x/ucontrol_test.c | 131 ++ 1 file changed, 131 insertions(+) diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c b/tools/testing/selftests/kvm/s390x/ucontrol_test.c index

[PATCH v5 01/10] selftests: kvm: s390: Define page sizes in shared header

2024-08-07 Thread Christoph Schlameuss
Multiple test cases need page size and shift definitions. By moving the definitions to a single architecture specific header we limit the repetition. Make use of PAGE_SIZE, PAGE_SHIFT and PAGE_MASK defines in existing code. Signed-off-by: Christoph Schlameuss Reviewed-by: Claudio Imbrenda

[PATCH v5 06/10] selftests: kvm: s390: Add VM run test case

2024-08-07 Thread Christoph Schlameuss
Add test case running code interacting with registers within a ucontrol VM. * Add uc_gprs test case The test uses the same VM setup using the fixture and debug macros introduced in earlier patches in this series. Signed-off-by: Christoph Schlameuss Reviewed-by: Janosch Frank

[PATCH v5 07/10] selftests: kvm: s390: Add uc_map_unmap VM test case

2024-08-07 Thread Christoph Schlameuss
. Signed-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x/ucontrol_test.c | 167 +- 1 file changed, 166 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c b/tools/testing/selftests/kvm/s390x/ucontrol_test.c index 030c59010fe1

[PATCH v5 05/10] selftests: kvm: s390: Add debug print functions

2024-08-07 Thread Christoph Schlameuss
: PRINT_HEX with 512 bytes * print_run: use print_psw and print_hex to print contents of VM run state and SIE state description * print_regs: print content of general and control registers All prints use pr_debug for the output and can be configured using DEBUG. Signed-off-by: Christoph Schlameuss

[PATCH v5 03/10] selftests: kvm: s390: Add s390x ucontrol test suite with hpage test

2024-08-07 Thread Christoph Schlameuss
containing CONFIG_KVM_S390_UCONTROL. This config needs to be set to built-in (y) as this cannot be built as module. Signed-off-by: Christoph Schlameuss Reviewed-by: Janosch Frank --- tools/testing/selftests/kvm/.gitignore| 1 + tools/testing/selftests/kvm/Makefile | 1 + tools/testing

[PATCH v5 08/10] selftests: kvm: s390: Add uc_skey VM test case

2024-08-07 Thread Christoph Schlameuss
Add a test case manipulating s390 storage keys from within the ucontrol VM. Signed-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x/ucontrol_test.c | 78 +++ 1 file changed, 78 insertions(+) diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c b/tools

[PATCH v5 09/10] selftests: kvm: s390: Verify reject memory region operations for ucontrol VMs

2024-08-07 Thread Christoph Schlameuss
eject memory region operations for ucontrol VMs") Signed-off-by: Christoph Schlameuss Reviewed-by: Janosch Frank --- .../selftests/kvm/s390x/ucontrol_test.c | 22 +++ 1 file changed, 22 insertions(+) diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c b/too

[PATCH v5 02/10] selftests: kvm: s390: Add kvm_s390_sie_block definition for userspace tests

2024-08-07 Thread Christoph Schlameuss
. * In the context of the selftests this does not require atomicity for the flags. With the userspace definition of the SIE block layout now being present we can reuse the values in other tests where applicable. Signed-off-by: Christoph Schlameuss Reviewed-by: Janosch Frank --- .../testing

Re: [PATCH v4 08/10] selftests: kvm: s390: Add uc_skey VM test case

2024-08-07 Thread Christoph Schlameuss
On Tue, 6 Aug 2024 15:39:44 +0200 Janosch Frank wrote: > On 8/2/24 5:59 PM, Christoph Schlameuss wrote: > > Add a test case manipulating s390 storage keys from within the ucontrol > > VM. > > > > Signed-off-by: Christoph Schlameuss > > --- > >

Re: [PATCH v4 07/10] selftests: kvm: s390: Add uc_map_unmap VM test case

2024-08-06 Thread Christoph Schlameuss
On Tue, 6 Aug 2024 15:13:34 +0200 Janosch Frank wrote: > On 8/2/24 5:59 PM, Christoph Schlameuss wrote: > > Add a test case verifying basic running and interaction of ucontrol VMs. > > Fill the segment and page tables for allocated memory and map memory on &

[PATCH v4 08/10] selftests: kvm: s390: Add uc_skey VM test case

2024-08-02 Thread Christoph Schlameuss
Add a test case manipulating s390 storage keys from within the ucontrol VM. Signed-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x/ucontrol_test.c | 78 +++ 1 file changed, 78 insertions(+) diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c b/tools

[PATCH v4 06/10] selftests: kvm: s390: Add VM run test case

2024-08-02 Thread Christoph Schlameuss
Add test case running code interacting with registers within a ucontrol VM. * Add uc_gprs test case The test uses the same VM setup using the fixture and debug macros introduced in earlier patches in this series. Signed-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x/ucontrol_test.c

[PATCH v4 04/10] selftests: kvm: s390: Add test fixture and simple VM setup tests

2024-08-02 Thread Christoph Schlameuss
-off-by: Christoph Schlameuss Reviewed-by: Claudio Imbrenda --- .../selftests/kvm/s390x/ucontrol_test.c | 131 ++ 1 file changed, 131 insertions(+) diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c b/tools/testing/selftests/kvm/s390x/ucontrol_test.c index

[PATCH v4 02/10] selftests: kvm: s390: Add kvm_s390_sie_block definition for userspace tests

2024-08-02 Thread Christoph Schlameuss
. * In the context of the selftests this does not require atomicity for the flags. With the userspace definition of the SIE block layout now being present we can reuse the values in other tests where applicable. Signed-off-by: Christoph Schlameuss Reviewed-by: Janosch Frank --- .../testing

[PATCH v4 00/10] selftests: kvm: s390: Add s390x ucontrol selftests

2024-08-02 Thread Christoph Schlameuss
ore declarative defines instead of magic values (thanks Claudio) - PATCH 9: add reference to fix verified by the test case Christoph Schlameuss (10): selftests: kvm: s390: Define page sizes in shared header selftests: kvm: s390: Add kvm_s390_sie_block definition for userspace te

[PATCH v4 10/10] s390: Enable KVM_S390_UCONTROL config in debug_defconfig

2024-08-02 Thread Christoph Schlameuss
To simplify testing enable UCONTROL KVM by default in debug kernels. Signed-off-by: Christoph Schlameuss Reviewed-by: Janosch Frank --- arch/s390/configs/debug_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/s390/configs/debug_defconfig b/arch/s390/configs/debug_defconfig

[PATCH v4 09/10] selftests: kvm: s390: Verify reject memory region operations for ucontrol VMs

2024-08-02 Thread Christoph Schlameuss
eject memory region operations for ucontrol VMs") Signed-off-by: Christoph Schlameuss Reviewed-by: Janosch Frank --- .../selftests/kvm/s390x/ucontrol_test.c | 22 +++ 1 file changed, 22 insertions(+) diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c b/too

[PATCH v4 01/10] selftests: kvm: s390: Define page sizes in shared header

2024-08-02 Thread Christoph Schlameuss
Multiple test cases need page size and shift definitions. By moving the definitions to a single architecture specific header we limit the repetition. Make use of PAGE_SIZE, PAGE_SHIFT and PAGE_MASK defines in existing code. Signed-off-by: Christoph Schlameuss Reviewed-by: Claudio Imbrenda

[PATCH v4 07/10] selftests: kvm: s390: Add uc_map_unmap VM test case

2024-08-02 Thread Christoph Schlameuss
. Signed-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x/ucontrol_test.c | 165 +- 1 file changed, 164 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c b/tools/testing/selftests/kvm/s390x/ucontrol_test.c index 030c59010fe1

[PATCH v4 05/10] selftests: kvm: s390: Add debug print functions

2024-08-02 Thread Christoph Schlameuss
: PRINT_HEX with 512 bytes * print_run: use print_psw and print_hex to print contents of VM run state and SIE state description * print_regs: print content of general and control registers All prints use pr_debug for the output and can be configured using DEBUG. Signed-off-by: Christoph Schlameuss

[PATCH v4 03/10] selftests: kvm: s390: Add s390x ucontrol test suite with hpage test

2024-08-02 Thread Christoph Schlameuss
containing CONFIG_KVM_S390_UCONTROL. This config needs to be set to built-in (y) as this cannot be built as module. Signed-off-by: Christoph Schlameuss Reviewed-by: Janosch Frank --- tools/testing/selftests/kvm/.gitignore| 1 + tools/testing/selftests/kvm/Makefile | 1 + tools/testing

Re: [PATCH v3 07/10] selftests: kvm: s390: Add uc_map_unmap VM test case

2024-08-01 Thread Christoph Schlameuss
On Thu, 1 Aug 2024 11:08:30 +0200 Janosch Frank wrote: > On 7/30/24 9:24 AM, Christoph Schlameuss wrote: > > Add a test case verifying basic running and interaction of ucontrol VMs. > > Fill the segment and page tables for allocated memory and map memory on &

Re: [PATCH v3 06/10] selftests: kvm: s390: Add VM run test case

2024-08-01 Thread Christoph Schlameuss
On Wed, 31 Jul 2024 16:37:19 +0200 Janosch Frank wrote: > On 7/30/24 9:24 AM, Christoph Schlameuss wrote: > > Add test case running code interacting with registers within a > > ucontrol VM. > > > > * Add uc_gprs test case > > > > The test uses the sa

[PATCH v3 03/10] selftests: kvm: s390: Add s390x ucontrol test suite with hpage test

2024-07-30 Thread Christoph Schlameuss
containing CONFIG_KVM_S390_UCONTROL. This config needs to be set to built-in (y) as this cannot be built as module. Signed-off-by: Christoph Schlameuss --- tools/testing/selftests/kvm/.gitignore| 1 + tools/testing/selftests/kvm/Makefile | 1 + tools/testing/selftests/kvm/s390x/config

[PATCH v3 08/10] selftests: kvm: s390: Add uc_skey VM test case

2024-07-30 Thread Christoph Schlameuss
Add a test case manipulating s390 storage keys from within the ucontrol VM. Signed-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x/ucontrol_test.c | 77 +++ 1 file changed, 77 insertions(+) diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c b/tools

[PATCH v3 02/10] selftests: kvm: s390: Add kvm_s390_sie_block definition for userspace tests

2024-07-30 Thread Christoph Schlameuss
. * In the context of the selftests this does not require atomicity for the flags. With the userspace definition of the SIE block layout now being present we can reuse the values in other tests where applicable. Signed-off-by: Christoph Schlameuss --- .../testing/selftests/kvm/include/s390x/sie.h

[PATCH v3 00/10] selftests: kvm: s390: Add s390x ucontrol selftests

2024-07-30 Thread Christoph Schlameuss
laudio - PATCH 4: - Remove erroneous 1MB offset from self->base_hva (thanks Janosch) - PATCH 6-8: Change name of test program _pgm to _asm to prevent confusion - PATCH 10: Move KVM_S390_UCONTROL default option to actual debug config (thanks Christian) Christoph Schlameuss (10):

[PATCH v3 10/10] s390: Enable KVM_S390_UCONTROL config in debug_defconfig

2024-07-30 Thread Christoph Schlameuss
To simplify testing enable UCONTROL KVM by default in debug kernels. Signed-off-by: Christoph Schlameuss --- arch/s390/configs/debug_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/s390/configs/debug_defconfig b/arch/s390/configs/debug_defconfig index ea63a7342f5f

[PATCH v3 07/10] selftests: kvm: s390: Add uc_map_unmap VM test case

2024-07-30 Thread Christoph Schlameuss
. Signed-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x/ucontrol_test.c | 165 +- 1 file changed, 164 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c b/tools/testing/selftests/kvm/s390x/ucontrol_test.c index 817b1e08559c

[PATCH v3 01/10] selftests: kvm: s390: Define page sizes in shared header

2024-07-30 Thread Christoph Schlameuss
Multiple test cases need page size and shift definitions. By moving the definitions to a single architecture specific header we limit the repetition. Make use of PAGE_SIZE, PAGE_SHIFT and PAGE_MASK defines in existing code. Signed-off-by: Christoph Schlameuss Reviewed-by: Claudio Imbrenda

[PATCH v3 06/10] selftests: kvm: s390: Add VM run test case

2024-07-30 Thread Christoph Schlameuss
Add test case running code interacting with registers within a ucontrol VM. * Add uc_gprs test case The test uses the same VM setup using the fixture and debug macros introduced in earlier patches in this series. Signed-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x/ucontrol_test.c

[PATCH v3 09/10] selftests: kvm: s390: Verify reject memory region operations for ucontrol VMs

2024-07-30 Thread Christoph Schlameuss
eject memory region operations for ucontrol VMs") Signed-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x/ucontrol_test.c | 22 +++ 1 file changed, 22 insertions(+) diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c b/tools/testing/selftests

[PATCH v3 04/10] selftests: kvm: s390: Add test fixture and simple VM setup tests

2024-07-30 Thread Christoph Schlameuss
-off-by: Christoph Schlameuss Reviewed-by: Claudio Imbrenda --- .../selftests/kvm/s390x/ucontrol_test.c | 131 ++ 1 file changed, 131 insertions(+) diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c b/tools/testing/selftests/kvm/s390x/ucontrol_test.c index

[PATCH v3 05/10] selftests: kvm: s390: Add debug print functions

2024-07-30 Thread Christoph Schlameuss
: PRINT_HEX with 512 bytes * print_run: use print_psw and print_hex to print contents of VM run state and SIE state description * print_regs: print content of general and control registers All prints use pr_debug for the output and can be configured using DEBUG. Signed-off-by: Christoph Schlameuss

Re: [PATCH v2 06/10] selftests: kvm: s390: Add VM run test case

2024-07-25 Thread Christoph Schlameuss
On Thu, 25 Jul 2024 14:03:12 +0200 Janosch Frank wrote: > On 7/23/24 11:31, Christoph Schlameuss wrote: > > Add test case running code interacting with registers within a > > ucontrol VM. > > > > * Add uc_gprs test case > > > > The test uses the same VM s

Re: [PATCH v2 03/10] selftests: kvm: s390: Add s390x ucontrol test suite with hpage test

2024-07-24 Thread Christoph Schlameuss
On Wed, 24 Jul 2024 16:52:00 +0200 Janosch Frank wrote: > On 7/23/24 11:31, Christoph Schlameuss wrote: > > Add test suite to validate the s390x architecture specific ucontrol KVM > > interface. > > > > Make use of the selftest test harness. > > > >

Re: [PATCH v2 02/10] selftests: kvm: s390: Add kvm_s390_sie_block definition for userspace tests

2024-07-24 Thread Christoph Schlameuss
On Wed, 24 Jul 2024 16:39:28 +0200 Janosch Frank wrote: > On 7/23/24 11:31, Christoph Schlameuss wrote: > > Subsequent tests do require direct manipulation of the SIE instruction. > > This commit introduces the SIE definition for the selftests. > > AFAIK ucontrol doesn&

Re: [PATCH v2 10/10] s390: Enable KVM_S390_UCONTROL config in debug_defconfig

2024-07-23 Thread Christoph Schlameuss
On Tue, 23 Jul 2024 11:40:35 +0200 Christian Borntraeger wrote: > Am 23.07.24 um 11:31 schrieb Christoph Schlameuss: > > To simplify testing enable UCONTROL KVM by default in debug kernels. > > > > Signed-off-by: Christoph Schlameuss > > --- > > arch/s390/K

[PATCH v2 10/10] s390: Enable KVM_S390_UCONTROL config in debug_defconfig

2024-07-23 Thread Christoph Schlameuss
To simplify testing enable UCONTROL KVM by default in debug kernels. Signed-off-by: Christoph Schlameuss --- arch/s390/Kconfig.debug | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/s390/Kconfig.debug b/arch/s390/Kconfig.debug index c4300ea4abf8..4798dded6d76 100644 --- a/arch/s390

[PATCH v2 08/10] selftests: kvm: s390: Add uc_skey VM test case

2024-07-23 Thread Christoph Schlameuss
Add a test case manipulating s390 storage keys from within the ucontrol VM. Signed-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x/ucontrol_test.c | 85 ++- 1 file changed, 84 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/s390x

[PATCH v2 07/10] selftests: kvm: s390: Add uc_map_unmap VM test case

2024-07-23 Thread Christoph Schlameuss
. Signed-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x/ucontrol_test.c | 171 +- 1 file changed, 170 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c b/tools/testing/selftests/kvm/s390x/ucontrol_test.c index c98d5a3a315b

[PATCH v2 09/10] selftests: kvm: s390: Verify reject memory region operations for ucontrol VMs

2024-07-23 Thread Christoph Schlameuss
eject memory region operations for ucontrol VMs") Signed-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x/ucontrol_test.c | 22 +++ 1 file changed, 22 insertions(+) diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c b/tools/testing/selftests

[PATCH v2 06/10] selftests: kvm: s390: Add VM run test case

2024-07-23 Thread Christoph Schlameuss
Add test case running code interacting with registers within a ucontrol VM. * Add uc_gprs test case The test uses the same VM setup using the fixture and debug macros introduced in earlier patches in this series. Signed-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x/ucontrol_test.c

[PATCH v2 04/10] selftests: kvm: s390: Add test fixture and simple VM setup tests

2024-07-23 Thread Christoph Schlameuss
-off-by: Christoph Schlameuss Reviewed-by: Claudio Imbrenda --- .../selftests/kvm/s390x/ucontrol_test.c | 129 ++ 1 file changed, 129 insertions(+) diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c b/tools/testing/selftests/kvm/s390x/ucontrol_test.c index

[PATCH v2 00/10] selftests: kvm: s390: Add s390x ucontrol selftests

2024-07-23 Thread Christoph Schlameuss
ore internal reuse (thanks Claudio) - PATCH 7: make use of more declarative defines instead of magic values - PATCH 8: make use of more declarative defines instead of magic values (thanks Claudio) - PATCH 9: add reference to fix verified by the test case Christoph Schlameuss

[PATCH v2 05/10] selftests: kvm: s390: Add debug print functions

2024-07-23 Thread Christoph Schlameuss
: PRINT_HEX with 512 bytes * print_run: use print_psw and print_hex to print contents of VM run state and SIE state description * print_regs: print content of general and control registers All prints use pr_debug for the output and can be configured using DEBUG. Signed-off-by: Christoph Schlameuss

[PATCH v2 03/10] selftests: kvm: s390: Add s390x ucontrol test suite with hpage test

2024-07-23 Thread Christoph Schlameuss
containing CONFIG_KVM_S390_UCONTROL. This config needs to be set to built-in (y) as this cannot be built as module. Signed-off-by: Christoph Schlameuss Reviewed-by: Claudio Imbrenda --- tools/testing/selftests/kvm/.gitignore| 1 + tools/testing/selftests/kvm/Makefile | 1 + tools

[PATCH v2 02/10] selftests: kvm: s390: Add kvm_s390_sie_block definition for userspace tests

2024-07-23 Thread Christoph Schlameuss
atomicity for the flags. With the userspace definition of the SIE block layout now being present we can reuse the values in other tests where applicable. Signed-off-by: Christoph Schlameuss --- .../testing/selftests/kvm/include/s390x/sie.h | 240 ++ .../testing/selftests/kvm/s390x

[PATCH v2 01/10] selftests: kvm: s390: Define page sizes in shared header

2024-07-23 Thread Christoph Schlameuss
Multiple test cases need page size and shift definitions. By moving the definitions to a single architecture specific header we limit the repetition. Make use of PAGE_SIZE, PAGE_SHIFT and PAGE_MASK defines in existing code. Signed-off-by: Christoph Schlameuss Reviewed-by: Claudio Imbrenda

Re: [PATCH v1 8/9] selftests: kvm: s390: Add uc_skey VM test case

2024-07-11 Thread Christoph Schlameuss
On Tue, 9 Jul 2024 19:06:58 +0200 Claudio Imbrenda wrote: > On Tue, 9 Jul 2024 14:57:03 +0200 > Christoph Schlameuss wrote: > > > Add a test case manipulating s390 storage keys from within the ucontrol > > VM. > > > > Signed-off-by: Christoph Schlameuss >

Re: [PATCH v1 5/9] selftests: kvm: s390: Add debug print functions

2024-07-11 Thread Christoph Schlameuss
On Tue, 9 Jul 2024 18:31:54 +0200 Claudio Imbrenda wrote: > On Tue, 9 Jul 2024 14:57:00 +0200 > Christoph Schlameuss wrote: > [...] > > +static inline void print_hex_bytes(const char *name, u64 page, size_t len) > > > > "page" is not an appropri

Re: [PATCH v1 2/9] selftests: kvm: s390: Add kvm_s390_sie_block definition for userspace tests

2024-07-10 Thread Christoph Schlameuss
On Tue, 9 Jul 2024 17:40:22 +0200 Claudio Imbrenda wrote: > On Tue, 9 Jul 2024 14:56:57 +0200 > Christoph Schlameuss wrote: > > > Subsequent tests do require direct manipulation of the SIE instruction. > > This commit introduces the SIE definition for the selftests. >

[PATCH v1 9/9] selftests: kvm: s390: Verify reject memory region operations for ucontrol VMs

2024-07-09 Thread Christoph Schlameuss
Add a test case verifying KVM_SET_USER_MEMORY_REGION and KVM_SET_USER_MEMORY_REGION2 cannot be executed on ucontrol VMs. Executing this test case on not patched kernels will cause a null pointer dereference in the host kernel. Signed-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x

[PATCH v1 8/9] selftests: kvm: s390: Add uc_skey VM test case

2024-07-09 Thread Christoph Schlameuss
Add a test case manipulating s390 storage keys from within the ucontrol VM. Signed-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x/ucontrol_test.c | 83 +++ 1 file changed, 83 insertions(+) diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c b/tools

[PATCH v1 7/9] selftests: kvm: s390: Add uc_map_unmap VM test case

2024-07-09 Thread Christoph Schlameuss
. Signed-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x/ucontrol_test.c | 169 +- 1 file changed, 168 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c b/tools/testing/selftests/kvm/s390x/ucontrol_test.c index deeb9d089124

[PATCH v1 6/9] selftests: kvm: s390: Add VM run test case

2024-07-09 Thread Christoph Schlameuss
Add test case running code interacting with registers within a ucontrol VM. * Add uc_gprs test case The test uses the same VM setup using the fixture and debug macros introduced in earlier patches in this series. Signed-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x/ucontrol_test.c

[PATCH v1 5/9] selftests: kvm: s390: Add debug print functions

2024-07-09 Thread Christoph Schlameuss
: PRINT_HEX with 512 bytes * print_run: use print_psw and print_hex to print contents of VM run state and SIE state description * print_regs: print content of general and control registers All prints use pr_debug for the output and can be configured using DEBUG. Signed-off-by: Christoph Schlameuss

[PATCH v1 2/9] selftests: kvm: s390: Add kvm_s390_sie_block definition for userspace tests

2024-07-09 Thread Christoph Schlameuss
atomicity for the flags. With the userspace definition of the SIE block layout now being present we can reuse the values in other tests where applicable. Signed-off-by: Christoph Schlameuss --- .../testing/selftests/kvm/include/s390x/sie.h | 240 ++ .../testing/selftests/kvm/s390x

[PATCH v1 4/9] selftests: kvm: s390: Add test fixture and simple VM setup tests

2024-07-09 Thread Christoph Schlameuss
-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x/ucontrol_test.c | 130 ++ 1 file changed, 130 insertions(+) diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_test.c b/tools/testing/selftests/kvm/s390x/ucontrol_test.c index a706a9f2b9ea..44945af6d47d 100644

[PATCH v1 0/9] selftests: kvm: s390: Add s390x ucontrol selftests

2024-07-09 Thread Christoph Schlameuss
architecture specific defines that are now used in multiple test cases. Christoph Schlameuss (9): selftests: kvm: s390: Define page sizes in shared header selftests: kvm: s390: Add kvm_s390_sie_block definition for userspace tests selftests: kvm: s390: Add s390x ucontrol test suite with

[PATCH v1 3/9] selftests: kvm: s390: Add s390x ucontrol test suite with hpage test

2024-07-09 Thread Christoph Schlameuss
containing CONFIG_KVM_S390_UCONTROL. This config needs to be set to built-in (y) as this cannot be built as module. Signed-off-by: Christoph Schlameuss --- tools/testing/selftests/kvm/.gitignore| 1 + tools/testing/selftests/kvm/Makefile | 1 + tools/testing/selftests/kvm/s390x/config

[PATCH v1 1/9] selftests: kvm: s390: Define page sizes in shared header

2024-07-09 Thread Christoph Schlameuss
Multiple test cases need page size and shift definitions. By moving the definitions to a single architecture specific header we limit the repetition. Make use of PAGE_SIZE, PAGE_SHIFT and PAGE_MASK defines in existing code. Signed-off-by: Christoph Schlameuss --- tools/testing/selftests/kvm