Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2252457iof; Wed, 8 Jun 2022 00:32:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzDNePLLuBlZWBsCSpHWwKazhN04yqVgE3MY//zbyt8UVdyCHf3HfuvnM1YzL61BaxYXpr X-Received: by 2002:a17:903:31d1:b0:159:804:e852 with SMTP id v17-20020a17090331d100b001590804e852mr33024488ple.19.1654673574530; Wed, 08 Jun 2022 00:32:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654673574; cv=none; d=google.com; s=arc-20160816; b=JC7r/ticYZnUvuWLYhT7luj5tlAtYMpIAxBKBJUC6RxHKGvznwCWUfuCcD0IDIff2Z 3MRVnVyu9/ZhCBGm0AkhbstNB/4mg30v3jnkNZPvhcmnpsqzAwtlb96t9q1U64hTcxaS iNwIMmdpsd1iciT0xh6ZYxhB9kOHyZUdkzIdg5Rp9/YvXrYD+JXSPKdS5s/6ld63gFR0 XLaka7HqP/YYSlPpn2bZ31Rp5EfVJvcSlkIX32vlG8w+2OQ9NNbD8SKYdWPoYCcycM4v Hy8wi6GBmkjmDDgE28O0s86zb3ti77D9VmVCV2W9bdIkV9cafk26nHxkn2x7fPK77ZSN FYeQ== 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=Wf32qKw8BoHptCndWut5qPTpo6TQReYUIBLyM98bNVo=; b=hfmeCsD727rux4rXm66zf0UMqwKzP7hcP8L9bhzyfey4DFNND8NhzcOOUMdqWJPiYc Lt8ZywbxDF6NKPaitC1nTPvzK6ZvLtyMRazw14Ow6iHWvGHRQQxSAGhxbtk/UZcOtmLm Hf1pS1piNOVJDnJbgDvqhAAO5M4Pbn1uoWZUn/j01Fy5s429EdVSwXt5QDN/PC3iV2Nn Vc4HWjeotTsx2izmN/1GNiVP6zoC9GOl9nS3xXxB1Qu4kYbGpNULVfstTfRMQJnbVdhD MXsmMLHdMUALt/r8ZD5SeKGBoFhH7HybpjEeHruf6NbeBWHfjQ04xEfvhhAm/2nJUzqW BDqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Fl0B1ZjV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l73-20020a63914c000000b003fe0f4990ddsi4334674pge.255.2022.06.08.00.32.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 00:32:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Fl0B1ZjV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 38A892065D7; Wed, 8 Jun 2022 00:05:36 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354631AbiFHAj7 (ORCPT + 99 others); Tue, 7 Jun 2022 20:39:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352519AbiFGWGs (ORCPT ); Tue, 7 Jun 2022 18:06:48 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B17F2252C19; Tue, 7 Jun 2022 12:15:39 -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 ams.source.kernel.org (Postfix) with ESMTPS id 6DD2BB82368; Tue, 7 Jun 2022 19:15:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D74C4C385A2; Tue, 7 Jun 2022 19:15:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629337; bh=9gkjTA76dgs24GcEIjC4D42xCNupGf2beWLw9aticJg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fl0B1ZjVAjnQPhFgd6fB7hkrsTaqHgF+GmB9HGfhHVVlYTNaym+EalvlwZcaRpoEy aePNK6/SSlNWokLHep9J2mx4kDjoWEODvUHQ3isEzCXv2ipXMpaFf2W6G7W5P+O4TO mcMkNQeQJEOJyLUIMOTG4vq2SOsVOJa095VqNik8= 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.18 655/879] KVM: LAPIC: Drop pending LAPIC timer injection when canceling the timer Date: Tue, 7 Jun 2022 19:02:53 +0200 Message-Id: <20220607165021.857886722@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@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 66b0eb0bda94..6268880c8eed 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -1548,6 +1548,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