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

Re: [Xen-devel] [PATCH v4 08/16] xen: Add limited support of VMware's hyper-call rpc



On 09/12/14 09:37, Boris Ostrovsky wrote:
> On 09/11/2014 02:36 PM, Don Slutz wrote:
>> @@ -6142,6 +6148,43 @@ long do_hvm_op(unsigned long op, 
>> XEN_GUEST_HANDLE_PARAM(void) arg)
>>           break;
>>       }
>>   +    case HVMOP_get_vmport_guest_info:
>> +    case HVMOP_set_vmport_guest_info:
>> +    {
>> +        struct xen_hvm_vmport_guest_info a;
>> +        struct domain *d;
>> +
>> +        if ( copy_from_guest(&a, arg, 1) )
>> +            return -EFAULT;
>> +
>> +        rc = vmport_rpc_hvmop_precheck(op, &a);
>> +        if ( rc )
>> +            return rc;
>> +
>> +        d = rcu_lock_domain_by_any_id(a.domid);
>> +        if ( d == NULL )
>> +            return rc;
>> +
>> +        rc = -EINVAL;
>> +        if ( !is_hvm_domain(d) )
>> +            goto param_fail9;
>
> Do we need this check? If you are concerned about PVH then checking 
> explicitly for that may be better (and probably do it first thing in 
> the case clause)
>

I am not sure.  This is copied from HVMOP_inject_trap; and a lot of the
other cases have the same test.  I do not see that PVH needs to be
excluded.  It is the 1st thing after d has a value.

>> +
>> +        rc = xsm_hvm_param(XSM_TARGET, d, op);
>> +        if ( rc )
>> +            goto param_fail9;
>> +
>> +        rc = vmport_rpc_hvmop_do(d, op, &a);
>> +        if ( rc )
>> +            goto param_fail9;
>> +
>> +        if ( op == HVMOP_get_vmport_guest_info )
>> +            rc = copy_to_guest(arg, &a, 1) ? -EFAULT : 0;
>> +
>> +    param_fail9:
>> +        rcu_unlock_domain(d);
>> +        break;
>> +    }
>> +
>>       default:
>>       {
>>           gdprintk(XENLOG_DEBUG, "Bad HVM op %ld.\n", op);
>> diff --git a/xen/arch/x86/hvm/vmware/Makefile 
>> b/xen/arch/x86/hvm/vmware/Makefile
>> index cd8815b..4a14124 100644
>> --- a/xen/arch/x86/hvm/vmware/Makefile
>> +++ b/xen/arch/x86/hvm/vmware/Makefile
>> @@ -1,2 +1,3 @@
>>   obj-y += cpuid.o
>>   obj-y += vmport.o
>> +obj-y += vmport_rpc.o
>> diff --git a/xen/arch/x86/hvm/vmware/vmport.c 
>> b/xen/arch/x86/hvm/vmware/vmport.c
>> index 26aeb37..9e308a0 100644
>> --- a/xen/arch/x86/hvm/vmware/vmport.c
>> +++ b/xen/arch/x86/hvm/vmware/vmport.c
>> @@ -139,6 +139,13 @@ int vmport_ioport(int dir, uint32_t port, 
>> uint32_t bytes, uint32_t *val)
>>               /* maxTimeLag */
>>               regs->rcx = 0;
>>               break;
>> +        case BDOOR_CMD_MESSAGE:
>> +            if ( !is_pv_vcpu(current) )
>> +            {
>> +                /* Only supported for non pv domains */
>
> PV vs. HVM vs. PVH. So probably 'if(is_hvm_vcpu)'?

I see no reason to exclude PVH.   Will change to has_hvm_container_vcpu()

     -Don Slutz

(rest on different thread.)


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


 


Rackspace

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