Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp800325pxu; Thu, 3 Dec 2020 13:01:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwBqBL/eveOXSboNqzVrqKUhzkEFr4mR1ziMc9P8SLUXhlYlRRvLwaUXBwQLQm7jK3p1cU2 X-Received: by 2002:a17:906:5182:: with SMTP id y2mr4237958ejk.471.1607029270252; Thu, 03 Dec 2020 13:01:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607029270; cv=none; d=google.com; s=arc-20160816; b=Ao+ZPmPPWob8Dz3n41Gw1S6XrTkEFPni1AN4+ZovzGdbLlf8oQQEb+f4qy8H1bUd9C C2YfP07scCZ2qyFB959uMsEDgACl+1LoQBtx0s+ijxdchDDe/auoQPznSIzeGLRKASSV eeLYCx1oA7MdOb6J9F0ctti2HfceyCh2b+cy5HtIHX20ft41n13fWWFWLI7xlZ+jWXsP 58/psEP3GU+04kUvrvMH+7hUMgQLZuLyfGELlkGY1UV1OpolTjzGXtU/LdLqat/LreCw IfuPYE6iKa44iu9uneAI3oP6nd6ZFlPGaItCG4Nurv5nSsXCT3Yo5T8jMTH8QrYbEmKw 7PqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :sender:dkim-signature; bh=S5ra3fFtwyrR4DBSDAkXB7bmFSTJjJvoJm1aScqSvD8=; b=mBR8P8PHgkbgcYocTjoT98BA8Rkyrmi5ZlKFrAo1A0MrYg+4gHlLjFuU8MKYYZQyUm 0AoXiQs6sWGYLwcJqjAIOQgm0Z8LjUuVHzryTsDiLLJhe/2v5C/Vfh89gkKMwo8wp7un BgkMAr20a4qEfiXDZkhXfopOtn77Av0nbkA4uy+ZBDj/Md5vS+TrC5sijZZaUSJHVp+e YxHvuV3DAeWf2CFtPbpqxpYMWu+Kt+67Ev+ah94HEI9pDMmyQDzDk7vdf/Fp1YRmLKAx VuYox6taXpR6mQJ9N9co0J2CIztpPDjsTqmx/KnzdWfAChBksr4jMs1TkhDONkTAHHqZ ztIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=LBTW4G1y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hb44si111759ejc.150.2020.12.03.13.00.46; Thu, 03 Dec 2020 13:01:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=LBTW4G1y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387815AbgLCU5N (ORCPT + 99 others); Thu, 3 Dec 2020 15:57:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387560AbgLCU5N (ORCPT ); Thu, 3 Dec 2020 15:57:13 -0500 Received: from mail-pj1-x1049.google.com (mail-pj1-x1049.google.com [IPv6:2607:f8b0:4864:20::1049]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E55E6C061A51 for ; Thu, 3 Dec 2020 12:56:26 -0800 (PST) Received: by mail-pj1-x1049.google.com with SMTP id hg11so1946985pjb.2 for ; Thu, 03 Dec 2020 12:56:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=S5ra3fFtwyrR4DBSDAkXB7bmFSTJjJvoJm1aScqSvD8=; b=LBTW4G1yq8Tlr8j60sdrqz5HWAARs1V+8aIMhV3V5AQLPx6JTlpixUJ5GfUFelcDwW wXHs1SeZdVZXtuID6Oekg9t3XeAP4+ILetytMukbpIbSjcIGt0KpUh7r5ihOA7uYlvcY jnb7iYbl4p7UsgRbX5OuBqAKSmm0x4WiiStX7RazsIyIWOfnXG6avJc44OEP48/9R/FI WHXpHTzUZKF35lQZHHryI4l7Up3rMNW6Rhz+YFgAY6Pf/AKrOYpY0k3maORqmuMNkB+9 UeqK8C2XVnlf+XLCKB7Zfa+8p68DYcRLpmc5CQKVcQ53zzlquK/3bKdiJjp8cunqIhUt UYoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=S5ra3fFtwyrR4DBSDAkXB7bmFSTJjJvoJm1aScqSvD8=; b=kSmqjqV2QDdzX4Vj/BH2HC/XZ344FLMKA5GQtu3vY7htSt7UNkXeplin9J9UtBKkzg VcX+Ai5Rpo7JRJyn0F+NnnQRK/eFizXy6WPDaQ0DODgeZg18Z2n75fOjDkHWbkTNVL2t zQyZB7z2kwZNYihqZxOeH0dNtRT4vRYwm0cF1bilmEeSKV7HKnm1ZQ3Dlt/0FsLq2cVQ OAOwH4/37bWh3X4dO5Se107IHeUG0aG0AXxc0E0Vy0xDX+SJOEHW3X9GhwcQMlVTi3VP GlTNKZW4zLia/HdEmIcv2vd7E/3Ae8zHiR1o+AAxYt3oy3+zdYwQAgogCebhi4iomw2Y bTUg== X-Gm-Message-State: AOAM53253Mp8YJeknuou0U1m/SK7xeXX+1SRZubTnueu7TEQ0kcOCcqp 6qILy4jjvAMtl1xEGnK6Jtlf5ZkpOa8Uqg== Sender: "jacobhxu via sendmgr" X-Received: from mhmmm.sea.corp.google.com ([2620:15c:100:202:f693:9fff:feef:a9a1]) (user=jacobhxu job=sendmgr) by 2002:a17:90a:bc0a:: with SMTP id w10mr847025pjr.79.1607028986454; Thu, 03 Dec 2020 12:56:26 -0800 (PST) Date: Thu, 3 Dec 2020 12:56:19 -0800 Message-Id: <20201203205619.1776417-1-jacobhxu@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.29.2.576.ga3fc446d84-goog Subject: [PATCH] kvm: svm: de-allocate svm_cpu_data for all cpus in svm_cpu_uninit() From: Jacob Xu To: Paolo Bonzini , Sean Christopherson , Jim Mattson , Oliver Upton Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Jacob Xu Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The cpu arg for svm_cpu_uninit() was previously ignored resulting in the per cpu structure svm_cpu_data not being de-allocated for all cpus. Signed-off-by: Jacob Xu --- arch/x86/kvm/svm/svm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index 79b3a564f1c9..da7eb4aaf44f 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -530,12 +530,12 @@ static int svm_hardware_enable(void) static void svm_cpu_uninit(int cpu) { - struct svm_cpu_data *sd = per_cpu(svm_data, raw_smp_processor_id()); + struct svm_cpu_data *sd = per_cpu(svm_data, cpu); if (!sd) return; - per_cpu(svm_data, raw_smp_processor_id()) = NULL; + per_cpu(svm_data, cpu) = NULL; kfree(sd->sev_vmcbs); __free_page(sd->save_area); kfree(sd); -- 2.29.2.576.ga3fc446d84-goog