Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5534589ybe; Tue, 17 Sep 2019 09:23:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkrL1vMgdLFi7wFg96AkT7ZtA9dkn2nRc8xLiXAvrIVHxtrxFUiXJvxdzUwvMv2WAIXe30 X-Received: by 2002:a05:6402:1a4c:: with SMTP id bf12mr5599825edb.277.1568737430548; Tue, 17 Sep 2019 09:23:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568737430; cv=none; d=google.com; s=arc-20160816; b=Uj0L4ZfL9Ql6FBYVHy8wHp80Gn7Tz4XUasTslSJgt97ELRmRKRMAJzh5cC2Ij9kFTm 3kC3IcerKmOWCfOpxOPqDzI+hpMpt65O4TrOkXMQPctpWOW0eG1S4Uukn1mSEF1/XLBo zUtREXq4X5LdY7L0QqyUYdAAvMzQouuAYRMP6LKlbiFoKTrnZRUyJpb+QAR6tdpDzNif WwtPvNlDDKKWFqMv6Rvx60uDYf8YGnwRlwuBfNM84Y1bnzfOQzwXQiDUtCTeCfZzF5FG iJ3ffHuazTiB1seXbbhT3zIr0wivckPPn7jskgXuzte8Z0x8Ue48A6AaUfMKpAA5XLqi xFTg== 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=V9fbCDW8KDCeDQ8CVI8noB1RYmUbDe4e0o+JDj+oHb4Ek2qQXx9CuhQxwbT+441aQT 2Jvj4VJn/L6YlzqhfszOKrzpnMUH/gf4ij51Z18maMo/QiZ3OEG9mkpqof1eVwI5TTJ5 DA+MGhgcReAn7X+Z8TDYL95fJvbiKNckdkBPlCbA1mKjNHWpJ72nHyaFaFZu6FYTzi2E H34pj19BAd/dheA5CESaH/WiAO//t9eeZFgTOz6edYFxkooK/Xe+UoQs/CrK7Qre81JW 0F+scdTPkk3LlTNn8EjlfBS9JSxuVj+p7n6aiIFNaFsVXMGQc5StIGDAbIwEEDqgkoZg HmgA== 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 jr9si1408740ejb.118.2019.09.17.09.23.26; Tue, 17 Sep 2019 09:23:50 -0700 (PDT) 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 S1727591AbfIQLZZ (ORCPT + 99 others); Tue, 17 Sep 2019 07:25:25 -0400 Received: from foss.arm.com ([217.140.110.172]:54714 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727478AbfIQLZU (ORCPT ); Tue, 17 Sep 2019 07:25:20 -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 B5F5E1000; Tue, 17 Sep 2019 04:25:19 -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 D0F253F59C; Tue, 17 Sep 2019 04:25:16 -0700 (PDT) From: Jianyong Wu To: netdev@vger.kernel.org, pbonzini@redhat.com, sean.j.christopherson@intel.com, maz@kernel.org, richardcochran@gmail.com, Mark.Rutland@arm.com, Will.Deacon@arm.com, suzuki.poulose@arm.com Cc: linux-kernel@vger.kernel.org, Steve.Capper@arm.com, Kaly.Xin@arm.com, justin.he@arm.com, jianyong.wu@arm.com, nd@arm.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH 6/6] kvm: add kvm ptp capability extension for arm64 Date: Tue, 17 Sep 2019 07:24:30 -0400 Message-Id: <20190917112430.45680-7-jianyong.wu@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190917112430.45680-1-jianyong.wu@arm.com> References: <20190917112430.45680-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