Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1209803rdb; Mon, 19 Feb 2024 07:40:51 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV1IU+C4bn4KlgOUzJbmYc98B/c27SOU+UFDvh8qZvOV1QzC6JoFYo0d8Egqjts528mdjJFixIw5sa76V8H3d0qabzUJ+H3zgTSGomHsg== X-Google-Smtp-Source: AGHT+IHUsxntNgsqRGyGoJl+XZ2Sv+DEv7Lb5KS3tmAvkui8uQA0hWJAXX2Er/pPJQF4aGV44/C0 X-Received: by 2002:a17:902:e809:b0:1db:dbce:1849 with SMTP id u9-20020a170902e80900b001dbdbce1849mr5255170plg.2.1708357251590; Mon, 19 Feb 2024 07:40:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708357251; cv=pass; d=google.com; s=arc-20160816; b=vvT7Z98i+pGsJLdmBrW2DP2RiN/txJBux8CQcOE30v5S0EZdT0LkTx1HFAbVetp82K chDfdLQpiP2eTlT5lxJg2TtUpTrP2k4tbz6ILHXHYeoMip7oygbdpSnpIzdY1Znrdilu B7drcq/U+mlDj+NhSnLyvNJxXlo4Aw8LHEemEV9imlTOKvGt3cEMI61y/i6nPhKvCSKh S5eB6KfGD0mcXW9OyV6nmMLu6b+Cus9JeU1GSPcAASC8wLlRBBOLUpHDODFXojVGnhT1 GANcr0gaRKSghb/qhXMOQ1j0JGJ7Cabc5BxR/kL2d57MCrXlSP9sIwUbc0Rz/MDXWolv TPyg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:dkim-signature:dkim-signature:from; bh=QlKcGbQq5n1Lw3ANMVFZoMmufVy08yz4U/pR4YBIv6o=; fh=Nx2YW50pAR2bPUBI+SEMiQx8T/QhDIC834QrLJg7z8M=; b=JN7VmurGItckX5P4uM11kR/PchtC0aZMxAi9pPgRIhG2W7XVcGPqUkfORVag2/8fOC QVnVdbl1ItM6QaVbUs7ciCYXpmPWs76lBpMPhX/oczrHQ65qlh2vZ89t3UErRrwvh/fC Bk7I30GlYzxlOLRYNumAf9OQ28yyvPpYOmlufO7GxG0Z3sV3RomT8mHLuTTPfWC2GqA6 HnTUKanUriQJ3h6iabRKSo9WSHm1X60dV2HqCuCYXXSzIi0v7slQyzjgsRd1KWiJo5mt s8g5hzIVPhOXPU+F/qZgMuXpMmQsNGpCLE9TqBwRkesg6PjGXVe2z8LgSO1EbXTy94Ch mRAw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=DQVndt3p; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-71599-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71599-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id b14-20020a170902650e00b001dbd677a910si3332959plk.500.2024.02.19.07.40.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 07:40:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71599-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=DQVndt3p; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-71599-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71599-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id BC085284D75 for ; Mon, 19 Feb 2024 15:40:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AF4FC3D960; Mon, 19 Feb 2024 15:40:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="DQVndt3p"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="znuj+4xx" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D24AF3AC08 for ; Mon, 19 Feb 2024 15:40:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708357208; cv=none; b=kVxbiACk2j8tdSpq0kV7kG+aHcQR4ZPlfdaLrLOlKFTCRz2HZll+AYOjGcLv9oKGaIhEOhFL5VQESBuwpyA/K0bqdrS1n9sn1AvWYOJ+qOocdi9d7htuKMkZmigwhx8bzr4OO9Cp2X1p9aUQiGfyXQOyQWvk/RAi6tMc+aQjR1I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708357208; c=relaxed/simple; bh=4nSPlxQK2Qa4EXTdhd2aosfODHzGKDI3DJ3vUm8YPFE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lg8GAzo3eP/ZeIcvnvWbdpkmEcR3tBD4rRz1X5OwlwkJvrRVot1N1DNbQHBqr5Um028OYXRHy03O1qwD7Q46FfOcU9NfC5AHBqBbuVM9cojTk4DGN1/fWAMOQeAjzDC70SJAZ5ygjhe1qcUmwmHxh6yeyNbIt8PBtClBvivoRXk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=DQVndt3p; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=znuj+4xx; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: -- 2.39.2