Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4294598ybz; Mon, 20 Apr 2020 20:28:55 -0700 (PDT) X-Google-Smtp-Source: APiQypLNC8BWLaJ5mpxS08XNdnBToGQ4+sPiCP4spDYrcbV1OOLrkD7KYFDGBXBqO5/MPBgonzxx X-Received: by 2002:a17:906:24c2:: with SMTP id f2mr19390861ejb.285.1587439734894; Mon, 20 Apr 2020 20:28:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587439734; cv=none; d=google.com; s=arc-20160816; b=KEo49jxcxyhAhPB0ksWdEB5amb03TGSuz9AWmZ+XqAevIBURZpTCvcoQDZlkig1pBZ 6YsDbbsGvBoRFfmYSMdKqPnHeY8KXRAPacXJQnRBs/Xa3SeNag70Tb1Vej0YINY2guZ/ aItEPJa+MjKzxDBDN7rVfnuTyRSmZtKnEI94eU3rQjocs6hmDclmWN/TKWuVRJL3RqyT 9OzLD6VhudwyM+EDVtDAqtsrWKLYBkEoJEuEvM6j3u2mbNmhmPpplQnhI2kakYI9jIqQ wIHwU5TwxY6TYRrSXP8bAmZYVb9G5ZEbuDJqgCDyLedQc1pHvMylVYN15f1qzuvWMGL9 G0pg== 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=FTpTUkwFlMHFCInyhinsajAD9u8mXus8OYX8OBnVbQQ=; b=yKBbWTqMib7U0jdY756MG/NtJLCAUd6naq4u5f7ekkNTWUwgZlEvz7szw7wdwlBOhy 5WB1OjACNMPr3sDAcdiYY8Ri9GFhDfyFdqo/4gaK3vpsr+wNq1hAtsGPa/Xf5qEBI5oQ SFJwS8Dyw5bOXLC6fDKpDhRwSKZSNQUt2Qw3weoh01Hz6oNxLEhE6Wb5WzH0MvGlgtU/ TyNgv1MdnChuMGbVmtHhAjmTnGNtBvqB9Exy5luF73QosZ7NmgRArPxiqo8r3OzpTcV3 yZ1SfkBhzJwxUR48nZ/lKXDFbHinkUt6carlhTVvA9HQ48ggbvT1OCZykOjTTW9ouF+Q a6Cw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ov7si757248ejb.489.2020.04.20.20.28.32; Mon, 20 Apr 2020 20:28:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728488AbgDUDYa (ORCPT + 99 others); Mon, 20 Apr 2020 23:24:30 -0400 Received: from foss.arm.com ([217.140.110.172]:57586 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726793AbgDUDY2 (ORCPT ); Mon, 20 Apr 2020 23:24:28 -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 33C3D31B; Mon, 20 Apr 2020 20:24:28 -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 0D03A3F6CF; Mon, 20 Apr 2020 20:24:21 -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, 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 v11 9/9] arm64: Add kvm capability check extension for ptp_kvm Date: Tue, 21 Apr 2020 11:23:04 +0800 Message-Id: <20200421032304.26300-10-jianyong.wu@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200421032304.26300-1-jianyong.wu@arm.com> References: <20200421032304.26300-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 another host, VMM may check if this cap is available to determine the next behavior. 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 428c7dde6b4b..668049ad78e1 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -1017,6 +1017,7 @@ struct kvm_ppc_resize_hpt { #define KVM_CAP_S390_VCPU_RESETS 179 #define KVM_CAP_S390_PROTECTED 180 #define KVM_CAP_PPC_SECURE_GUEST 181 +#define KVM_CAP_ARM_KVM_PTP 182 #ifdef KVM_CAP_IRQ_ROUTING diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c index 48d0ec44ad77..4726a88949f5 100644 --- a/virt/kvm/arm/arm.c +++ b/virt/kvm/arm/arm.c @@ -195,6 +195,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) case KVM_CAP_ARM_IRQ_LINE_LAYOUT_2: case KVM_CAP_ARM_NISV_TO_USER: case KVM_CAP_ARM_INJECT_EXT_DABT: + case KVM_CAP_ARM_KVM_PTP: r = 1; break; case KVM_CAP_ARM_SET_DEVICE_ADDR: -- 2.17.1