[Kernel-packages] [Bug 1995941] Re: [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW wait

2023-01-17 Thread Frank Heimes
** Tags removed: verification-needed-focal
** Tags added: verification-done-focal

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1995941

Title:
  [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW
  wait

Status in Ubuntu on IBM z Systems:
  Fix Released
Status in linux package in Ubuntu:
  Invalid
Status in linux source package in Focal:
  Fix Released

Bug description:
  SRU Justification:
  ==

  [Impact]

   * In a secure execution guest, the external interrupt for the SIGP
 external call order is delivered twice to a VCPU even though it was 
 only sent once.

   * Under PV (protected virtualization), external call interrupts are
     delivered by the SIGP interpretation facility, without KVM's
     involvement.
     But, if the receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered.
     Hence, in this case, the SIGP external call order causes
     an interception.

   * In response, KVM only needs to wake the receiving VCPU.
     Interrupt delivery is then handled by the SIGP interpretation facility.

   * KVM wrongly assumed it also needs to request injection for the
     external call interrupt after the respective intercept, causing the
     interrupt to be delivered twice:
     * once through the SIGP interpretation facility
     * and once through the interrupt injection control by KVM.

   * Solution is to add appropriate special handling for 108 external
     call intercepts.

  [Fix]

   * c3f0e5fd2d33 c3f0e5fd2d33d80c5a5a8b5e5d2bab2841709cc8
     "KVM: s390: pv: don't present the ecall interrupt twice"

  [Test Case]

   * Have an Secure Execution (PV) environment setup on an
     IBM z15 or LinuxONE III LPAR using Ubuntu Server 20.04 (latest).

   * Apply kvm-unit-test submitted upstream:
     "[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP call \
  orders in enabled wait"

   * Run the smp_PV kvm-unit-test: ./run_tests.sh smp_PV

   * Check logs/smp_PV.log.
     If system is affected, the following line can be found:
     "ABORT: smp: psw wait: ecall: Unexpected external call interrupt \
  (code 0x1202): on cpu 1 at 0x11958"

   * If the system is not affected, the line should look like this:
     "PASS: smp: psw wait: ecall: received"

  [Regression Potential / What can go wrong]

   * The handle_pv_notification can be wrong and misleading
     in case 'ret' is not handled correctly.

   * trace_kvm_s390_handle_sigp_pei might not be called correctly,
     now after the if condition.

   * In worst case the external interrupt could not be delivered
     at all or still too often.

  [Other]

   * The fix/patch c3f0e5fd2d33 got upstream accepted with kernel v6.0,
     so it not only needs to be applied to 20.04/5.4, but also to 22.04/5.15
     and 22.10/5.19.

   * But the patch got properly tagged for upstream stable:
     Cc:  # 5.7
     Fixes: da24a0cc58ed ("KVM: s390: protvirt: Instruction emulation")

   * And with that it got already picked up and is included in:
     22.04 with Ubuntu-5.15.0-53.59 (currently in jammy-proposed)
     22.10 with Ubuntu-5.19.0-16.16 means incl. in the release kernel.

   * So the only Ubuntu release that is affected is 20.04/focal.
  __

  Description:   KVM: PV: ext call delivered twice when receiver in PSW wait
  Symptom:   In a secure execution guest, the external interrupt for the
     SIGP external call order is delivered twice to a VCPU even
     though it was only sent once.
  Problem:   Under PV, external call interrupts are delivered by the SIGP
     interpretation facility, without KVM's involvement. But, if the
     receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered. Hence,
     in this case, the SIGP external call order causes an
     interception. In response, KVM only needs to wake the receiving
     VCPU. Interrupt delivery is then handled by the SIGP
     interpretation facility.

     KVM wrongfuly assumed it also needs to request injection for 
the
     external call interrupt after the respective intercept, causing
     the interrupt to be delivered twice: once through the SIGP
     interpretation facility and once through the interrupt 
injection
     control by KVM.
  Solution:  Add appropriate special handling for 108 external call
     intercepts.
  Reproduction:  0. Apply kvm-unit-test submitted upstream
    ("[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP
    call orders in enabled wait").
     1. Run the smp_PV kvm-unit-test:
  ./run_tests.sh smp_PV
     2. 

[Kernel-packages] [Bug 1995941] Re: [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW wait

2023-01-17 Thread Ubuntu Kernel Bot
This bug is awaiting verification that the linux-azure/5.4.0-1102.108
kernel in -proposed solves the problem. Please test the kernel and
update this bug with the results. If the problem is solved, change the
tag 'verification-needed-focal' to 'verification-done-focal'. If the
problem still exists, change the tag 'verification-needed-focal' to
'verification-failed-focal'.

If verification is not done by 5 working days from today, this fix will
be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how
to enable and use -proposed. Thank you!


** Tags removed: verification-done-focal
** Tags added: kernel-spammed-focal-linux-azure verification-needed-focal

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1995941

Title:
  [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW
  wait

Status in Ubuntu on IBM z Systems:
  Fix Released
Status in linux package in Ubuntu:
  Invalid
Status in linux source package in Focal:
  Fix Released

Bug description:
  SRU Justification:
  ==

  [Impact]

   * In a secure execution guest, the external interrupt for the SIGP
 external call order is delivered twice to a VCPU even though it was 
 only sent once.

   * Under PV (protected virtualization), external call interrupts are
     delivered by the SIGP interpretation facility, without KVM's
     involvement.
     But, if the receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered.
     Hence, in this case, the SIGP external call order causes
     an interception.

   * In response, KVM only needs to wake the receiving VCPU.
     Interrupt delivery is then handled by the SIGP interpretation facility.

   * KVM wrongly assumed it also needs to request injection for the
     external call interrupt after the respective intercept, causing the
     interrupt to be delivered twice:
     * once through the SIGP interpretation facility
     * and once through the interrupt injection control by KVM.

   * Solution is to add appropriate special handling for 108 external
     call intercepts.

  [Fix]

   * c3f0e5fd2d33 c3f0e5fd2d33d80c5a5a8b5e5d2bab2841709cc8
     "KVM: s390: pv: don't present the ecall interrupt twice"

  [Test Case]

   * Have an Secure Execution (PV) environment setup on an
     IBM z15 or LinuxONE III LPAR using Ubuntu Server 20.04 (latest).

   * Apply kvm-unit-test submitted upstream:
     "[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP call \
  orders in enabled wait"

   * Run the smp_PV kvm-unit-test: ./run_tests.sh smp_PV

   * Check logs/smp_PV.log.
     If system is affected, the following line can be found:
     "ABORT: smp: psw wait: ecall: Unexpected external call interrupt \
  (code 0x1202): on cpu 1 at 0x11958"

   * If the system is not affected, the line should look like this:
     "PASS: smp: psw wait: ecall: received"

  [Regression Potential / What can go wrong]

   * The handle_pv_notification can be wrong and misleading
     in case 'ret' is not handled correctly.

   * trace_kvm_s390_handle_sigp_pei might not be called correctly,
     now after the if condition.

   * In worst case the external interrupt could not be delivered
     at all or still too often.

  [Other]

   * The fix/patch c3f0e5fd2d33 got upstream accepted with kernel v6.0,
     so it not only needs to be applied to 20.04/5.4, but also to 22.04/5.15
     and 22.10/5.19.

   * But the patch got properly tagged for upstream stable:
     Cc:  # 5.7
     Fixes: da24a0cc58ed ("KVM: s390: protvirt: Instruction emulation")

   * And with that it got already picked up and is included in:
     22.04 with Ubuntu-5.15.0-53.59 (currently in jammy-proposed)
     22.10 with Ubuntu-5.19.0-16.16 means incl. in the release kernel.

   * So the only Ubuntu release that is affected is 20.04/focal.
  __

  Description:   KVM: PV: ext call delivered twice when receiver in PSW wait
  Symptom:   In a secure execution guest, the external interrupt for the
     SIGP external call order is delivered twice to a VCPU even
     though it was only sent once.
  Problem:   Under PV, external call interrupts are delivered by the SIGP
     interpretation facility, without KVM's involvement. But, if the
     receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered. Hence,
     in this case, the SIGP external call order causes an
     interception. In response, KVM only needs to wake the receiving
     VCPU. Interrupt delivery is then handled by the SIGP
     interpretation facility.

     KVM wrongfuly assumed it also needs to request injection for 
the
     

[Kernel-packages] [Bug 1995941] Re: [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW wait

2023-01-17 Thread Frank Heimes
** Tags removed: verification-needed-focal
** Tags added: verification-done-focal

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1995941

Title:
  [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW
  wait

Status in Ubuntu on IBM z Systems:
  Fix Released
Status in linux package in Ubuntu:
  Invalid
Status in linux source package in Focal:
  Fix Released

Bug description:
  SRU Justification:
  ==

  [Impact]

   * In a secure execution guest, the external interrupt for the SIGP
 external call order is delivered twice to a VCPU even though it was 
 only sent once.

   * Under PV (protected virtualization), external call interrupts are
     delivered by the SIGP interpretation facility, without KVM's
     involvement.
     But, if the receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered.
     Hence, in this case, the SIGP external call order causes
     an interception.

   * In response, KVM only needs to wake the receiving VCPU.
     Interrupt delivery is then handled by the SIGP interpretation facility.

   * KVM wrongly assumed it also needs to request injection for the
     external call interrupt after the respective intercept, causing the
     interrupt to be delivered twice:
     * once through the SIGP interpretation facility
     * and once through the interrupt injection control by KVM.

   * Solution is to add appropriate special handling for 108 external
     call intercepts.

  [Fix]

   * c3f0e5fd2d33 c3f0e5fd2d33d80c5a5a8b5e5d2bab2841709cc8
     "KVM: s390: pv: don't present the ecall interrupt twice"

  [Test Case]

   * Have an Secure Execution (PV) environment setup on an
     IBM z15 or LinuxONE III LPAR using Ubuntu Server 20.04 (latest).

   * Apply kvm-unit-test submitted upstream:
     "[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP call \
  orders in enabled wait"

   * Run the smp_PV kvm-unit-test: ./run_tests.sh smp_PV

   * Check logs/smp_PV.log.
     If system is affected, the following line can be found:
     "ABORT: smp: psw wait: ecall: Unexpected external call interrupt \
  (code 0x1202): on cpu 1 at 0x11958"

   * If the system is not affected, the line should look like this:
     "PASS: smp: psw wait: ecall: received"

  [Regression Potential / What can go wrong]

   * The handle_pv_notification can be wrong and misleading
     in case 'ret' is not handled correctly.

   * trace_kvm_s390_handle_sigp_pei might not be called correctly,
     now after the if condition.

   * In worst case the external interrupt could not be delivered
     at all or still too often.

  [Other]

   * The fix/patch c3f0e5fd2d33 got upstream accepted with kernel v6.0,
     so it not only needs to be applied to 20.04/5.4, but also to 22.04/5.15
     and 22.10/5.19.

   * But the patch got properly tagged for upstream stable:
     Cc:  # 5.7
     Fixes: da24a0cc58ed ("KVM: s390: protvirt: Instruction emulation")

   * And with that it got already picked up and is included in:
     22.04 with Ubuntu-5.15.0-53.59 (currently in jammy-proposed)
     22.10 with Ubuntu-5.19.0-16.16 means incl. in the release kernel.

   * So the only Ubuntu release that is affected is 20.04/focal.
  __

  Description:   KVM: PV: ext call delivered twice when receiver in PSW wait
  Symptom:   In a secure execution guest, the external interrupt for the
     SIGP external call order is delivered twice to a VCPU even
     though it was only sent once.
  Problem:   Under PV, external call interrupts are delivered by the SIGP
     interpretation facility, without KVM's involvement. But, if the
     receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered. Hence,
     in this case, the SIGP external call order causes an
     interception. In response, KVM only needs to wake the receiving
     VCPU. Interrupt delivery is then handled by the SIGP
     interpretation facility.

     KVM wrongfuly assumed it also needs to request injection for 
the
     external call interrupt after the respective intercept, causing
     the interrupt to be delivered twice: once through the SIGP
     interpretation facility and once through the interrupt 
injection
     control by KVM.
  Solution:  Add appropriate special handling for 108 external call
     intercepts.
  Reproduction:  0. Apply kvm-unit-test submitted upstream
    ("[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP
    call orders in enabled wait").
     1. Run the smp_PV kvm-unit-test:
  ./run_tests.sh smp_PV
     2. 

[Kernel-packages] [Bug 1995941] Re: [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW wait

2023-01-17 Thread Ubuntu Kernel Bot
This bug is awaiting verification that the linux-aws/5.4.0-1095.103
kernel in -proposed solves the problem. Please test the kernel and
update this bug with the results. If the problem is solved, change the
tag 'verification-needed-focal' to 'verification-done-focal'. If the
problem still exists, change the tag 'verification-needed-focal' to
'verification-failed-focal'.

If verification is not done by 5 working days from today, this fix will
be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how
to enable and use -proposed. Thank you!


** Tags removed: verification-done-focal
** Tags added: kernel-spammed-focal-linux-aws verification-needed-focal

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1995941

Title:
  [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW
  wait

Status in Ubuntu on IBM z Systems:
  Fix Released
Status in linux package in Ubuntu:
  Invalid
Status in linux source package in Focal:
  Fix Released

Bug description:
  SRU Justification:
  ==

  [Impact]

   * In a secure execution guest, the external interrupt for the SIGP
 external call order is delivered twice to a VCPU even though it was 
 only sent once.

   * Under PV (protected virtualization), external call interrupts are
     delivered by the SIGP interpretation facility, without KVM's
     involvement.
     But, if the receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered.
     Hence, in this case, the SIGP external call order causes
     an interception.

   * In response, KVM only needs to wake the receiving VCPU.
     Interrupt delivery is then handled by the SIGP interpretation facility.

   * KVM wrongly assumed it also needs to request injection for the
     external call interrupt after the respective intercept, causing the
     interrupt to be delivered twice:
     * once through the SIGP interpretation facility
     * and once through the interrupt injection control by KVM.

   * Solution is to add appropriate special handling for 108 external
     call intercepts.

  [Fix]

   * c3f0e5fd2d33 c3f0e5fd2d33d80c5a5a8b5e5d2bab2841709cc8
     "KVM: s390: pv: don't present the ecall interrupt twice"

  [Test Case]

   * Have an Secure Execution (PV) environment setup on an
     IBM z15 or LinuxONE III LPAR using Ubuntu Server 20.04 (latest).

   * Apply kvm-unit-test submitted upstream:
     "[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP call \
  orders in enabled wait"

   * Run the smp_PV kvm-unit-test: ./run_tests.sh smp_PV

   * Check logs/smp_PV.log.
     If system is affected, the following line can be found:
     "ABORT: smp: psw wait: ecall: Unexpected external call interrupt \
  (code 0x1202): on cpu 1 at 0x11958"

   * If the system is not affected, the line should look like this:
     "PASS: smp: psw wait: ecall: received"

  [Regression Potential / What can go wrong]

   * The handle_pv_notification can be wrong and misleading
     in case 'ret' is not handled correctly.

   * trace_kvm_s390_handle_sigp_pei might not be called correctly,
     now after the if condition.

   * In worst case the external interrupt could not be delivered
     at all or still too often.

  [Other]

   * The fix/patch c3f0e5fd2d33 got upstream accepted with kernel v6.0,
     so it not only needs to be applied to 20.04/5.4, but also to 22.04/5.15
     and 22.10/5.19.

   * But the patch got properly tagged for upstream stable:
     Cc:  # 5.7
     Fixes: da24a0cc58ed ("KVM: s390: protvirt: Instruction emulation")

   * And with that it got already picked up and is included in:
     22.04 with Ubuntu-5.15.0-53.59 (currently in jammy-proposed)
     22.10 with Ubuntu-5.19.0-16.16 means incl. in the release kernel.

   * So the only Ubuntu release that is affected is 20.04/focal.
  __

  Description:   KVM: PV: ext call delivered twice when receiver in PSW wait
  Symptom:   In a secure execution guest, the external interrupt for the
     SIGP external call order is delivered twice to a VCPU even
     though it was only sent once.
  Problem:   Under PV, external call interrupts are delivered by the SIGP
     interpretation facility, without KVM's involvement. But, if the
     receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered. Hence,
     in this case, the SIGP external call order causes an
     interception. In response, KVM only needs to wake the receiving
     VCPU. Interrupt delivery is then handled by the SIGP
     interpretation facility.

     KVM wrongfuly assumed it also needs to request injection for 
the
     

[Kernel-packages] [Bug 1995941] Re: [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW wait

2023-01-10 Thread Frank Heimes
This bug was not opened against linux-iot, hence the new request for 
verification is not valid.
I'm updating the verification tags just to unblock the further process...

** Tags removed: verification-needed-focal
** Tags added: verification-done-focal

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1995941

Title:
  [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW
  wait

Status in Ubuntu on IBM z Systems:
  Fix Released
Status in linux package in Ubuntu:
  Invalid
Status in linux source package in Focal:
  Fix Released

Bug description:
  SRU Justification:
  ==

  [Impact]

   * In a secure execution guest, the external interrupt for the SIGP
 external call order is delivered twice to a VCPU even though it was 
 only sent once.

   * Under PV (protected virtualization), external call interrupts are
     delivered by the SIGP interpretation facility, without KVM's
     involvement.
     But, if the receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered.
     Hence, in this case, the SIGP external call order causes
     an interception.

   * In response, KVM only needs to wake the receiving VCPU.
     Interrupt delivery is then handled by the SIGP interpretation facility.

   * KVM wrongly assumed it also needs to request injection for the
     external call interrupt after the respective intercept, causing the
     interrupt to be delivered twice:
     * once through the SIGP interpretation facility
     * and once through the interrupt injection control by KVM.

   * Solution is to add appropriate special handling for 108 external
     call intercepts.

  [Fix]

   * c3f0e5fd2d33 c3f0e5fd2d33d80c5a5a8b5e5d2bab2841709cc8
     "KVM: s390: pv: don't present the ecall interrupt twice"

  [Test Case]

   * Have an Secure Execution (PV) environment setup on an
     IBM z15 or LinuxONE III LPAR using Ubuntu Server 20.04 (latest).

   * Apply kvm-unit-test submitted upstream:
     "[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP call \
  orders in enabled wait"

   * Run the smp_PV kvm-unit-test: ./run_tests.sh smp_PV

   * Check logs/smp_PV.log.
     If system is affected, the following line can be found:
     "ABORT: smp: psw wait: ecall: Unexpected external call interrupt \
  (code 0x1202): on cpu 1 at 0x11958"

   * If the system is not affected, the line should look like this:
     "PASS: smp: psw wait: ecall: received"

  [Regression Potential / What can go wrong]

   * The handle_pv_notification can be wrong and misleading
     in case 'ret' is not handled correctly.

   * trace_kvm_s390_handle_sigp_pei might not be called correctly,
     now after the if condition.

   * In worst case the external interrupt could not be delivered
     at all or still too often.

  [Other]

   * The fix/patch c3f0e5fd2d33 got upstream accepted with kernel v6.0,
     so it not only needs to be applied to 20.04/5.4, but also to 22.04/5.15
     and 22.10/5.19.

   * But the patch got properly tagged for upstream stable:
     Cc:  # 5.7
     Fixes: da24a0cc58ed ("KVM: s390: protvirt: Instruction emulation")

   * And with that it got already picked up and is included in:
     22.04 with Ubuntu-5.15.0-53.59 (currently in jammy-proposed)
     22.10 with Ubuntu-5.19.0-16.16 means incl. in the release kernel.

   * So the only Ubuntu release that is affected is 20.04/focal.
  __

  Description:   KVM: PV: ext call delivered twice when receiver in PSW wait
  Symptom:   In a secure execution guest, the external interrupt for the
     SIGP external call order is delivered twice to a VCPU even
     though it was only sent once.
  Problem:   Under PV, external call interrupts are delivered by the SIGP
     interpretation facility, without KVM's involvement. But, if the
     receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered. Hence,
     in this case, the SIGP external call order causes an
     interception. In response, KVM only needs to wake the receiving
     VCPU. Interrupt delivery is then handled by the SIGP
     interpretation facility.

     KVM wrongfuly assumed it also needs to request injection for 
the
     external call interrupt after the respective intercept, causing
     the interrupt to be delivered twice: once through the SIGP
     interpretation facility and once through the interrupt 
injection
     control by KVM.
  Solution:  Add appropriate special handling for 108 external call
     intercepts.
  Reproduction:  0. Apply kvm-unit-test submitted upstream
    ("[kvm-unit-tests PATCH v1 0/4] s390x: add tests 

[Kernel-packages] [Bug 1995941] Re: [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW wait

2023-01-10 Thread Ubuntu Kernel Bot
This bug is awaiting verification that the linux-iot/5.4.0-1011.13
kernel in -proposed solves the problem. Please test the kernel and
update this bug with the results. If the problem is solved, change the
tag 'verification-needed-focal' to 'verification-done-focal'. If the
problem still exists, change the tag 'verification-needed-focal' to
'verification-failed-focal'.

If verification is not done by 5 working days from today, this fix will
be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how
to enable and use -proposed. Thank you!


** Tags removed: verification-done-focal
** Tags added: kernel-spammed-focal-linux-iot verification-needed-focal

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1995941

Title:
  [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW
  wait

Status in Ubuntu on IBM z Systems:
  Fix Released
Status in linux package in Ubuntu:
  Invalid
Status in linux source package in Focal:
  Fix Released

Bug description:
  SRU Justification:
  ==

  [Impact]

   * In a secure execution guest, the external interrupt for the SIGP
 external call order is delivered twice to a VCPU even though it was 
 only sent once.

   * Under PV (protected virtualization), external call interrupts are
     delivered by the SIGP interpretation facility, without KVM's
     involvement.
     But, if the receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered.
     Hence, in this case, the SIGP external call order causes
     an interception.

   * In response, KVM only needs to wake the receiving VCPU.
     Interrupt delivery is then handled by the SIGP interpretation facility.

   * KVM wrongly assumed it also needs to request injection for the
     external call interrupt after the respective intercept, causing the
     interrupt to be delivered twice:
     * once through the SIGP interpretation facility
     * and once through the interrupt injection control by KVM.

   * Solution is to add appropriate special handling for 108 external
     call intercepts.

  [Fix]

   * c3f0e5fd2d33 c3f0e5fd2d33d80c5a5a8b5e5d2bab2841709cc8
     "KVM: s390: pv: don't present the ecall interrupt twice"

  [Test Case]

   * Have an Secure Execution (PV) environment setup on an
     IBM z15 or LinuxONE III LPAR using Ubuntu Server 20.04 (latest).

   * Apply kvm-unit-test submitted upstream:
     "[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP call \
  orders in enabled wait"

   * Run the smp_PV kvm-unit-test: ./run_tests.sh smp_PV

   * Check logs/smp_PV.log.
     If system is affected, the following line can be found:
     "ABORT: smp: psw wait: ecall: Unexpected external call interrupt \
  (code 0x1202): on cpu 1 at 0x11958"

   * If the system is not affected, the line should look like this:
     "PASS: smp: psw wait: ecall: received"

  [Regression Potential / What can go wrong]

   * The handle_pv_notification can be wrong and misleading
     in case 'ret' is not handled correctly.

   * trace_kvm_s390_handle_sigp_pei might not be called correctly,
     now after the if condition.

   * In worst case the external interrupt could not be delivered
     at all or still too often.

  [Other]

   * The fix/patch c3f0e5fd2d33 got upstream accepted with kernel v6.0,
     so it not only needs to be applied to 20.04/5.4, but also to 22.04/5.15
     and 22.10/5.19.

   * But the patch got properly tagged for upstream stable:
     Cc:  # 5.7
     Fixes: da24a0cc58ed ("KVM: s390: protvirt: Instruction emulation")

   * And with that it got already picked up and is included in:
     22.04 with Ubuntu-5.15.0-53.59 (currently in jammy-proposed)
     22.10 with Ubuntu-5.19.0-16.16 means incl. in the release kernel.

   * So the only Ubuntu release that is affected is 20.04/focal.
  __

  Description:   KVM: PV: ext call delivered twice when receiver in PSW wait
  Symptom:   In a secure execution guest, the external interrupt for the
     SIGP external call order is delivered twice to a VCPU even
     though it was only sent once.
  Problem:   Under PV, external call interrupts are delivered by the SIGP
     interpretation facility, without KVM's involvement. But, if the
     receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered. Hence,
     in this case, the SIGP external call order causes an
     interception. In response, KVM only needs to wake the receiving
     VCPU. Interrupt delivery is then handled by the SIGP
     interpretation facility.

     KVM wrongfuly assumed it also needs to request injection for 
the
     

[Kernel-packages] [Bug 1995941] Re: [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW wait

2023-01-05 Thread Frank Heimes
** Changed in: ubuntu-z-systems
   Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1995941

Title:
  [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW
  wait

Status in Ubuntu on IBM z Systems:
  Fix Released
Status in linux package in Ubuntu:
  Invalid
Status in linux source package in Focal:
  Fix Released

Bug description:
  SRU Justification:
  ==

  [Impact]

   * In a secure execution guest, the external interrupt for the SIGP
 external call order is delivered twice to a VCPU even though it was 
 only sent once.

   * Under PV (protected virtualization), external call interrupts are
     delivered by the SIGP interpretation facility, without KVM's
     involvement.
     But, if the receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered.
     Hence, in this case, the SIGP external call order causes
     an interception.

   * In response, KVM only needs to wake the receiving VCPU.
     Interrupt delivery is then handled by the SIGP interpretation facility.

   * KVM wrongly assumed it also needs to request injection for the
     external call interrupt after the respective intercept, causing the
     interrupt to be delivered twice:
     * once through the SIGP interpretation facility
     * and once through the interrupt injection control by KVM.

   * Solution is to add appropriate special handling for 108 external
     call intercepts.

  [Fix]

   * c3f0e5fd2d33 c3f0e5fd2d33d80c5a5a8b5e5d2bab2841709cc8
     "KVM: s390: pv: don't present the ecall interrupt twice"

  [Test Case]

   * Have an Secure Execution (PV) environment setup on an
     IBM z15 or LinuxONE III LPAR using Ubuntu Server 20.04 (latest).

   * Apply kvm-unit-test submitted upstream:
     "[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP call \
  orders in enabled wait"

   * Run the smp_PV kvm-unit-test: ./run_tests.sh smp_PV

   * Check logs/smp_PV.log.
     If system is affected, the following line can be found:
     "ABORT: smp: psw wait: ecall: Unexpected external call interrupt \
  (code 0x1202): on cpu 1 at 0x11958"

   * If the system is not affected, the line should look like this:
     "PASS: smp: psw wait: ecall: received"

  [Regression Potential / What can go wrong]

   * The handle_pv_notification can be wrong and misleading
     in case 'ret' is not handled correctly.

   * trace_kvm_s390_handle_sigp_pei might not be called correctly,
     now after the if condition.

   * In worst case the external interrupt could not be delivered
     at all or still too often.

  [Other]

   * The fix/patch c3f0e5fd2d33 got upstream accepted with kernel v6.0,
     so it not only needs to be applied to 20.04/5.4, but also to 22.04/5.15
     and 22.10/5.19.

   * But the patch got properly tagged for upstream stable:
     Cc:  # 5.7
     Fixes: da24a0cc58ed ("KVM: s390: protvirt: Instruction emulation")

   * And with that it got already picked up and is included in:
     22.04 with Ubuntu-5.15.0-53.59 (currently in jammy-proposed)
     22.10 with Ubuntu-5.19.0-16.16 means incl. in the release kernel.

   * So the only Ubuntu release that is affected is 20.04/focal.
  __

  Description:   KVM: PV: ext call delivered twice when receiver in PSW wait
  Symptom:   In a secure execution guest, the external interrupt for the
     SIGP external call order is delivered twice to a VCPU even
     though it was only sent once.
  Problem:   Under PV, external call interrupts are delivered by the SIGP
     interpretation facility, without KVM's involvement. But, if the
     receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered. Hence,
     in this case, the SIGP external call order causes an
     interception. In response, KVM only needs to wake the receiving
     VCPU. Interrupt delivery is then handled by the SIGP
     interpretation facility.

     KVM wrongfuly assumed it also needs to request injection for 
the
     external call interrupt after the respective intercept, causing
     the interrupt to be delivered twice: once through the SIGP
     interpretation facility and once through the interrupt 
injection
     control by KVM.
  Solution:  Add appropriate special handling for 108 external call
     intercepts.
  Reproduction:  0. Apply kvm-unit-test submitted upstream
    ("[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP
    call orders in enabled wait").
     1. Run the smp_PV kvm-unit-test:
  ./run_tests.sh smp_PV
     2. 

[Kernel-packages] [Bug 1995941] Re: [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW wait

2023-01-05 Thread Launchpad Bug Tracker
This bug was fixed in the package linux - 5.4.0-136.153

---
linux (5.4.0-136.153) focal; urgency=medium

  * focal/linux: 5.4.0-136.153 -proposed tracker (LP: #1997835)

  * Expose built-in trusted and revoked certificates (LP: #1996892)
- [Packaging] Expose built-in trusted and revoked certificates

  * [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW wait
(LP: #1995941)
- KVM: s390: pv: don't present the ecall interrupt twice

  * [UBUNTU 20.04] boot: Add s390x secure boot trailer (LP: #1996071)
- s390/boot: add secure boot trailer

  * Fix rfkill causing soft blocked wifi (LP: #1996198)
- platform/x86: hp_wmi: Fix rfkill causing soft blocked wifi

  * md: Replace snprintf with scnprintf (LP: #1993315)
- md: Replace snprintf with scnprintf

  * input/keyboard: the keyboard on some Asus laptops can't work (LP: #1992266)
- ACPI: resource: Skip IRQ override on Asus Vivobook K3402ZA/K3502ZA
- ACPI: resource: Add ASUS model S5402ZA to quirks

  * Focal update: v5.4.218 upstream stable release (LP: #1995530)
- mm: pagewalk: Fix race between unmap and page walker
- perf tools: Fixup get_current_dir_name() compilation
- firmware: arm_scmi: Add SCMI PM driver remove routine
- dmaengine: xilinx_dma: cleanup for fetching xlnx,num-fstores property
- dmaengine: xilinx_dma: Report error in case of dma_set_mask_and_coherent 
API
  failure
- ARM: dts: fix Moxa SDIO 'compatible', remove 'sdhci' misnomer
- scsi: qedf: Fix a UAF bug in __qedf_probe()
- net/ieee802154: fix uninit value bug in dgram_sendmsg
- um: Cleanup syscall_handler_t cast in syscalls_32.h
- um: Cleanup compiler warning in arch/x86/um/tls_32.c
- arch: um: Mark the stack non-executable to fix a binutils warning
- usb: mon: make mmapped memory read only
- USB: serial: ftdi_sio: fix 300 bps rate for SIO
- mmc: core: Replace with already defined values for readability
- mmc: core: Terminate infinite loop in SD-UHS voltage switch
- rpmsg: qcom: glink: replace strncpy() with strscpy_pad()
- nilfs2: fix leak of nilfs_root in case of writer thread creation failure
- nilfs2: replace WARN_ONs by nilfs_error for checkpoint acquisition failure
- ceph: don't truncate file in atomic_open
- random: clamp credited irq bits to maximum mixed
- ALSA: hda: Fix position reporting on Poulsbo
- efi: Correct Macmini DMI match in uefi cert quirk
- USB: serial: qcserial: add new usb-id for Dell branded EM7455
- random: restore O_NONBLOCK support
- random: avoid reading two cache lines on irq randomness
- random: use expired timer rather than wq for mixing fast pool
- Input: xpad - add supported devices as contributed on github
- Input: xpad - fix wireless 360 controller breaking after suspend
- Linux 5.4.218

  * Focal update: v5.4.217 upstream stable release (LP: #1995528)
- xfs: fix misuse of the XFS_ATTR_INCOMPLETE flag
- xfs: introduce XFS_MAX_FILEOFF
- xfs: truncate should remove all blocks, not just to the end of the page
  cache
- xfs: fix s_maxbytes computation on 32-bit kernels
- xfs: fix IOCB_NOWAIT handling in xfs_file_dio_aio_read
- xfs: refactor remote attr value buffer invalidation
- xfs: fix memory corruption during remote attr value buffer invalidation
- xfs: move incore structures out of xfs_da_format.h
- xfs: streamline xfs_attr3_leaf_inactive
- xfs: fix uninitialized variable in xfs_attr3_leaf_inactive
- xfs: remove unused variable 'done'
- Makefile.extrawarn: Move -Wcast-function-type-strict to W=1
- docs: update mediator information in CoC docs
- Linux 5.4.217

  * Focal update: v5.4.216 upstream stable release (LP: #1995526)
- uas: add no-uas quirk for Hiksemi usb_disk
- usb-storage: Add Hiksemi USB3-FW to IGNORE_UAS
- uas: ignore UAS for Thinkplus chips
- net: usb: qmi_wwan: Add new usb-id for Dell branded EM7455
- clk: ingenic-tcu: Properly enable registers before accessing timers
- ARM: dts: integrator: Tag PCI host with device_type
- ntfs: fix BUG_ON in ntfs_lookup_inode_by_name()
- libata: add ATA_HORKAGE_NOLPM for Pioneer BDR-207M and BDR-205
- mmc: moxart: fix 4-bit bus width and remove 8-bit bus width
- mm/page_alloc: fix race condition between build_all_zonelists and page
  allocation
- mm: prevent page_frag_alloc() from corrupting the memory
- mm/migrate_device.c: flush TLB while holding PTL
- mm: fix madivse_pageout mishandling on non-LRU page
- media: dvb_vb2: fix possible out of bound access
- ARM: dts: Move am33xx and am43xx mmc nodes to sdhci-omap driver
- ARM: dts: am33xx: Fix MMCHS0 dma properties
- soc: sunxi: sram: Actually claim SRAM regions
- soc: sunxi: sram: Prevent the driver from being unbound
- soc: sunxi_sram: Make use of the helper function
  devm_platform_ioremap_resource()
- soc: sunxi: sram: Fix 

[Kernel-packages] [Bug 1995941] Re: [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW wait

2022-12-15 Thread Frank Heimes
This bug was not opened against linux-xilinx-zynqmp.
So I'm updating the verification tag just to unblock the further process.

** Tags removed: verification-needed-focal
** Tags added: verification-done-focal

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1995941

Title:
  [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW
  wait

Status in Ubuntu on IBM z Systems:
  Fix Committed
Status in linux package in Ubuntu:
  Invalid
Status in linux source package in Focal:
  Fix Committed

Bug description:
  SRU Justification:
  ==

  [Impact]

   * In a secure execution guest, the external interrupt for the SIGP
 external call order is delivered twice to a VCPU even though it was 
 only sent once.

   * Under PV (protected virtualization), external call interrupts are
     delivered by the SIGP interpretation facility, without KVM's
     involvement.
     But, if the receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered.
     Hence, in this case, the SIGP external call order causes
     an interception.

   * In response, KVM only needs to wake the receiving VCPU.
     Interrupt delivery is then handled by the SIGP interpretation facility.

   * KVM wrongly assumed it also needs to request injection for the
     external call interrupt after the respective intercept, causing the
     interrupt to be delivered twice:
     * once through the SIGP interpretation facility
     * and once through the interrupt injection control by KVM.

   * Solution is to add appropriate special handling for 108 external
     call intercepts.

  [Fix]

   * c3f0e5fd2d33 c3f0e5fd2d33d80c5a5a8b5e5d2bab2841709cc8
     "KVM: s390: pv: don't present the ecall interrupt twice"

  [Test Case]

   * Have an Secure Execution (PV) environment setup on an
     IBM z15 or LinuxONE III LPAR using Ubuntu Server 20.04 (latest).

   * Apply kvm-unit-test submitted upstream:
     "[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP call \
  orders in enabled wait"

   * Run the smp_PV kvm-unit-test: ./run_tests.sh smp_PV

   * Check logs/smp_PV.log.
     If system is affected, the following line can be found:
     "ABORT: smp: psw wait: ecall: Unexpected external call interrupt \
  (code 0x1202): on cpu 1 at 0x11958"

   * If the system is not affected, the line should look like this:
     "PASS: smp: psw wait: ecall: received"

  [Regression Potential / What can go wrong]

   * The handle_pv_notification can be wrong and misleading
     in case 'ret' is not handled correctly.

   * trace_kvm_s390_handle_sigp_pei might not be called correctly,
     now after the if condition.

   * In worst case the external interrupt could not be delivered
     at all or still too often.

  [Other]

   * The fix/patch c3f0e5fd2d33 got upstream accepted with kernel v6.0,
     so it not only needs to be applied to 20.04/5.4, but also to 22.04/5.15
     and 22.10/5.19.

   * But the patch got properly tagged for upstream stable:
     Cc:  # 5.7
     Fixes: da24a0cc58ed ("KVM: s390: protvirt: Instruction emulation")

   * And with that it got already picked up and is included in:
     22.04 with Ubuntu-5.15.0-53.59 (currently in jammy-proposed)
     22.10 with Ubuntu-5.19.0-16.16 means incl. in the release kernel.

   * So the only Ubuntu release that is affected is 20.04/focal.
  __

  Description:   KVM: PV: ext call delivered twice when receiver in PSW wait
  Symptom:   In a secure execution guest, the external interrupt for the
     SIGP external call order is delivered twice to a VCPU even
     though it was only sent once.
  Problem:   Under PV, external call interrupts are delivered by the SIGP
     interpretation facility, without KVM's involvement. But, if the
     receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered. Hence,
     in this case, the SIGP external call order causes an
     interception. In response, KVM only needs to wake the receiving
     VCPU. Interrupt delivery is then handled by the SIGP
     interpretation facility.

     KVM wrongfuly assumed it also needs to request injection for 
the
     external call interrupt after the respective intercept, causing
     the interrupt to be delivered twice: once through the SIGP
     interpretation facility and once through the interrupt 
injection
     control by KVM.
  Solution:  Add appropriate special handling for 108 external call
     intercepts.
  Reproduction:  0. Apply kvm-unit-test submitted upstream
    ("[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP
    call orders in 

[Kernel-packages] [Bug 1995941] Re: [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW wait

2022-12-15 Thread Ubuntu Kernel Bot
This bug is awaiting verification that the linux-xilinx-
zynqmp/5.4.0-1020.24 kernel in -proposed solves the problem. Please test
the kernel and update this bug with the results. If the problem is
solved, change the tag 'verification-needed-focal' to 'verification-
done-focal'. If the problem still exists, change the tag 'verification-
needed-focal' to 'verification-failed-focal'.

If verification is not done by 5 working days from today, this fix will
be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how
to enable and use -proposed. Thank you!


** Tags removed: verification-done-focal
** Tags added: kernel-spammed-focal-linux-xilinx-zynqmp 
verification-needed-focal

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1995941

Title:
  [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW
  wait

Status in Ubuntu on IBM z Systems:
  Fix Committed
Status in linux package in Ubuntu:
  Invalid
Status in linux source package in Focal:
  Fix Committed

Bug description:
  SRU Justification:
  ==

  [Impact]

   * In a secure execution guest, the external interrupt for the SIGP
 external call order is delivered twice to a VCPU even though it was 
 only sent once.

   * Under PV (protected virtualization), external call interrupts are
     delivered by the SIGP interpretation facility, without KVM's
     involvement.
     But, if the receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered.
     Hence, in this case, the SIGP external call order causes
     an interception.

   * In response, KVM only needs to wake the receiving VCPU.
     Interrupt delivery is then handled by the SIGP interpretation facility.

   * KVM wrongly assumed it also needs to request injection for the
     external call interrupt after the respective intercept, causing the
     interrupt to be delivered twice:
     * once through the SIGP interpretation facility
     * and once through the interrupt injection control by KVM.

   * Solution is to add appropriate special handling for 108 external
     call intercepts.

  [Fix]

   * c3f0e5fd2d33 c3f0e5fd2d33d80c5a5a8b5e5d2bab2841709cc8
     "KVM: s390: pv: don't present the ecall interrupt twice"

  [Test Case]

   * Have an Secure Execution (PV) environment setup on an
     IBM z15 or LinuxONE III LPAR using Ubuntu Server 20.04 (latest).

   * Apply kvm-unit-test submitted upstream:
     "[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP call \
  orders in enabled wait"

   * Run the smp_PV kvm-unit-test: ./run_tests.sh smp_PV

   * Check logs/smp_PV.log.
     If system is affected, the following line can be found:
     "ABORT: smp: psw wait: ecall: Unexpected external call interrupt \
  (code 0x1202): on cpu 1 at 0x11958"

   * If the system is not affected, the line should look like this:
     "PASS: smp: psw wait: ecall: received"

  [Regression Potential / What can go wrong]

   * The handle_pv_notification can be wrong and misleading
     in case 'ret' is not handled correctly.

   * trace_kvm_s390_handle_sigp_pei might not be called correctly,
     now after the if condition.

   * In worst case the external interrupt could not be delivered
     at all or still too often.

  [Other]

   * The fix/patch c3f0e5fd2d33 got upstream accepted with kernel v6.0,
     so it not only needs to be applied to 20.04/5.4, but also to 22.04/5.15
     and 22.10/5.19.

   * But the patch got properly tagged for upstream stable:
     Cc:  # 5.7
     Fixes: da24a0cc58ed ("KVM: s390: protvirt: Instruction emulation")

   * And with that it got already picked up and is included in:
     22.04 with Ubuntu-5.15.0-53.59 (currently in jammy-proposed)
     22.10 with Ubuntu-5.19.0-16.16 means incl. in the release kernel.

   * So the only Ubuntu release that is affected is 20.04/focal.
  __

  Description:   KVM: PV: ext call delivered twice when receiver in PSW wait
  Symptom:   In a secure execution guest, the external interrupt for the
     SIGP external call order is delivered twice to a VCPU even
     though it was only sent once.
  Problem:   Under PV, external call interrupts are delivered by the SIGP
     interpretation facility, without KVM's involvement. But, if the
     receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered. Hence,
     in this case, the SIGP external call order causes an
     interception. In response, KVM only needs to wake the receiving
     VCPU. Interrupt delivery is then handled by the SIGP
     interpretation facility.

     KVM wrongfuly assumed it also needs to request injection for 

[Kernel-packages] [Bug 1995941] Re: [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW wait

2022-12-09 Thread Frank Heimes
Thank you Nico for your verification! I'm going to adjust the tags
accordingly.

** Tags removed: verification-needed-focal
** Tags added: verification-done-focal

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1995941

Title:
  [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW
  wait

Status in Ubuntu on IBM z Systems:
  Fix Committed
Status in linux package in Ubuntu:
  Invalid
Status in linux source package in Focal:
  Fix Committed

Bug description:
  SRU Justification:
  ==

  [Impact]

   * In a secure execution guest, the external interrupt for the SIGP
 external call order is delivered twice to a VCPU even though it was 
 only sent once.

   * Under PV (protected virtualization), external call interrupts are
     delivered by the SIGP interpretation facility, without KVM's
     involvement.
     But, if the receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered.
     Hence, in this case, the SIGP external call order causes
     an interception.

   * In response, KVM only needs to wake the receiving VCPU.
     Interrupt delivery is then handled by the SIGP interpretation facility.

   * KVM wrongly assumed it also needs to request injection for the
     external call interrupt after the respective intercept, causing the
     interrupt to be delivered twice:
     * once through the SIGP interpretation facility
     * and once through the interrupt injection control by KVM.

   * Solution is to add appropriate special handling for 108 external
     call intercepts.

  [Fix]

   * c3f0e5fd2d33 c3f0e5fd2d33d80c5a5a8b5e5d2bab2841709cc8
     "KVM: s390: pv: don't present the ecall interrupt twice"

  [Test Case]

   * Have an Secure Execution (PV) environment setup on an
     IBM z15 or LinuxONE III LPAR using Ubuntu Server 20.04 (latest).

   * Apply kvm-unit-test submitted upstream:
     "[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP call \
  orders in enabled wait"

   * Run the smp_PV kvm-unit-test: ./run_tests.sh smp_PV

   * Check logs/smp_PV.log.
     If system is affected, the following line can be found:
     "ABORT: smp: psw wait: ecall: Unexpected external call interrupt \
  (code 0x1202): on cpu 1 at 0x11958"

   * If the system is not affected, the line should look like this:
     "PASS: smp: psw wait: ecall: received"

  [Regression Potential / What can go wrong]

   * The handle_pv_notification can be wrong and misleading
     in case 'ret' is not handled correctly.

   * trace_kvm_s390_handle_sigp_pei might not be called correctly,
     now after the if condition.

   * In worst case the external interrupt could not be delivered
     at all or still too often.

  [Other]

   * The fix/patch c3f0e5fd2d33 got upstream accepted with kernel v6.0,
     so it not only needs to be applied to 20.04/5.4, but also to 22.04/5.15
     and 22.10/5.19.

   * But the patch got properly tagged for upstream stable:
     Cc:  # 5.7
     Fixes: da24a0cc58ed ("KVM: s390: protvirt: Instruction emulation")

   * And with that it got already picked up and is included in:
     22.04 with Ubuntu-5.15.0-53.59 (currently in jammy-proposed)
     22.10 with Ubuntu-5.19.0-16.16 means incl. in the release kernel.

   * So the only Ubuntu release that is affected is 20.04/focal.
  __

  Description:   KVM: PV: ext call delivered twice when receiver in PSW wait
  Symptom:   In a secure execution guest, the external interrupt for the
     SIGP external call order is delivered twice to a VCPU even
     though it was only sent once.
  Problem:   Under PV, external call interrupts are delivered by the SIGP
     interpretation facility, without KVM's involvement. But, if the
     receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered. Hence,
     in this case, the SIGP external call order causes an
     interception. In response, KVM only needs to wake the receiving
     VCPU. Interrupt delivery is then handled by the SIGP
     interpretation facility.

     KVM wrongfuly assumed it also needs to request injection for 
the
     external call interrupt after the respective intercept, causing
     the interrupt to be delivered twice: once through the SIGP
     interpretation facility and once through the interrupt 
injection
     control by KVM.
  Solution:  Add appropriate special handling for 108 external call
     intercepts.
  Reproduction:  0. Apply kvm-unit-test submitted upstream
    ("[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP
    call orders in enabled wait").
     1. Run the 

[Kernel-packages] [Bug 1995941] Re: [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW wait

2022-12-08 Thread bugproxy
** Tags removed: targetmilestone-inin---
** Tags added: targetmilestone-inin2004

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1995941

Title:
  [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW
  wait

Status in Ubuntu on IBM z Systems:
  Fix Committed
Status in linux package in Ubuntu:
  Invalid
Status in linux source package in Focal:
  Fix Committed

Bug description:
  SRU Justification:
  ==

  [Impact]

   * In a secure execution guest, the external interrupt for the SIGP
 external call order is delivered twice to a VCPU even though it was 
 only sent once.

   * Under PV (protected virtualization), external call interrupts are
     delivered by the SIGP interpretation facility, without KVM's
     involvement.
     But, if the receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered.
     Hence, in this case, the SIGP external call order causes
     an interception.

   * In response, KVM only needs to wake the receiving VCPU.
     Interrupt delivery is then handled by the SIGP interpretation facility.

   * KVM wrongly assumed it also needs to request injection for the
     external call interrupt after the respective intercept, causing the
     interrupt to be delivered twice:
     * once through the SIGP interpretation facility
     * and once through the interrupt injection control by KVM.

   * Solution is to add appropriate special handling for 108 external
     call intercepts.

  [Fix]

   * c3f0e5fd2d33 c3f0e5fd2d33d80c5a5a8b5e5d2bab2841709cc8
     "KVM: s390: pv: don't present the ecall interrupt twice"

  [Test Case]

   * Have an Secure Execution (PV) environment setup on an
     IBM z15 or LinuxONE III LPAR using Ubuntu Server 20.04 (latest).

   * Apply kvm-unit-test submitted upstream:
     "[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP call \
  orders in enabled wait"

   * Run the smp_PV kvm-unit-test: ./run_tests.sh smp_PV

   * Check logs/smp_PV.log.
     If system is affected, the following line can be found:
     "ABORT: smp: psw wait: ecall: Unexpected external call interrupt \
  (code 0x1202): on cpu 1 at 0x11958"

   * If the system is not affected, the line should look like this:
     "PASS: smp: psw wait: ecall: received"

  [Regression Potential / What can go wrong]

   * The handle_pv_notification can be wrong and misleading
     in case 'ret' is not handled correctly.

   * trace_kvm_s390_handle_sigp_pei might not be called correctly,
     now after the if condition.

   * In worst case the external interrupt could not be delivered
     at all or still too often.

  [Other]

   * The fix/patch c3f0e5fd2d33 got upstream accepted with kernel v6.0,
     so it not only needs to be applied to 20.04/5.4, but also to 22.04/5.15
     and 22.10/5.19.

   * But the patch got properly tagged for upstream stable:
     Cc:  # 5.7
     Fixes: da24a0cc58ed ("KVM: s390: protvirt: Instruction emulation")

   * And with that it got already picked up and is included in:
     22.04 with Ubuntu-5.15.0-53.59 (currently in jammy-proposed)
     22.10 with Ubuntu-5.19.0-16.16 means incl. in the release kernel.

   * So the only Ubuntu release that is affected is 20.04/focal.
  __

  Description:   KVM: PV: ext call delivered twice when receiver in PSW wait
  Symptom:   In a secure execution guest, the external interrupt for the
     SIGP external call order is delivered twice to a VCPU even
     though it was only sent once.
  Problem:   Under PV, external call interrupts are delivered by the SIGP
     interpretation facility, without KVM's involvement. But, if the
     receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered. Hence,
     in this case, the SIGP external call order causes an
     interception. In response, KVM only needs to wake the receiving
     VCPU. Interrupt delivery is then handled by the SIGP
     interpretation facility.

     KVM wrongfuly assumed it also needs to request injection for 
the
     external call interrupt after the respective intercept, causing
     the interrupt to be delivered twice: once through the SIGP
     interpretation facility and once through the interrupt 
injection
     control by KVM.
  Solution:  Add appropriate special handling for 108 external call
     intercepts.
  Reproduction:  0. Apply kvm-unit-test submitted upstream
    ("[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP
    call orders in enabled wait").
     1. Run the smp_PV kvm-unit-test:
  ./run_tests.sh smp_PV
     

[Kernel-packages] [Bug 1995941] Re: [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW wait

2022-12-07 Thread Ubuntu Kernel Bot
This bug is awaiting verification that the linux/5.4.0-136.153 kernel in
-proposed solves the problem. Please test the kernel and update this bug
with the results. If the problem is solved, change the tag
'verification-needed-focal' to 'verification-done-focal'. If the problem
still exists, change the tag 'verification-needed-focal' to
'verification-failed-focal'.

If verification is not done by 5 working days from today, this fix will
be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how
to enable and use -proposed. Thank you!


** Tags added: kernel-spammed-focal-linux verification-needed-focal

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1995941

Title:
  [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW
  wait

Status in Ubuntu on IBM z Systems:
  Fix Committed
Status in linux package in Ubuntu:
  Invalid
Status in linux source package in Focal:
  Fix Committed

Bug description:
  SRU Justification:
  ==

  [Impact]

   * In a secure execution guest, the external interrupt for the SIGP
 external call order is delivered twice to a VCPU even though it was 
 only sent once.

   * Under PV (protected virtualization), external call interrupts are
     delivered by the SIGP interpretation facility, without KVM's
     involvement.
     But, if the receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered.
     Hence, in this case, the SIGP external call order causes
     an interception.

   * In response, KVM only needs to wake the receiving VCPU.
     Interrupt delivery is then handled by the SIGP interpretation facility.

   * KVM wrongly assumed it also needs to request injection for the
     external call interrupt after the respective intercept, causing the
     interrupt to be delivered twice:
     * once through the SIGP interpretation facility
     * and once through the interrupt injection control by KVM.

   * Solution is to add appropriate special handling for 108 external
     call intercepts.

  [Fix]

   * c3f0e5fd2d33 c3f0e5fd2d33d80c5a5a8b5e5d2bab2841709cc8
     "KVM: s390: pv: don't present the ecall interrupt twice"

  [Test Case]

   * Have an Secure Execution (PV) environment setup on an
     IBM z15 or LinuxONE III LPAR using Ubuntu Server 20.04 (latest).

   * Apply kvm-unit-test submitted upstream:
     "[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP call \
  orders in enabled wait"

   * Run the smp_PV kvm-unit-test: ./run_tests.sh smp_PV

   * Check logs/smp_PV.log.
     If system is affected, the following line can be found:
     "ABORT: smp: psw wait: ecall: Unexpected external call interrupt \
  (code 0x1202): on cpu 1 at 0x11958"

   * If the system is not affected, the line should look like this:
     "PASS: smp: psw wait: ecall: received"

  [Regression Potential / What can go wrong]

   * The handle_pv_notification can be wrong and misleading
     in case 'ret' is not handled correctly.

   * trace_kvm_s390_handle_sigp_pei might not be called correctly,
     now after the if condition.

   * In worst case the external interrupt could not be delivered
     at all or still too often.

  [Other]

   * The fix/patch c3f0e5fd2d33 got upstream accepted with kernel v6.0,
     so it not only needs to be applied to 20.04/5.4, but also to 22.04/5.15
     and 22.10/5.19.

   * But the patch got properly tagged for upstream stable:
     Cc:  # 5.7
     Fixes: da24a0cc58ed ("KVM: s390: protvirt: Instruction emulation")

   * And with that it got already picked up and is included in:
     22.04 with Ubuntu-5.15.0-53.59 (currently in jammy-proposed)
     22.10 with Ubuntu-5.19.0-16.16 means incl. in the release kernel.

   * So the only Ubuntu release that is affected is 20.04/focal.
  __

  Description:   KVM: PV: ext call delivered twice when receiver in PSW wait
  Symptom:   In a secure execution guest, the external interrupt for the
     SIGP external call order is delivered twice to a VCPU even
     though it was only sent once.
  Problem:   Under PV, external call interrupts are delivered by the SIGP
     interpretation facility, without KVM's involvement. But, if the
     receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered. Hence,
     in this case, the SIGP external call order causes an
     interception. In response, KVM only needs to wake the receiving
     VCPU. Interrupt delivery is then handled by the SIGP
     interpretation facility.

     KVM wrongfuly assumed it also needs to request injection for 
the
     external call interrupt after the respective 

[Kernel-packages] [Bug 1995941] Re: [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW wait

2022-11-14 Thread Frank Heimes
** Changed in: ubuntu-z-systems
   Status: In Progress => Fix Committed

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1995941

Title:
  [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW
  wait

Status in Ubuntu on IBM z Systems:
  Fix Committed
Status in linux package in Ubuntu:
  Invalid
Status in linux source package in Focal:
  Fix Committed

Bug description:
  SRU Justification:
  ==

  [Impact]

   * In a secure execution guest, the external interrupt for the SIGP
 external call order is delivered twice to a VCPU even though it was 
 only sent once.

   * Under PV (protected virtualization), external call interrupts are
     delivered by the SIGP interpretation facility, without KVM's
     involvement.
     But, if the receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered.
     Hence, in this case, the SIGP external call order causes
     an interception.

   * In response, KVM only needs to wake the receiving VCPU.
     Interrupt delivery is then handled by the SIGP interpretation facility.

   * KVM wrongly assumed it also needs to request injection for the
     external call interrupt after the respective intercept, causing the
     interrupt to be delivered twice:
     * once through the SIGP interpretation facility
     * and once through the interrupt injection control by KVM.

   * Solution is to add appropriate special handling for 108 external
     call intercepts.

  [Fix]

   * c3f0e5fd2d33 c3f0e5fd2d33d80c5a5a8b5e5d2bab2841709cc8
     "KVM: s390: pv: don't present the ecall interrupt twice"

  [Test Case]

   * Have an Secure Execution (PV) environment setup on an
     IBM z15 or LinuxONE III LPAR using Ubuntu Server 20.04 (latest).

   * Apply kvm-unit-test submitted upstream:
     "[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP call \
  orders in enabled wait"

   * Run the smp_PV kvm-unit-test: ./run_tests.sh smp_PV

   * Check logs/smp_PV.log.
     If system is affected, the following line can be found:
     "ABORT: smp: psw wait: ecall: Unexpected external call interrupt \
  (code 0x1202): on cpu 1 at 0x11958"

   * If the system is not affected, the line should look like this:
     "PASS: smp: psw wait: ecall: received"

  [Regression Potential / What can go wrong]

   * The handle_pv_notification can be wrong and misleading
     in case 'ret' is not handled correctly.

   * trace_kvm_s390_handle_sigp_pei might not be called correctly,
     now after the if condition.

   * In worst case the external interrupt could not be delivered
     at all or still too often.

  [Other]

   * The fix/patch c3f0e5fd2d33 got upstream accepted with kernel v6.0,
     so it not only needs to be applied to 20.04/5.4, but also to 22.04/5.15
     and 22.10/5.19.

   * But the patch got properly tagged for upstream stable:
     Cc:  # 5.7
     Fixes: da24a0cc58ed ("KVM: s390: protvirt: Instruction emulation")

   * And with that it got already picked up and is included in:
     22.04 with Ubuntu-5.15.0-53.59 (currently in jammy-proposed)
     22.10 with Ubuntu-5.19.0-16.16 means incl. in the release kernel.

   * So the only Ubuntu release that is affected is 20.04/focal.
  __

  Description:   KVM: PV: ext call delivered twice when receiver in PSW wait
  Symptom:   In a secure execution guest, the external interrupt for the
     SIGP external call order is delivered twice to a VCPU even
     though it was only sent once.
  Problem:   Under PV, external call interrupts are delivered by the SIGP
     interpretation facility, without KVM's involvement. But, if the
     receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered. Hence,
     in this case, the SIGP external call order causes an
     interception. In response, KVM only needs to wake the receiving
     VCPU. Interrupt delivery is then handled by the SIGP
     interpretation facility.

     KVM wrongfuly assumed it also needs to request injection for 
the
     external call interrupt after the respective intercept, causing
     the interrupt to be delivered twice: once through the SIGP
     interpretation facility and once through the interrupt 
injection
     control by KVM.
  Solution:  Add appropriate special handling for 108 external call
     intercepts.
  Reproduction:  0. Apply kvm-unit-test submitted upstream
    ("[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP
    call orders in enabled wait").
     1. Run the smp_PV kvm-unit-test:
  ./run_tests.sh smp_PV
     2. 

[Kernel-packages] [Bug 1995941] Re: [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW wait

2022-11-11 Thread Stefan Bader
** Changed in: linux (Ubuntu Focal)
   Status: In Progress => Fix Committed

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1995941

Title:
  [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW
  wait

Status in Ubuntu on IBM z Systems:
  In Progress
Status in linux package in Ubuntu:
  Invalid
Status in linux source package in Focal:
  Fix Committed

Bug description:
  SRU Justification:
  ==

  [Impact]

   * In a secure execution guest, the external interrupt for the SIGP
 external call order is delivered twice to a VCPU even though it was 
 only sent once.

   * Under PV (protected virtualization), external call interrupts are
     delivered by the SIGP interpretation facility, without KVM's
     involvement.
     But, if the receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered.
     Hence, in this case, the SIGP external call order causes
     an interception.

   * In response, KVM only needs to wake the receiving VCPU.
     Interrupt delivery is then handled by the SIGP interpretation facility.

   * KVM wrongly assumed it also needs to request injection for the
     external call interrupt after the respective intercept, causing the
     interrupt to be delivered twice:
     * once through the SIGP interpretation facility
     * and once through the interrupt injection control by KVM.

   * Solution is to add appropriate special handling for 108 external
     call intercepts.

  [Fix]

   * c3f0e5fd2d33 c3f0e5fd2d33d80c5a5a8b5e5d2bab2841709cc8
     "KVM: s390: pv: don't present the ecall interrupt twice"

  [Test Case]

   * Have an Secure Execution (PV) environment setup on an
     IBM z15 or LinuxONE III LPAR using Ubuntu Server 20.04 (latest).

   * Apply kvm-unit-test submitted upstream:
     "[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP call \
  orders in enabled wait"

   * Run the smp_PV kvm-unit-test: ./run_tests.sh smp_PV

   * Check logs/smp_PV.log.
     If system is affected, the following line can be found:
     "ABORT: smp: psw wait: ecall: Unexpected external call interrupt \
  (code 0x1202): on cpu 1 at 0x11958"

   * If the system is not affected, the line should look like this:
     "PASS: smp: psw wait: ecall: received"

  [Regression Potential / What can go wrong]

   * The handle_pv_notification can be wrong and misleading
     in case 'ret' is not handled correctly.

   * trace_kvm_s390_handle_sigp_pei might not be called correctly,
     now after the if condition.

   * In worst case the external interrupt could not be delivered
     at all or still too often.

  [Other]

   * The fix/patch c3f0e5fd2d33 got upstream accepted with kernel v6.0,
     so it not only needs to be applied to 20.04/5.4, but also to 22.04/5.15
     and 22.10/5.19.

   * But the patch got properly tagged for upstream stable:
     Cc:  # 5.7
     Fixes: da24a0cc58ed ("KVM: s390: protvirt: Instruction emulation")

   * And with that it got already picked up and is included in:
     22.04 with Ubuntu-5.15.0-53.59 (currently in jammy-proposed)
     22.10 with Ubuntu-5.19.0-16.16 means incl. in the release kernel.

   * So the only Ubuntu release that is affected is 20.04/focal.
  __

  Description:   KVM: PV: ext call delivered twice when receiver in PSW wait
  Symptom:   In a secure execution guest, the external interrupt for the
     SIGP external call order is delivered twice to a VCPU even
     though it was only sent once.
  Problem:   Under PV, external call interrupts are delivered by the SIGP
     interpretation facility, without KVM's involvement. But, if the
     receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered. Hence,
     in this case, the SIGP external call order causes an
     interception. In response, KVM only needs to wake the receiving
     VCPU. Interrupt delivery is then handled by the SIGP
     interpretation facility.

     KVM wrongfuly assumed it also needs to request injection for 
the
     external call interrupt after the respective intercept, causing
     the interrupt to be delivered twice: once through the SIGP
     interpretation facility and once through the interrupt 
injection
     control by KVM.
  Solution:  Add appropriate special handling for 108 external call
     intercepts.
  Reproduction:  0. Apply kvm-unit-test submitted upstream
    ("[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP
    call orders in enabled wait").
     1. Run the smp_PV kvm-unit-test:
  ./run_tests.sh smp_PV
     2. 

[Kernel-packages] [Bug 1995941] Re: [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW wait

2022-11-10 Thread Frank Heimes
A test kernel is currently being build at this PPA:
https://launchpad.net/~fheimes/+archive/ubuntu/lp1995941

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1995941

Title:
  [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW
  wait

Status in Ubuntu on IBM z Systems:
  In Progress
Status in linux package in Ubuntu:
  Invalid
Status in linux source package in Focal:
  In Progress

Bug description:
  SRU Justification:
  ==

  [Impact]

   * In a secure execution guest, the external interrupt for the SIGP
 external call order is delivered twice to a VCPU even though it was 
 only sent once.

   * Under PV (protected virtualization), external call interrupts are
     delivered by the SIGP interpretation facility, without KVM's
     involvement.
     But, if the receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered.
     Hence, in this case, the SIGP external call order causes
     an interception.

   * In response, KVM only needs to wake the receiving VCPU.
     Interrupt delivery is then handled by the SIGP interpretation facility.

   * KVM wrongly assumed it also needs to request injection for the
     external call interrupt after the respective intercept, causing the
     interrupt to be delivered twice:
     * once through the SIGP interpretation facility
     * and once through the interrupt injection control by KVM.

   * Solution is to add appropriate special handling for 108 external
     call intercepts.

  [Fix]

   * c3f0e5fd2d33 c3f0e5fd2d33d80c5a5a8b5e5d2bab2841709cc8
     "KVM: s390: pv: don't present the ecall interrupt twice"

  [Test Case]

   * Have an Secure Execution (PV) environment setup on an
     IBM z15 or LinuxONE III LPAR using Ubuntu Server 20.04 (latest).

   * Apply kvm-unit-test submitted upstream:
     "[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP call \
  orders in enabled wait"

   * Run the smp_PV kvm-unit-test: ./run_tests.sh smp_PV

   * Check logs/smp_PV.log.
     If system is affected, the following line can be found:
     "ABORT: smp: psw wait: ecall: Unexpected external call interrupt \
  (code 0x1202): on cpu 1 at 0x11958"

   * If the system is not affected, the line should look like this:
     "PASS: smp: psw wait: ecall: received"

  [Regression Potential / What can go wrong]

   * The handle_pv_notification can be wrong and misleading
     in case 'ret' is not handled correctly.

   * trace_kvm_s390_handle_sigp_pei might not be called correctly,
     now after the if condition.

   * In worst case the external interrupt could not be delivered
     at all or still too often.

  [Other]

   * The fix/patch c3f0e5fd2d33 got upstream accepted with kernel v6.0,
     so it not only needs to be applied to 20.04/5.4, but also to 22.04/5.15
     and 22.10/5.19.

   * But the patch got properly tagged for upstream stable:
     Cc:  # 5.7
     Fixes: da24a0cc58ed ("KVM: s390: protvirt: Instruction emulation")

   * And with that it got already picked up and is included in:
     22.04 with Ubuntu-5.15.0-53.59 (currently in jammy-proposed)
     22.10 with Ubuntu-5.19.0-16.16 means incl. in the release kernel.

   * So the only Ubuntu release that is affected is 20.04/focal.
  __

  Description:   KVM: PV: ext call delivered twice when receiver in PSW wait
  Symptom:   In a secure execution guest, the external interrupt for the
     SIGP external call order is delivered twice to a VCPU even
     though it was only sent once.
  Problem:   Under PV, external call interrupts are delivered by the SIGP
     interpretation facility, without KVM's involvement. But, if the
     receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered. Hence,
     in this case, the SIGP external call order causes an
     interception. In response, KVM only needs to wake the receiving
     VCPU. Interrupt delivery is then handled by the SIGP
     interpretation facility.

     KVM wrongfuly assumed it also needs to request injection for 
the
     external call interrupt after the respective intercept, causing
     the interrupt to be delivered twice: once through the SIGP
     interpretation facility and once through the interrupt 
injection
     control by KVM.
  Solution:  Add appropriate special handling for 108 external call
     intercepts.
  Reproduction:  0. Apply kvm-unit-test submitted upstream
    ("[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP
    call orders in enabled wait").
     1. Run the smp_PV kvm-unit-test:
  ./run_tests.sh 

[Kernel-packages] [Bug 1995941] Re: [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW wait

2022-11-10 Thread Frank Heimes
SRU request submitted to the Ubuntu kernel team mailing list for focal:
https://lists.ubuntu.com/archives/kernel-team/2022-November/thread.html#134671
Changing status to 'In Progress' for focal.

** Changed in: linux (Ubuntu Focal)
 Assignee: Skipper Bug Screeners (skipper-screen-team) => Canonical Kernel 
Team (canonical-kernel-team)

** Changed in: linux (Ubuntu Focal)
   Status: Triaged => In Progress

** Changed in: ubuntu-z-systems
   Status: Triaged => In Progress

** Changed in: ubuntu-z-systems
   Importance: Undecided => Medium

** Changed in: linux (Ubuntu Focal)
   Importance: Undecided => Medium

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1995941

Title:
  [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW
  wait

Status in Ubuntu on IBM z Systems:
  In Progress
Status in linux package in Ubuntu:
  Invalid
Status in linux source package in Focal:
  In Progress

Bug description:
  SRU Justification:
  ==

  [Impact]

   * In a secure execution guest, the external interrupt for the SIGP
 external call order is delivered twice to a VCPU even though it was 
 only sent once.

   * Under PV (protected virtualization), external call interrupts are
     delivered by the SIGP interpretation facility, without KVM's
     involvement.
     But, if the receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered.
     Hence, in this case, the SIGP external call order causes
     an interception.

   * In response, KVM only needs to wake the receiving VCPU.
     Interrupt delivery is then handled by the SIGP interpretation facility.

   * KVM wrongly assumed it also needs to request injection for the
     external call interrupt after the respective intercept, causing the
     interrupt to be delivered twice:
     * once through the SIGP interpretation facility
     * and once through the interrupt injection control by KVM.

   * Solution is to add appropriate special handling for 108 external
     call intercepts.

  [Fix]

   * c3f0e5fd2d33 c3f0e5fd2d33d80c5a5a8b5e5d2bab2841709cc8
     "KVM: s390: pv: don't present the ecall interrupt twice"

  [Test Case]

   * Have an Secure Execution (PV) environment setup on an
     IBM z15 or LinuxONE III LPAR using Ubuntu Server 20.04 (latest).

   * Apply kvm-unit-test submitted upstream:
     "[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP call \
  orders in enabled wait"

   * Run the smp_PV kvm-unit-test: ./run_tests.sh smp_PV

   * Check logs/smp_PV.log.
     If system is affected, the following line can be found:
     "ABORT: smp: psw wait: ecall: Unexpected external call interrupt \
  (code 0x1202): on cpu 1 at 0x11958"

   * If the system is not affected, the line should look like this:
     "PASS: smp: psw wait: ecall: received"

  [Regression Potential / What can go wrong]

   * The handle_pv_notification can be wrong and misleading
     in case 'ret' is not handled correctly.

   * trace_kvm_s390_handle_sigp_pei might not be called correctly,
     now after the if condition.

   * In worst case the external interrupt could not be delivered
     at all or still too often.

  [Other]

   * The fix/patch c3f0e5fd2d33 got upstream accepted with kernel v6.0,
     so it not only needs to be applied to 20.04/5.4, but also to 22.04/5.15
     and 22.10/5.19.

   * But the patch got properly tagged for upstream stable:
     Cc:  # 5.7
     Fixes: da24a0cc58ed ("KVM: s390: protvirt: Instruction emulation")

   * And with that it got already picked up and is included in:
     22.04 with Ubuntu-5.15.0-53.59 (currently in jammy-proposed)
     22.10 with Ubuntu-5.19.0-16.16 means incl. in the release kernel.

   * So the only Ubuntu release that is affected is 20.04/focal.
  __

  Description:   KVM: PV: ext call delivered twice when receiver in PSW wait
  Symptom:   In a secure execution guest, the external interrupt for the
     SIGP external call order is delivered twice to a VCPU even
     though it was only sent once.
  Problem:   Under PV, external call interrupts are delivered by the SIGP
     interpretation facility, without KVM's involvement. But, if the
     receiving CPU is in enabled wait, KVM needs to wake the
     receiving CPU such that the interrupt can be delivered. Hence,
     in this case, the SIGP external call order causes an
     interception. In response, KVM only needs to wake the receiving
     VCPU. Interrupt delivery is then handled by the SIGP
     interpretation facility.

     KVM wrongfuly assumed it also needs to request injection for 
the
     external call interrupt after the respective intercept, causing
     the interrupt to be delivered 

[Kernel-packages] [Bug 1995941] Re: [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW wait

2022-11-10 Thread Frank Heimes
** Description changed:

+ SRU Justification:
+ ==
+ 
+ [Impact]
+ 
+  * In a secure execution guest, the external interrupt for the SIGP external
+call order is delivered twice to a VCPU even though it was only sent once.
+ 
+  * Under PV (protected virtualization), external call interrupts are
+delivered by the SIGP interpretation facility, without KVM's 
+involvement.
+But, if the receiving CPU is in enabled wait, KVM needs to wake the
+receiving CPU such that the interrupt can be delivered.
+Hence, in this case, the SIGP external call order causes
+an interception.
+ 
+  * In response, KVM only needs to wake the receiving VCPU.
+Interrupt delivery is then handled by the SIGP interpretation facility.
+ 
+  * KVM wrongly assumed it also needs to request injection for the 
+external call interrupt after the respective intercept, causing the 
+interrupt to be delivered twice:
+* once through the SIGP interpretation facility
+* and once through the interrupt injection control by KVM.
+ 
+  * Solution is to add appropriate special handling for 108 external
+call intercepts.
+ 
+ [Fix]
+ 
+  * c3f0e5fd2d33 c3f0e5fd2d33d80c5a5a8b5e5d2bab2841709cc8
+"KVM: s390: pv: don't present the ecall interrupt twice"
+ 
+ [Test Case]
+ 
+  * Have an Secure Execution (PV) environment setup on an
+IBM z15 or LinuxONE III LPAR using Ubuntu Server 20.04 (latest).
+ 
+  * Apply kvm-unit-test submitted upstream:
+"[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP call \
+ orders in enabled wait"
+ 
+  * Run the smp_PV kvm-unit-test: ./run_tests.sh smp_PV
+ 
+  * Check logs/smp_PV.log.
+If system is affected, the following line can be found:
+"ABORT: smp: psw wait: ecall: Unexpected external call interrupt \
+ (code 0x1202): on cpu 1 at 0x11958"
+ 
+  * If the system is not affected, the line should look like this:
+"PASS: smp: psw wait: ecall: received"
+ 
+ [Regression Potential / What can go wrong]
+ 
+  * The handle_pv_notification can be wrong and misleading
+in case 'ret' is not handled correctly.
+ 
+  * trace_kvm_s390_handle_sigp_pei might not be called correctly,
+now after the if condition.
+ 
+  * In worst case the external interrupt could not be delivered
+at all or still too often.
+ 
+ [Other]
+ 
+  * The fix/patch c3f0e5fd2d33 got upstream accepted with kernel v6.0,
+so it not only needs to be applied to 20.04/5.4, but also to 22.04/5.15
+and 22.10/5.19.
+ 
+  * But the patch got properly tagged for upstream stable:
+Cc:  # 5.7
+Fixes: da24a0cc58ed ("KVM: s390: protvirt: Instruction emulation")
+ 
+  * And with that it got already picked up and is included in:
+22.04 with Ubuntu-5.15.0-53.59 (currently in jammy-proposed)
+22.10 with Ubuntu-5.19.0-16.16 means incl. in the release kernel.
+ 
+  * So the only Ubuntu release that is affected is 20.04/focal.
+ __
+ 
  Description:   KVM: PV: ext call delivered twice when receiver in PSW wait
- Symptom:   In a secure execution guest, the external interrupt for the 
-SIGP external call order is delivered twice to a VCPU even
-though it was only sent once.
+ Symptom:   In a secure execution guest, the external interrupt for the
+    SIGP external call order is delivered twice to a VCPU even
+    though it was only sent once.
  Problem:   Under PV, external call interrupts are delivered by the SIGP
-interpretation facility, without KVM's involvement. But, if the
-receiving CPU is in enabled wait, KVM needs to wake the
-receiving CPU such that the interrupt can be delivered. Hence,
-in this case, the SIGP external call order causes an
-interception. In response, KVM only needs to wake the receiving
-VCPU. Interrupt delivery is then handled by the SIGP
-interpretation facility. 
+    interpretation facility, without KVM's involvement. But, if the
+    receiving CPU is in enabled wait, KVM needs to wake the
+    receiving CPU such that the interrupt can be delivered. Hence,
+    in this case, the SIGP external call order causes an
+    interception. In response, KVM only needs to wake the receiving
+    VCPU. Interrupt delivery is then handled by the SIGP
+    interpretation facility.
  
-KVM wrongfuly assumed it also needs to request injection for 
the
-external call interrupt after the respective intercept, causing
-the interrupt to be delivered twice: once through the SIGP
-interpretation facility and once through the interrupt 
injection
-control by KVM.
+    KVM wrongfuly assumed it also needs to request injection for 
the
+    external call interrupt after the 

[Kernel-packages] [Bug 1995941] Re: [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW wait

2022-11-08 Thread Frank Heimes
Hello Nico, thanks for raising this.

The fix/patch c3f0e5fd2d33 "KVM: s390: pv: don't present the ecall interrupt 
twice" got upstream accepted with kernel v6.0, so I assume that it not only 
needs to be applied to 20.04/5.4, but also to 22.04/5.15 and 22.10/5.19.
And I've noticed that it got nice and properly tagged for upstream stable:
Cc:  # 5.7
Fixes: da24a0cc58ed ("KVM: s390: protvirt: Instruction emulation")

And with that it got already picked up and is included in:
22.04 with Ubuntu-5.15.0-53.59 (currently in jammy-proposed)
22.10 with Ubuntu-5.19.0-16.16 means already incl. in the release kernel.

So the only Ubuntu release that is affected is 20.04/focal, so I've set
that as affected target series...

** Also affects: linux (Ubuntu Focal)
   Importance: Undecided
   Status: New

** Changed in: linux (Ubuntu)
   Status: New => Invalid

** Changed in: linux (Ubuntu Focal)
   Status: New => Triaged

** Also affects: ubuntu-z-systems
   Importance: Undecided
   Status: New

** Changed in: ubuntu-z-systems
   Status: New => Triaged

** Changed in: linux (Ubuntu Focal)
 Assignee: (unassigned) => Skipper Bug Screeners (skipper-screen-team)

** Changed in: linux (Ubuntu)
 Assignee: Skipper Bug Screeners (skipper-screen-team) => (unassigned)

** Changed in: ubuntu-z-systems
 Assignee: (unassigned) => Skipper Bug Screeners (skipper-screen-team)

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1995941

Title:
  [UBUNTU 20.04] KVM: PV: ext call delivered twice when receiver in PSW
  wait

Status in Ubuntu on IBM z Systems:
  Triaged
Status in linux package in Ubuntu:
  Invalid
Status in linux source package in Focal:
  Triaged

Bug description:
  Description:   KVM: PV: ext call delivered twice when receiver in PSW wait
  Symptom:   In a secure execution guest, the external interrupt for the 
 SIGP external call order is delivered twice to a VCPU even
 though it was only sent once.
  Problem:   Under PV, external call interrupts are delivered by the SIGP
 interpretation facility, without KVM's involvement. But, if the
 receiving CPU is in enabled wait, KVM needs to wake the
 receiving CPU such that the interrupt can be delivered. Hence,
 in this case, the SIGP external call order causes an
 interception. In response, KVM only needs to wake the receiving
 VCPU. Interrupt delivery is then handled by the SIGP
 interpretation facility. 

 KVM wrongfuly assumed it also needs to request injection for 
the
 external call interrupt after the respective intercept, causing
 the interrupt to be delivered twice: once through the SIGP
 interpretation facility and once through the interrupt 
injection
 control by KVM.
  Solution:  Add appropriate special handling for 108 external call
 intercepts.
  Reproduction:  0. Apply kvm-unit-test submitted upstream 
("[kvm-unit-tests PATCH v1 0/4] s390x: add tests for SIGP
call orders in enabled wait").
 1. Run the smp_PV kvm-unit-test:
  ./run_tests.sh smp_PV
 2. Check logs/smp_PV.log. If system is affected, the following
line can be found:
  ABORT: smp: psw wait: ecall: Unexpected external call \
   interrupt (code 0x1202): on cpu 1 at 0x11958
If the system is not affected, the line should look like
this:
  PASS: smp: psw wait: ecall: received

  Preventive:yes
  Author:Nico Boehr 
  Component: kernel

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-z-systems/+bug/1995941/+subscriptions


-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp