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

Re: [Xen-devel] [PATCH 12/18 V2]:PVH xen: support invalid op, return PVH features etc...



At 17:48 -0700 on 15 Mar (1363369724), Mukesh Rathor wrote:
> @@ -908,14 +916,18 @@ static int emulate_invalid_rdtscp(struct cpu_user_regs 
> *regs)
>  unsigned long emulate_forced_invalid_op(struct cpu_user_regs *regs)
>  {
>      char sig[5], instr[2];
> -    unsigned long eip, rc;
> +    unsigned long eip, rc, addr;
>  
>      eip = regs->eip;
>  
>      /* Check for forced emulation signature: ud2 ; .ascii "xen". */
> -    if ( (rc = copy_from_user(sig, (char *)eip, sizeof(sig))) != 0 )
> +    if ( (rc = raw_copy_from_guest(sig, (char *)eip, sizeof(sig))) != 0 )
>      {
> -        propagate_page_fault(eip + sizeof(sig) - rc, 0);
> +        addr = eip + sizeof(sig) - rc;
> +        if ( is_pvh_vcpu(current) )
> +            return addr;
> +
> +        propagate_page_fault(addr, 0);
>          return EXCRET_fault_fixed;

Ah, I see Jan already commented on this.  Since the function can already
return 0 or 1 there's no consistent way to tell what the return value
means (and if there were, it would merit a great big comment at the
declaration explaining it).

Tim.


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