Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp802289pxu; Thu, 3 Dec 2020 13:03:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJxmCz4VbXpxcjJfc0zCgBJcQ4wIk3eXgW77a1To0LvFIZjedS4odtTQwqgDhWLjaoikOFtb X-Received: by 2002:a05:6402:31a5:: with SMTP id dj5mr4533042edb.325.1607029421050; Thu, 03 Dec 2020 13:03:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607029421; cv=none; d=google.com; s=arc-20160816; b=HG7bLEFdBamnLRbM+YSoRdt0DjXSQt4+Itaeg/2l8dgeNwFaJAINQ7T2qQP7sukDI/ 3b8W0KPWMh6y1C+RHjU8ajkUSTSL8JEUuqDuWx89xtz7yhzFCnG2ha6ORyI0X47yeH38 9pRv8Nd6es6aY2/JL1szB+ga1wJ+6/qgUwG/y/zpHxN2IZHi1VzsNX8z2zYilmOoDHuQ 0PcN7OnikuvOmmrGgjqc5uF/64+rEeM2CoNOJIctsiDdJaLMvQLjJILnQNln+XdIDTFm 70yUR56R5CKKCpah0oTUWaDraPIKM+NTmP9k521DLryIPucxCQYNXcMvJBF9bOHeTnZj cf9A== 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=m3FnV7TPuhRtIZgiGjHEgXkVEW/qqxg4qIHxLJoeQMVLMh7cBhttHaiU/n7TD/uZU6 1+xZRWyj2l2X/o/9WjfVxZrNap3T6TkKxUt9HchDXKFtrqICW1FXJ2WQoxMjW9NUXP8E 23mROYFihJ6phROOJ1zD5tEAMf1aDYXTKMfElPDFY2VhfpslnpLL/KsZZtZrKMUy9Lyt oAE4gWDgG7jusX09hVsCIZjBzUbizde69rRUtPdPdetkDPTxLe2kbGh1s2slNHeFBh7s 6hZCCDqymWxBYq6pLRyk7z88Vj/s2w7bve5luBNHdzmsw9sC3FDacKbGM75QnJD1d0bp 4N4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CMgmPGQ3; 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 x31si1655713ede.198.2020.12.03.13.02.47; Thu, 03 Dec 2020 13:03:41 -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=CMgmPGQ3; 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 S1728460AbgLCVAY (ORCPT + 99 others); Thu, 3 Dec 2020 16:00:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726597AbgLCVAX (ORCPT ); Thu, 3 Dec 2020 16:00:23 -0500 Received: from mail-pl1-x649.google.com (mail-pl1-x649.google.com [IPv6:2607:f8b0:4864:20::649]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A462C061A52 for ; Thu, 3 Dec 2020 12:59:43 -0800 (PST) Received: by mail-pl1-x649.google.com with SMTP id b4so1867481plk.17 for ; Thu, 03 Dec 2020 12:59:43 -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=CMgmPGQ3LRAJ91emyWbIDeeu4Npdy86zsS9HBSAc8ghZ8AyFtq8IPAKujurb3BXMl6 qydVnY5AUbZc+vdzxNbWWmIYmU4B56Pn368RqYqcA/O84Rn1fAmI+r5iI/4QxefdR5L4 iQPuaefyDoLSUm69oF0b5m4cjGZdtvwKugIsWO4AGpChjbjG3aZNa/TpTARfvmP7XDMv kYG4ybDJe0sJEk612YLAPX11BceZM8h3ap3K0/bEhhEFT2n2BI4/ChT6ITK0bUC3ZAtT gej5444rFOdUyWbg53TWG8bvVleKc4MyYctWo1+IF5Y2QdMGnyziGqHn4tNa6P/rBz3k R3fw== 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=PF8IjP4dQFh5e0Xze6S8oKRjvwIYCVnslw6WIuqAjZqAYA9wkytHzbuFnj5vD8q7gn X2bX16GRFC1y4tP27wKSo32gHbv4l9QyennbDxyuH1lY5Ao8hXt4v60YHuxV3TGzRmUr dUDsLeAzrECWBlEUta7qmGQh/DsjUSuEAR8vNTEqNEsUQ1fa/x5ACB8HdDi5SWIsV6ES KgAMV+ZQzaLgNyqItFLbXg4XB9kooEXjsjEQfO0YqVAECLM4+Jap6FBIzs72Jhk0ThkD +z5r0ftqLjGFcnoKmFkWCrEiFwUCSxzw6onGlKqqQiAcF2BJUT0WH8MjIVQ1xofhh+vy HRvA== X-Gm-Message-State: AOAM530GmhfIg7514Fe4gvhhmarXa5ztLcxGcFlQXEDQbZ448K/CfMsT U0vIRqBBbibs4pDhmk90nRR5LH6xciSO5A== 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:a62:1a16:0:b029:197:eabc:9b74 with SMTP id a22-20020a621a160000b0290197eabc9b74mr683802pfa.62.1607029182775; Thu, 03 Dec 2020 12:59:42 -0800 (PST) Date: Thu, 3 Dec 2020 12:59:39 -0800 Message-Id: <20201203205939.1783969-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