Re: [PATCH v4 0/2] KVM: s390: Fix AR parameter in ioctl

2024-02-21 Thread Eric Farman
On Wed, 2024-02-21 at 12:26 +0100, Heiko Carstens wrote: > On Wed, Feb 21, 2024 at 08:49:58AM +0100, Janosch Frank wrote: > > On 2/20/24 22:12, Eric Farman wrote: > > > Hi Janosch, > > > > > > Here is a new (final?) version for the AR/MEM_OP issue I'm >

[PATCH v4 2/2] KVM: s390: selftests: memop: add a simple AR test

2024-02-20 Thread Eric Farman
used anyway. AR[1] is selected for this test because the host AR[1] is usually non-zero, and KVM needs to correctly swap those values. Reviewed-by: Nina Schoetterl-Glausch Acked-by: Christian Borntraeger Signed-off-by: Eric Farman --- tools/testing/selftests/kvm/s390x/memop.c | 31

[PATCH v4 0/2] KVM: s390: Fix AR parameter in ioctl

2024-02-20 Thread Eric Farman
v1: https://lore.kernel.org/r/20240209204539.4150550-1-far...@linux.ibm.com/ [CB] Store access registers around memop ioctl [JF] Add a kernel selftest RFC: https://lore.kernel.org/r/20240131205832.2179029-1-far...@linux.ibm.com/ Eric Farman (2): KVM: s390: fix access register usage in ioctls

[PATCH v4 1/2] KVM: s390: fix access register usage in ioctls

2024-02-20 Thread Eric Farman
path), the AR can be read from vcpu->run without stashing the current contents. Reviewed-by: Heiko Carstens Reviewed-by: Nina Schoetterl-Glausch Acked-by: Christian Borntraeger Reviewed-by: Christian Borntraeger Signed-off-by: Eric Farman --- arch/s390/include/asm/kvm_host.h | 2 +

Re: [PATCH v3 1/2] KVM: s390: fix access register usage in ioctls

2024-02-20 Thread Eric Farman
On Tue, 2024-02-20 at 15:19 +0100, Janosch Frank wrote: > On 2/20/24 15:15, Christian Borntraeger wrote: > > > > > > Am 16.02.24 um 22:36 schrieb Eric Farman: > > > The routine ar_translation() can be reached by both the > > > instruction > > > int

Re: [PATCH v2 2/2] KVM: s390: selftests: memop: add a simple AR test

2024-02-20 Thread Eric Farman
On Tue, 2024-02-20 at 14:34 +0100, Nina Schoetterl-Glausch wrote: > On Thu, 2024-02-15 at 21:53 +0100, Eric Farman wrote: > > There is a selftest that checks for an (expected) error when an > > invalid AR is specified, but not one that exercises the AR path. > > > > Add

[PATCH v3 0/2] KVM: s390: Fix AR parameter in ioctl

2024-02-16 Thread Eric Farman
RFC: https://lore.kernel.org/r/20240131205832.2179029-1-far...@linux.ibm.com/ Eric Farman (2): KVM: s390: fix access register usage in ioctls KVM: s390: selftests: memop: add a simple AR test arch/s390/include/asm/kvm_host.h | 1 + arch/s390/kvm/gaccess.c | 3 ++- arc

[PATCH v3 1/2] KVM: s390: fix access register usage in ioctls

2024-02-16 Thread Eric Farman
path), the AR can be read from vcpu->run without stashing the current contents. Signed-off-by: Eric Farman --- arch/s390/include/asm/kvm_host.h | 1 + arch/s390/kvm/gaccess.c | 3 ++- arch/s390/kvm/kvm-s390.c | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff -

[PATCH v3 2/2] KVM: s390: selftests: memop: add a simple AR test

2024-02-16 Thread Eric Farman
used anyway. AR[1] is selected for this test because the host AR[1] is usually non-zero, and KVM needs to correctly swap those values. Signed-off-by: Eric Farman --- tools/testing/selftests/kvm/s390x/memop.c | 28 +++ 1 file changed, 28 insertions(+) diff --git a/tools

