All of lore.kernel.org
 help / color / mirror / Atom feed
From: Franck Bui-Huu <vagabon.xyz@gmail.com>
To: Thiemo Seufer <ths@networkno.de>
Cc: Franck Bui-Huu <vagabon.xyz@gmail.com>,
	Ralf Baechle <ralf@linux-mips.org>,
	linux-mips@linux-mips.org
Subject: Re: [PATCH] setup.c: introduce __pa_symbol() and get ride of CPHYSADDR()
Date: Mon, 09 Oct 2006 17:30:30 +0200	[thread overview]
Message-ID: <452A6B16.60507@innova-card.com> (raw)
In-Reply-To: <20061009145817.GB18308@networkno.de>

Thiemo Seufer wrote:
> Franck Bui-Huu wrote:
>> sorry to be ignorant of 64 bit kernels, but what's the point
>> to load them in KSEG0.
> 
> Smaller code with better performance.
> 

you mean we get smaller code _only_ by using the short 2 instructions
you described below ?

>>> and use short 2-instruction symbol references there.
>> do you mean "it allows to use only 2 'lui' instructions to load
>> a symbol address into a register" ?
> 
> It allows a 2-instruction "lui ; addiu" sequence instead of a
> 6-instruction "lui ; lui ; addiu ; addiu ; dsll32 ; addu" sequence.
> 
[snip]
>>
>> 	code_resource.start = virt_to_phys(&_text);
>> 	code_resource.end = virt_to_phys(&_etext) - 1;
>> 	data_resource.start = virt_to_phys(&_etext);
>> 	data_resource.end = virt_to_phys(&_edata) - 1;
>>
>> How does it work in this case ?
> 
> Those are addresses in 64-bit space, no special handling is needed
> there.

hm I'missing something there. Let's say that '&_text' is in KSEG0 and
is equal to 0xffffffff80000000. In this case virt_to_phys() returns
0x57ffffff80000000 (with PAGE_OFFSET = 0xa800000000000000). Is this 
physical address correct ??

> 
> The same doesn't hold for the initrd addresses supplied by the (32-bit)
> firmware. The firmware doesn't convert the kernel parameters to 64-bit
> values because the O2 kernel used to allow a pure 32-bit build, and the
> firmware can't find out what's actually inside the object file.
> 

This should be already handled by this code taken from setup.c:

static int __init rd_start_early(char *p)
{
        unsigned long start = memparse(p, &p);

#ifdef CONFIG_64BIT
        /* HACK: Guess if the sign extension was forgotten */
        if (start > 0x0000000080000000 && start < 0x00000000ffffffff)
                start |= 0xffffffff00000000UL;
#endif
        initrd_start = start;
        initrd_end += start;

        return 0;
}

Thanks
		Franck

  reply	other threads:[~2006-10-09 15:29 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-06 13:36 [PATCH] setup.c: introduce __pa_symbol() and get ride of CPHYSADDR() Franck Bui-Huu
2006-10-06 17:21 ` Thiemo Seufer
2006-10-09 11:58   ` Franck Bui-Huu
2006-10-09 13:21     ` Thiemo Seufer
2006-10-09 14:25       ` Franck Bui-Huu
2006-10-09 14:58         ` Thiemo Seufer
2006-10-09 15:30           ` Franck Bui-Huu [this message]
2006-10-09 15:51           ` Atsushi Nemoto
2006-10-09 16:59             ` Thiemo Seufer
2006-10-10  8:49               ` Atsushi Nemoto
2006-10-10 13:49                 ` Franck Bui-Huu
2006-10-10 14:19                   ` Atsushi Nemoto
2006-10-10 15:01                     ` Franck Bui-Huu
2006-10-10 15:29                       ` Atsushi Nemoto
2006-10-10 16:04                         ` Franck Bui-Huu
2006-10-10 16:16                           ` Franck Bui-Huu
2006-10-10 21:51                           ` Ralf Baechle
2006-10-11  3:11                             ` Atsushi Nemoto
2006-10-11  9:37                             ` Franck Bui-Huu

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=452A6B16.60507@innova-card.com \
    --to=vagabon.xyz@gmail.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=ths@networkno.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.