All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Matthew Rosato <mjrosato@linux.ibm.com>,
	Halil Pasic <pasic@linux.ibm.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Michael Mueller <mimu@linux.ibm.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.4 49/51] KVM: s390: clear kicked_mask before sleeping again
Date: Mon,  1 Nov 2021 10:17:53 +0100	[thread overview]
Message-ID: <20211101082511.910355787@linuxfoundation.org> (raw)
In-Reply-To: <20211101082500.203657870@linuxfoundation.org>

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 9ed2fee61229..b286818d8d54 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -3092,6 +3092,7 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm,
 
 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




  parent reply	other threads:[~2021-11-01  9:32 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-01  9:17 [PATCH 5.4 00/51] 5.4.157-rc1 review Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 01/51] ARM: 9133/1: mm: proc-macros: ensure *_tlb_fns are 4B aligned Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 02/51] ARM: 9134/1: remove duplicate memcpy() definition Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 03/51] ARM: 9139/1: kprobes: fix arch_init_kprobes() prototype Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 04/51] ARM: 9141/1: only warn about XIP address when not compile testing Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 05/51] powerpc/bpf: Fix BPF_MOD when imm == 1 Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 06/51] ipv6: use siphash in rt6_exception_hash() Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 07/51] ipv4: use siphash instead of Jenkins in fnhe_hashfun() Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 08/51] usbnet: sanity check for maxpacket Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 09/51] usbnet: fix error return code in usbnet_probe() Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 10/51] Revert "pinctrl: bcm: ns: support updated DT binding as syscon subnode" Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 11/51] ata: sata_mv: Fix the error handling of mv_chip_id() Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 12/51] nfc: port100: fix using -ERRNO as command type mask Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 13/51] Revert "net: mdiobus: Fix memory leak in __mdiobus_register" Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 14/51] net/tls: Fix flipped sign in tls_err_abort() calls Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 15/51] mmc: vub300: fix control-message timeouts Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 16/51] mmc: cqhci: clear HALT state after CQE enable Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 17/51] mmc: dw_mmc: exynos: fix the finding clock sample value Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 18/51] mmc: sdhci: Map more voltage level to SDHCI_POWER_330 Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 19/51] mmc: sdhci-esdhc-imx: clear the buffer_read_ready to reset standard tuning circuit Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 20/51] cfg80211: scan: fix RCU in cfg80211_add_nontrans_list() Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 21/51] net: lan78xx: fix division by zero in send path Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 22/51] drm/ttm: fix memleak in ttm_transfered_destroy Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 23/51] tcp_bpf: Fix one concurrency problem in the tcp_bpf_send_verdict function Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 24/51] IB/qib: Protect from buffer overflow in struct qib_user_sdma_pkt fields Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 25/51] IB/hfi1: Fix abba locking issue with sc_disable() Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 26/51] nvmet-tcp: fix data digest pointer calculation Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 27/51] nvme-tcp: " Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 28/51] RDMA/mlx5: Set user priority for DCT Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 29/51] arm64: dts: allwinner: h5: NanoPI Neo 2: Fix ethernet node Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 30/51] regmap: Fix possible double-free in regcache_rbtree_exit() Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 31/51] net: batman-adv: fix error handling Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 32/51] net: Prevent infinite while loop in skb_tx_hash() Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 33/51] RDMA/sa_query: Use strscpy_pad instead of memcpy to copy a string Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 34/51] nios2: Make NIOS2_DTB_SOURCE_BOOL depend on !COMPILE_TEST Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 35/51] net: ethernet: microchip: lan743x: Fix driver crash when lan743x_pm_resume fails Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 36/51] net: ethernet: microchip: lan743x: Fix dma allocation failure by using dma_set_mask_and_coherent Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 37/51] net: nxp: lpc_eth.c: avoid hang when bringing interface down Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 38/51] net/tls: Fix flipped sign in async_wait.err assignment Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 39/51] phy: phy_ethtool_ksettings_get: Lock the phy for consistency Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 40/51] phy: phy_start_aneg: Add an unlocked version Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 41/51] sctp: use init_tag from inithdr for ABORT chunk Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 42/51] sctp: fix the processing for INIT_ACK chunk Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 43/51] sctp: fix the processing for COOKIE_ECHO chunk Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 44/51] sctp: add vtag check in sctp_sf_violation Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 45/51] sctp: add vtag check in sctp_sf_do_8_5_1_E_sa Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 46/51] sctp: add vtag check in sctp_sf_ootb Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 47/51] net: use netif_is_bridge_port() to check for IFF_BRIDGE_PORT Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 48/51] cfg80211: correct bridge/4addr mode check Greg Kroah-Hartman
2021-11-01  9:17 ` Greg Kroah-Hartman [this message]
2021-11-01  9:17 ` [PATCH 5.4 50/51] KVM: s390: preserve deliverable_mask in __airqs_kick_single_vcpu Greg Kroah-Hartman
2021-11-01  9:17 ` [PATCH 5.4 51/51] perf script: Check session->header.env.arch before using it Greg Kroah-Hartman
2021-11-01 11:09 ` [PATCH 5.4 00/51] 5.4.157-rc1 review Naresh Kamboju
2021-11-01 11:11   ` Jon Hunter
2021-11-01 11:42     ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211101082511.910355787@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=borntraeger@de.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mimu@linux.ibm.com \
    --cc=mjrosato@linux.ibm.com \
    --cc=pasic@linux.ibm.com \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.