On 07/06/2019 13:07, Andrew Cooper wrote:
> Currently, booting staging fails with:
>
>   (XEN) Using APIC driver default
>   (XEN) ----[ Xen-4.13-unstable  x86_64  debug=y   Not tainted ]----
>   (XEN) CPU:    0
>   (XEN) RIP:    e008:[<ffff82d08038f66e>] __x86_indirect_thunk_rax+0xe/0x10
>   (XEN) RFLAGS: 0000000000010016   CONTEXT: hypervisor
>   (XEN) rax: c2c2c2c2c2c2c2c2   rbx: ffff83003f4cc000   rcx: 0000000000000000
>   <snip>
>   (XEN) Xen code around <ffff82d08038f66e> 
> (__x86_indirect_thunk_rax+0xe/0x10):
>   (XEN)  ae e8 eb fb 48 89 04 24 <c3> 90 e8 05 00 00 00 0f ae e8 eb fb 48 89 
> 0c 24
>   (XEN) Xen stack trace from rsp=ffff82d080827d28:
>   (XEN)    c2c2c2c2c2c2c2c2 ffff82d080207588 ffff82d080827d68 0000000000000000
>   <snip>
>   (XEN) Xen call trace:
>   (XEN)    [<ffff82d08038f66e>] __x86_indirect_thunk_rax+0xe/0x10
>   (XEN)    [<ffff82d0806078a9>] setup_system_domains+0x18/0xab
>   (XEN)    [<ffff82d08062d9c8>] __start_xen+0x1ea9/0x2935
>   (XEN)    [<ffff82d0802000f3>] __high_start+0x53/0x55
>   (XEN)
>   (XEN) ****************************************
>   (XEN) Panic on CPU 0:
>   (XEN) GENERAL PROTECTION FAULT
>   (XEN) [error_code=0000]
>   (XEN) ****************************************
>
> UBSAN (which I happened to have active in my build at the time) identifies the
> problem explicitly:
>
>   (XEN) Using APIC driver default
>   (XEN) 
> ================================================================================
>   (XEN) UBSAN: Undefined behaviour in 
> /local/xen.git/xen/include/xsm/xsm.h:309:19
>   (XEN) member access within null pointer of type 'struct xsm_operations'
>   (XEN) ----[ Xen-4.13-unstable  x86_64  debug=y   Not tainted ]----
>
> "adjust system domain creation (and call it earlier on x86)" didn't account
> for the fact that domain_create() depends on XSM already being set up.  There
> is nothing very interesting which xsm_multiboot_init() more than allocating
> memory, which means it is safe to move earlier during boot.

Oh - perhaps it is worth pointing out that we end up following the NULL
function pointer xsm_ops->alloc_security_domain() and execute part of
the 16bit IVT until we end up with the retpoline explosion.

~Andrew

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

Reply via email to