Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753756AbdLHKxx (ORCPT ); Fri, 8 Dec 2017 05:53:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36572 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753202AbdLHKuL (ORCPT ); Fri, 8 Dec 2017 05:50:11 -0500 From: Vitaly Kuznetsov To: kvm@vger.kernel.org, x86@kernel.org Cc: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "Michael Kelley (EOSG)" , Andy Lutomirski , Mohammed Gamal , Cathy Avery , linux-kernel@vger.kernel.org, devel@linuxdriverproject.org Subject: [PATCH 0/6] x86/kvm/hyperv: stable clocksorce for L2 guests when running nested KVM on Hyper-V Date: Fri, 8 Dec 2017 11:49:54 +0100 Message-Id: <20171208105000.25116-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 08 Dec 2017 10:50:11 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2037 Lines: 46 Changes since RFC: - Handle disabled TSC page case [Radim Krčmář] - Function/parameter renames [Radim Krčmář] - Protect against simultaneous CPU shutdown (future-proof) [Radim Krčmář] - BUG() in !CONFIG_HYPERV_TSCPAGE case [Stephen Hemminger, Paolo Bonzini] - Fix build issues (hopefully) [kbuild test robot] - Fix typos [Andrew Jones] - Switch to delayed work to workaround a host issue (reported to Microsoft) Changes are described in the individual patches too. Original description: Currently, KVM passes PVCLOCK_TSC_STABLE_BIT to its guests when running in so called 'masterclock' mode and this is only possible when the clocksource on the host is TSC. When running nested on Hyper-V we're using a different clocksource in L1 (Hyper-V TSC Page) which can actually be used for masterclock. This series brings the required support. Making KVM work with TSC page clocksource is relatively easy, it is done in PATCH 5 of the series. All the rest is required to support L1 migration when TSC frequency changes, we use a special feature from Hyper-V to do the job. Vitaly Kuznetsov (6): x86/hyper-v: check for required priviliges in hyperv_init() x86/hyper-v: add a function to read both TSC and TSC page value simulateneously x86/hyper-v: reenlightenment notifications support x86/hyper-v: redirect reenlightment notifications on CPU offlining x86/kvm: pass stable clocksource to guests when running nested on Hyper-V x86/kvm: support Hyper-V reenlightenment arch/x86/entry/entry_64.S | 4 ++ arch/x86/hyperv/hv_init.c | 113 +++++++++++++++++++++++++++++- arch/x86/include/asm/entry_arch.h | 4 ++ arch/x86/include/asm/hw_irq.h | 1 + arch/x86/include/asm/irq_vectors.h | 7 +- arch/x86/include/asm/mshyperv.h | 31 +++++++-- arch/x86/include/uapi/asm/hyperv.h | 27 ++++++++ arch/x86/kernel/idt.c | 3 + arch/x86/kvm/x86.c | 138 ++++++++++++++++++++++++++++++------- 9 files changed, 296 insertions(+), 32 deletions(-) -- 2.14.3