public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Roman Kagan <rkagan@virtuozzo.com>
Cc: kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	"Denis V. Lunev" <den@openvz.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	David Hildenbrand <david@redhat.com>
Subject: Re: [PATCH v9 2/2] kvm: x86: hyperv: guest->host event signaling via eventfd
Date: Thu, 1 Feb 2018 15:52:19 +0100	[thread overview]
Message-ID: <20180201145219.GB26932@flask> (raw)
In-Reply-To: <20180201134832.17259-3-rkagan@virtuozzo.com>

2018-02-01 16:48+0300, Roman Kagan:
> In Hyper-V, the fast guest->host notification mechanism is the
> SIGNAL_EVENT hypercall, with a single parameter of the connection ID to
> signal.
> 
> Currently this hypercall incurs a user exit and requires the userspace
> to decode the parameters and trigger the notification of the potentially
> different I/O context.
> 
> To avoid the costly user exit, process this hypercall and signal the
> corresponding eventfd in KVM, similar to ioeventfd.  The association
> between the connection id and the eventfd is established via the newly
> introduced KVM_HYPERV_EVENTFD ioctl, and maintained in an
> (srcu-protected) IDR.
> 
> Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
> Reviewed-by: David Hildenbrand <david@redhat.com>
> ---

Queued, thanks.

> diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
> index fc3ae951bc07..3a3fbcc3377d 100644
> --- a/Documentation/virtual/kvm/api.txt
> +++ b/Documentation/virtual/kvm/api.txt
> @@ -3449,6 +3449,37 @@ array bounds check and the array access.
>  These fields use the same bit definitions as the new
>  H_GET_CPU_CHARACTERISTICS hypercall.
>  
> +4.110 KVM_HYPERV_EVENTFD
> +
> +Capability: KVM_CAP_HYPERV_EVENTFD
> +Architectures: x86
> +Type: vm ioctl
> +Parameters: struct kvm_hyperv_eventfd (in)
> +
> +This ioctl (un)registers an eventfd to receive notifications from the guest on
> +the specified Hyper-V connection id through the SIGNAL_EVENT hypercall, without
> +causing a user exit.

I've added:

+                        SIGNAL_EVENT hypercall with non-zero event flag number
+ (bits 24-31) still triggers a KVM_EXIT_HYPERV_HCALL VM exit.

We might have to extend the interface to optimize this case in the
future, but at least it's not going to bug.

> diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
> @@ -934,6 +934,7 @@ struct kvm_ppc_resize_hpt {
>  #define KVM_CAP_S390_AIS_MIGRATION 150
>  #define KVM_CAP_PPC_GET_CPU_CHAR 151
>  #define KVM_CAP_S390_BPB 152
> +#define KVM_CAP_HYPERV_EVENTFD 153
>  
>  #ifdef KVM_CAP_IRQ_ROUTING
>  
> @@ -1363,6 +1364,8 @@ struct kvm_s390_ucas_mapping {
>  #define KVM_S390_GET_CMMA_BITS      _IOWR(KVMIO, 0xb8, struct kvm_s390_cmma_log)
>  #define KVM_S390_SET_CMMA_BITS      _IOW(KVMIO, 0xb9, struct kvm_s390_cmma_log)
>  
> +#define KVM_HYPERV_EVENTFD	_IOW(KVMIO,  0xba, struct kvm_hyperv_eventfd)

The hypercall number is 0xbd for now.
(Might change until the patches get to kvm/next and the capability
 number is also prone to changing).

  reply	other threads:[~2018-02-01 14:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-01 13:48 [PATCH v9 0/2] kvm: x86: hyperv: guest->host event signaling via eventfd Roman Kagan
2018-02-01 13:48 ` [PATCH v9 1/2] kvm: x86: factor out kvm.arch.hyperv (de)init Roman Kagan
2018-02-01 13:48 ` [PATCH v9 2/2] kvm: x86: hyperv: guest->host event signaling via eventfd Roman Kagan
2018-02-01 14:52   ` Radim Krčmář [this message]
2018-02-01 14:56   ` Radim Krčmář
2018-02-01 19:19     ` KY Srinivasan
2018-02-01 13:51 ` [PATCH v9 0/2] " David Hildenbrand
2018-02-01 13:53   ` David Hildenbrand
2018-02-01 14:08 ` David Hildenbrand

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=20180201145219.GB26932@flask \
    --to=rkrcmar@redhat.com \
    --cc=david@redhat.com \
    --cc=den@openvz.org \
    --cc=konrad.wilk@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkagan@virtuozzo.com \
    --cc=vkuznets@redhat.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox