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

Re: [Xen-devel] [PATCH v2] vmx/monitor: CPUID events



On 12/07/16 19:13, Tamas K Lengyel wrote:
> This patch implements sending notification to a monitor subscriber when an
> x86/vmx guest executes the CPUID instruction.
>
> Signed-off-by: Tamas K Lengyel <tamas.lengyel@xxxxxxxxxxxx>

From an x86 point of view, Reviewed-by: Andrew Cooper
<andrew.cooper3@xxxxxxxxxx>, with one nit that I can fix on commit if
needs be.

> @@ -3524,10 +3526,28 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
>          hvm_task_switch((uint16_t)exit_qualification, reasons[source], 
> ecode);
>          break;
>      }
> -    case EXIT_REASON_CPUID:
> -        is_pvh_vcpu(v) ? pv_cpuid(regs) : vmx_do_cpuid(regs);
> -        update_guest_eip(); /* Safe: CPUID */
> +    case EXIT_REASON_CPUID: {

Brace on a newline here.

> +        int rc;
> +
> +        if ( is_pvh_vcpu(v) )
> +        {
> +            pv_cpuid(regs);
> +            rc = 0;
> +        }
> +        else
> +            rc = vmx_do_cpuid(regs);
> +
> +        /*
> +         * rc < 0 error in monitor/vm_event, crash
> +         * !rc    continue normally
> +         * rc > 0 paused waiting for response, work here is done
> +         */
> +        if ( rc < 0 )
> +            goto exit_and_crash;
> +        if ( !rc )
> +            update_guest_eip(); /* Safe: CPUID */
>          break;
> +    }
>      case EXIT_REASON_HLT:
>          update_guest_eip(); /* Safe: HLT */
>          hvm_hlt(regs->eflags);
>


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