On 01/07/18 23:26, Michael Young wrote:
> On Sun, 1 Jul 2018, M A Young wrote:
> 
>> I get (with kernel-4.17.3-200.fc28.x86_64 which is a bit easier)
>>
>> rip: ffffffff81062330 native_irq_disable
>> flags: 00000246 i z p
>> rsp: ffffffff82203d90
>> rax: 0000000000000246    rcx: 0000000000000000    rdx: 0000000000000000
>> rbx: 00000000ffffffff    rsi: 00000000ffffffff    rdi: 0000000000000000
>> rbp: 0000000000000000     r8: ffffffff820bb698     r9: ffffffff82203e38
>> r10: 0000000000000000    r11: 0000000000000000    r12: 0000000000000000
>> r13: ffffffff820bb698    r14: ffffffff82203e38    r15: 0000000000000000
>> cs: e033     ss: e02b     ds: 0000     es: 0000
>> fs: 0000 @ 0000000000000000
>> gs: 0000 @ ffffffff82731000/0000000000000000 __init_begin/
>> Code (instr addr ffffffff81062330)
>> 00 00 00 00 00 57 9d c3 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 00 <fa> c3 0f
>> 1f 40 00 66 2e 0f 1f 84
>>
>>
>> Stack:
>> 0000000000000000 0000000000000000 0000000000000000 ffffffff81062330
>> 000000010000e030 0000000000010046 ffffffff82203dd8 000000000000e02b
>> 0000000000000246 ffffffff8110dff9 0000000000000000 0000000000000246
>> 0000000000000000 0000000000000000 ffffffff820a6cd0 ffffffff82203e88
>> ffffffff82739000 8000000000000061 0000000000000000 0000000000000000
>>
>> Call Trace:
>>                    [<ffffffff81062330>] native_irq_disable <--
>> ffffffff82203da8:   [<ffffffff81062330>] native_irq_disable
>> ffffffff82203dd8:   [<ffffffff8110dff9>] vprintk_emit+0xe9
>> ffffffff82203e30:   [<ffffffff8110ec96>] printk+0x58
>> ffffffff82203e90:   [<ffffffff810ac970>] __warn_printk+0x46
>> ffffffff82203ef8:   [<ffffffff8275db62>] xen_load_gdt_boot+0x108
>> ffffffff82203f28:   [<ffffffff81037c70>] load_direct_gdt+0x30
>> ffffffff82203f40:   [<ffffffff81037f08>] switch_to_new_gdt+0x8
>> ffffffff82203f48:   [<ffffffff8102aae0>] x86_init_noop
>> ffffffff82203f50:   [<ffffffff8275dc8c>] xen_start_kernel+0xed
>
> I think the crash is triggered by the code
> 
> static inline pgprotval_t check_pgprot(pgprot_t pgprot)
> {
>         pgprotval_t massaged_val = massage_pgprot(pgprot);
> 
>         /* mmdebug.h can not be included here because of dependencies */
> #ifdef CONFIG_DEBUG_VM
>         WARN_ONCE(pgprot_val(pgprot) != massaged_val,
>                   "attempted to set unsupported pgprot: %016llx "
>                   "bits: %016llx supported: %016llx\n",
>                   (u64)pgprot_val(pgprot),
>                   (u64)pgprot_val(pgprot) ^ massaged_val,
>                   (u64)__supported_pte_mask);
> #endif
> 
>         return massaged_val;
> }
> 
> static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot)
> {
>         return __pte(((phys_addr_t)page_nr << PAGE_SHIFT) |
>                      check_pgprot(pgprot));
> }
> 
> in arch/x86/include/asm/pgtable.h which is inlined into
> xen_load_gdt_boot by via pfn_pte
> 
> In 4.16 the equivalent code was
> 
> static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot)
> {
>     return __pte(((phys_addr_t)page_nr << PAGE_SHIFT) |
>              massage_pgprot(pgprot));
> }

There are two problems here:

1. pv_irq_ops hasn't been setup early enough, so the printk() will use
   native_irq_disable() instead of the Xen variant.

2. For PV domains the default kernel pte should not include the global
   bit. Repairing this issue will avoid the WARN_ONCE() above.

I'll send two patches soon to fix the issues.


Juergen

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

Reply via email to