mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: Re: MIPS : die at free_initmem() function 3.9+
@ 2013-05-05 22:39 EUNBONG SONG
  2013-05-07 16:46 ` Jiang Liu
  0 siblings, 1 reply; 3+ messages in thread
From: EUNBONG SONG @ 2013-05-05 22:39 UTC (permalink / raw)
  To: Jiang Liu; +Cc: ralf, linux-mips, linux-kernel, jogo, david.daney

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=euc-kr, Size: 792 bytes --]


>So on 64bits MIPS platforms, __va(__pa(x)) may not equal to x, that may cause
>trouble to free_initmem_default(). Could you please help to do another test
>by changing
>free_initmem_default(POISON_FREE_INITMEM);
>to
>free_initmem_default(0);

>This test could help to identify whether this panic is caused by
>memset((void *)pos, poison, PAGE_SIZE);
>in function free_reserved_area().

Hello, as you said i changed  "free_initmem_default(POISON_FREE_INITMEM);" to
"free_initmem_default(0);". Panic still occurred. 
Actually, i put the some debug messages. and i confirmed panic occurs in __free_reserved_page() function.
Thanks!

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: MIPS : die at free_initmem() function 3.9+
  2013-05-05 22:39 Re: MIPS : die at free_initmem() function 3.9+ EUNBONG SONG
@ 2013-05-07 16:46 ` Jiang Liu
  2013-05-07 17:27   ` David Daney
  0 siblings, 1 reply; 3+ messages in thread
From: Jiang Liu @ 2013-05-07 16:46 UTC (permalink / raw)
  To: eunb.song; +Cc: ralf, linux-mips, linux-kernel, jogo, david.daney

Hi Eunsong,
	Thanks for your help. I have done some code inspection and have 
found a possible reason for this issue. It seems that virt_to_page()
can't be used to handle address in compatible segments due to following
definitions.

#define virt_to_page(kaddr)     pfn_to_page(PFN_DOWN(virt_to_phys(kaddr)))
static inline unsigned long virt_to_phys(volatile const void *address)
{
        return (unsigned long)address - PAGE_OFFSET + PHYS_OFFSET;
}
#define __va(x)         ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET))
#define __pa_symbol(x)  __pa(RELOC_HIDE((unsigned long)(x), 0))
#define __pa(x)                                                         \
({                                                                      \
    unsigned long __x = (unsigned long)(x);                             \
    __x < CKSEG0 ? XPHYSADDR(__x) : CPHYSADDR(__x);                     \
})

#define CPHYSADDR(a)            ((_ACAST32_(a)) & 0x1fffffff)
#define XPHYSADDR(a)            ((_ACAST64_(a)) &                       \
                                 _CONST64_(0x000000ffffffffff))

#define XKUSEG                  _CONST64_(0x0000000000000000)
#define XKSSEG                  _CONST64_(0x4000000000000000)
#define XKPHYS                  _CONST64_(0x8000000000000000)
#define XKSEG                   _CONST64_(0xc000000000000000)
#define CKSEG0                  _CONST64_(0xffffffff80000000)
#define CKSEG1                  _CONST64_(0xffffffffa0000000)
#define CKSSEG                  _CONST64_(0xffffffffc0000000)
#define CKSEG3                  _CONST64_(0xffffffffe0000000)

So could you please help to prepare a formal patch for this bug and send
it to Andrew Morton for v3.10-rc1? Otherwise I could help to it too.

Regards!
Gerry


=On 05/06/2013 06:39 AM, EUNBONG SONG wrote:
> 
>> So on 64bits MIPS platforms, __va(__pa(x)) may not equal to x, that may cause
>> trouble to free_initmem_default(). Could you please help to do another test
>> by changing
>> free_initmem_default(POISON_FREE_INITMEM);
>> to
>> free_initmem_default(0);
> 
>> This test could help to identify whether this panic is caused by
>> memset((void *)pos, poison, PAGE_SIZE);
>> in function free_reserved_area().
> 
> Hello, as you said i changed  "free_initmem_default(POISON_FREE_INITMEM);" to
> "free_initmem_default(0);". Panic still occurred. 
> Actually, i put the some debug messages. and i confirmed panic occurs in __free_reserved_page() function.
> Thanks!
> 
> N떑꿩�r툤y鉉싕b쾊Ф푤v�^�)頻{.n�+돴쪐{콗喩zX㎍\x17썳變}찠꼿쟺�&j:+v돣�\a쳭喩zZ+�+zf"톒쉱�~넮녬i�鎬z�\x1e췿ⅱ�?솳鈺�&�)刪^[f뷌^j푹y쬶끷@A첺뛴��\f0띠h�\x0f�i�
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: MIPS : die at free_initmem() function 3.9+
  2013-05-07 16:46 ` Jiang Liu
