Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D72A7C433DF for ; Fri, 5 Jun 2020 13:19:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A81F92067B for ; Fri, 5 Jun 2020 13:19:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OTpEsiR1"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="L90ZdWI9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A81F92067B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8retFmqVTCTPoqjXpxEuzTnJgD0PrdT4G4OUOL7YtHA=; b=OTpEsiR1ZRS5Y0 2Ah7HK0/CefGbfxQGV4G5odqWpwfNzp/lBlzS99glwZOP+WMJaK51YG28nOjxqpzD1QQTRR/Nd7rx TWOXEVirNB/c8+O6RQaGr+GdqjlmVwYqw6C+q3Y+wGHB2fwKXwptp2+bDnKOgz7Zn5CJLTg/t8LrS /wi4+hY5fTVuA0Unl9dKRhLWj4XBMMEc+X9ibkNeZobFqzEYvS7pT7BnJS8r3/76Jix9s4UrLW3Nv TqNpGmA+dj2Dd81bxffB4ZwDmxRTsv0TzZKtDHVA3WK7sGNYTl0+RU9aDty+d8W8O7eZmADJZpLmK 5Zlq/d5WVcVUeyDV8D5w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jhCFx-0002gF-Va; Fri, 05 Jun 2020 13:19:34 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jhCFF-0001zb-Q5 for linux-arm-kernel@lists.infradead.org; Fri, 05 Jun 2020 13:18:51 +0000 Received: from localhost (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A23F3206E6; Fri, 5 Jun 2020 13:18:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591363129; bh=iPssJmSp+Kp0nUy4lU4dQ6cYBwra3RuOzpDl2L+d1Ys=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L90ZdWI9fqE888FrKc2cxOzwp6Hc/bNdPVDKxrYrcgHW5sJls8N65WYxUp8eA+PvT WH0vqoo8Wp3nWiWFmfpbERrlHsucOTkIFzfYe+XzQZMhZpKt9sAZ5D5BQeGpzVGJQu DXqHY3FJoF3oux3EOGzwD9AiVPFAb8uu94HZt7MI= From: Mark Brown To: Will Deacon , Catalin Marinas Subject: [PATCH 3/5] arm64: vdso: Initialise the per-CPU vDSO data Date: Fri, 5 Jun 2020 14:11:29 +0100 Message-Id: <20200605131131.16491-4-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200605131131.16491-1-broonie@kernel.org> References: <20200605131131.16491-1-broonie@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200605_061849_864153_C0ADC080 X-CRM114-Status: GOOD ( 11.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Brown , Andrei Vagin , Vincenzo Frascino , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Register with the CPU hotplug system to initialise the per-CPU data for getcpu(). Signed-off-by: Mark Brown --- arch/arm64/kernel/vdso.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c index ea5e18e37371..9e5d12ce7de9 100644 --- a/arch/arm64/kernel/vdso.c +++ b/arch/arm64/kernel/vdso.c @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -18,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -363,6 +365,26 @@ int aarch32_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) } #endif /* CONFIG_COMPAT */ +static void vdso_cpu_init(void *p) +{ + struct arm64_vdso_data *data = (struct arm64_vdso_data *)vdso_data; + unsigned int cpu; + + if (vdso_cpu_offset()) { + cpu = smp_processor_id(); + + data->cpu_data[cpu].cpu = cpu; + data->cpu_data[cpu].node = cpu_to_node(cpu); + } +} + +static int vdso_cpu_online(unsigned int cpu) +{ + smp_call_function_single(cpu, vdso_cpu_init, NULL, 1); + + return 0; +} + static int vdso_mremap(const struct vm_special_mapping *sm, struct vm_area_struct *new_vma) { @@ -389,6 +411,12 @@ static int __init vdso_init(void) vdso_info[VDSO_ABI_AA64].dm = &aarch64_vdso_maps[AA64_MAP_VVAR]; vdso_info[VDSO_ABI_AA64].cm = &aarch64_vdso_maps[AA64_MAP_VDSO]; + /* + * Initialize per-CPU data, callback runs for all current and + * future CPUs. + */ + cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "vdso", vdso_cpu_online, NULL); + return __vdso_init(VDSO_ABI_AA64); } arch_initcall(vdso_init); -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel