Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp92845ybr; Fri, 22 May 2020 01:41:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUThiIQ9jqdFBg8d28Zf1F8tqSpTdKseEo7pb1HAzeWIU5uttIu15UihCti8q1guCFSjgn X-Received: by 2002:a17:906:2455:: with SMTP id a21mr6847072ejb.73.1590136908230; Fri, 22 May 2020 01:41:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590136908; cv=none; d=google.com; s=arc-20160816; b=Mt2KoHVLefTXxEbQwL6KILo6IsFIYIDsmW9vHIpwbaTXWUmwmaLyq8X1+WwW0/B8/Z DVtHop+c0BsLJT/jc19tkoqn0HhT5aIztGEThGMyemX/o2dBX7XTTMzGWApUUGEFSqH6 ujizYzARL0ZAbK//MKRVYoEelXFuaf9+yMcfjMGK/YFpjogK9pSOQJY0bl4O2aIibJOD hYqDfm14qNz9Y5dOqMmkbR3lEZ8NYTAyST1oU+sVNhundklL9n7aa2NnUsqshTYIMaF5 bJDFKunxdKHBYgSOI3un7dRtdcyov5VSNUM8p27NEHkOvaulhY1oPtAklZrxUbcraMfX FHTQ== 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=FTpTUkwFlMHFCInyhinsajAD9u8mXus8OYX8OBnVbQQ=; b=FZxBNDxGSlB0AsIVwDmm+eBWP7f9m8XXQ6fq/LpoECTEs3lACYFLqMqiE2TIsKuw2V l+7GLehj25/ALyt6eKCZqZnV6HiSlegOh4ymtdWnru5BOhteI8cHKsBQzVDMyXqJiV0j p2FwZ5oLuWN7mOmAt68TVEKRM4Rbxr7ejovqEUTh1lwNWiTxRlA9A3OAlZ3yuH6q9bFI /30OOqRQc4PSU+X0H8J62ltMHs2mUoN4Sm6OzATCL9T6Vn9TnEhfOPtu9UYQkuOupwRi QVUu5nLyjRP661lJK/CWfO/e8MRTFOl++tV7vzIjjhOFj6rB7dsThzVF7h54CtSJRVd5 v9mw== 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 mf14si4694027ejb.659.2020.05.22.01.41.25; Fri, 22 May 2020 01:41:48 -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 S1730038AbgEVIiw (ORCPT + 99 others); Fri, 22 May 2020 04:38:52 -0400 Received: from foss.arm.com ([217.140.110.172]:59546 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730007AbgEVIiu (ORCPT ); Fri, 22 May 2020 04:38: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 261651063; Fri, 22 May 2020 01:38:50 -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 2C1D33F52E; Fri, 22 May 2020 01:38:43 -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 v12 11/11] arm64: Add kvm capability check extension for ptp_kvm Date: Fri, 22 May 2020 16:37:24 +0800 Message-Id: <20200522083724.38182-12-jianyong.wu@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200522083724.38182-1-jianyong.wu@arm.com> References: <20200522083724.38182-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 428c7dde6b4b..668049ad78e1 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -1017,6 +1017,7 @@ struct kvm_ppc_resize_hpt { #define KVM_CAP_S390_VCPU_RESETS 179 #define KVM_CAP_S390_PROTECTED 180 #define KVM_CAP_PPC_SECURE_GUEST 181 +#define KVM_CAP_ARM_KVM_PTP 182 #ifdef KVM_CAP_IRQ_ROUTING diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c index 48d0ec44ad77..4726a88949f5 100644 --- a/virt/kvm/arm/arm.c +++ b/virt/kvm/arm/arm.c @@ -195,6 +195,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