lkml.org 
[lkml]   [2015]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 4/5] KVM: add KVM_USER_EXIT vcpu ioctl for userspace exit
From
Date


On 06/08/2015 15:44, Radim Krčmář wrote:
>> > 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 ...

Yes.

> The two obvious extensions are flags to skip kvm_make_request() or
> kvm_vcpu_kick(), both of dubious use.

Skipping kvm_make_request() would make some sense if you can set
vcpu->run->request_interrupt_window asynchronously. So you could do

vcpu->run->request_interrupt_window = 1;
ioctl(vcpu_fd, KVM_USER_EXIT, KVM_USER_EXIT_LAZY);

and only cause a lightweight vmexit if the interrupt window is currently
closed. I haven't thought of any races that could happen, but it looks
like it could work.

Skipping kvm_vcpu_kick() makes much less sense.

> 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?

Yeah, that would work for me as well. Also because, for now, you'd
return EINVAL if the unsigned long is not zero, which boils down to
"return EINVAL if the parameter is not NULL". :)

Paolo


\
 
 \ /
  Last update: 2015-08-06 16:21    [W:0.077 / U:1.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site