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 <[email protected]>
> Cc: Ingo Molnar <[email protected]>
> Cc: "H. Peter Anvin" <[email protected]>
> Cc: Paolo Bonzini <[email protected]>
> Cc: "Radim Krčmář" <[email protected]>
> Cc: Joerg Roedel <[email protected]>
> Cc: Borislav Petkov <[email protected]>
> Cc: Tom Lendacky <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Brijesh Singh <[email protected]>
> ---
>  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 <[email protected]>

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

Reply via email to