From: Sasha Levin Date: Mon, 1 Nov 2021 00:40:28 +0000 (-0400) Subject: Fixes for 5.10 X-Git-Tag: v4.4.291~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=87022d616cbe7f751d740c08d17bd19d67a9e9c1;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.10 Signed-off-by: Sasha Levin --- 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 index 00000000000..1a56e879d0e --- /dev/null +++ b/queue-5.10/kvm-s390-clear-kicked_mask-before-sleeping-again.patch @@ -0,0 +1,55 @@ +From 35be2f788a95474f15cb7699c490e4fe1d1baa9f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 19 Oct 2021 19:53:59 +0200 +Subject: KVM: s390: clear kicked_mask before sleeping again + +From: Halil Pasic + +[ 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 +Signed-off-by: Halil Pasic +Reviewed-by: Christian Borntraeger +Reviewed-by: Michael Mueller +Reviewed-by: Claudio Imbrenda +Link: https://lore.kernel.org/r/20211019175401.3757927-2-pasic@linux.ibm.com +Signed-off-by: Christian Borntraeger +Signed-off-by: Sasha Levin +--- + 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 index 00000000000..f1ad0cf9bbe --- /dev/null +++ b/queue-5.10/kvm-s390-preserve-deliverable_mask-in-__airqs_kick_s.patch @@ -0,0 +1,51 @@ +From a838ce4b6b7c5b4876a248d1381610a6ce7e9f2b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 19 Oct 2021 19:54:00 +0200 +Subject: KVM: s390: preserve deliverable_mask in __airqs_kick_single_vcpu + +From: Halil Pasic + +[ 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 +Reviewed-by: Christian Borntraeger +Reviewed-by: Michael Mueller +Reviewed-by: Claudio Imbrenda +Link: https://lore.kernel.org/r/20211019175401.3757927-3-pasic@linux.ibm.com +Signed-off-by: Christian Borntraeger +Signed-off-by: Sasha Levin +--- + 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 index 00000000000..9b8dbd6263f --- /dev/null +++ b/queue-5.10/scsi-ufs-ufs-exynos-correct-timeout-value-setting-re.patch @@ -0,0 +1,47 @@ +From 0b4e3484ba5056552d88e756b6586ffa217c7d22 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 18 Oct 2021 15:28:41 +0900 +Subject: scsi: ufs: ufs-exynos: Correct timeout value setting registers + +From: Chanho Park + +[ 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 +Cc: Kiwoong Kim +Cc: Krzysztof Kozlowski +Reviewed-by: Alim Akhtar +Reviewed-by: Avri Altman +Signed-off-by: Chanho Park +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + 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 + diff --git a/queue-5.10/series b/queue-5.10/series index 1f75855ce1a..b45f9ba66de 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -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