Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754637AbbHFOqK (ORCPT ); Thu, 6 Aug 2015 10:46:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43148 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753969AbbHFOqD (ORCPT ); Thu, 6 Aug 2015 10:46:03 -0400 Date: Thu, 6 Aug 2015 15:44:15 +0200 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH v2 4/5] KVM: add KVM_USER_EXIT vcpu ioctl for userspace exit Message-ID: <20150806134415.GB31952@potion.brq.redhat.com> References: <1438792381-19453-1-git-send-email-rkrcmar@redhat.com> <1438792381-19453-5-git-send-email-rkrcmar@redhat.com> <55C23B91.4010900@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <55C23B91.4010900@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1227 Lines: 33 2015-08-05 18:36+0200, Paolo Bonzini: > On 05/08/2015 18:33, Radim Krčmář wrote: >> +4.97 KVM_USER_EXIT >> + >> +Capability: KVM_CAP_USER_EXIT >> +Architectures: x86 >> +Type: vcpu ioctl >> +Parameters: struct kvm_user_exit (in) >> +Returns: 0 on success, >> + -EFAULT if the parameter couldn't be read, >> + -EINVAL if 'reserved' is not zeroed, >> + >> +struct kvm_user_exit { >> + __u8 reserved[32]; >> +}; > > Can we just return EINVAL if the parameter is not NULL? It complicates handling if we extend the ioctl, but removes the useless clearing/copying/checking now ... The two obvious extensions are flags to skip kvm_make_request() or kvm_vcpu_kick(), both of dubious use. Another possibility is setting up conditional exits, but that would be better as a separate control, like most other sophisticated extensions. I think that u32 flags would be sufficient -- is casting the 'unsigned long arg' (data pointer) to a value still an accepted solution? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/