Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6383292ybe; Wed, 18 Sep 2019 02:32:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqweHNgXPgWA1GrwI8mrh2jzqyYJzuSn6SSt+sZbrS+VBYZONMdyi7DbTVG/9J4QFcBbMihj X-Received: by 2002:a50:aa96:: with SMTP id q22mr9130175edc.179.1568799166444; Wed, 18 Sep 2019 02:32:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568799166; cv=none; d=google.com; s=arc-20160816; b=AyjC3P2nVze5bgbxO7fxooYy1axJ8+JgYo/Md/x2nMP3QYpKvpX8YcjOnxi/vrrlT8 q8InG32yCKVLTAzy2Y8BE5yDGYmFJNW/LKoZm/Mx7xq20TNJXsepY/nCURA9EXHgWDx+ alIaEiPvNaVHYTXMewglYZDeKt8OQmGjDhMY3EuHaoQVDHAASE4azOlYpSrNh6ewSKWl RV8d3AsLqZLlwhZ3Sd+JHUcoElx7nmw24mMotyPt7JxIygd3JPn8xDnMCAEF3YhLcalQ EOveBoda2QY38DpA9elwysJofsQsvIArBMUjguxHkKrd7VpwlGZ/8+Zq1nkyMJqrGPCW FGHw== 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=CbrHcrFf4DFfP8azjY2KjFoSXbfN1eQC4j7sXVn88O5Xzzl/jsbbQJbbw+2kwJVVvw 0Qek3F6y7dp6f91hZINRQR2zk305icqMefsOY6EzLHgdzoAul5BfJgny+p3LCUOjmI0P IBRhI3BDub55d29C1m5Loj7OpHm3+ZBEr1byWO9AeVvyQGfaEZkpKfbaH6ooKlnGnl24 29bTQ/HnN8Iha7EnWm/z+nuvTlXIj7OjQoHjFOqemUQ67JUACMhGNAo9JV5/Ko+VJtPr CpydiZpBX36T/VaSTPchWTXcqhkHXkE65CDbTt7jgdj0OvKG4SVRl5AZLDmXE8OhEfrz aVDw== 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 y17si2732377edt.101.2019.09.18.02.32.22; Wed, 18 Sep 2019 02:32:46 -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 S1729833AbfIRIIJ (ORCPT + 99 others); Wed, 18 Sep 2019 04:08:09 -0400 Received: from foss.arm.com ([217.140.110.172]:36890 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729751AbfIRIID (ORCPT ); Wed, 18 Sep 2019 04:08:03 -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 D5C8228; Wed, 18 Sep 2019 01:08:02 -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 1DAAF3F59C; Wed, 18 Sep 2019 01:07:57 -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, kvm@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: [RFC PATCH v3 6/6] kvm: arm64: Add capability check extension for ptp_kvm Date: Wed, 18 Sep 2019 04:07:16 -0400 Message-Id: <20190918080716.64242-7-jianyong.wu@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190918080716.64242-1-jianyong.wu@arm.com> References: <20190918080716.64242-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