Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5515290imm; Mon, 23 Jul 2018 00:41:06 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfEM8Yw26CANY0HggdTvLksUxIa7t9HYp4mqE9FgVtCoyoiqt0x4NxZrOTvObwYxdgI6Tbg X-Received: by 2002:a17:902:9a01:: with SMTP id v1-v6mr12060768plp.20.1532331666190; Mon, 23 Jul 2018 00:41:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532331666; cv=none; d=google.com; s=arc-20160816; b=pdbqYaTH7Qyez/d8Yl2S/sbraKF+PEcbIO0nooEqKAjOckalnAPhLc1wz0B09xBBsI auJ+JutNQcGn/dHoVLvodgBLw2vaUdo3cXPB3k0AoX+5x93q2Wo8mrdaF1KvCTsQDEEa x5wWhVU7tD7nyv0bUdgRIOiMwR+ic/Hk/Ym+M0a2zBDzGgg7zk9zaSoThZq8wqghN4O3 WsvDXnXDVs4mEKmo27BzESngJNPJHSXO03A3rSrYJ73EN5p6EZCzMM7bqNvYTrcFoSGS HNTfhyy8uDZ/YvEFOhY150Gd4fi0VhvridlMmVWvoO1P19G7jGThzSBO7W2u9uHn/mHw 3XRw== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature:arc-authentication-results; bh=A98c3pN0in+1Jsrk2GiiXzMq0ORDPtoekvKVYk8Zfp8=; b=hzBzEcAQN60dEwunZE0vNyXFvaJHorAjnSvAFONWPTbpYN93BzuGwMqp+biGnROfxt WnCQZGNL64peUkl5znZqLaIwGOdwjZm1W8WfOsiceJ0J7sezMrdGn6V2OIzx7V7rVjh4 c6dzcHLio62x0eBZiePx35yzdR4Vp+9MnM0JPLsF+99psGkQ27ii107obmUDvZAk40OJ PUmi1B10cNQax/Lxrixof+unG02bokoWCQI8hhXKeMjBHh5+TQ8G8ntmrXPvAs5gvuSN 65C2fY6gHEF8sUgM/e4DwGj6tiERHY/r9zBWbmau4q8H6WjMmLdplwUO/nsm8x8REa07 Hwtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jNzBb5HJ; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o18-v6si7829417pgg.250.2018.07.23.00.40.49; Mon, 23 Jul 2018 00:41:06 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jNzBb5HJ; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388005AbeGWIjt (ORCPT + 99 others); Mon, 23 Jul 2018 04:39:49 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:35572 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387950AbeGWIjt (ORCPT ); Mon, 23 Jul 2018 04:39:49 -0400 Received: by mail-oi0-f65.google.com with SMTP id i12-v6so31599889oik.2; Mon, 23 Jul 2018 00:39:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=A98c3pN0in+1Jsrk2GiiXzMq0ORDPtoekvKVYk8Zfp8=; b=jNzBb5HJ5v7wiIol9moqtNn59VypRfcdXh8VxyzXBWBK0202HgeSqMVg4b2+m64SE7 XJGiWgpc7L9hOh7mEgFYQ3BlU4rpXctOK4Pgrdb4uqr8jHFJ88nNRCBWZtkDN0Q3N0N5 LVh57enOFTEGnq4gWZqpcm6vpcx6YSiNhQ8fAoue+VY1z65iVQrPh6cyrG57B4GMfGXT pcwbqS/ugMvzNPKhmOJ6I5aKt6HHFY8QAMlCrqYQJV5AmHYeRMgZFTjKpAzKmYO6fBkk wGdozbsZuLbuK5X6mcHAwNDC3+jTLFJMXKzOu0tPoguxyV4M3s1ER0YaoIWjx+Nc+Oop pkJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=A98c3pN0in+1Jsrk2GiiXzMq0ORDPtoekvKVYk8Zfp8=; b=DV+JZXV6i2cf/mEFbvbcNbkiov4ryrWMJTBJEPkK/WrgoJkgkttnUD2RoB2mva4ACr ++c46nSWPmLRZVqRQuDA9oiKXP9buzN2RAoyuT0y476QG2lFw84n+GpOt0Ua+IxZY6LO UjHZjWdC99WLJ8tpKN1Vi879a2SN7jhRKz5mWh2tt1molg3YYHVomxpuSe+0mTRphzs2 mOVKSc1mnZ6X67Rf12Ia7E8nFcPtcQa7OmngDlmSreLGdd/A5rdbw3D02zoBgStlKFid KkqeWrk8bJ/nNkFDsJy8scCReXolSJjt1HSw3lu/kNsxhUhYMNZXtnnjA9sTbVfO4qes whIg== X-Gm-Message-State: AOUpUlGiGpKy0If/1w92BtzhImlIVITwPIDobzEcCgYM9DL2wiKUwYtc 4fT6ELRQY2O5JRSdP3SLEabmdMAi6KDi0lFuW9U= X-Received: by 2002:aca:7c5:: with SMTP id 188-v6mr8082600oih.58.1532331595806; Mon, 23 Jul 2018 00:39:55 -0700 (PDT) MIME-Version: 1.0 References: <20180719083946.121493-1-Tianyu.Lan@microsoft.com> In-Reply-To: From: Wanpeng Li Date: Mon, 23 Jul 2018 15:39:47 +0800 Message-ID: Subject: Re: [PATCH V3 0/4] KVM/x86/hyper-V: Introduce PV guest address space mapping flush support To: Paolo Bonzini Cc: "K. Y. Srinivasan" , Tianyu.Lan@microsoft.com, devel@linuxdriverproject.org, Haiyang Zhang , "H. Peter Anvin" , kvm , LKML , Ingo Molnar , Radim Krcmar , Stephen Hemminger , Thomas Gleixner , "the arch/x86 maintainers" , "Michael Kelley (EOSG)" , Vitaly Kuznetsov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 20 Jul 2018 at 16:32, Paolo Bonzini wrote: > > On 20/07/2018 05:58, KY Srinivasan wrote: > > > > > >> -----Original Message----- > >> From: Tianyu Lan > >> Sent: Thursday, July 19, 2018 1:40 AM > >> Cc: Tianyu Lan ; devel@linuxdriverproject.or= g; > >> Haiyang Zhang ; hpa@zytor.com; > >> kvm@vger.kernel.org; KY Srinivasan ; linux- > >> kernel@vger.kernel.org; mingo@redhat.com; pbonzini@redhat.com; > >> rkrcmar@redhat.com; Stephen Hemminger ; > >> tglx@linutronix.de; x86@kernel.org; Michael Kelley (EOSG) > >> ; vkuznets@redhat.com > >> Subject: [PATCH V3 0/4] KVM/x86/hyper-V: Introduce PV guest address > >> space mapping flush support > >> > >> Hyper-V provides a para-virtualization hypercall > >> HvFlushGuestPhysicalAddressSpace > >> to flush nested VM address space mapping in l1 hypervisor and it's to = reduce > >> overhead > >> of flushing ept tlb among vcpus. The tradition way is to send IPIs to = all > >> affected > >> vcpus and executes INVEPT on each vcpus. It will trigger several vmexi= ts for > >> IPI and > >> INVEPT emulation. The pv hypercall can help to flush specified ept tab= le on all > >> vcpus > >> via one single hypercall. > >> > >> Change since v2: > >> - Make ept_pointers_match as tristate "check", "match" and "mis= match". > >> Set "check" in vmx_set_cr3(), check all ept table pointers in > >> hv_remote_flush_tlb() > >> and call hypercall when all ept pointers are same. > >> - Rename kvm_arch_hv_flush_remote_tlb with > >> kvm_arch_flush_remote_tlb and > >> Rename kvm_x86_ops->hv_tlb_remote_flush with kvm_x86_ops- > >>> tlb_remote_flush > >> - Fix issue that ignore updating tlbs_dirty during calling > >> kvm_arch_flush_remote_tlbs() > >> - Merge patch "KVM/VMX: Add identical ept table pointer check" = and > >> patch "KVM/x86: Add tlb_remote_flush callback support for vmx" > >> > >> Change since v1: > >> - Fix compilation error for non-x86 platform. > >> - Use ept_pointers_match to check condition of identical ept > >> table pointer and get ept pointer from struct vcpu_vmx->ep= t_pointer. > >> - Add hyperv_nested_flush_guest_mapping ftrace support > >> > >> > >> > >> Lan Tianyu (4): > >> X86/Hyper-V: Add flush HvFlushGuestPhysicalAddressSpace hypercall > >> support > >> X86/Hyper-V: Add hyperv_nested_flush_guest_mapping ftrace support > >> KVM: Add tlb remote flush callback in kvm_x86_ops. > >> KVM/x86: Add tlb_remote_flush callback support for vmx > >> > >> arch/x86/hyperv/Makefile | 2 +- > >> arch/x86/hyperv/nested.c | 67 > >> ++++++++++++++++++++++++++++++++++ > >> arch/x86/include/asm/hyperv-tlfs.h | 8 +++++ > >> arch/x86/include/asm/kvm_host.h | 11 ++++++ > >> arch/x86/include/asm/mshyperv.h | 2 ++ > >> arch/x86/include/asm/trace/hyperv.h | 14 ++++++++ > >> arch/x86/kvm/vmx.c | 72 > >> ++++++++++++++++++++++++++++++++++++- > >> include/linux/kvm_host.h | 7 ++++ > >> virt/kvm/kvm_main.c | 3 +- > >> 9 files changed, 183 insertions(+), 3 deletions(-) > >> create mode 100644 arch/x86/hyperv/nested.c > > > > Acked-by: K. Y. Srinivasan > > Queued, thanks! My CONFIG_HYPERV is disabled, there is a warning when compiling kvm/queue. warning: =E2=80=98hv_remote_flush_tlb=E2=80=99 defined but not used [-Wunus= ed-function] static int hv_remote_flush_tlb(struct kvm *kvm) Regards, Wanpeng Li