Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2704532ybc; Mon, 25 Nov 2019 02:48:31 -0800 (PST) X-Google-Smtp-Source: APXvYqyI6YbtvNN6iwhSFMtH2j++KToYlb1t13nYj3MavXPiojWvNgSvtw5inWEUugonkHmF+1xH X-Received: by 2002:a05:6402:611:: with SMTP id n17mr17601352edv.143.1574678911256; Mon, 25 Nov 2019 02:48:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574678911; cv=none; d=google.com; s=arc-20160816; b=KMyeRp//G/+yCJAU5y6/kg3MsN9BAhJop7FnhEDb36p9j2wcQu0Sz8Lzqc4Oc4NhWm YkxQX/hVx5NtrnTf6+NOLYfO7DCe01pxRDZjFwBFpGlSO/3qJkFJqGRb3AvrWLu0BrYx XKznw3sa5KFWS2jCy+YjP2QyX7cjq1ICpTmeA+SkvYduTgGZqtWhvbxbA9bJxj9FkkBO xaK53cnvl3DPtpt20twDbzYanynFrbKa+cyrXg3pLe/xguJYU+ae0xeY35xYkAQoKPKU RytxOCLmn0lFwTE/9i/dp7T//rylSeT263yLhQAWIS4CrdIrsbVxHqEEh+oBaRqdDg9Z 09ag== 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=achmyVYwLDZNIBjOxT5ysfu7i09MUm76WMU8D8UhDf0=; b=CaSUngX9f8Opft4fFma7vPFSUG9fgaXNCTXMg3ywFPrPZKPFBN4oLGGor3oFSeDToa qfH0/FVTK7TRIFgFnUqwnoTZb7GCoWgm2/arVJhv95AwjHZSXlCfLX0iK+aDUIEpNcnt zJMLEUDvzA41AR85ieoDivzF5a5d177PWCuJHXdvDkW6m+amWl7rNURTXLOSDg4wLztS R95n6DUj7oeVu/9fHrxukgUNlL6eon6gsfHksM/awUHr7I2tp76L0JkCVjk/fMLeE1Z0 foXux0Vpvpngvp7ZXXVZ44pWVLnQkDAHCOktdYffPVdN2NI21C64R5QKYYklQwNTBo3X 7jNQ== 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 l27si4330829eji.208.2019.11.25.02.48.07; Mon, 25 Nov 2019 02:48:31 -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 S1727783AbfKYKqU (ORCPT + 99 others); Mon, 25 Nov 2019 05:46:20 -0500 Received: from foss.arm.com ([217.140.110.172]:48228 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727767AbfKYKqR (ORCPT ); Mon, 25 Nov 2019 05:46:17 -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 13B8B328; Mon, 25 Nov 2019 02:46:17 -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 DCB133F52E; Mon, 25 Nov 2019 02:46:11 -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 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 v8 8/8] kvm: arm64: Add capability check extension for ptp_kvm Date: Mon, 25 Nov 2019 18:45:06 +0800 Message-Id: <20191125104506.36850-9-jianyong.wu@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191125104506.36850-1-jianyong.wu@arm.com> References: <20191125104506.36850-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 a another host, VMM may check if this cap is available to determine the migration behaviour. 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 2fe12b40d503..a0bff6002bd9 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -993,6 +993,7 @@ struct kvm_ppc_resize_hpt { #define KVM_CAP_ARM_SVE 170 #define KVM_CAP_ARM_PTRAUTH_ADDRESS 171 #define KVM_CAP_ARM_PTRAUTH_GENERIC 172 +#define KVM_CAP_ARM_KVM_PTP 173 #ifdef KVM_CAP_IRQ_ROUTING diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c index bd5c55916d0d..80999985160b 100644 --- a/virt/kvm/arm/arm.c +++ b/virt/kvm/arm/arm.c @@ -201,6 +201,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) case KVM_CAP_MP_STATE: case KVM_CAP_IMMEDIATE_EXIT: case KVM_CAP_VCPU_EVENTS: + case KVM_CAP_ARM_KVM_PTP: r = 1; break; case KVM_CAP_ARM_SET_DEVICE_ADDR: -- 2.17.1