mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shea Levy <shea@shealevy.com>
To: Palmer Dabbelt <palmer@sifive.com>, linux-kernel@vger.kernel.org
Cc: linux-riscv@lists.infradead.org
Subject: Re: [PATCH] riscv: Implement free_initrd_mem.
Date: Thu, 08 Mar 2018 14:14:52 -0500	[thread overview]
Message-ID: <87efkuv0pf.fsf@xps13.shealevy.com> (raw)
In-Reply-To: <mhng-96c45513-b898-42bc-af9e-f24d9909f489@palmer-si-x1c4>

[-- Attachment #1: Type: text/plain, Size: 1417 bytes --]

Hi Palmer,

Palmer Dabbelt <palmer@sifive.com> writes:

> On Tue, 20 Feb 2018 05:50:43 PST (-0800), shea@shealevy.com wrote:
>> Signed-off-by: Shea Levy <shea@shealevy.com>
>> ---
>>  arch/riscv/mm/init.c | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
>> index c77df8142be2..1c832b541e95 100644
>> --- a/arch/riscv/mm/init.c
>> +++ b/arch/riscv/mm/init.c
>> @@ -66,5 +66,11 @@ void free_initmem(void)
>>  #ifdef CONFIG_BLK_DEV_INITRD
>>  void free_initrd_mem(unsigned long start, unsigned long end)
>>  {
>> +	if (start == initrd_start)
>> +		start = round_down(start, PAGE_SIZE);
>> +	if (end == initrd_end)
>> +		end = round_up(end, PAGE_SIZE);
>> +
>> +	free_reserved_area((void *)start, (void *)end, -1, "initrd");
>>  }
>>  #endif /* CONFIG_BLK_DEV_INITRD */
>
> It looks like everyone is doing something slightly different here:
>
> * arm64 doesn't round to a page size, and has keep_initrd.
> * arm calls poison_init_mem(), and has keep_initrd.
> * sparc64 doesn't round, and doesn't have a keep_initrd.
> * mips doesn't round, and doesn't have a keep_initrd.
> * x86 rounds end to a page size but not start, and doesn't have a keep_initrd.
>
> It feels like this should be something generic.  I'm adding linux-kernel to see 
> what people think.

Should I try to whip up something generic?

Thanks,
Shea

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2018-03-08 19:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180220135043.15411-1-shea@shealevy.com>
2018-02-23  0:41 ` Palmer Dabbelt
2018-03-08 19:14   ` Shea Levy [this message]
2018-03-08 19:35     ` Palmer Dabbelt
2018-03-08 19:47       ` Shea Levy
2018-03-08 20:31         ` Palmer Dabbelt

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=87efkuv0pf.fsf@xps13.shealevy.com \
    --to=shea@shealevy.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@sifive.com \
    /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

all inboxes | Powered by JetHome®