Received: by 10.223.185.111 with SMTP id b44csp352894wrg; Fri, 9 Mar 2018 06:08:57 -0800 (PST) X-Google-Smtp-Source: AG47ELt1neTjKVr/Pj0XbiJxz7KiC01E5x1mX68WZDBBUb3YA6d7EArmTJ+h1T0FsimKjhELpff/ X-Received: by 2002:a17:902:aa03:: with SMTP id be3-v6mr26209513plb.211.1520604537599; Fri, 09 Mar 2018 06:08:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520604537; cv=none; d=google.com; s=arc-20160816; b=IfIjaLCDQaIG1W367aBs7071Jy8WDFm23RGU+CzLSXPaUZ1KdzxH1KD0W9NvJM3TLM qtwHrYyqBJAtlZs7WlFBu494jSnQPvnvOTIfeSbgjpkZLbO7id7Fi+mmg5WXAyl/TxuD gSTMu3Yvd94ECrljkhx8wQtCmjEjKUv03L4ZyOhtef6F0A2dbwI8CwiC01xzZpofEe4/ R7IxBTXauJzGj+6D1bJx73MSzgjBj7xRNstYc9Kl8+h4pP9apvxhkm7UvbRTWJ9kjraL qbJqkGWMRyytoh+qF24rPVkqsk+hpjLezzRIR81OpFUjTEt2OC7AyfkaPwmESHXH2LBW bstA== 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 :message-id:date:subject:cc:to:from:arc-authentication-results; bh=qSipavGzeTmVOrqlYsPhqfieoauDmKgBGkuYqlNAlV0=; b=s2s4QWEb7S/PDyVLAGoXWAFz4UyoOEp6S8np6fW8C69qV8W8kUm6kwIngdpBbaPyl4 vNehXTt27AK61usxN9GjZ8nsvyOMpO9aJaKrp1SBGmramRUxeVu/5q+c93NQRjhnpdFN dx33A1kInLhPcDpPKm1eV/sNdfvpwHiIMCqv2oP9Ylg8HOFybeerzjWaT8qR/ObcUwb+ L4UcZFxetSqfYRcA8Jlzn6933OmeJDHKUBAfpGc+aj7FgxVsrCBh20otT6fsw0BikcGm PFdysdrApzaM/syzMs/FvgwKhs47QHh/R/uQp8mIVqZg8qL71fLhmiNqskX2V03dCvx6 VWUA== 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 f20si875941pff.252.2018.03.09.06.08.42; Fri, 09 Mar 2018 06:08:57 -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 S932071AbeCIOCy (ORCPT + 99 others); Fri, 9 Mar 2018 09:02:54 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:34092 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751056AbeCIOCx (ORCPT ); Fri, 9 Mar 2018 09:02:53 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 865384067F25; Fri, 9 Mar 2018 14:02:52 +0000 (UTC) Received: from vitty.brq.redhat.com (unknown [10.43.2.155]) by smtp.corp.redhat.com (Postfix) with ESMTP id A9664215CDAA; Fri, 9 Mar 2018 14:02:50 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org Cc: x86@kernel.org, Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "Michael Kelley (EOSG)" , Mohammed Gamal , Cathy Avery , Bandan Das , linux-kernel@vger.kernel.org Subject: [PATCH v3 0/7] Enlightened VMCS support for KVM on Hyper-V Date: Fri, 9 Mar 2018 15:02:42 +0100 Message-Id: <20180309140249.2840-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 09 Mar 2018 14:02:52 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 09 Mar 2018 14:02:52 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'vkuznets@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changes since v2: - Move hyperv.h out of uapi [Radim Krčmář], PATCHes 1 and 2 added. - define KVM_EVMCS_VERSION, HV_X64_ENLIGHTENED_VMCS_VERSION [Radim Krčmář] - WARN_ONCE in get_evmcs_offset[,_cf] [Radim Krčmář] - add evmcs_sanitize_exec_ctrls() and use it in hardware_setup() and dump_vmcs() [Radim Krčmář] When running nested KVM on Hyper-V it's possible to use so called 'Enlightened VMCS' and do normal memory reads/writes instead of doing VMWRITE/VMREAD instructions. In addition, clean field mask provides a huge room for optimization on L0's side. Tight CPUID loop test shows significant speedup (E5-2667 v4 @ 3.20GHz): Before: 18890 cycles After: 8304 cycles Ladi Prosek (1): x86/kvm: rename HV_X64_MSR_APIC_ASSIST_PAGE to HV_X64_MSR_VP_ASSIST_PAGE Vitaly Kuznetsov (6): x86/hyper-v: move hyperv.h out of uapi x86/hyper-v: move definitions from TLFS to hyperv-tlfs.h x86/hyper-v: allocate and use Virtual Processor Assist Pages x86/hyper-v: define struct hv_enlightened_vmcs and clean field bits x86/hyper-v: detect nested features x86/kvm: use Enlightened VMCS when running on Hyper-V MAINTAINERS | 2 +- arch/x86/hyperv/hv_init.c | 35 +- arch/x86/include/asm/hyperv-tlfs.h | 695 +++++++++++++++++++++++++++++++++++ arch/x86/include/asm/kvm_host.h | 1 + arch/x86/include/asm/mshyperv.h | 91 +---- arch/x86/include/uapi/asm/hyperv.h | 421 --------------------- arch/x86/include/uapi/asm/kvm_para.h | 1 - arch/x86/kernel/cpu/mshyperv.c | 21 +- arch/x86/kvm/hyperv.c | 8 +- arch/x86/kvm/lapic.h | 2 +- arch/x86/kvm/vmx.c | 625 ++++++++++++++++++++++++++++++- arch/x86/kvm/x86.c | 2 +- drivers/hv/connection.c | 1 - drivers/hv/hv.c | 1 - drivers/hv/hyperv_vmbus.h | 1 + drivers/hv/vmbus_drv.c | 1 - include/linux/hyperv.h | 1 - 17 files changed, 1379 insertions(+), 530 deletions(-) create mode 100644 arch/x86/include/asm/hyperv-tlfs.h delete mode 100644 arch/x86/include/uapi/asm/hyperv.h -- 2.14.3