Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2166007iof; Tue, 7 Jun 2022 21:56:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8ImhF7z76stHLw+p69xUZbVmF35gQCsP7mMyqIzm+96UwXTw/W6A7f/m+VDYScxbK6OiN X-Received: by 2002:a17:90a:c981:b0:1e6:75f0:d4ea with SMTP id w1-20020a17090ac98100b001e675f0d4eamr37213004pjt.37.1654664214881; Tue, 07 Jun 2022 21:56:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654664214; cv=none; d=google.com; s=arc-20160816; b=KemC8AA2/z9BxqxdY9/RTky9RP7MQLKie+0nPK96BZ9KtaMLshG9unIQ41XW/5jFHv HgN9yw+31fcR4N6bn6D9kgpZvBqmGv38dJVbUt/XZZDnp7v6AzGAnxAVebTo7Ihmgp3K 9gaSD1DTD0rizGPTvaZifsbkrQCyqqY/V88PwQVGSMucRkoA0P6jqCXIxfw9oWjxjUXu B8HaxjS1cDzYXlw0G5savyrHa0dRLW5ATgmaB8dJ0SEaqMon0qO6Nr+ecIW6g1732Ult Y8TrkUQab+ANlgRQjNlTPgBBsvsxBwfS5KSg5Px+5I71DAC2Pb1n3e+Ou2KiLPrByB+d +ohw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mGYPiRXQnxMHTm2VSqMDDG5Pf2unWnO/ThLc8P6R+fw=; b=03/4f53n9GiNkWqSCbkxKc+rWLSLlbzckROdNhRXyGxtX0Lm6GjOXX3qHMRQPuHfpe YA3+I5Uh7ibx/Rsrrshq27LRA1DYmHX781UCQYWzvD+ChXrAMIZJtUx7lkE3RcUqQAju 7c1FKMKXB4OG1o63R1UPGIbF3rvO+BvTCKfNH8IAdCmthIlafA8fh/z15NPhdqkjiocG 2YJDOLetSWNWRUprj4RFJvyj2eWrXeG1oET1dtSi0szC4M/qkzAQv+RszbE8ZtKw/yLs sb3gIThQ5X9pbT+dRwHFyjLMRH4Rg0ODmRg9rstE0GcphWCqUikJ7UbA32EcdbLt+j1Q j1iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NexCKgDs; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id e20-20020a656794000000b003fe2a273da6si1684575pgr.552.2022.06.07.21.56.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:56:54 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NexCKgDs; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6982546382D; Tue, 7 Jun 2022 21:32:54 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380918AbiFGVb2 (ORCPT + 99 others); Tue, 7 Jun 2022 17:31:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378153AbiFGUey (ORCPT ); Tue, 7 Jun 2022 16:34:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB1641EA04D; Tue, 7 Jun 2022 11:37:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 875BE615D2; Tue, 7 Jun 2022 18:37:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90D6CC385A5; Tue, 7 Jun 2022 18:37:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654627046; bh=DLwWHDiK86MBmRvx35YmuRnwRWDcKIAibL+V2Fw+nPk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NexCKgDsU2kfjqQPKQXeLVA1Jfp70NLFjtw8D7h7TKhi48U6AMgqHhSvo+G5Q5+42 F9PJKF4rSV7bEBOs71HNWmgO+fF3fH8FBWG0qtXwyabskpqUf36zHoq2Rl25OGuaXA ilSfatfvch3jPtZ6b723CCwJ23nSqxdzVEVry8Do= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wanpeng Li , Paolo Bonzini , Sasha Levin Subject: [PATCH 5.17 561/772] KVM: LAPIC: Drop pending LAPIC timer injection when canceling the timer Date: Tue, 7 Jun 2022 19:02:33 +0200 Message-Id: <20220607165005.489725587@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164948.980838585@linuxfoundation.org> References: <20220607164948.980838585@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wanpeng Li [ Upstream commit 619f51da097952194a5d4d6a6c5f9ef3b9d1b25a ] The timer is disarmed when switching between TSC deadline and other modes; however, the pending timer is still in-flight, so let's accurately remove any traces of the previous mode. Fixes: 4427593258 ("KVM: x86: thoroughly disarm LAPIC timer around TSC deadline switch") Signed-off-by: Wanpeng Li Signed-off-by: Paolo Bonzini Signed-off-by: Sasha Levin --- arch/x86/kvm/lapic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 970d5c740b00..dd12c15b69e6 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -1508,6 +1508,7 @@ static void cancel_apic_timer(struct kvm_lapic *apic) if (apic->lapic_timer.hv_timer_in_use) cancel_hv_timer(apic); preempt_enable(); + atomic_set(&apic->lapic_timer.pending, 0); } static void apic_update_lvtt(struct kvm_lapic *apic) -- 2.35.1