From patchwork Mon Feb 19 15:39:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anna-Maria Behnsen X-Patchwork-Id: 13562846 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E500C48BC3 for ; Mon, 19 Feb 2024 15:40:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 20FF96B007E; Mon, 19 Feb 2024 10:40:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C0786B0081; Mon, 19 Feb 2024 10:40:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 061166B0082; Mon, 19 Feb 2024 10:40:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id E452D6B007E for ; Mon, 19 Feb 2024 10:40:10 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 7E598C049F for ; Mon, 19 Feb 2024 15:40:10 +0000 (UTC) X-FDA: 81808964580.18.F690A24 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf27.hostedemail.com (Postfix) with ESMTP id 897B840023 for ; Mon, 19 Feb 2024 15:40:07 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=DQVndt3p; dkim=pass header.d=linutronix.de header.s=2020e header.b=znuj+4xx; spf=pass (imf27.hostedemail.com: domain of anna-maria@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=anna-maria@linutronix.de; dmarc=pass (policy=none) header.from=linutronix.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708357207; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=QlKcGbQq5n1Lw3ANMVFZoMmufVy08yz4U/pR4YBIv6o=; b=WVai3fgXv+RfrXHy+SsTzndY1U1UlUv9pfjfrNnuF9vltuzIxG5gmdwXw4SKT88cbL8CfR SD7uAEDw56HJ8HXvw5tcK31pq3gqWScEpgVUOAXu5dbZUdsUO0at+J/L60eS40cDA8ez4+ LZr80Ew7L9rxRnpzqLBtNeK7pA1OsFg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708357207; a=rsa-sha256; cv=none; b=yQ6kfgpQfgWh0KYJsmXuAZ4WETOntMvcixj7pG8cDwtXWc8IIZ4c9yyeFzkaQX7Zr3/0E1 38KmZAiL9yiZWCQbtGwoGg9YON+6AHG3ZpeukwmWaBAt82oVSPvji7N1LiHsixZjIbXBdd 1H9vZ2UclMX2/jBhgP08bfK6NJ0maCo= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=DQVndt3p; dkim=pass header.d=linutronix.de header.s=2020e header.b=znuj+4xx; spf=pass (imf27.hostedemail.com: domain of anna-maria@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=anna-maria@linutronix.de; dmarc=pass (policy=none) header.from=linutronix.de From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1708357205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QlKcGbQq5n1Lw3ANMVFZoMmufVy08yz4U/pR4YBIv6o=; b=DQVndt3p0yfttx5AUPeZCN3iTtdWAV24hcFQuNtKUGHDfWkmTmFOzBwJ4tX79ZpwmjQqlo wsPmcs6vqvJKWsSFuoHbpNZFIBeMUIyKj8ntew1GN8JErgcphPgfCzSBjXIRVnkRuvh00b 3U7UjOc9gWh78q87i+720c5EaQDtDSmfqsqibDcmLbYUmEjYhfpJ3v/IUgZ9nkm9TA4czC rzJjPBcvSHRkv3zGbOzlOmEhJsH3SlIyGHObDLQy1LHy84ud7HDnQ+KIym5dKFkKnBuUr0 gtlWnwlHDN4wVXCuystRefqWOwCqZWRdd076BoftdfAE+sZOnUPycjEXnz/h6A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1708357205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QlKcGbQq5n1Lw3ANMVFZoMmufVy08yz4U/pR4YBIv6o=; b=znuj+4xxxhEIGTq4lLn9ezO0YtooAhxLQ7RA0DFKxuk+jNtat7QB8A5H1hpkVLW5Edcw52 0IGraAgMTD7ge5DQ== To: linux-kernel@vger.kernel.org Cc: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Anna-Maria Behnsen , Russell King , Eric Biederman , Kees Cook , linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 04/10] vdso/arm: make union vdso_data_store available for all Date: Mon, 19 Feb 2024 16:39:33 +0100 Message-Id: <20240219153939.75719-5-anna-maria@linutronix.de> In-Reply-To: <20240219153939.75719-1-anna-maria@linutronix.de> References: <20240219153939.75719-1-anna-maria@linutronix.de> MIME-Version: 1.0 X-Rspamd-Queue-Id: 897B840023 X-Rspam-User: X-Stat-Signature: 686ij7rui8r5ztnhgqujm1pxophigr77 X-Rspamd-Server: rspam03 X-HE-Tag: 1708357207-583040 X-HE-Meta: U2FsdGVkX1/fTxaZpeBDV7d6II/Ay+sKDMTklDFF/1RNPXnMhPdqsRZ9AfT7X5w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rqKKpXGOm4dswdrVKMsv9f0blR+/ohc4tGnHP0tEjDHbyc58updUVHJJz5cKJEhso6SWuwY9pOXWSVj3jxS6lI6kX3TMQpso8JRVS4BIfGDewdQAP6kLkOXBLP6fnxgA+j2POEGPhqpeCxYni95NyrJ4GYuwdNFQpPUR1eQo07NxuMFtPgT6lHKopRP53/WoZYPv+cNUCpkNYw2G+YGccWNt+09Wgv+P/reWvEHzJvVP4osL4FIQEZhW5j7L37o5QH/20jt3ydn7hG5zTFADkWNCP8xXGn6PBjr467UWA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: The vDSO data page "union vdso_data_store" is defined in an arm header file and also defined in several other places. Move the definition from arm header file into the generic vdso datapage header to make it also usable for others and to prevent code duplication. Signed-off-by: Anna-Maria Behnsen Cc: Russell King Cc: Eric Biederman Cc: Kees Cook Cc: linux-mm@kvack.org Cc: linux-arm-kernel@lists.infradead.org --- arch/arm/include/asm/elf.h | 1 - arch/arm/include/asm/vdso_datapage.h | 26 -------------------------- arch/arm/kernel/asm-offsets.c | 4 +++- arch/arm/kernel/vdso.c | 4 ---- include/vdso/datapage.h | 10 ++++++++++ 5 files changed, 13 insertions(+), 32 deletions(-) delete mode 100644 arch/arm/include/asm/vdso_datapage.h diff --git a/arch/arm/include/asm/elf.h b/arch/arm/include/asm/elf.h index d68101655b74..9f21e170320f 100644 --- a/arch/arm/include/asm/elf.h +++ b/arch/arm/include/asm/elf.h @@ -4,7 +4,6 @@ #include #include -#include /* * ELF register definitions.. diff --git a/arch/arm/include/asm/vdso_datapage.h b/arch/arm/include/asm/vdso_datapage.h deleted file mode 100644 index bef68f59928d..000000000000 --- a/arch/arm/include/asm/vdso_datapage.h +++ /dev/null @@ -1,26 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * Adapted from arm64 version. - * - * Copyright (C) 2012 ARM Limited - */ -#ifndef __ASM_VDSO_DATAPAGE_H -#define __ASM_VDSO_DATAPAGE_H - -#ifdef __KERNEL__ - -#ifndef __ASSEMBLY__ - -#include -#include - -union vdso_data_store { - struct vdso_data data[CS_BASES]; - u8 page[PAGE_SIZE]; -}; - -#endif /* !__ASSEMBLY__ */ - -#endif /* __KERNEL__ */ - -#endif /* __ASM_VDSO_DATAPAGE_H */ diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c index 219cbc7e5d13..4915662842ff 100644 --- a/arch/arm/kernel/asm-offsets.c +++ b/arch/arm/kernel/asm-offsets.c @@ -21,10 +21,12 @@ #include #include #include -#include #include #include #include + +#include + #include "signal.h" /* diff --git a/arch/arm/kernel/vdso.c b/arch/arm/kernel/vdso.c index f297d66a8a76..d499ad461b00 100644 --- a/arch/arm/kernel/vdso.c +++ b/arch/arm/kernel/vdso.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -35,9 +34,6 @@ extern char vdso_start[], vdso_end[]; /* Total number of pages needed for the data and text portions of the VDSO. */ unsigned int vdso_total_pages __ro_after_init; -/* - * The VDSO data page. - */ static union vdso_data_store vdso_data_store __page_aligned_data; struct vdso_data *vdso_data = vdso_data_store.data; diff --git a/include/vdso/datapage.h b/include/vdso/datapage.h index 73eb622e7663..7ba44379a095 100644 --- a/include/vdso/datapage.h +++ b/include/vdso/datapage.h @@ -19,6 +19,8 @@ #include #include +#include + #ifdef CONFIG_ARCH_HAS_VDSO_DATA #include #else @@ -121,6 +123,14 @@ struct vdso_data { extern struct vdso_data _vdso_data[CS_BASES] __attribute__((visibility("hidden"))); extern struct vdso_data _timens_data[CS_BASES] __attribute__((visibility("hidden"))); +/** + * union vdso_data_store - Generic vDSO data page + */ +union vdso_data_store { + struct vdso_data data[CS_BASES]; + u8 page[PAGE_SIZE]; +}; + /* * The generic vDSO implementation requires that gettimeofday.h * provides: