Received: by 10.223.176.46 with SMTP id f43csp746430wra; Wed, 24 Jan 2018 05:25:11 -0800 (PST) X-Google-Smtp-Source: AH8x227gFI93YnQ8QPojmnBJJI5zJ97MGGoRAOa2AN5188N1Okd/pX6hFvQ6d20x9u8YOiWw4tId X-Received: by 10.99.6.14 with SMTP id 14mr10542289pgg.8.1516800311019; Wed, 24 Jan 2018 05:25:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516800310; cv=none; d=google.com; s=arc-20160816; b=Lh1v287r3yC5ZaR7GeWoHkHM3kzid7V4GbmS6hATxP2EIqaUIlE3xDON4iP/qrG6YK YhWs0DG+nvW77O9KNAiR63tMgRlOeHL4GUuW8s0mhLtWp7AV1u3kStKUqmiKC0C7SpR+ MW44m1atMEJLgnT8rBF/BTDGIxW/Prv8xM0FPS3A4uN/uQrjmbYbvBsrrdf3sK6XdDOr o2fE20TMjE/+SQAnYHWMM1ULJC184cC3I0N7UWasI1SviT0LNqEIx2AnSvpb406egt6a T6AznMduBOWi877i6trMrBLNXGuS3icYqo9mnmSjPLeoRihlNx+1yUUpsP5uRTR0Wigb t9pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=PuxSCqt3FfEhRYv/xHWb/rImFg6lGkD+yNXdQgFpEK8=; b=TWxWBs2LIDhH80bQhd4Wm+sxW0uaWX/vAmBNmQ9IyiFRjgwvMsrkTx2ZiEKa7qKq61 Oj9+QGPh24Wxb37y6+dPj7++zfrskQnnvKAz51K9PF0Ahr5+gEnKp19Va1sKILm4vC3H i+jgZ+M+zR5zBfJsNTbwbIHJbznAc7eKLyo7pypNjQjTqoQZlhLvMLjGJtv8stf+KQMP bwTcK1JEGEkJrnZ2CIU1A3ArLVpSORbbpwebZRBnfkhK1dBjLYNznArrlDx/Z1LQ9tAT cWZBKcl+/KH8TJ5zpxxCIXCKbYPM4ytzWVxekoOA5IPIY5qm8DaJg8oIV4B0RG48HT5b tKAw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i11si148384pgp.337.2018.01.24.05.24.57; Wed, 24 Jan 2018 05:25:10 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933865AbeAXNXp (ORCPT + 99 others); Wed, 24 Jan 2018 08:23:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44471 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933615AbeAXNXm (ORCPT ); Wed, 24 Jan 2018 08:23:42 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9B5318B101; Wed, 24 Jan 2018 13:23:42 +0000 (UTC) Received: from vitty.brq.redhat.com (unknown [10.43.2.155]) by smtp.corp.redhat.com (Postfix) with ESMTP id F24E37A006; Wed, 24 Jan 2018 13:23:38 +0000 (UTC) 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 , Roman Kagan , linux-kernel@vger.kernel.org, devel@linuxdriverproject.org Subject: [PATCH v4 0/7] x86/kvm/hyperv: stable clocksource for L2 guests when running nested KVM on Hyper-V Date: Wed, 24 Jan 2018 14:23:30 +0100 Message-Id: <20180124132337.30138-1-vkuznets@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 24 Jan 2018 13:23:42 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changes since v3: - PATCH3: - drop 'include ' (and __visible/_irq_entry from hyperv_reenlightenment_intr declaration -- but not from implementation) from mshyperv.h [kbuild robot] I'm retaining Thomas' Reviewed-by tag as the change is small, hope that's OK. - PATCH7: - add static to kvm_hyperv_tsc_notifier() [kbuild robot]. I'm also keeping Paolo's Acked-by as the change is trivial. So currently only PATCH2 of the series doesn't have a Reviewed-by/ Acked-by tag. 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 6 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 (7): 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/irq: Count Hyper-V reenlightenment interrupts x86/kvm: pass stable clocksource to guests when running nested on Hyper-V x86/kvm: support Hyper-V reenlightenment arch/x86/entry/entry_32.S | 3 + arch/x86/entry/entry_64.S | 3 + arch/x86/hyperv/hv_init.c | 123 ++++++++++++++++++++++++++++++++- arch/x86/include/asm/hardirq.h | 3 + arch/x86/include/asm/irq_vectors.h | 7 +- arch/x86/include/asm/mshyperv.h | 32 +++++++-- arch/x86/include/uapi/asm/hyperv.h | 27 ++++++++ arch/x86/kernel/cpu/mshyperv.c | 6 ++ arch/x86/kernel/irq.c | 9 +++ arch/x86/kvm/x86.c | 138 ++++++++++++++++++++++++++++++------- 10 files changed, 319 insertions(+), 32 deletions(-) -- 2.14.3