Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2134143imm; Wed, 16 May 2018 08:22:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp0ikpz1pOGLug1J+3tJSXpkA26p2m03BsoofkDMPMRjq2ZmlubaVYx2oCjH1Mvg9BSv4Ny X-Received: by 2002:a17:902:2702:: with SMTP id c2-v6mr1314314plb.297.1526484151888; Wed, 16 May 2018 08:22:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526484151; cv=none; d=google.com; s=arc-20160816; b=fV9RbaUMcb7c8ivUqEtGRAQStOYakE72D/AHlkJTBpL6xQOzkoFXrbDlejWfKE62DS sVGx0zlIbP3JZt00LMehGJQiraKMOeGhSw+A8w9GiR0kGg/1PkFDfXpKzZ2IWSUyGnP7 Qm8M2zOlTNsHbjOylKHGLY9Znu2M5ck63Gni722QZikPzNjZOjHiroI35XR5+v84gcrN FXVyloxfXz8hnq7d54n4VQp8O/nyR4xg1aLkIQ4pOvWPz7AYf28U+NR+sLMK/evHnlK+ S70Uor+LzStpk6nDEZMbqTBPIrI/JJCSM89bYNzfPsxSyUHexOT1BeNCo3+wdrvPCsXk VWLA== 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=JluRLRtTUtIF9rxFB8M5LmMUCBoqxdGdTYWx0CoOOak=; b=OiJS37i7ER8bgyt+2vwWZznU01h3LAhZX91BoWdrZiqKPQ921EkIEoe9d9o6c6Wlx0 mEGaRniFlcov2zKRJTac0uVtMLkupFLcZfVhscjGz3okE9hvihcERXyGl0spNlfjRyXg CQ6BLwGXZKfr6pc0g7vqmvSbjSqSn2gxTk/t80VMqEwGec0hKrnTQCHX93JcJ3DetW1U xd9owC2bFmXjf0/YinpBx9751RaIclJ7ewVbQSKQtKPjDsdESYBJy+xe8DzVPWlJ56g6 iXN2ELtQFoJRPEZTmPhffxjG0S0XhXg5yL1pEpqwWaD77So37MR8tJb3MDcl/8VmleTl xSpw== 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 f15-v6si2679530plr.365.2018.05.16.08.22.17; Wed, 16 May 2018 08:22:31 -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 S1752205AbeEPPVy (ORCPT + 99 others); Wed, 16 May 2018 11:21:54 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58224 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752022AbeEPPVv (ORCPT ); Wed, 16 May 2018 11:21:51 -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 EFBF1400E9BA; Wed, 16 May 2018 15:21:50 +0000 (UTC) Received: from vitty.brq.redhat.com (unknown [10.43.2.155]) by smtp.corp.redhat.com (Postfix) with ESMTP id 24364215CDA7; Wed, 16 May 2018 15:21:49 +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 v4 8/8] KVM: x86: hyperv: declare KVM_CAP_HYPERV_TLBFLUSH capability Date: Wed, 16 May 2018 17:21:31 +0200 Message-Id: <20180516152131.30689-9-vkuznets@redhat.com> In-Reply-To: <20180516152131.30689-1-vkuznets@redhat.com> References: <20180516152131.30689-1-vkuznets@redhat.com> 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.7]); Wed, 16 May 2018 15:21:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 16 May 2018 15:21:51 +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 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 758bf403a169..c563da4244da 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt @@ -4603,3 +4603,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 87e480521550..d523b124656a 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -2874,6 +2874,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 b02c41e53d56..b252ceb3965c 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -948,6 +948,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