Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751002AbeAPBVH (ORCPT + 1 other); Mon, 15 Jan 2018 20:21:07 -0500 Received: from mail-ot0-f196.google.com ([74.125.82.196]:43507 "EHLO mail-ot0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750716AbeAPBVF (ORCPT ); Mon, 15 Jan 2018 20:21:05 -0500 X-Google-Smtp-Source: ACJfBoskrfC/w7ErYSx53z6kFhEIKtKpSuT9E/tbkhCNzirJhG+jZx4pHrmu69DzUUI9weLECnj5TFrSgFq0pXA1lRs= MIME-Version: 1.0 In-Reply-To: <20180115173105.31845-1-vkuznets@redhat.com> References: <20180115173105.31845-1-vkuznets@redhat.com> From: Wanpeng Li Date: Tue, 16 Jan 2018 09:21:04 +0800 Message-ID: Subject: Re: [RFC 0/6] Enlightened VMCS support for KVM on Hyper-V To: Vitaly Kuznetsov Cc: kvm , "the arch/x86 maintainers" , Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "Michael Kelley (EOSG)" , Mohammed Gamal , Cathy Avery , Bandan Das , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 2018-01-16 1:30 GMT+08:00 Vitaly Kuznetsov : > Early RFC. I'll refer to this patchset in my DevConf/FOSDEM > presentations. > > 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. Tests show that this speeds up > tight CPUID loop almost 3 times: > > Before: > ./cpuid_tight > 20459 > > After: > ./cpuid_tight > 7698 Maybe you can apply a similar idea to kvm nested on kvm. Regards, Wanpeng Li > > checkpatch.pl errors/warnings and possible 32bit brokenness are known > things. > > Main RFC questions I have are: > - Do we want to have this per L2 VM or per L1 host? > - How can we achieve zero overhead for non-Hyper-V deployments? Use static > keys? But this will only work if we decide to do eVMCS per host. > - Can we do better than a big switch in evmcs_read()/evmcs_write()? And > probably don't use 'case' defines which checkpatch.pl hates. > > I would really apreciate any feedback! > > Ladi Prosek (1): > x86/kvm: rename HV_X64_MSR_APIC_ASSIST_PAGE to > HV_X64_MSR_VP_ASSIST_PAGE > > Vitaly Kuznetsov (5): > x86/hyper-v: define virtual processor assist page structure > x86/hyper-v: allocate and use hv_vp_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 > > arch/x86/hyperv/hv_init.c | 35 ++- > arch/x86/include/asm/mshyperv.h | 3 + > arch/x86/include/uapi/asm/hyperv.h | 223 +++++++++++++- > arch/x86/kernel/cpu/mshyperv.c | 3 + > arch/x86/kvm/hyperv.c | 8 +- > arch/x86/kvm/lapic.h | 2 +- > arch/x86/kvm/vmx.c | 595 ++++++++++++++++++++++++++++++++++++- > arch/x86/kvm/x86.c | 2 +- > 8 files changed, 857 insertions(+), 14 deletions(-) > > -- > 2.14.3 >