Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1172146pxk; Fri, 4 Sep 2020 02:32:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygZ5z+1UcJcyMG1/zltyjMd5czHS6GNUtZ6SugP/z8i2QD2L14yf8Jeb3ts0/KNlMglCV9 X-Received: by 2002:a05:6402:326:: with SMTP id q6mr7555197edw.216.1599211976612; Fri, 04 Sep 2020 02:32:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599211976; cv=none; d=google.com; s=arc-20160816; b=fqkKYenqb2+YSOA18TNFBC3oU4zXiV8L+7ZsnoymK4roRlYUzYemDv6PUIMSds+Vf6 /LHU7ntVumdn+w5JM0q0dIE1cCeglZC2XSCQuQWf+8j6WRCnF6md/MVzZUzpwRESJUSV N1MkO0S+ai24E1pZdW21hjamyCo0VkC+BKx5/f3seRIXVxMfYuFvxZdGY6V/j+kGr4rE J+9yDkFmJtqtJOePMEnRFqXBVwUW5wbotnY1DoU01+trzK0XuoEuoVq9kGVdHTxZa2c5 1vGjn8TS85qdMtMcYrqwIGNd3n8SZzpki241DfMWEh1Zeb8WU+FCy/butNV09c5ZJlbe vo8Q== 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=WhQw18PiY4kzRj5eJOVtxIWtCn7PltEpjK9UoaoxtYM=; b=geBcypFdHDOntoTFVHHHvMoryOlsK8ejxF9GK85Ck2S4RVzZWha1cnaLC/A/L0CM5B lkqjFW/xzkZspSs/a73M9EP5tYIfkoutZ/JYXv08asU8gEk2UM/aNhzqf30TZWdpVFWX zolwCGr4MKUtagmbfCMMgFxGSncOvKsJwSYym4fRPHBSjD2qGX4gqjLUvlbZcFUcMdta /gcT8CAMh3WNqN5S/DSiIwcuYUYc4vEWukzH4XlrDLdDcOFwO1jRkwfkDtT3Ab3HQqhw JCgEdAFbkmdEONeGE7kU6+9Re5z6LvmiD576DxCo7dClEtIUMQprQWfGIpaQGMqcCTUT ALqg== 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 g20si4059560ejz.452.2020.09.04.02.32.34; Fri, 04 Sep 2020 02:32:56 -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 S1730262AbgIDJaG (ORCPT + 99 others); Fri, 4 Sep 2020 05:30:06 -0400 Received: from foss.arm.com ([217.140.110.172]:46976 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730251AbgIDJaA (ORCPT ); Fri, 4 Sep 2020 05:30:00 -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 410CD152F; Fri, 4 Sep 2020 02:30:00 -0700 (PDT) Received: from localhost.localdomain (entos-thunderx2-desktop.shanghai.arm.com [10.169.212.215]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 841153F66F; Fri, 4 Sep 2020 02:29:54 -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, justin.he@arm.com, jianyong.wu@arm.com, nd@arm.com Subject: [PATCH v14 10/10] arm64: Add kvm capability check extension for ptp_kvm Date: Fri, 4 Sep 2020 17:27:44 +0800 Message-Id: <20200904092744.167655-11-jianyong.wu@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200904092744.167655-1-jianyong.wu@arm.com> References: <20200904092744.167655-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 691d21e4c717..8e99ad2f0b83 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -178,6 +178,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_PTP_KVM: +#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 f6d86033c4fa..dd58ebe0daf5 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -1035,6 +1035,7 @@ struct kvm_ppc_resize_hpt { #define KVM_CAP_LAST_CPU 184 #define KVM_CAP_SMALLER_MAXPHYADDR 185 #define KVM_CAP_S390_DIAG318 186 +#define KVM_CAP_ARM_PTP_KVM 187 #ifdef KVM_CAP_IRQ_ROUTING -- 2.17.1