Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp460751ybt; Fri, 19 Jun 2020 06:06:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzklRb4LTluv6bM6vLbuS3fyhPG1IOrW6XL2USBKObHJ4xpHOCOBQH+ZL9VkY66y94AWFDe X-Received: by 2002:a17:906:11d9:: with SMTP id o25mr3443361eja.377.1592572011220; Fri, 19 Jun 2020 06:06:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592572011; cv=none; d=google.com; s=arc-20160816; b=ehIvAY2jVOsalRcbeDBh5Y9uJLvXaaMbYNrLH4hDzJbQkVFaECyAe68vxoNDTh/xW7 GYwaiYxOmoWwDXwZy8ZiZZeQOZyRb7vJkglHT6KRz8+zyywDhXNWXlWYZkMfM1993KH8 dZ3GxueWy1m6oQrsc7dNH35Dh7i+T46SPWmuF/+Rh/jDwql8cq0Y6hBr+seK/Hmox9dQ PF1ia2r1Rksmb5LucgRGs0Pd2WxM4wlfamxNlHEd4qZoArAMko4wHpXCLjm4uS2xyhoC B5rTbHIe+QsJ9DfyllcWVLO77AJw0eXRGHSo/aTiDh2RehScf16Ves46AOaLks9mY9Zh 8lDQ== 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=EFTsv129kUtYg7qAI9hkSBpYYbFZ7V6kUYwNicV+J2gbILF5K1YsHZGF41Nq8wUqpG WTx1ebP10AoKPms7j26Ecu4z45CumWn3wDbbxVTxg/ehe/7BKfeW/MGBTSZp/9JlKJVo eUxk6noF6OIJiVtii4wHmBy9nb6vEi80yZ0cwf4B/nSpHwYaUQNniwU6jdezI5LNIRVK UxVjDrW3sH2QtVd5L1vFyh/5I4m+wq/0Tg760vAVmWcEjjW6yWrly2YOJJJtMbmGk1tO 2eDeC4cX/GSlJXGv1PU0vnwCFaiauQmy6vtJPB5ATeH1Dz3UVJoAFjF4/0iMKiXNfoNZ HGZg== 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 b24si3895385edx.176.2020.06.19.06.06.29; Fri, 19 Jun 2020 06:06:51 -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 S1733032AbgFSNCv (ORCPT + 99 others); Fri, 19 Jun 2020 09:02:51 -0400 Received: from foss.arm.com ([217.140.110.172]:57638 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733002AbgFSNCl (ORCPT ); Fri, 19 Jun 2020 09:02:41 -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 17DFC11B3; Fri, 19 Jun 2020 06:02:40 -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 D51983F6CF; Fri, 19 Jun 2020 06:02:33 -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: [PATCH v13 9/9] arm64: Add kvm capability check extension for ptp_kvm Date: Fri, 19 Jun 2020 21:01:20 +0800 Message-Id: <20200619130120.40556-10-jianyong.wu@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200619130120.40556-1-jianyong.wu@arm.com> References: <20200619130120.40556-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