Re: [PATCH] x86/kvm: Make parse_no_xxx __init for kvm
From: Paolo Bonzini
Date: Fri Feb 23 2018 - 17:46:45 EST
On 17/01/2018 04:46, Dou Liyang wrote:
> The early_param() is only called during kernel initialization, So Linux
> marks the functions of it with __init macro to save memory.
>
> But it forgot to mark the parse_no_kvmapf/stealacc/kvmclock_vsyscall,
> So, Make them __init as well.
>
> Cc: Paolo Bonzini <pbonzini@xxxxxxxxxx>
> Cc: rkrcmar@xxxxxxxxxx
> Cc: kvm@xxxxxxxxxxxxxxx
> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Cc: Ingo Molnar <mingo@xxxxxxxxxx>
> Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
> Cc: Juergen Gross <jgross@xxxxxxxx>
> Cc: x86@xxxxxxxxxx
> Signed-off-by: Dou Liyang <douly.fnst@xxxxxxxxxxxxxx>
> ---
> arch/x86/kernel/kvm.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
> index b40ffbf156c1..06801b0069db 100644
> --- a/arch/x86/kernel/kvm.c
> +++ b/arch/x86/kernel/kvm.c
> @@ -49,7 +49,7 @@
>
> static int kvmapf = 1;
>
> -static int parse_no_kvmapf(char *arg)
> +static int __init parse_no_kvmapf(char *arg)
> {
> kvmapf = 0;
> return 0;
> @@ -58,7 +58,7 @@ static int parse_no_kvmapf(char *arg)
> early_param("no-kvmapf", parse_no_kvmapf);
>
> static int steal_acc = 1;
> -static int parse_no_stealacc(char *arg)
> +static int __init parse_no_stealacc(char *arg)
> {
> steal_acc = 0;
> return 0;
> @@ -67,7 +67,7 @@ static int parse_no_stealacc(char *arg)
> early_param("no-steal-acc", parse_no_stealacc);
>
> static int kvmclock_vsyscall = 1;
> -static int parse_no_kvmclock_vsyscall(char *arg)
> +static int __init parse_no_kvmclock_vsyscall(char *arg)
> {
> kvmclock_vsyscall = 0;
> return 0;
>
Queued, thanks.
Paolo