From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH v9 2/2] kvm: x86: hyperv: guest->host event signaling via eventfd Date: Thu, 1 Feb 2018 15:56:45 +0100 Message-ID: <20180201145645.GC26932@flask> References: <20180201134832.17259-1-rkagan@virtuozzo.com> <20180201134832.17259-3-rkagan@virtuozzo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Roman Kagan , kvm@vger.kernel.org, Paolo Bonzini , "Denis V. Lunev" , Konrad Rzeszutek Wilk , Vitaly Kuznetsov , David Hildenbrand To: "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:49676 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751378AbeBAO5l (ORCPT ); Thu, 1 Feb 2018 09:57:41 -0500 Content-Disposition: inline In-Reply-To: <20180201134832.17259-3-rkagan@virtuozzo.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 > Reviewed-by: David Hildenbrand > --- > Documentation/virtual/kvm/api.txt | 31 +++++++++++ > arch/x86/include/asm/kvm_host.h | 2 + > arch/x86/include/uapi/asm/hyperv.h | 2 + > arch/x86/kvm/hyperv.h | 1 + > include/uapi/linux/kvm.h | 13 +++++ > arch/x86/kvm/hyperv.c | 103 ++++++++++++++++++++++++++++++++++++- > arch/x86/kvm/x86.c | 10 ++++ > 7 files changed, 161 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/include/uapi/asm/hyperv.h b/arch/x86/include/uapi/asm/hyperv.h > index 1a5bfead93b4..f9ed479d479c 100644 > --- a/arch/x86/include/uapi/asm/hyperv.h > +++ b/arch/x86/include/uapi/asm/hyperv.h > @@ -276,7 +276,9 @@ enum HV_GENERIC_SET_FORMAT { > #define HV_STATUS_INVALID_HYPERCALL_CODE 2 > #define HV_STATUS_INVALID_HYPERCALL_INPUT 3 > #define HV_STATUS_INVALID_ALIGNMENT 4 > +#define HV_STATUS_INVALID_PARAMETER 5 > #define HV_STATUS_INSUFFICIENT_MEMORY 11 > +#define HV_STATUS_INVALID_PORT_ID 17 > #define HV_STATUS_INVALID_CONNECTION_ID 18 > #define HV_STATUS_INSUFFICIENT_BUFFERS 19 > x86/hyperv maintainers, are you ok with this hunk going through the kvm tree? Thanks.