riscv: Implement free_initrd_mem.
PATCH 1/1 riscv: Implement free_initrd_mem.
--- arch/riscv/mm/init.c | 6 ++++++ 1 file changed, 6 insertions(+)
arch/riscv/mm/init.c +6 -0
@@ -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 */
Signature · 1 line
2.16.1
PATCH v2 1/1 riscv: Implement free_initrd_mem.
v2: Remove incorrect page alignment.
--- arch/riscv/mm/init.c | 1 + 1 file changed, 1 insertion(+)
arch/riscv/mm/init.c +1 -0
@@ -66,5 +66,6 @@ void free_initmem(void)#ifdef CONFIG_BLK_DEV_INITRD void free_initrd_mem (unsigned long start,unsigned long end) { +free_reserved_area ((void *)start, (void *)end,-1 ,"initrd" ); }#endif /* CONFIG_BLK_DEV_INITRD */
Signature · 1 line
2.16.1
Quoted 11 lines · shea at shealevy.com
Signed-off-by Shea Levy <[email protected]>--- arch/riscv/mm/init.c | 6 ++++++ 1 file changed, 6 insertions(+)arch/riscv/mm/init.c +0
-0@@ -66,5 +66,11 @@ void free_initmem(void)#ifdef CONFIG_BLK_DEV_INITRD
arch/riscv/mm/init.c void free_initmem(void) · line 76
Quoted 10 lines
arch/riscv/mm/init.c +6
-0void 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.
Hi Palmer,
Quoted 25 lines · Palmer Dabbelt
Quoted 11 lines · shea at shealevy.com
Signed-off-by Shea Levy <[email protected]>--- arch/riscv/mm/init.c | 6 ++++++ 1 file changed, 6 insertions(+)arch/riscv/mm/init.c +0
-0@@ -66,5 +66,11 @@ void free_initmem(void)#ifdef CONFIG_BLK_DEV_INITRD arch/riscv/mm/init.c void free_initmem(void) · line 76
Quoted 10 lines
arch/riscv/mm/init.c +6
-0void 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:
Quoted 8 lines
* arm64 doesn't round to a page size, and has
keep_initrd.
* arm callspoison_init_mem(), and haskeep_initrd.
* sparc64 doesn't round, and doesn't have akeep_initrd.
* mips doesn't round, and doesn't have akeep_initrd.
* x86 rounds end to a page size but not start, and doesn't have akeep_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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20180308/74bf8d50/attachment.sig>
Quoted 35 lines · shea at shealevy.com
Hi Palmer,
Quoted 31 lines · Palmer Dabbelt
Quoted 11 lines · shea at shealevy.com
Signed-off-by Shea Levy <[email protected]>--- arch/riscv/mm/init.c | 6 ++++++ 1 file changed, 6 insertions(+)arch/riscv/mm/init.c +0
-0@@ -66,5 +66,11 @@ void free_initmem(void)#ifdef CONFIG_BLK_DEV_INITRD arch/riscv/mm/init.c void free_initmem(void) · line 76
Quoted 10 lines
arch/riscv/mm/init.c +6
-0void 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 callspoison_init_mem(), and haskeep_initrd.
* sparc64 doesn't round, and doesn't have akeep_initrd.
* mips doesn't round, and doesn't have akeep_initrd.
* x86 rounds end to a page size but not start, and doesn't have akeep_initrd.
Quoted 4 lines
Quoted 2 lines
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?
I think that'd be best. Nobody has said anything specific, but it's generally been suggested to take bits that we copy into our port and make them generic. If there's no clean way do to so then I'm OK taking this, though.
Quoted 36 lines · Palmer Dabbelt
Quoted 35 lines · shea at shealevy.com
Hi Palmer,
Quoted 31 lines · Palmer Dabbelt
Quoted 11 lines · shea at shealevy.com
Signed-off-by Shea Levy <[email protected]>--- arch/riscv/mm/init.c | 6 ++++++ 1 file changed, 6 insertions(+)arch/riscv/mm/init.c +0
-0@@ -66,5 +66,11 @@ void free_initmem(void)#ifdef CONFIG_BLK_DEV_INITRD arch/riscv/mm/init.c void free_initmem(void) · line 76
Quoted 10 lines
arch/riscv/mm/init.c +6
-0void 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 callspoison_init_mem(), and haskeep_initrd.
* sparc64 doesn't round, and doesn't have akeep_initrd.
* mips doesn't round, and doesn't have akeep_initrd.
* x86 rounds end to a page size but not start, and doesn't have akeep_initrd.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
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?
I think that'd be best. Nobody has said anything specific, but it's generally been suggested to take bits that we copy into our port and make them generic. If there's no clean way do to so then I'm OK taking this, though.
OK, will add it to my queue.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20180308/1ab4f3cb/attachment.sig>
Quoted 41 lines · shea at shealevy.com
Quoted 39 lines · Palmer Dabbelt
Quoted 38 lines · shea at shealevy.com
Hi Palmer,
Quoted 33 lines · Palmer Dabbelt
Quoted 11 lines · shea at shealevy.com
Signed-off-by Shea Levy <[email protected]>--- arch/riscv/mm/init.c | 6 ++++++ 1 file changed, 6 insertions(+)arch/riscv/mm/init.c +0
-0@@ -66,5 +66,11 @@ void free_initmem(void)#ifdef CONFIG_BLK_DEV_INITRD arch/riscv/mm/init.c void free_initmem(void) · line 76
Quoted 10 lines
arch/riscv/mm/init.c +6
-0void 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 callspoison_init_mem(), and haskeep_initrd.
* sparc64 doesn't round, and doesn't have akeep_initrd.
* mips doesn't round, and doesn't have akeep_initrd.
* x86 rounds end to a page size but not start, and doesn't have akeep_initrd.It feels like this should be something generic. I'm adding linux-kernel to see what people think.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Should I try to whip up something generic?
I think that'd be best. Nobody has said anything specific, but it's generally been suggested to take bits that we copy into our port and make them generic. If there's no clean way do to so then I'm OK taking this, though.
OK, will add it to my queue.
Thanks!