From patchwork Fri Jul 12 05:28:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 168879 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp394956ilk; Thu, 11 Jul 2019 22:29:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+og7B39ktsQYQrHtqm9MjFrvCsdPIzINBUoFQA4xKLCRj1a8LtGTTbR+nqhwnNANMRfNt X-Received: by 2002:a65:454c:: with SMTP id x12mr8636282pgr.354.1562909394669; Thu, 11 Jul 2019 22:29:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562909394; cv=none; d=google.com; s=arc-20160816; b=smSaIdb5yH3BXbq+kizCd9Eu6OKl3pGuw5ncnGSROMdoG9YLKnDHOpNaULlnE/fpD/ qD7w7pgeiIImGv+8BhBuFb/dfo6DHZ8pYM3y8jKlSfTjcYXV5sWDyhvYGIlDogQZwb/0 t3BYoMG3/l86ZiGbLEXl53wS6v1G6MgPj5/MTHVkY03W70dSsOokvIRUNwA3hMMR0IRF ZMy4u8jHsTetXkgXgsnOyILPgr8B3gJLkRZMeCnNw4dzk9GZw/QhxUlj25E+cl7761zz FlQqAPReJxRn0Q4l2C9edQtjSU/6PxuRUkDjtnR5ycG511/nj3XMqwTzPBeXYgVcmKvX Q3fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=L+Gdnz2jFF65J3PIUhAk0AHlnEqUM/+ROCtumKJNSeI=; b=B1KhdgqkkKFSJXr4kqkli41iosAlNMeHf4BZgH0WchEsA1Fg2A5eKFPnC2xmMozcaS wvhdBtBj/wQZFb2om+Jm/L1RtRn+cSj7B1WIBUoJcYc0pHdh64qm333ZHywP1/8pOR4M 0Wmd2mb9i4cAQzcDLk49D8/DbE+j0xnpE4vQZVXTARW2vjY/y3SDx5dyWppLsC7kkXxe AQfXFVEUpyVU9AQnRm8dZDE4jCiSgTRz6fnHZE8E2cyTv1ZtWx35pMDDxShDfxx6P3WG VavlPM/i1UZAhZX0RJCBs5bmO9aIylozP6YUvFsqnDif+zJohIcnBTyJAFF0K3hnvw0f SJHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O28H3hJb; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e36si5303191pgm.17.2019.07.11.22.29.54; Thu, 11 Jul 2019 22:29:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O28H3hJb; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726074AbfGLF3y (ORCPT + 13 others); Fri, 12 Jul 2019 01:29:54 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:34657 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725791AbfGLF3x (ORCPT ); Fri, 12 Jul 2019 01:29:53 -0400 Received: by mail-pf1-f195.google.com with SMTP id b13so3800253pfo.1 for ; Thu, 11 Jul 2019 22:29:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=L+Gdnz2jFF65J3PIUhAk0AHlnEqUM/+ROCtumKJNSeI=; b=O28H3hJbcm//HM+U/MWBuTNk2PRepOPX88YnoORFVdxZm09Mikdw3xD5PNVZAZcyJe SbkalfujGuflSOEKDuz9pC45lyZQhzbUFb7eZBEv5TnP6mQk8SvYOnFZ0TAHg6XgjTO1 M4vVkB+MqXqFKCP5J1/py2/4yb93120qicinbyThs1y/CAvkwHcoXZ4UWNASDaZYbr/o KYF1Zg1rmYn7w1Sp2W48nAkF5hIm0uUEOTg57A/O2D8Nr6d+6wXJNmGb5uKfNpzD01Ii iBwFDSQSY7S7s5vf8Mcz0jnUo5cUdJL1ne7hbWENSdlHLL+vqy0eyBtxP15jn46Jl6RI A0Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=L+Gdnz2jFF65J3PIUhAk0AHlnEqUM/+ROCtumKJNSeI=; b=dWLjpMmproeZeoqW+SLuWLZZHkHju0/3SY9dkCpXhTMLEY2u1h27QlZXzwvMDk0Uwt 5/FAgkhxs+VP1PxfWuELSxPWef8LT2SdXgPIO0I4BjO78kqjV++3gVMdpUNPcOCKcFID hQbvUlyN7br5S4Imnkv7qRZpJlyp2DuCsUu95Nu2N8K2ggnRb1QcYAfRg9HfiYNJGTN7 Xx7u3LjCP372IURTKd75DBlw1exS10YDFhAWMIl2UVyeZEpSjOtbJtcVsB58HelvpmAJ eddm/I7oK9WQwRhjddfFEirD3ihAnI4VC3Boq+MKI6bRZ/2AJLoHPvwR/KFdBDTzOsX+ Q7UQ== X-Gm-Message-State: APjAAAXXFqBsJJgR2+DZBAX3ol6PAVBwiLRSf3sqn8Lhs1o9aYPNfvjO /w0vwhDtJoyC46A84LYKVWkn0VTE/GI= X-Received: by 2002:a17:90a:fe5:: with SMTP id 92mr9537112pjz.35.1562909392738; Thu, 11 Jul 2019 22:29:52 -0700 (PDT) Received: from localhost ([122.172.28.117]) by smtp.gmail.com with ESMTPSA id p20sm11193369pgj.47.2019.07.11.22.29.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jul 2019 22:29:52 -0700 (PDT) From: Viresh Kumar To: stable@vger.kernel.org, Julien Thierry Cc: Viresh Kumar , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Marc Zyngier , Mark Rutland , Will Deacon , Russell King , Vincent Guittot , mark.brown@arm.com Subject: [PATCH v4.4 V2 20/43] arm64: cpufeature: Pass capability structure to ->enable callback Date: Fri, 12 Jul 2019 10:58:08 +0530 Message-Id: X-Mailer: git-send-email 2.21.0.rc0.269.g1a574e7a288b In-Reply-To: References: MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Will Deacon commit 0a0d111d40fd1dc588cc590fab6b55d86ddc71d3 upstream. In order to invoke the CPU capability ->matches callback from the ->enable callback for applying local-CPU workarounds, we need a handle on the capability structure. This patch passes a pointer to the capability structure to the ->enable callback. Reviewed-by: Suzuki K Poulose Signed-off-by: Will Deacon Signed-off-by: Catalin Marinas [ v4.4: Use &caps[i] instead as caps isn't incremented ] Signed-off-by: Viresh Kumar --- arch/arm64/kernel/cpufeature.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.21.0.rc0.269.g1a574e7a288b diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index c74df3ca000e..474b34243521 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -832,7 +832,7 @@ void enable_cpu_capabilities(const struct arm64_cpu_capabilities *caps) * uses an IPI, giving us a PSTATE that disappears when * we return. */ - stop_machine(caps[i].enable, NULL, cpu_online_mask); + stop_machine(caps[i].enable, (void *)&caps[i], cpu_online_mask); } #ifdef CONFIG_HOTPLUG_CPU @@ -881,7 +881,7 @@ static void verify_local_cpu_capabilities(void) cpu_die_early(); } if (caps[i].enable) - caps[i].enable(NULL); + caps[i].enable((void *)&caps[i]); } for (i = 0, caps = arm64_hwcaps; caps[i].matches; i++) {