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

Re: [Xen-devel] xen crash with 4.17 kernel on Fedora


  • To: Michael Young <m.a.young@xxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Juergen Gross <jgross@xxxxxxxx>
  • Date: Mon, 2 Jul 2018 08:33:24 +0200
  • Autocrypt: addr=jgross@xxxxxxxx; prefer-encrypt=mutual; keydata= xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB AAHNHkp1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmRlPsLAeQQTAQIAIwUCU4xw6wIbAwcL CQgHAwIBBhUIAgkKCwQWAgMBAh4BAheAAAoJELDendYovxMvi4UH/Ri+OXlObzqMANruTd4N zmVBAZgx1VW6jLc8JZjQuJPSsd/a+bNr3BZeLV6lu4Pf1Yl2Log129EX1KWYiFFvPbIiq5M5 kOXTO8Eas4CaScCvAZ9jCMQCgK3pFqYgirwTgfwnPtxFxO/F3ZcS8jovza5khkSKL9JGq8Nk czDTruQ/oy0WUHdUr9uwEfiD9yPFOGqp4S6cISuzBMvaAiC5YGdUGXuPZKXLpnGSjkZswUzY d9BVSitRL5ldsQCg6GhDoEAeIhUC4SQnT9SOWkoDOSFRXZ+7+WIBGLiWMd+yKDdRG5RyP/8f 3tgGiB6cyuYfPDRGsELGjUaTUq3H2xZgIPfOwE0EU4x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eqtqNKjHstHatgMZ2W0CFC4hJ3YEetuRBURYPiGzuJXU pAd7a7BdsqWC4o+GTm5tnGrCyD+4gfDSpkOT53S/GNO07YkPkm/8J4OBoFfgSaCnQ1izwgJQ jIpcG2fPCI2/hxf2oqXPYbKr1v4Z1wthmoyUgGN0LPTIm+B5vdY82wI5qe9uN6UOGyTH2B3p hRQUWqCwu2sqkI3LLbTdrnyDZaixT2T0f4tyF5Lfs+Ha8xVMhIyzNb1byDI5FKCb
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 02 Jul 2018 06:33:54 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Openpgp: preference=signencrypt

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