[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171106105737.fkv6hah4ynugyzym@pd.tnic>
Date: Mon, 6 Nov 2017 11:57:37 +0100
From: Borislav Petkov <bp@...en8.de>
To: Brijesh Singh <brijesh.singh@....com>
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Radim Krčmář <rkrcmar@...hat.com>,
Joerg Roedel <joro@...tes.org>,
Tom Lendacky <thomas.lendacky@....com>, x86@...nel.org
Subject: Re: [Part2 PATCH v7 25/38] KVM: SVM: Add KVM_SEV_INIT command
On Wed, Nov 01, 2017 at 04:16:10PM -0500, Brijesh Singh wrote:
> The command initializes the SEV platform context and allocates a new ASID
> for this guest from the SEV ASID pool. The firmware must be initialized
> before we issue any guest launch commands to create a new memory encryption
> context.
>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: "H. Peter Anvin" <hpa@...or.com>
> Cc: Paolo Bonzini <pbonzini@...hat.com>
> Cc: "Radim Krčmář" <rkrcmar@...hat.com>
> Cc: Joerg Roedel <joro@...tes.org>
> Cc: Borislav Petkov <bp@...e.de>
> Cc: Tom Lendacky <thomas.lendacky@....com>
> Cc: x86@...nel.org
> Cc: kvm@...r.kernel.org
> Cc: linux-kernel@...r.kernel.org
> Signed-off-by: Brijesh Singh <brijesh.singh@....com>
> ---
> arch/x86/include/asm/kvm_host.h | 7 +++
> arch/x86/kvm/svm.c | 130 +++++++++++++++++++++++++++++++++++++++-
> 2 files changed, 136 insertions(+), 1 deletion(-)
...
> @@ -1167,10 +1187,18 @@ static __init int svm_hardware_setup(void)
> return r;
> }
>
> +static __exit void sev_hardware_unsetup(void)
> +{
> + if (svm_sev_enabled())
> + kfree(sev_asid_bitmap);
> +}
Just get rid of that silly function:
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 1410e6b7e8d8..5f5c3ddad139 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -1187,17 +1187,12 @@ static __init int svm_hardware_setup(void)
return r;
}
-static __exit void sev_hardware_unsetup(void)
-{
- if (svm_sev_enabled())
- kfree(sev_asid_bitmap);
-}
-
static __exit void svm_hardware_unsetup(void)
{
int cpu;
- sev_hardware_unsetup();
+ if (svm_sev_enabled())
+ kfree(sev_asid_bitmap);
for_each_possible_cpu(cpu)
svm_cpu_uninit(cpu);
with that:
Reviewed-by: Borislav Petkov <bp@...e.de>
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
Powered by blists - more mailing lists