Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2022022pxa; Mon, 3 Aug 2020 05:36:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7rBSpKZ1QL+uJMf9HJkYX2t7sA5pAPxkw6HiU0e7ea3R5g1aLdCsHfpVdmpvj4UFZg9je X-Received: by 2002:a05:6402:cb9:: with SMTP id cn25mr15840674edb.247.1596458210250; Mon, 03 Aug 2020 05:36:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596458210; cv=none; d=google.com; s=arc-20160816; b=s1hoQbGN+NJUOh4km9UEqmg20paJV2OkJVZhhqlAo6D0DV6I4Zi0Vi7KuzJfZOMPIc c5LTdQHmWh9nwRLmxOvHEyjZi7IgBR+K/S978WvddGeMLtGjlRCMbHaNQiSW1mPw103N xhGQ85WmjJyyl0xUJlvHgd3Ho6XcuvNr+f73ddsbwfCZt0CxiSlTbIDG9Yscq01GjpnS V1xAYIOIR8Z5QD7J/XRzhV6XxmOKR1VnmcCbHCQlBlrP/z8x/Y8d2TmZAgnxBeA/o6AA 9WUQ+XojdM30tPSVK+lf50SvlDagx03zd+48CAAvnDdc9gaEzukGPo1x/RrsfK1Br9Jq Nl0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IJyh2oV7VqprqstkKQq8rMdjpJvhcFkBjEqSRELLdUQ=; b=W47OsGB9QNvOK0zzibRrMBylsbJtF5ahPA0FFsar6KWka7lKtPszla9Bm6fwYU3Ust x4CAAc9/Vwo6GBcknnnZ45cA5UFmJupqtvpLYiu4PpSFA6mLSOpNT1HTDBTEluY6IYWw BRB4mtZ6Xn/r5RYFH8cdCI+a/TKJ0tYAfEgkgJiS8lDCIlmNyr7NWYz9jB0Tp6GcUM5r rgT9Q5+/GMOjhGRE10hs+hVbYhlBY8JyZamCMG3LiKkcb7zOVmPn4wfF5SPJfEn9qNG8 Td6XCIXB4nkqgKenZmSsYJsPZjn+Zbnf5g6AB4IcGbmf+R7jy0Lhy33fx3wnkLzaCWEp ugnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DsdtjUxk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 38si4738482edq.297.2020.08.03.05.36.27; Mon, 03 Aug 2020 05:36:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DsdtjUxk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729468AbgHCMdj (ORCPT + 99 others); Mon, 3 Aug 2020 08:33:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:33532 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729460AbgHCMdg (ORCPT ); Mon, 3 Aug 2020 08:33:36 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 033742054F; Mon, 3 Aug 2020 12:33:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596458015; bh=jsu8/lcHR3VW514Oav5CeYk/ph0J8f7DY87s4w+qszQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DsdtjUxkR1Y+87UL/YrLeBb3QEEfz5psXXYOSix7wu0YodYMe1YIocLhYOXvUkKOd UpkZzQ1bZFkDTaNsiemKSPXMmWNsivZg2xtXc0CfJPn7g+2fdsuYEdKH9Bezu7SypR 3ACdbuegHtWOypXZJUNkHWxPnQkZESixSYPLvkgg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wanpeng Li , Paolo Bonzini Subject: [PATCH 4.19 55/56] KVM: LAPIC: Prevent setting the tscdeadline timer if the lapic is hw disabled Date: Mon, 3 Aug 2020 14:20:10 +0200 Message-Id: <20200803121853.012485450@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200803121850.306734207@linuxfoundation.org> References: <20200803121850.306734207@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wanpeng Li commit d2286ba7d574ba3103a421a2f9ec17cb5b0d87a1 upstream. Prevent setting the tscdeadline timer if the lapic is hw disabled. Fixes: bce87cce88 (KVM: x86: consolidate different ways to test for in-kernel LAPIC) Cc: Signed-off-by: Wanpeng Li Message-Id: <1596165141-28874-1-git-send-email-wanpengli@tencent.com> Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/lapic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -2034,7 +2034,7 @@ void kvm_set_lapic_tscdeadline_msr(struc { struct kvm_lapic *apic = vcpu->arch.apic; - if (!lapic_in_kernel(vcpu) || apic_lvtt_oneshot(apic) || + if (!kvm_apic_present(vcpu) || apic_lvtt_oneshot(apic) || apic_lvtt_period(apic)) return;