Re: [PATCH v2 1/2] KVM: s390: load guest access registers in MEM_OP ioctl

2024-02-16 Thread Eric Farman
On Fri, 2024-02-16 at 11:33 -0500, Eric Farman wrote: > On Fri, 2024-02-16 at 10:40 +0100, Heiko Carstens wrote: > > On Thu, Feb 15, 2024 at 09:53:43PM +0100, Eric Farman wrote: > > > The routine ar_translation() can be reached by both the > > > instruction > > &

Re: [PATCH v2 1/2] KVM: s390: load guest access registers in MEM_OP ioctl

2024-02-16 Thread Eric Farman
On Fri, 2024-02-16 at 10:40 +0100, Heiko Carstens wrote: > On Thu, Feb 15, 2024 at 09:53:43PM +0100, Eric Farman wrote: > > The routine ar_translation() can be reached by both the instruction > > intercept path (where the access registers had been loaded with the > > guest re

[PATCH v2 0/2] KVM: s390: Fix AR parameter in MEM_OP ioctl

2024-02-15 Thread Eric Farman
ound memop ioctl [JF] Add a kernel selftest RFC: https://lore.kernel.org/r/20240131205832.2179029-1-far...@linux.ibm.com/ Eric Farman (2): KVM: s390: load guest access registers in MEM_OP ioctl KVM: s390: selftests: memop: add a simple AR test arch/s390/include/asm/kvm_host.h

[PATCH v2 1/2] KVM: s390: load guest access registers in MEM_OP ioctl

2024-02-15 Thread Eric Farman
struct to indicate the guest ARs have been loaded into the registers. This permits a warning to be emitted if entering this path without a proper register setup. Suggested-by: Christian Borntraeger Signed-off-by: Eric Farman --- arch/s390/include/asm/kvm_host.h | 1 + arch/s390/kvm/gaccess.c

[PATCH v2 2/2] KVM: s390: selftests: memop: add a simple AR test

2024-02-15 Thread Eric Farman
used anyway. AR[1] is selected for this test because the host AR[1] is usually non-zero, and KVM needs to correctly swap those values. Signed-off-by: Eric Farman --- tools/testing/selftests/kvm/s390x/memop.c | 28 +++ 1 file changed, 28 insertions(+) diff --git a/tools

Re: [PATCH v1 1/2] KVM: s390: load guest access registers in MEM_OP ioctl

2024-02-13 Thread Eric Farman
On Mon, 2024-02-12 at 12:52 +0100, Heiko Carstens wrote: > > On Mon, Feb 12, 2024 at 11:21:30AM +0100, Heiko Carstens wrote: > > > > Or maybe a TIF flag with different semantics: "guest save area > > > > does > > > > not > > > > reflect current state - which is within registers". > > > > Something

[PATCH v1 2/2] KVM: s390: selftests: memop: add a simple AR test

2024-02-09 Thread Eric Farman
used anyway. AR[1] is selected for this test because the host AR[1] is usually non-zero, and KVM needs to correctly swap those values. Signed-off-by: Eric Farman --- tools/testing/selftests/kvm/s390x/memop.c | 28 +++ 1 file changed, 28 insertions(+) diff --git a/tools

[PATCH v1 1/2] KVM: s390: load guest access registers in MEM_OP ioctl

2024-02-09 Thread Eric Farman
registers around the MEM_OP ioctl, in the same way that the KVM_RUN ioctl does with sync_regs()/store_regs(). The full register swap isn't needed here, since only the access registers are used in this interface. Suggested-by: Christian Borntraeger Signed-off-by: Eric Farman --- arch/s390/kvm

[PATCH v1 0/2] KVM: s390: Fix AR parameter in MEM_OP ioctl

2024-02-09 Thread Eric Farman
system call) Thoughts on this approach? Thanks, Eric [1] https://lore.kernel.org/r/20240131205832.2179029-1-far...@linux.ibm.com/ Eric Farman (2): KVM: s390: load guest access registers in MEM_OP ioctl KVM: s390: selftests: memop: add a simple AR test arch/s390/kvm/kvm-s390.c