[PATCH v4 0/6] KVM: s390: interrupt: Fix stepping into interrupt handlers

Ilya Leoshkevich posted 6 patches 2 years, 6 months ago
arch/s390/kvm/intercept.c                     |  38 ++++-
arch/s390/kvm/interrupt.c                     |  14 ++
arch/s390/kvm/kvm-s390.c                      |  27 ++-
tools/testing/selftests/kvm/Makefile          |   1 +
.../testing/selftests/kvm/s390x/debug_test.c  | 160 ++++++++++++++++++
5 files changed, 229 insertions(+), 11 deletions(-)
create mode 100644 tools/testing/selftests/kvm/s390x/debug_test.c
[PATCH v4 0/6] KVM: s390: interrupt: Fix stepping into interrupt handlers
Posted by Ilya Leoshkevich 2 years, 6 months ago
v3: https://lore.kernel.org/kvm/20230724094716.91510-1-iii@linux.ibm.com/
v3 -> v4: Restore the per_event() macro (Claudio).

v2: https://lore.kernel.org/lkml/20230721120046.2262291-1-iii@linux.ibm.com/
v2 -> v3: Add comments, improve the commit messages (Christian, David).
          Add R-bs.
          Patches that need review: [4/6], [6/6].

v1: https://lore.kernel.org/lkml/20230629083452.183274-1-iii@linux.ibm.com/
v1 -> v2: Fix three more issues.
          Add selftests (Claudio).

Hi,

I tried to compare the behavior of KVM and TCG by diffing instruction
traces, and found five issues in KVM related to stepping into interrupt
handlers.

Best regards,
Ilya

Ilya Leoshkevich (6):
  KVM: s390: interrupt: Fix single-stepping into interrupt handlers
  KVM: s390: interrupt: Fix single-stepping into program interrupt
    handlers
  KVM: s390: interrupt: Fix single-stepping kernel-emulated instructions
  KVM: s390: interrupt: Fix single-stepping userspace-emulated
    instructions
  KVM: s390: interrupt: Fix single-stepping keyless mode exits
  KVM: s390: selftests: Add selftest for single-stepping

 arch/s390/kvm/intercept.c                     |  38 ++++-
 arch/s390/kvm/interrupt.c                     |  14 ++
 arch/s390/kvm/kvm-s390.c                      |  27 ++-
 tools/testing/selftests/kvm/Makefile          |   1 +
 .../testing/selftests/kvm/s390x/debug_test.c  | 160 ++++++++++++++++++
 5 files changed, 229 insertions(+), 11 deletions(-)
 create mode 100644 tools/testing/selftests/kvm/s390x/debug_test.c

-- 
2.41.0
Re: [PATCH v4 0/6] KVM: s390: interrupt: Fix stepping into interrupt handlers
Posted by Sean Christopherson 2 years, 6 months ago
On Tue, Jul 25, 2023, Ilya Leoshkevich wrote:
> Ilya Leoshkevich (6):
>   KVM: s390: interrupt: Fix single-stepping into interrupt handlers
>   KVM: s390: interrupt: Fix single-stepping into program interrupt
>     handlers
>   KVM: s390: interrupt: Fix single-stepping kernel-emulated instructions
>   KVM: s390: interrupt: Fix single-stepping userspace-emulated
>     instructions
>   KVM: s390: interrupt: Fix single-stepping keyless mode exits
>   KVM: s390: selftests: Add selftest for single-stepping

FYI, the selftests change silently conflicts with a global s/ASSERT_EQ/TEST_ASSERT_EQ
rename[1], but the conflicts are very straightforward to resolve (just prepend TEST_).
If we want to proactively avoid mild pain in linux-next, one option would be to merge
the full kvm-x86/selftests branch/tag once I've made that immutable[2] (will be done
Friday if there are no fireworks).  Though we can probably just get away with doing
nothing other than letting Paolo know there's a silent conflict.

[1] https://lore.kernel.org/all/169101245511.1754469.7852701829984104093.b4-ty@google.com
[2] https://lore.kernel.org/all/169101267140.1755771.17089576255751273053.b4-ty@google.com
Re: [PATCH v4 0/6] KVM: s390: interrupt: Fix stepping into interrupt handlers
Posted by Christian Borntraeger 2 years, 6 months ago

Am 03.08.23 um 00:24 schrieb Sean Christopherson:
> On Tue, Jul 25, 2023, Ilya Leoshkevich wrote:
>> Ilya Leoshkevich (6):
>>    KVM: s390: interrupt: Fix single-stepping into interrupt handlers
>>    KVM: s390: interrupt: Fix single-stepping into program interrupt
>>      handlers
>>    KVM: s390: interrupt: Fix single-stepping kernel-emulated instructions
>>    KVM: s390: interrupt: Fix single-stepping userspace-emulated
>>      instructions
>>    KVM: s390: interrupt: Fix single-stepping keyless mode exits
>>    KVM: s390: selftests: Add selftest for single-stepping
> 
> FYI, the selftests change silently conflicts with a global s/ASSERT_EQ/TEST_ASSERT_EQ
> rename[1], but the conflicts are very straightforward to resolve (just prepend TEST_).
> If we want to proactively avoid mild pain in linux-next, one option would be to merge
> the full kvm-x86/selftests branch/tag once I've made that immutable[2] (will be done
> Friday if there are no fireworks).  Though we can probably just get away with doing
> nothing other than letting Paolo know there's a silent conflict.
> 
> [1] https://lore.kernel.org/all/169101245511.1754469.7852701829984104093.b4-ty@google.com
> [2] https://lore.kernel.org/all/169101267140.1755771.17089576255751273053.b4-ty@google.com

Thanks for telling. Paolo, do you have a preference?

Janosch, Claudio I think this series is good to go otherwise.