Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4914378ybl; Mon, 9 Dec 2019 19:43:29 -0800 (PST) X-Google-Smtp-Source: APXvYqycSfBOT2gt6A6nlRvDP+cYR/8CeaiKEKIQ+LMhPgmzMMk5oZeOwt/zZQCEm18rb1IueWxb X-Received: by 2002:a05:6830:56a:: with SMTP id f10mr17199118otc.368.1575949409373; Mon, 09 Dec 2019 19:43:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575949409; cv=none; d=google.com; s=arc-20160816; b=YjvJpJodl+YDObMSZQDPVw2RPzMm7xJElpEi3+YI5ik69zvzP6P/JWvDsALSM9Kjpe N2STAAVQ80nJmo5LqHFAH7mwtsfjAHc3QFAgmIRgIbic1HHKvJ5rphjVoBpv+tZRUgwX jtTo6vyv9eCjW3buSReRj2qsv0V97hTkBvEOUBUiuDjDxax+o1jcMFme9jrCWo3RtHp7 zXZ/UDqtl3UwDvWsKsCt7yf9pfHtMdlMQ2p3nftOkoow7x4omnplgG7+JShr9PkzAUyz 1WiVistj977K9S+gFvC+ohKbvH0A59YA+ZiDmfiBM2Mj7eV+KAYn9dfygLOxfgFeLN8X 9r8A== 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=pVEOTU7z722bGRlkIRv6UDSdGeQ2SE2pqNphPoUUjv4DsfAdOfACmOFcIyUxD7zlu7 J517Ql4LR42WXF2ZgItXRYAf3VCEuBL1qLU72v+dJs/0S/6w7LjOvCpWh/uwsAYGsI3z ZbvLEoTQqt8SHlZvqyUvd6I1n2hcURMsmwokXJ6b9vohKnYsdjBHRfu2mQnIbrHAUT+N HeN9DcoGeIbzBAaoq6n9vQ6no1c1iqL9MoH8rapau5DIdCje9nSwH/2hr6u20PwHn/aS sjetM4NPu40SKy9Na9nCND1dxcbsVApbUeHzx+islVc2KtyhBHY7F+xNJjGXi47HePyc DBWg== 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 v1si1132674otq.141.2019.12.09.19.43.16; Mon, 09 Dec 2019 19:43:29 -0800 (PST) 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 S1727351AbfLJDlZ (ORCPT + 99 others); Mon, 9 Dec 2019 22:41:25 -0500 Received: from foss.arm.com ([217.140.110.172]:56054 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727325AbfLJDlZ (ORCPT ); Mon, 9 Dec 2019 22:41:25 -0500 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 6B3B51FB; Mon, 9 Dec 2019 19:41:24 -0800 (PST) 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 51CEA3F52E; Mon, 9 Dec 2019 19:41:19 -0800 (PST) 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, jianyong.wu@arm.com, nd@arm.com Subject: [RFC PATCH v9 8/8] kvm: arm64: Add capability check extension for ptp_kvm Date: Tue, 10 Dec 2019 11:40:26 +0800 Message-Id: <20191210034026.45229-9-jianyong.wu@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191210034026.45229-1-jianyong.wu@arm.com> References: <20191210034026.45229-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