Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp313583ybt; Fri, 19 Jun 2020 02:37:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUZrqCdVPfYud27ruPrkwmQdvU3X0YXAiYvbhnaiXf6YtUJo5b5VuOMi5pm+ZDVAf5su2j X-Received: by 2002:a17:906:899:: with SMTP id n25mr2618504eje.298.1592559425657; Fri, 19 Jun 2020 02:37:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592559425; cv=none; d=google.com; s=arc-20160816; b=DybbFdcy+8YvGKn5v4/T+REIOZjgCXC/7t2pS1hNNOljNOkV4uJsmRD8NAz+gDEMof KqT8S/X3BsdmQ07BZVISITQaC3spHmkv1bC5MXfllMGNhahdK0I+o13a3ansOQ7TCZtm HN/5+dJ+CHL4fUOG45GSdiE3RfyUlPsXl/pCCWNKtYRocvmB3yanYLxyWDj4jtiY26zc 7anMHBvLFwNykJJd5GEepl7X1gCdCu21edjLr7hrpD2udUitIiPQ9ML1eqxeKXB9Df+U bt6P3V411sY/hQ16+yugrO5WwrssNzYMIqLIN3HbuhJuCAcymLcY3fc899T5Tr1UliK0 MREQ== 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=5oBq+z8ruI0PLt7ILjtw4L/kuNnz6Nlv5cKNuThbheE=; b=NJhEOMi1ukVub/jDKfftQKcxA21808boSitQ0ht+eL7DdxTzMpWCDS6yHitnfElgjs XqzU49bFcCOS6JIaAk+cnlTPKPa4uS/IQac4ceSfTojP15Uj9FY0M4Aw43Co7KDqn/nZ rv9KZOieVLkGYbUcH1DGBqKpvxEjeHfHb4wOAM29weyyn9jl1TyZ8fWiA9MB0CskOkS8 NJjVfUqAOAx0CS/FnJahuZa6y757DQe0KDBxZ07sMLChH8DT4jScjMyAYQQ/N0GggTHK b1oeg2Q8X+UJSrvoNSYL7HmYPbWHBJ+JMgUsrELnSiIsADgWwMx2xHY+ie3P3OXHqWJd hIJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id od24si3561081ejb.103.2020.06.19.02.36.42; Fri, 19 Jun 2020 02:37:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732123AbgFSJcl (ORCPT + 99 others); Fri, 19 Jun 2020 05:32:41 -0400 Received: from foss.arm.com ([217.140.110.172]:49376 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731953AbgFSJbu (ORCPT ); Fri, 19 Jun 2020 05:31:50 -0400 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 1A0F81477; Fri, 19 Jun 2020 02:31:49 -0700 (PDT) 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 D5DBB3F71F; Fri, 19 Jun 2020 02:31:42 -0700 (PDT) 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, Wei.Chen@arm.com, jianyong.wu@arm.com, nd@arm.com Subject: [RFC PATCH v13 9/9] arm64: Add kvm capability check extension for ptp_kvm Date: Fri, 19 Jun 2020 17:30:33 +0800 Message-Id: <20200619093033.58344-10-jianyong.wu@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200619093033.58344-1-jianyong.wu@arm.com> References: <20200619093033.58344-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 --- arch/arm64/kvm/arm.c | 4 ++++ include/uapi/linux/kvm.h | 1 + 2 files changed, 5 insertions(+) diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index 90cb90561446..f41e84346468 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -194,6 +194,10 @@ 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: + +#ifdef CONFIG_ARM64_KVM_PTP_HOST + case KVM_CAP_ARM_KVM_PTP: +#endif r = 1; break; case KVM_CAP_ARM_SET_DEVICE_ADDR: diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 4fdf30316582..f3d4b00dac57 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -1031,6 +1031,7 @@ struct kvm_ppc_resize_hpt { #define KVM_CAP_PPC_SECURE_GUEST 181 #define KVM_CAP_HALT_POLL 182 #define KVM_CAP_ASYNC_PF_INT 183 +#define KVM_CAP_ARM_KVM_PTP 184 #ifdef KVM_CAP_IRQ_ROUTING -- 2.17.1