Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1946187ybn; Thu, 26 Sep 2019 04:46:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqy13rjyja/yvONS8MKmvOyo7AiniGR9pdhO2hM7gZeTxgvXA6dB9jGA7bQH+ufXdacm1h80 X-Received: by 2002:a50:e691:: with SMTP id z17mr3090958edm.84.1569498367112; Thu, 26 Sep 2019 04:46:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569498367; cv=none; d=google.com; s=arc-20160816; b=AERsetJFYM3exzqX5tIY8Rd4MIl2H0IntH5UM1d+VfPIoJR+TH0rWvlogoenV4ktbU 49DhIQUvgIAjTlgYMGl9XLms1J0vv73zHddcrJ92HMwVp8Kq86uiUjewTtrYYeIQm1+M l6AlcwmHZ0YY4FhillE1VdzsACb0Fq51zMD9xLcB6MmbphP0d7oTC/UH0sQaape56weA vLUdeFKJHvvkmgsR/JW4uEjgTaFll5STKvJBAepZxlPJPD6Jqj+m65lgjAZXeXkuBCAj Op319uY6R+DHf8/ptpIZNXiAfbcNYOoz5xlmALB4q1abSHaDVlJZIQ1VJSlifjmVJQPS GCYQ== 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=kIeRWd2ENoKsyjHquVvjhHPVLel8UTzuZnG2Ch0hxwA/azt+CyJC9n9NO1+HGsMkY8 SgtIFR3ggm9hp/iAE1s85aB+wexLwK7uFFIDjg0x4w0pGkvPIIo5pi9FeNgGaDC0OPnM nahuFaC5YXKdYA/R3Jm0Ptx9R0/QqPPzWD46IbeCKoBCJ4dkz2qldDGxwdFurLI5NivZ SRQQcPaWZOYZ8a0FmvZR7EhUNVzfO0eZfNIypBaYcCJ8By3/U0L/blJ8Z0z/LbcZjDTX 0P2Kqr9mVAOGLBCNNK1YSezF2PlHjx+6cWJdsCLyz5mlOkKNG0LTD8cPacjLtZhIODqd MwEQ== 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 ca4si888544ejb.39.2019.09.26.04.45.43; Thu, 26 Sep 2019 04:46:07 -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 S1726795AbfIZLmv (ORCPT + 99 others); Thu, 26 Sep 2019 07:42:51 -0400 Received: from foss.arm.com ([217.140.110.172]:47178 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726710AbfIZLmt (ORCPT ); Thu, 26 Sep 2019 07:42:49 -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 9D9BF142F; Thu, 26 Sep 2019 04:42:48 -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 EC5613F67D; Thu, 26 Sep 2019 04:42: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.Deacon@arm.com, 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: [RFC PATCH v4 5/5] kvm: arm64: Add capability check extension for ptp_kvm Date: Thu, 26 Sep 2019 19:42:12 +0800 Message-Id: <20190926114212.5322-6-jianyong.wu@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926114212.5322-1-jianyong.wu@arm.com> References: <20190926114212.5322-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