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

Re: [Xen-devel] [PATCH 2/2] x86: latch currentâ>domain in do_physdev_op()



On 19/01/15 15:36, Jan Beulich wrote:
> @@ -483,7 +482,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
>          ret = -EFAULT;
>          if ( copy_from_guest(&apic, arg, 1) != 0 )
>              break;
> -        ret = xsm_apic(XSM_PRIV, v->domain, cmd);
> +        ret = xsm_apic(XSM_PRIV, currd, cmd);
>          if ( ret )
>              break;
>          ret = ioapic_guest_write(apic.apic_physbase, apic.reg, apic.value);
> @@ -499,7 +498,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
>  
>          /* Use the APIC check since this dummy hypercall should still only
>           * be called by the domain with access to program the ioapic */
> -        ret = xsm_apic(XSM_PRIV, v->domain, cmd);
> +        ret = xsm_apic(XSM_PRIV, currd, cmd);
>          if ( ret )
>              break;
>  
> @@ -529,15 +528,16 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H

There is a "is_pvh_vcpu(current)" between these two hunks which wants
latching in the same way as set_iobitmap, allowing the "current" below
to become "curr".

With that fixed, Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

>          if ( set_iopl.iopl > 3 )
>              break;
>          ret = 0;
> -        v->arch.pv_vcpu.iopl = set_iopl.iopl;
> +        current->arch.pv_vcpu.iopl = set_iopl.iopl;
>          break;
>      }
>  
>      case PHYSDEVOP_set_iobitmap: {
> +        struct vcpu *curr = current;
>          struct physdev_set_iobitmap set_iobitmap;
>  
>          ret = -ENOSYS;
> -        if ( is_pvh_vcpu(current) )
> +        if ( is_pvh_vcpu(curr) )
>              break;
>  
>          ret = -EFAULT;


_______________________________________________
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®.