Received: by 10.192.165.156 with SMTP id m28csp708039imm; Mon, 16 Apr 2018 07:29:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/4Ntv46rI3ZFF09QSoWRTAaUP6IsPzgxlpNz4TwJr00iZn/FNy2wuYFAVTXmkTJgE2pmTF X-Received: by 10.99.115.4 with SMTP id o4mr12944222pgc.404.1523888973438; Mon, 16 Apr 2018 07:29:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523888973; cv=none; d=google.com; s=arc-20160816; b=PPQnisJKD9K3PBf5XYV0zmoNJBk+Z2/8EX1IOUEjDqxeDkoYEt06z1imOq0a/bB2aq Md6VyM4ZbGaCv6x7WbKJy7mRKd27YRhKy9Pf0ZKB7MLcJB2XF1bxGqVDa4796yKydBNi L9lOOEq+6fC8Ocm+OCcxaFmGohkWK6N5aWYm40HjEthoCmPxbeJLf7jpRaJkFJCWAmfu p6VjkIauyCzac3Js5u8vAeo/QgJ9xlFD70zh/BMqv9JjHH+L1GlJ9ofRIndLUztDOYi2 YFK9H3QW6mQ5b77bvsvSp1wJCiskbM85XLEGXUteaH6nknS6i2P1Dxtx1LGOzRfkFnxT pEUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=LceKzqsvnXr9BMF07WHWE/OB9VYSHVS7Xjjt9ZkDEhM=; b=j1M0EpXga2pB3w30NC12K75CLiWaZRs5kiZFuXQe9b4+pdUcRFS/eysteXCjDFXFJq PXKG1dZDgEaX9TT/uWO3JcH0K7r66eyikxhnbZq+mRAu6vmTar8PxwEzcr0T2ARoBR9l gLOiqIHVXaiLnJh9m2dXp1X5Ie54pg/q4FlQbxXXt1+Ka+xtR0MFrsUmPdHgxoTqHsrZ D/qiA0SaA1WzApme9Yn/by31kkS6OdnKCNG6XsiCwyokPWnQjrE2VO/Tij8otoOPbYY8 Yhnobcu4Tg5VmEsPC1R4QjCCb+XJ2vZvjxLAgfRObAlwpOjHfyOD44HYLl9vFxevdtba kw6A== 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 p1-v6si11843968pld.412.2018.04.16.07.29.18; Mon, 16 Apr 2018 07:29:33 -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 S1754878AbeDPLIZ (ORCPT + 99 others); Mon, 16 Apr 2018 07:08:25 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:48402 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754555AbeDPLIW (ORCPT ); Mon, 16 Apr 2018 07:08:22 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DB5058DC48; Mon, 16 Apr 2018 11:08:21 +0000 (UTC) Received: from vitty.brq.redhat.com (unknown [10.43.2.155]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0979C111DCF1; Mon, 16 Apr 2018 11:08:19 +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?= , Roman Kagan , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "Michael Kelley (EOSG)" , Mohammed Gamal , Cathy Avery , linux-kernel@vger.kernel.org Subject: [PATCH v3 6/6] KVM: x86: hyperv: declare KVM_CAP_HYPERV_TLBFLUSH capability Date: Mon, 16 Apr 2018 13:08:06 +0200 Message-Id: <20180416110806.4896-7-vkuznets@redhat.com> In-Reply-To: <20180416110806.4896-1-vkuznets@redhat.com> References: <20180416110806.4896-1-vkuznets@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 16 Apr 2018 11:08:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 16 Apr 2018 11:08:21 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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 We need a new capability to indicate support for the newly added HvFlushVirtualAddress{List,Space}{,Ex} hypercalls. Upon seeing this capability, userspace is supposed to announce PV TLB flush features by setting the appropriate CPUID bits (if needed). Signed-off-by: Vitaly Kuznetsov --- Documentation/virtual/kvm/api.txt | 9 +++++++++ arch/x86/kvm/x86.c | 1 + include/uapi/linux/kvm.h | 1 + 3 files changed, 11 insertions(+) diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index 1c7958b57fe9..74e22e36b3c8 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt @@ -4596,3 +4596,12 @@ Architectures: s390 This capability indicates that kvm will implement the interfaces to handle reset, migration and nested KVM for branch prediction blocking. The stfle facility 82 should not be provided to the guest without this capability. + +8.14 KVM_CAP_HYPERV_TLBFLUSH + +Architectures: x86 + +This capability indicates that KVM supports paravirtualized Hyper-V TLB Flush +hypercalls: +HvFlushVirtualAddressSpace, HvFlushVirtualAddressSpaceEx, +HvFlushVirtualAddressList, HvFlushVirtualAddressListEx. diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 51ecd381793b..c6784ea69dc6 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -2864,6 +2864,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) case KVM_CAP_HYPERV_SYNIC2: case KVM_CAP_HYPERV_VP_INDEX: case KVM_CAP_HYPERV_EVENTFD: + case KVM_CAP_HYPERV_TLBFLUSH: case KVM_CAP_PCI_SEGMENT: case KVM_CAP_DEBUGREGS: case KVM_CAP_X86_ROBUST_SINGLESTEP: diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 1065006c9bf5..30c193b43d89 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -941,6 +941,7 @@ struct kvm_ppc_resize_hpt { #define KVM_CAP_S390_BPB 152 #define KVM_CAP_GET_MSR_FEATURES 153 #define KVM_CAP_HYPERV_EVENTFD 154 +#define KVM_CAP_HYPERV_TLBFLUSH 155 #ifdef KVM_CAP_IRQ_ROUTING -- 2.14.3