@ 2013-05-07 17:27   ` David Daney
  0 siblings, 0 replies; 3+ messages in thread
From: David Daney @ 2013-05-07 17:27 UTC (permalink / raw)
  To: Jiang Liu, ralf; +Cc: eunb.song, linux-mips, linux-kernel, jogo, david.daney

On 05/07/2013 09:46 AM, Jiang Liu wrote:
> Hi Eunsong,
> 	Thanks for your help. I have done some code inspection and have
> found a possible reason for this issue. It seems that virt_to_page()
> can't be used to handle address in compatible segments due to following
> definitions.

This has caused multiple problems in the past.  I wrote a patch to 
correct this problem, but it looks like it was never applied.

I just sent the patch to you guys as a separate e-mail.

David Daney



>
> #define virt_to_page(kaddr)     pfn_to_page(PFN_DOWN(virt_to_phys(kaddr)))
> static inline unsigned long virt_to_phys(volatile const void *address)
> {
>          return (unsigned long)address - PAGE_OFFSET + PHYS_OFFSET;
> }
> #define __va(x)         ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET))
> #define __pa_symbol(x)  __pa(RELOC_HIDE((unsigned long)(x), 0))
> #define __pa(x)                                                         \
> ({                                                                      \
>      unsigned long __x = (unsigned long)(x);                             \
>      __x < CKSEG0 ? XPHYSADDR(__x) : CPHYSADDR(__x);                     \
> })
>
> #define CPHYSADDR(a)            ((_ACAST32_(a)) & 0x1fffffff)
> #define XPHYSADDR(a)            ((_ACAST64_(a)) &                       \
>                                   _CONST64_(0x000000ffffffffff))
>
> #define XKUSEG                  _CONST64_(0x0000000000000000)
> #define XKSSEG                  _CONST64_(0x4000000000000000)
> #define XKPHYS                  _CONST64_(0x8000000000000000)
> #define XKSEG                   _CONST64_(0xc000000000000000)
> #define CKSEG0                  _CONST64_(0xffffffff80000000)
> #define CKSEG1                  _CONST64_(0xffffffffa0000000)
> #define CKSSEG                  _CONST64_(0xffffffffc0000000)
> #define CKSEG3                  _CONST64_(0xffffffffe0000000)
>
> So could you please help to prepare a formal patch for this bug and send
> it to Andrew Morton for v3.10-rc1? Otherwise I could help to it too.
>
> Regards!
> Gerry
>
>
> =On 05/06/2013 06:39 AM, EUNBONG SONG wrote:
>>
>>> So on 64bits MIPS platforms, __va(__pa(x)) may not equal to x, that may cause
>>> trouble to free_initmem_default(). Could you please help to do another test
>>> by changing
>>> free_initmem_default(POISON_FREE_INITMEM);
>>> to
>>> free_initmem_default(0);
>>
>>> This test could help to identify whether this panic is caused by
>>> memset((void *)pos, poison, PAGE_SIZE);
>>> in function free_reserved_area().
>>
>> Hello, as you said i changed  "free_initmem_default(POISON_FREE_INITMEM);" to
>> "free_initmem_default(0);". Panic still occurred.
>> Actually, i put the some debug messages. and i confirmed panic occurs in __free_reserved_page() function.
>> Thanks!
>>
>> N떑꿩�r툤y鉉싕b쾊Ф푤v�^�)頻{.n�+돴쪐{콗喩zX㎍\x17썳變}찠꼿쟺�&j:+v돣�\a쳭喩zZ+�+zf"톒쉱�~넮녬i�鎬z�\x1e췿ⅱ�?솳鈺�&�)刪^[f뷌^j푹y쬶끷@A첺뛴��\f0띠h�\x0f�i�
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-07 17:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-05 22:39 Re: MIPS : die at free_initmem() function 3.9+ EUNBONG SONG
2013-05-07 16:46 ` Jiang Liu
2013-05-07 17:27   ` David Daney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome