Received: by 10.213.65.68 with SMTP id h4csp443914imn; Tue, 20 Mar 2018 07:04:47 -0700 (PDT) X-Google-Smtp-Source: AG47ELuIQEsLelOtHktejpLnFQGGhukPKAf0lezZ1vGChRWLV+V8m+qbBXEavKssyN5tuSmpngzN X-Received: by 2002:a17:902:161:: with SMTP id 88-v6mr16554962plb.212.1521554686956; Tue, 20 Mar 2018 07:04:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521554686; cv=none; d=google.com; s=arc-20160816; b=QAX9fcec1nhR5VCbq9wWdMP7brzg7GjkH2pcamFTWQsfj76GyxY0bGpoDLCVpzcb9z klECaqBSHEgS0ffbJFK/yHqeUW70x8OkkVctcsOAoxRYeQatdn02fBFsa+8ETV0P3+Ha j7iNWRM1UmpzV02afYPUhG13Mx82HnVdIxyvTkyQY8c4j6CysnwidmGE4sIjlpPoY8kL 6vCG0NjSTJRo2JeGVtw09kuBkZl9rR8//KboMtjgFP1z8mS2gsOyiuSgGYZpPBb5PhIk F92bi8wVv2Tes6xpt/fV3bJxjAq5OL480ycyIzmfdBRJUXMDIUfCKMWL1GsYUKVO5CvP rznw== 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=AqwZTnr6nM+Sh39uDCr/g5VbUTg3mwsCrFM8V1Jtv7I=; b=omY/FAQ3k9vYdHCPtxYarfYgIMdD2+W6GA2xzaM/WlKdNSxa6zzvaTD/168afyiqIs rkUksZkmhSIBksjekuFTeSbaI+72qy+IWQtSXCQgJbfygEmlFqQyO/BnIGGTY60TZnid aSM0fBOxDgFD2knRbev9mBjjD0e6Rt9vXzL9Rj9/XVKjXErQEd8NeBpPQXJlcRF9tqph OF9IrA6eMBNJSWbgjdhyf+JOPCkZiBwx7c8b7uT8dhTjG+Ys11ConjKkxUFbR/6q4UEP Shw/OpAOh44259MwfGTQwpalsQkAzLEuSi/5oqNIRjkwgPrKSWsyItRBCEbUI0zaOHm1 /MWQ== 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 g3si1252637pgc.14.2018.03.20.07.04.07; Tue, 20 Mar 2018 07:04:46 -0700 (PDT) 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 S1753222AbeCTOCT (ORCPT + 99 others); Tue, 20 Mar 2018 10:02:19 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33302 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752382AbeCTOCP (ORCPT ); Tue, 20 Mar 2018 10:02:15 -0400 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 45D7CEBFE8; Tue, 20 Mar 2018 14:02:15 +0000 (UTC) Received: from vitty.brq.redhat.com (unknown [10.43.2.155]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2DDA52166BDA; Tue, 20 Mar 2018 14:02:13 +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, Thomas Gleixner , Christoph Hellwig Subject: [PATCH v6 0/7] Enlightened VMCS support for KVM on Hyper-V Date: Tue, 20 Mar 2018 15:02:04 +0100 Message-Id: <20180320140211.7600-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.1]); Tue, 20 Mar 2018 14:02:15 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 20 Mar 2018 14:02:15 +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 v5: - Fix a couple of issues reported by kbuild test robot, both in PATCH7 (hope Radim's Reviewed-by: stands). 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 | 45 ++- .../{uapi/asm/hyperv.h => asm/hyperv-tlfs.h} | 295 ++++++++++++++++++- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/include/asm/mshyperv.h | 94 +----- arch/x86/include/uapi/asm/kvm_para.h | 1 - arch/x86/kernel/cpu/mshyperv.c | 22 +- arch/x86/kvm/hyperv.c | 8 +- arch/x86/kvm/lapic.h | 2 +- arch/x86/kvm/vmx.c | 301 ++++++++++++++++++- arch/x86/kvm/vmx_evmcs.h | 324 +++++++++++++++++++++ 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, 983 insertions(+), 119 deletions(-) rename arch/x86/include/{uapi/asm/hyperv.h => asm/hyperv-tlfs.h} (65%) create mode 100644 arch/x86/kvm/vmx_evmcs.h -- 2.14.3