Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2957540imu; Mon, 19 Nov 2018 08:36:52 -0800 (PST) X-Google-Smtp-Source: AFSGD/WWZqLRd32+wSlSEp1CkLt5pmvV7ZhPzkUqxKQ5z+scXHewBx3x92tEjprNxOORujro0mKN X-Received: by 2002:a17:902:8e8b:: with SMTP id bg11mr10339958plb.332.1542645412480; Mon, 19 Nov 2018 08:36:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542645412; cv=none; d=google.com; s=arc-20160816; b=gMVYt1qid7JIaQIA4fJwVhBwkvv796ZYrCSW93jMhn7OtlYITmz8Pb8tBMHC8pLkES VU5gzIn7Syg5bLXeVRCkv0HcjoQOoF+isiPTs5RLuh2XKHQZ/aURKb2V1kSuJeCGNE/g zCLewTAbmkZUqe7f8nckubx6pFyjPPMOQdCLHdssFD/v5CeoiFsSymrl5bF0ikMypXfz OK93NA9hr6uEE2Q97xuYwF1GjWfgEM8rQMCtwzqCfzpFcKbolaUG5mQcvcGDYuJL9+pl h6or95FGEif9cZo5Fn/v0s8stkZ1m6B8GlMB4owpA4vIItCayrkFMBpWn3RjkZgTnoR3 yGig== 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=qIHpRKQaAbmPqZjE9nNbiGJQRQPSb1cr0TMVlVagVzk=; b=iu5iLBl1hm6rp9sbi9Tc402fpYrWzV5spdaQTv9H04yL9h+RZNMG+ycCgGKaGHAee6 /cqhPLUw5q5RtD7uHwgfY6MaUJaWDTZATf0pTS2EMkPKlqTmPk8yfIFNRC+oqR3l0qor mHZlJOr/Abguw0WcoZdIRJtNU86K3SsEKIRNtF+b8nqn/yJmnMXCN4DHnNw1nrDNh1dQ U/g1KhQvHjoNb6hDGQK5DQxD8hQhcjjxGATkJxF8ZmvRwTXfNIEv3A9zsJvy+N+3ZGOe AOZsZM3rTBCPqwiVdA/GubBTFZ3unzgGYhsfU5u/em3/lsCII1UgfoWWI3TiJc2dy6wy nFAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SaY1qEPs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o127si4697340pfo.251.2018.11.19.08.36.38; Mon, 19 Nov 2018 08:36:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SaY1qEPs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731625AbeKTC70 (ORCPT + 99 others); Mon, 19 Nov 2018 21:59:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:58844 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730350AbeKTC7Z (ORCPT ); Mon, 19 Nov 2018 21:59:25 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 6AEA0213A2; Mon, 19 Nov 2018 16:35:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542645317; bh=zo0g9noOLwdDqyoK92NIcqZuz/SuzwLH1cLEZxcmQ78=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SaY1qEPs34lMRZcGUfsrfZHydTszWD2MbS7l8wIt5IEfpGTkDocspjAvf7GBYn6xg S45HPrJndHZlumxMN6vsKO73guSyCLZWxa5T7d5UUPdLI6zv+2Zl5ZAYYPmA10yo6R mnxHLu7ySlGmfzM/j713/gI9GB3RZOUGmqIPJtIk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Kelley , Thomas Gleixner , "devel@linuxdriverproject.org" , "daniel.lezcano@linaro.org" , "virtualization@lists.linux-foundation.org" , "jgross@suse.com" , "akataria@vmware.com" , "olaf@aepfle.de" , "apw@canonical.com" , vkuznets , "jasowang@redhat.com" , "marcelo.cerri@canonical.com" , KY Srinivasan Subject: [PATCH 4.19 119/205] x86/hyper-v: Enable PIT shutdown quirk Date: Mon, 19 Nov 2018 17:27:06 +0100 Message-Id: <20181119162635.826486017@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119162616.586062722@linuxfoundation.org> References: <20181119162616.586062722@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Kelley commit 1de72c706488b7be664a601cf3843bd01e327e58 upstream. Hyper-V emulation of the PIT has a quirk such that the normal PIT shutdown path doesn't work, because clearing the counter register restarts the timer. Disable the counter clearing on PIT shutdown. Signed-off-by: Michael Kelley Signed-off-by: Thomas Gleixner Cc: "gregkh@linuxfoundation.org" Cc: "devel@linuxdriverproject.org" Cc: "daniel.lezcano@linaro.org" Cc: "virtualization@lists.linux-foundation.org" Cc: "jgross@suse.com" Cc: "akataria@vmware.com" Cc: "olaf@aepfle.de" Cc: "apw@canonical.com" Cc: vkuznets Cc: "jasowang@redhat.com" Cc: "marcelo.cerri@canonical.com" Cc: KY Srinivasan Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/1541303219-11142-3-git-send-email-mikelley@microsoft.com Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/cpu/mshyperv.c | 11 +++++++++++ 1 file changed, 11 insertions(+) --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -285,6 +286,16 @@ static void __init ms_hyperv_init_platfo if (efi_enabled(EFI_BOOT)) x86_platform.get_nmi_reason = hv_get_nmi_reason; + /* + * Hyper-V VMs have a PIT emulation quirk such that zeroing the + * counter register during PIT shutdown restarts the PIT. So it + * continues to interrupt @18.2 HZ. Setting i8253_clear_counter + * to false tells pit_shutdown() not to zero the counter so that + * the PIT really is shutdown. Generation 2 VMs don't have a PIT, + * and setting this value has no effect. + */ + i8253_clear_counter_on_shutdown = false; + #if IS_ENABLED(CONFIG_HYPERV) /* * Setup the hook to get control post apic initialization.