linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Mohan Kumar M <mohan@in.ibm.com>
To: Paul Mackerras <paulus@samba.org>
Cc: ppcdev <linuxppc-dev@ozlabs.org>, miltonm@bga.com
Subject: Re: [PATCH 4/5] Relocation support
Date: Wed, 13 Aug 2008 23:52:18 +0530	[thread overview]
Message-ID: <48A3265A.4070008@in.ibm.com> (raw)
In-Reply-To: <18594.28433.827798.249177@cargo.ozlabs.ibm.com>

Paul Mackerras wrote:
> Mohan Kumar M writes:
>
Hi Paul,

Thanks for your comments.

I will update the patches as per your comment and will give a detailed 
description for each patch.

Regards,
Mohan.


> 
>>  static inline int in_kernel_text(unsigned long addr)
>>  {
>> -	if (addr >= (unsigned long)_stext && addr < (unsigned long)__init_end)
>> +	if (addr >= (unsigned long)_stext && addr < (unsigned long)__init_end
>> +								+ kernel_base)
> 
> Your patch adds kernel_base to some addresses but not to all of them,
> so your patch description should have told us why you added it in the
> those places and not others.  If you tell us the general principle
> you're following (even if it seems obvious to you) it will be useful
> to people chasing bugs or adding new code later on, or even just
> trying to understand what the code does.
> 
>> -	RELOC(alloc_bottom) = PAGE_ALIGN((unsigned long)&RELOC(_end) + 0x4000);
>> +#ifndef CONFIG_RELOCATABLE_PPC64
>> + 	RELOC(alloc_bottom) = PAGE_ALIGN((unsigned long)&RELOC(_end) + 0x4000);
>> +#else
>> +	RELOC(alloc_bottom) = PAGE_ALIGN((unsigned long)&RELOC(_end) + 0x4000 +
>> +							RELOC(reloc_delta));
>> +#endif
> 
> Ifdefs in code inside a function are frowned upon in the Linux
> kernel.  Try to find an alternative way to do this, such as ensuring
> that reloc_delta is 0 when CONFIG_RELOCATABLE_PPC64 is not set.
> Also it's not clear (to me at least) why you need to add reloc_data in
> the relocatable case.
> 
>> +#ifndef CONFIG_RELOCATABLE_PPC64
>>  	unsigned long *spinloop
>>  		= (void *) LOW_ADDR(__secondary_hold_spinloop);
>>  	unsigned long *acknowledge
>>  		= (void *) LOW_ADDR(__secondary_hold_acknowledge);
>> +#else
>> +	unsigned long *spinloop
>> +		= (void *) &__secondary_hold_spinloop;
>> +	unsigned long *acknowledge
>> +		= (void *) &__secondary_hold_acknowledge;
>> +#endif
> 
> This also needs some explanation.  (Put it in the patch description or
> in a comment in the code, not in a reply to this mail. :)
> 
>> +#ifndef CONFIG_RELOCATABLE_PPC64
>>  	ld	r4,htab_hash_mask@got(2)
>> +#else
>> +	LOAD_REG_IMMEDIATE(r4,htab_hash_mask)
>> +#endif
>>  	ld	r27,0(r4)	/* htab_hash_mask -> r27 */
> 
> Here and in the other similar places, I would prefer you just changed
> it to LOAD_REG_ADDR and not have any ifdef.
> 
> Paul.

  reply	other threads:[~2008-08-13 18:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-11 20:11 [PATCH 0/5] Relocatable kernel support for PPC64 Mohan Kumar M
2008-08-11 20:12 ` [PATCH 1/5] Extract list of relocation offsets Mohan Kumar M
2008-08-11 20:14 ` [PATCH 2/5] Build files needed for relocation Mohan Kumar M
2008-08-12  8:07   ` Mohan Kumar M
2008-08-12  8:09   ` Mohan Kumar M
2008-08-11 20:15 ` [PATCH 3/5] Apply relocation Mohan Kumar M
2008-08-12  0:23   ` Paul Mackerras
2008-08-12  8:10   ` Mohan Kumar M
2008-08-13  5:11     ` Paul Mackerras
2008-08-11 20:16 ` [PATCH 4/5] Relocation support Mohan Kumar M
2008-08-12  8:11   ` Mohan Kumar M
2008-08-13  5:20     ` Paul Mackerras
2008-08-13 18:22       ` Mohan Kumar M [this message]
2008-08-11 20:18 ` [PATCH 5/5] Relocation support for kdump kernel Mohan Kumar M
2008-08-12  8:11   ` Mohan Kumar M

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48A3265A.4070008@in.ibm.com \
    --to=mohan@in.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=miltonm@bga.com \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).