Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5770256ybp; Tue, 15 Oct 2019 04:55:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqz2QlRJlHCPe0UkCTw1q+M+EVn85baY8p0zfOx2uvi1bObDumuPpQrzfXkGKrhA1x/Ww7Jq X-Received: by 2002:aa7:c6cf:: with SMTP id b15mr32800450eds.215.1571140509648; Tue, 15 Oct 2019 04:55:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571140509; cv=none; d=google.com; s=arc-20160816; b=p34WUYMG8wC+ixIHgKw+AmSFSuxRAPq2j9DULtJBol82h8bHhBpwuoj83fM1iyLOku /ZRRy1FygFOyV87Pj2mUFIJz973v35xkZpT5FrgQdhvKYECwCRw9As+Q3tSvrqODDFKR 8vEuSQYUF0Izm6WrlLDXucmMvqr9Mk4AWfz7rXQUE6tbPDWgaveysaDSWPGF0Upi27Cf ewyyolAcwvWQlqm8bodgSJIlN7XljAqJ+C65vPm2pQgrJ1BOYL6SEbNKtVfTWR9PDlmO JTVnkJzkngrK+EjHnrLIo7FiHYON3Jo8C+CHZs3HQhljBf4wvIN1M2yw97I55uEnJoo+ tupg== 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=YI0f2+s3RctQpYkYs8NGIYSysPZmcqvQd++3yrQsQ75DZJUyNzZPSHGORH1GoRHoiu SBER0d3GSIefgkrqqBJ4B+zWEDUYjSVEv/Fjbfi2yYcDRgS1d9DnnXQbLAfUXdlqbXsp k/LmhUD48kfoAcLKme3nhczePaT90wX5I5jqkmhxY91Ujzpa37nmQwftgBx4K9ilo+4l cl7NNPq7EgPgV2T+LB/QFuEqu6Fe7KIvUUnPjgrNhI8g/3BKkLxWQnfV7MG6/PbBx0TN 8LrM1FhK6WF5sGTgzWdsd4Vlrz6dvM+fCeb/UzBCN7+EIXYsOexyfMPWpAMwysbsfQG6 2HWw== 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 c21si12843102ejx.295.2019.10.15.04.54.46; Tue, 15 Oct 2019 04:55:09 -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 S1731535AbfJOKt3 (ORCPT + 99 others); Tue, 15 Oct 2019 06:49:29 -0400 Received: from foss.arm.com ([217.140.110.172]:35240 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731470AbfJOKtZ (ORCPT ); Tue, 15 Oct 2019 06:49:25 -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 1742D28; Tue, 15 Oct 2019 03:49:25 -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 240B03F68E; Tue, 15 Oct 2019 03:49:19 -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 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: [PATCH v5 6/6] kvm: arm64: Add capability check extension for ptp_kvm Date: Tue, 15 Oct 2019 18:48:22 +0800 Message-Id: <20191015104822.13890-7-jianyong.wu@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191015104822.13890-1-jianyong.wu@arm.com> References: <20191015104822.13890-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