[PATCH v2] sh: Take into account the base of System RAM in virt_to_phys()

Nobuhiro Iwamatsu nobuhiro.iwamatsu.yj at renesas.com
Sun Oct 16 19:50:58 EDT 2011


Hi,

2011/10/13 Simon Horman <horms at verge.net.au>:
> On Wed, Oct 12, 2011 at 05:24:23PM +0900, Magnus Damm wrote:
>> On Mon, Oct 3, 2011 at 10:05 AM, Simon Horman <horms at verge.net.au> wrote:
>> > Previously virt_to_phys() assumed that physical memory always started
>> > at address 0. This is not always the case.
>> >
>> > Tested on an sh7757lcr (32bit system) whose only System RAM region is
>> > 40000000-4effffff and an ecovec24 (29bit system).
>> >
>> > Signed-off-by: Simon Horman <horms at verge.net.au>
>> >
>> > ---
>> >  kexec/arch/sh/kexec-sh.c |   45 ++++++++++++++++++++++++++++++++++++++++++++-
>> >  1 files changed, 44 insertions(+), 1 deletions(-)
>> >
>> > v2
>> > * Only use the base of System RAM as an offset into physical memory
>> >  if 32bit addressing is in use.
>>
>> This version looks much better, thanks!
>
> I thought so too. But after pushing it I realised the parsing logic in
> is_32bit() is flawed. I will send an update.


yes, line of sscan does not work.
I think that the following is good if I easily make modifications.

while(fgets(line, sizeof(line), fp) != 0) {
    if (!strcmp(line, "address sizes\t: 32 bits physical\n"))  {
        status = 1;
        break;
    }
}

Best regards,
  Nobuhiro


-- 
Nobuhiro Iwamatsu



More information about the kexec mailing list