lkml.org 
[lkml]   [2018]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v8 1/2] x86/mm: add .bss..decrypted section to hold shared variables
On Thu, 13 Sep 2018, Brijesh Singh wrote:
>
> +void __weak mem_encrypt_free_decrypted_mem(void) { }
> +
> void __ref free_initmem(void)
> {
> e820__reallocate_tables();
>
> + mem_encrypt_free_decrypted_mem();
> +
> free_kernel_image_pages(&__init_begin, &__init_end);
> }
>
> diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c
> index b2de398..718acdf 100644
> --- a/arch/x86/mm/mem_encrypt.c
> +++ b/arch/x86/mm/mem_encrypt.c
> @@ -348,6 +348,16 @@ bool sev_active(void)
> EXPORT_SYMBOL(sev_active);
>
> /* Architecture __weak replacement functions */
> +void __init mem_encrypt_free_decrypted_mem(void)
> +{
> + if (mem_encrypt_active())
> + return;

Why?

> +
> + free_init_pages("unused decrypted",
> + (unsigned long)__start_bss_decrypted_unused,
> + (unsigned long)__end_bss_decrypted);

Everything _AFTER_ __start_bss_decrypted_unused _IS_ unused and can be
freed. No conditional nothing. It's unused in any case.

Thanks,

tglx


\
 
 \ /
  Last update: 2018-09-14 01:25    [W:0.087 / U:24.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site