Received: by 10.213.65.68 with SMTP id h4csp2531948imn; Mon, 2 Apr 2018 09:12:47 -0700 (PDT) X-Google-Smtp-Source: AIpwx49eIK6gyOK+GR89MfGMIMzB7bVaYoCTf/hTgkPvOUY9xVYKagvFi6NOl+Um7LSOg8+J9a9I X-Received: by 10.98.103.69 with SMTP id b66mr7735196pfc.151.1522685567883; Mon, 02 Apr 2018 09:12:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522685567; cv=none; d=google.com; s=arc-20160816; b=PY6EScK5gjKPFeAIOP9xCKaFdkklL71rGAYwL5MGd6hLMhIRGKgA3lPGZyLKdExgWN 9sm8D1U8zOSlmO3d3FF7uKGXvftfgDS2Q1SU//Jt6LZliOCYqux2xUe+Ric9KjCMEKs9 P2JcXviiS418LDcWpext9/+HxSG9A3CEX4Vnhl9VCFnia5qGE2xaPu0kKmTI6U5HBHyA QUl6n0iA3QgvU7tbpr48EZoLZmoiWjx5HZUbAW31ELpUFoh3RsdOwrwRMiG1MoC0KEfP sZlHaDOLhvzjitk+hcXJU5b4X2HIt+b4tdI5svbX4aDgtiGL9la5YmPw2aniSscv0mYJ P7+w== 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=WgQWI/CITltgSF+YhKGsJiWyARpfqdyJ57VrrLA2Sgw=; b=Q9vtDZHkfR3QOxMXb82kOx8ueXamYyNZWTbPbGk6WcPuKycFX1dQ+HvKaknQrYseZt thGkOkfE07Q7XgxAkuZ8NUX4xYGhSVdk7c+jFozqEGihlpqcyOIlU2Hm65GFhwL4Vc72 V/FkOfEtieHC+QKCwSejBn8A1BJUYZYwjBzPFyaFyME8bYzuVG9U4zh9epy/WSP89oSW lAZC0FecYCrXGBX1CvOaxsrMyzyRU0NrgkGeqJsw59tUnm34xqBaVxwvIYz2OYK+vMiK /OmS7Y9Y2i5H4L5aZO9RV81PntAJIhIG1iIBQl8a9OhteFlKP5v98YO7/+uOXTliK05M fMLA== 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 w16-v6si591879plp.165.2018.04.02.09.12.33; Mon, 02 Apr 2018 09:12:47 -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 S1752958AbeDBQLW (ORCPT + 99 others); Mon, 2 Apr 2018 12:11:22 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:39992 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752877AbeDBQLN (ORCPT ); Mon, 2 Apr 2018 12:11:13 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A2B51722DC; Mon, 2 Apr 2018 16:11:12 +0000 (UTC) Received: from vitty.brq.redhat.com (ovpn-204-121.brq.redhat.com [10.40.204.121]) by smtp.corp.redhat.com (Postfix) with ESMTP id 68EB8D7E12; Mon, 2 Apr 2018 16:11:10 +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 5/5] KVM: x86: hyperv: declare KVM_CAP_HYPERV_TLBFLUSH capability Date: Mon, 2 Apr 2018 18:10:59 +0200 Message-Id: <20180402161059.8488-6-vkuznets@redhat.com> In-Reply-To: <20180402161059.8488-1-vkuznets@redhat.com> References: <20180402161059.8488-1-vkuznets@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 02 Apr 2018 16:11:12 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 02 Apr 2018 16:11:12 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.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 7d9a444f2f24..a34a068c4663 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -2852,6 +2852,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