]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.10
authorSasha Levin <sashal@kernel.org>
Mon, 1 Nov 2021 00:40:28 +0000 (20:40 -0400)
committerSasha Levin <sashal@kernel.org>
Mon, 1 Nov 2021 00:40:28 +0000 (20:40 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.10/kvm-s390-clear-kicked_mask-before-sleeping-again.patch [new file with mode: 0644]
queue-5.10/kvm-s390-preserve-deliverable_mask-in-__airqs_kick_s.patch [new file with mode: 0644]
queue-5.10/scsi-ufs-ufs-exynos-correct-timeout-value-setting-re.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/kvm-s390-clear-kicked_mask-before-sleeping-again.patch b/queue-5.10/kvm-s390-clear-kicked_mask-before-sleeping-again.patch
new file mode 100644 (file)
index 0000000..1a56e87
--- /dev/null
@@ -0,0 +1,55 @@
+From 35be2f788a95474f15cb7699c490e4fe1d1baa9f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 19 Oct 2021 19:53:59 +0200
+Subject: KVM: s390: clear kicked_mask before sleeping again
+
+From: Halil Pasic <pasic@linux.ibm.com>
+
+[ Upstream commit 9b57e9d5010bbed7c0d9d445085840f7025e6f9a ]
+
+The idea behind kicked mask is that we should not re-kick a vcpu that
+is already in the "kick" process, i.e. that was kicked and is
+is about to be dispatched if certain conditions are met.
+
+The problem with the current implementation is, that it assumes the
+kicked vcpu is going to enter SIE shortly. But under certain
+circumstances, the vcpu we just kicked will be deemed non-runnable and
+will remain in wait state. This can happen, if the interrupt(s) this
+vcpu got kicked to deal with got already cleared (because the interrupts
+got delivered to another vcpu). In this case kvm_arch_vcpu_runnable()
+would return false, and the vcpu would remain in kvm_vcpu_block(),
+but this time with its kicked_mask bit set. So next time around we
+wouldn't kick the vcpu form __airqs_kick_single_vcpu(), but would assume
+that we just kicked it.
+
+Let us make sure the kicked_mask is cleared before we give up on
+re-dispatching the vcpu.
+
+Fixes: 9f30f6216378 ("KVM: s390: add gib_alert_irq_handler()")
+Reported-by: Matthew Rosato <mjrosato@linux.ibm.com>
+Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
+Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
+Reviewed-by: Michael Mueller <mimu@linux.ibm.com>
+Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
+Link: https://lore.kernel.org/r/20211019175401.3757927-2-pasic@linux.ibm.com
+Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/s390/kvm/kvm-s390.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
+index 7f719b468b44..00f03f363c9b 100644
+--- a/arch/s390/kvm/kvm-s390.c
++++ b/arch/s390/kvm/kvm-s390.c
+@@ -3312,6 +3312,7 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu)
+ int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)
+ {
++      clear_bit(vcpu->vcpu_idx, vcpu->kvm->arch.gisa_int.kicked_mask);
+       return kvm_s390_vcpu_has_irq(vcpu, 0);
+ }
+-- 
+2.33.0
+
diff --git a/queue-5.10/kvm-s390-preserve-deliverable_mask-in-__airqs_kick_s.patch b/queue-5.10/kvm-s390-preserve-deliverable_mask-in-__airqs_kick_s.patch
new file mode 100644 (file)
index 0000000..f1ad0cf
--- /dev/null
@@ -0,0 +1,51 @@
+From a838ce4b6b7c5b4876a248d1381610a6ce7e9f2b Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 19 Oct 2021 19:54:00 +0200
+Subject: KVM: s390: preserve deliverable_mask in __airqs_kick_single_vcpu
+
+From: Halil Pasic <pasic@linux.ibm.com>
+
+[ Upstream commit 0e9ff65f455dfd0a8aea5e7843678ab6fe097e21 ]
+
+Changing the deliverable mask in __airqs_kick_single_vcpu() is a bug. If
+one idle vcpu can't take the interrupts we want to deliver, we should
+look for another vcpu that can, instead of saying that we don't want
+to deliver these interrupts by clearing the bits from the
+deliverable_mask.
+
+Fixes: 9f30f6216378 ("KVM: s390: add gib_alert_irq_handler()")
+Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
+Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
+Reviewed-by: Michael Mueller <mimu@linux.ibm.com>
+Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
+Link: https://lore.kernel.org/r/20211019175401.3757927-3-pasic@linux.ibm.com
+Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/s390/kvm/interrupt.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
+index 2bb9996ff09b..e6c4f29fc695 100644
+--- a/arch/s390/kvm/interrupt.c
++++ b/arch/s390/kvm/interrupt.c
+@@ -3053,13 +3053,14 @@ static void __airqs_kick_single_vcpu(struct kvm *kvm, u8 deliverable_mask)
+       int vcpu_idx, online_vcpus = atomic_read(&kvm->online_vcpus);
+       struct kvm_s390_gisa_interrupt *gi = &kvm->arch.gisa_int;
+       struct kvm_vcpu *vcpu;
++      u8 vcpu_isc_mask;
+       for_each_set_bit(vcpu_idx, kvm->arch.idle_mask, online_vcpus) {
+               vcpu = kvm_get_vcpu(kvm, vcpu_idx);
+               if (psw_ioint_disabled(vcpu))
+                       continue;
+-              deliverable_mask &= (u8)(vcpu->arch.sie_block->gcr[6] >> 24);
+-              if (deliverable_mask) {
++              vcpu_isc_mask = (u8)(vcpu->arch.sie_block->gcr[6] >> 24);
++              if (deliverable_mask & vcpu_isc_mask) {
+                       /* lately kicked but not yet running */
+                       if (test_and_set_bit(vcpu_idx, gi->kicked_mask))
+                               return;
+-- 
+2.33.0
+
diff --git a/queue-5.10/scsi-ufs-ufs-exynos-correct-timeout-value-setting-re.patch b/queue-5.10/scsi-ufs-ufs-exynos-correct-timeout-value-setting-re.patch
new file mode 100644 (file)
index 0000000..9b8dbd6
--- /dev/null
@@ -0,0 +1,47 @@
+From 0b4e3484ba5056552d88e756b6586ffa217c7d22 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 18 Oct 2021 15:28:41 +0900
+Subject: scsi: ufs: ufs-exynos: Correct timeout value setting registers
+
+From: Chanho Park <chanho61.park@samsung.com>
+
+[ Upstream commit 282da7cef078a87b6d5e8ceba8b17e428cf0e37c ]
+
+PA_PWRMODEUSERDATA0 -> DL_FC0PROTTIMEOUTVAL
+PA_PWRMODEUSERDATA1 -> DL_TC0REPLAYTIMEOUTVAL
+PA_PWRMODEUSERDATA2 -> DL_AFC0REQTIMEOUTVAL
+
+Link: https://lore.kernel.org/r/20211018062841.18226-1-chanho61.park@samsung.com
+Fixes: a967ddb22d94 ("scsi: ufs: ufs-exynos: Apply vendor-specific values for three timeouts")
+Cc: Alim Akhtar <alim.akhtar@samsung.com>
+Cc: Kiwoong Kim <kwmad.kim@samsung.com>
+Cc: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
+Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
+Reviewed-by: Avri Altman <avri.altman@wdc.com>
+Signed-off-by: Chanho Park <chanho61.park@samsung.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/scsi/ufs/ufs-exynos.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c
+index 3f4f3d6f48f9..0246ea99df7b 100644
+--- a/drivers/scsi/ufs/ufs-exynos.c
++++ b/drivers/scsi/ufs/ufs-exynos.c
+@@ -654,9 +654,9 @@ static int exynos_ufs_pre_pwr_mode(struct ufs_hba *hba,
+       }
+       /* setting for three timeout values for traffic class #0 */
+-      ufshcd_dme_set(hba, UIC_ARG_MIB(PA_PWRMODEUSERDATA0), 8064);
+-      ufshcd_dme_set(hba, UIC_ARG_MIB(PA_PWRMODEUSERDATA1), 28224);
+-      ufshcd_dme_set(hba, UIC_ARG_MIB(PA_PWRMODEUSERDATA2), 20160);
++      ufshcd_dme_set(hba, UIC_ARG_MIB(DL_FC0PROTTIMEOUTVAL), 8064);
++      ufshcd_dme_set(hba, UIC_ARG_MIB(DL_TC0REPLAYTIMEOUTVAL), 28224);
++      ufshcd_dme_set(hba, UIC_ARG_MIB(DL_AFC0REQTIMEOUTVAL), 20160);
+       return 0;
+ out:
+-- 
+2.33.0
+
index 1f75855ce1a8d9341d27328b5a467ccc4af71a6d..b45f9ba66de4758a3da1bea0385f628181773c3e 100644 (file)
@@ -69,3 +69,6 @@ sctp-add-vtag-check-in-sctp_sf_violation.patch
 sctp-add-vtag-check-in-sctp_sf_do_8_5_1_e_sa.patch
 sctp-add-vtag-check-in-sctp_sf_ootb.patch
 lan743x-fix-endianness-when-accessing-descriptors.patch
+kvm-s390-clear-kicked_mask-before-sleeping-again.patch
+kvm-s390-preserve-deliverable_mask-in-__airqs_kick_s.patch
+scsi-ufs-ufs-exynos-correct-timeout-value-setting-re.patch