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

Re: [Xen-devel] Crash with nested HVM and Linux v5.1+



Andrew Cooper <andrew.cooper3@xxxxxxxxxx> writes:

> (XEN) traps.c:1576: GPF (0000): ffff82d08031a80f 
> [vmx.c#vmx_msr_read_intercept+0x387/0x3fd] -> ffff82d08037c9f2
> (XEN) traps.c:1576: GPF (0000): ffff82d08031a80f 
> [vmx.c#vmx_msr_read_intercept+0x387/0x3fd] -> ffff82d08037c9f2
> (d2) xs_write(/vm/95f11fc0-b9e7-47ff-8523-bacab35b96b6/rtc/timeoffset): EACCES
> (XEN) d1v1 Unhandled nested vmexit: reason 51
> (XEN) domain_crash called from vvmx.c:2671
> (XEN) Domain 1 (vcpu#1) crashed on cpu#2:
>
> 51 is the RDTSCP intercept.  It seems that noone has ever tried executing a
> RDTSCP instruction in nested virt yet... which goes to show how untested this
> all is.
>
> Can you see about giving this patch a spin?
>
> ~Andrew
>
> diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
> index fdf449bfd1..6696bd6240 100644
> --- a/xen/arch/x86/hvm/vmx/vvmx.c
> +++ b/xen/arch/x86/hvm/vmx/vvmx.c
> @@ -2491,6 +2491,7 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
>              nvcpu->nv_vmexit_pending = 1;
>          break;
>      case EXIT_REASON_RDTSC:
> +    case EXIT_REASON_RDTSCP:
>          ctrl = __n2_exec_control(v);
>          if ( ctrl & CPU_BASED_RDTSC_EXITING )
>              nvcpu->nv_vmexit_pending = 1;
> @@ -2501,6 +2502,8 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
>               * avoiding changing guest_tsc and messing up timekeeping in L1
>               */
>              msr_split(regs, hvm_get_guest_tsc(v) + get_vvmcs(v,
> TSC_OFFSET));
> +            if ( exit_reason == EXIT_REASON_RDTSCP )
> +                regs->rcx = v->arch.msrs->tsc_aux;
>              update_guest_eip();
>  
>              return 1;

Hi Andrew,
This patch works for me.  The L2 domU boots successfully.

Thank you!

-- Chris

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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