[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] x86/hvm: Allow guest_request vm_events coming from userspace



>>> On 05.08.16 at 09:08, <rcojocaru@xxxxxxxxxxxxxxx> wrote:
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -5349,8 +5349,14 @@ int hvm_do_hypercall(struct cpu_user_regs *regs)
>      switch ( mode )
>      {
>      case 8:        
> +        if ( eax == __HYPERVISOR_hvm_op &&
> +             regs->rdi == HVMOP_guest_request_vm_event )
> +            break;
>      case 4:
>      case 2:
> +        if ( eax == __HYPERVISOR_hvm_op &&
> +             regs->_ebx == HVMOP_guest_request_vm_event )
> +            break;

For one, Coverity will choke on there not being a fall-through
annotation. And then the resulting fall-through behavior is now
wrong: You don't want the 64-bit case to also do the 16-/32-bit
check.

Finally, as indicated before, such a special casing model doesn't
scale well, i.e. as soon as further exception would get suggested
the code would quickly become hard to understand and maintain
(as is already being supported by the issue pointed out above,
addressing of which will likely further convolute this code).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.