Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3499160ybv; Mon, 10 Feb 2020 00:51:50 -0800 (PST) X-Google-Smtp-Source: APXvYqxBUJB1iCqmJNNUBYkJjEkbcJCaQdXueTmMNs1FWhZD3BgSzs7vMaCs6HR0cZFqgQjOqv75 X-Received: by 2002:a05:6830:12d5:: with SMTP id a21mr302317otq.296.1581324710709; Mon, 10 Feb 2020 00:51:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581324710; cv=none; d=google.com; s=arc-20160816; b=N+2klEosh39npy6BaWC+8iW4AJ/UNiafsngyEj970DUWkpRkMInWJzJBc1E1QBr2wM cOeRuhwvsilaVGn3wb+hNURg2i8xXxSrM8WRbImwJ7/5/2TyZmdw+n/KL5ypZRnch2wz RXmilXT4V0OE4VmGQEAQiGG/7yP0FBEnbpAmeo2CVTBBkoVvfI0+cZUkvjw+Z0lHqsuF vEz21oYrK2wUjDct176QNxh40ou+LvsiRufNDraWVq+llIP1s3TenIFxmKSftS/Q6ZMo QAX8BfzbIhBEcZUEOfsmwxrlyJBPF76hQZhMkoJjI2gerrMVnMfZNwfwiBwox6kid4oD fqfQ== 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; bh=h4Mo33k4Nw2qcr7k6Uyz4f9CoLNqjA5eYB1b4sspfh4=; b=UkXXDh+37k4vhoVfrI4kOlFKFJhN8EmFA+DjlRFt/YZsdkAa6DUdG1RSzFUtKYvTwZ BN06f/JXql1kLyKwaNXGd8VjwHWfOFCsyX3fITQPzI/OI8J9NZ2bnZcAgb0UBdp+FL8c aTxIQZkp4e6saqA+lrbQWKKAsce7sCh5z9uFBfHWQ1NOSQOMireKxAS9+qdGpAZywnXi uDTulou4tn3f2LmPRGUwGvcrW6kFuFtm+E5IewW8VUghEY0V0Oyt6OZQ6ZRSDLyhjf67 aK6NT0h63yUwP0y3c3f/vAw+Ek/dfsfEFLawuBRs3E+YIlvAUXPlCkRsim8JfyQNJz81 BdUQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k20si7168541oiw.273.2020.02.10.00.51.39; Mon, 10 Feb 2020 00:51:50 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727860AbgBJIuU (ORCPT + 99 others); Mon, 10 Feb 2020 03:50:20 -0500 Received: from foss.arm.com ([217.140.110.172]:57690 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727813AbgBJIuT (ORCPT ); Mon, 10 Feb 2020 03:50:19 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D28A41045; Mon, 10 Feb 2020 00:50:18 -0800 (PST) Received: from entos-d05.shanghai.arm.com (entos-d05.shanghai.arm.com [10.169.40.35]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 27F1B3F68F; Mon, 10 Feb 2020 00:50:12 -0800 (PST) From: Jianyong Wu To: netdev@vger.kernel.org, yangbo.lu@nxp.com, john.stultz@linaro.org, tglx@linutronix.de, pbonzini@redhat.com, sean.j.christopherson@intel.com, maz@kernel.org, richardcochran@gmail.com, Mark.Rutland@arm.com, will@kernel.org, suzuki.poulose@arm.com, steven.price@arm.com Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Steve.Capper@arm.com, Kaly.Xin@arm.com, justin.he@arm.com, jianyong.wu@arm.com, nd@arm.com Subject: [RFC PATCH 9/9] arm/arm64: Add kvm capability check extension for ptp_kvm Date: Mon, 10 Feb 2020 16:49:06 +0800 Message-Id: <20200210084906.24870-10-jianyong.wu@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200210084906.24870-1-jianyong.wu@arm.com> References: <20200210084906.24870-1-jianyong.wu@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Let userspace check if there is kvm ptp service in host. Before VMs migrate to another host, VMM may check if this cap is available to determine the next behavior. Signed-off-by: Jianyong Wu Suggested-by: Marc Zyngier --- include/uapi/linux/kvm.h | 1 + virt/kvm/arm/arm.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index f0a16b4adbbd..ca29f6a09c30 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -1009,6 +1009,7 @@ struct kvm_ppc_resize_hpt { #define KVM_CAP_PPC_GUEST_DEBUG_SSTEP 176 #define KVM_CAP_ARM_NISV_TO_USER 177 #define KVM_CAP_ARM_INJECT_EXT_DABT 178 +#define KVM_CAP_ARM_KVM_PTP 179 #ifdef KVM_CAP_IRQ_ROUTING diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c index 8de4daf25097..9cad433507df 100644 --- a/virt/kvm/arm/arm.c +++ b/virt/kvm/arm/arm.c @@ -223,6 +223,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) case KVM_CAP_ARM_IRQ_LINE_LAYOUT_2: case KVM_CAP_ARM_NISV_TO_USER: case KVM_CAP_ARM_INJECT_EXT_DABT: + case KVM_CAP_ARM_KVM_PTP: r = 1; break; case KVM_CAP_ARM_SET_DEVICE_ADDR: -- 2.17.1