KVM ARM Archive on lore.kernel.org
 help / color / Atom feed
From: Jianyong Wu <jianyong.wu@arm.com>
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: justin.he@arm.com, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org, nd@arm.com,
	kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 9/9] arm/arm64: Add kvm capability check extension for ptp_kvm
Date: Mon, 10 Feb 2020 16:49:06 +0800
Message-ID: <20200210084906.24870-10-jianyong.wu@arm.com> (raw)
In-Reply-To: <20200210084906.24870-1-jianyong.wu@arm.com>

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 <jianyong.wu@arm.com>
Suggested-by: Marc Zyngier <maz@kernel.org>
---
 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 f0a16b4adbbd..ca29f6a09c30 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -1009,6 +1009,7 @@ struct kvm_ppc_resize_hpt {
 #define KVM_CAP_PPC_GUEST_DEBUG_SSTEP 176
 #define KVM_CAP_ARM_NISV_TO_USER 177
 #define KVM_CAP_ARM_INJECT_EXT_DABT 178
+#define KVM_CAP_ARM_KVM_PTP 179
 
 #ifdef KVM_CAP_IRQ_ROUTING
 
diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c
index 8de4daf25097..9cad433507df 100644
--- a/virt/kvm/arm/arm.c
+++ b/virt/kvm/arm/arm.c
@@ -223,6 +223,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

_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

  parent reply index

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-10  8:48 [RFC PATCH v10 0/9] Enable ptp_kvm for arm/arm64 Jianyong Wu
2020-02-10  8:48 ` [RFC PATCH 1/9] psci: export psci conduit get helper Jianyong Wu
2020-02-10  8:48 ` [RFC PATCH 2/9] ptp: Reorganize ptp_kvm modules to make it arch-independent Jianyong Wu
2020-02-10  8:49 ` [RFC PATCH 3/9] time: Add mechanism to recognize clocksource in time_get_snapshot Jianyong Wu
2020-02-10  8:49 ` [RFC PATCH 4/9] clocksource: Add clocksource id for arm arch counter Jianyong Wu
2020-02-10  8:49 ` [RFC PATCH 5/9] psci: Add hypercall service for ptp_kvm Jianyong Wu
2020-02-10  8:49 ` [RFC PATCH 6/9] ptp: arm/arm64: Enable ptp_kvm for arm/arm64 Jianyong Wu
2020-02-10  8:49 ` [RFC PATCH 7/9] ptp: extend input argument for getcrosstimestamp API Jianyong Wu
2020-02-10  8:49 ` [RFC PATCH 8/9] arm/arm64: add mechanism to let user choose which counter to return Jianyong Wu
2020-02-10  8:49 ` Jianyong Wu [this message]
2020-02-17  2:28 ` [RFC PATCH v10 0/9] Enable ptp_kvm for arm/arm64 Jianyong Wu
2020-03-27  9:35   ` Jianyong Wu
2020-03-27  9:36     ` Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200210084906.24870-10-jianyong.wu@arm.com \
    --to=jianyong.wu@arm.com \
    --cc=Mark.Rutland@arm.com \
    --cc=john.stultz@linaro.org \
    --cc=justin.he@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=nd@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=sean.j.christopherson@intel.com \
    --cc=steven.price@arm.com \
    --cc=suzuki.poulose@arm.com \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.org \
    --cc=yangbo.lu@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

KVM ARM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kvmarm/0 kvmarm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kvmarm kvmarm/ https://lore.kernel.org/kvmarm \
		kvmarm@lists.cs.columbia.edu
	public-inbox-index kvmarm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/edu.columbia.cs.lists.kvmarm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git