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: 203152 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1363977dyc; Mon, 19 Feb 2024 07:41:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXJvJl47QQxnQyFXOXhB8fNuOr0ex4Pdrcj3uv75FuQR3hJargAUpReifT0zmRcgmQYDnBkmOy9IcwtBhNkkudVyagH4w== X-Google-Smtp-Source: AGHT+IGn7Aemn/X1xnMd/bKFYBa+CRZM20BGu5/5wP7Ii3rMyPRQ0vKceLEgGB7ySHSF2H1idQ9i X-Received: by 2002:a17:902:7ed0:b0:1d9:a4bb:29f2 with SMTP id p16-20020a1709027ed000b001d9a4bb29f2mr9863288plb.46.1708357299722; Mon, 19 Feb 2024 07:41:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708357299; cv=pass; d=google.com; s=arc-20160816; b=L8wJ2Zhy14oU3j3x7BYhX3+vP7GEh282O2ja6p6sMhhTOb6G+5vNfc1NXGvEr5Nue2 lQmjSRmNPG3vKA0ZR1y8fBv4sI9YpkpnCXvNQ+whFZYYlmd6tgAyNosuNQWkov6qNx45 bFv1JBVMfICrzzv+pSpV8NKUAh+mQ+ravl4xdCmi3CFvexffBaWEHG3ubXumFtHa7h4C 6F6B8HiL7cAj+agj1zely4Mo/17NI384GohpdPJSVlV4u2FVZmJl8IxAIo5rsPFvBpNk VWg/U703PNTG99h/e3p/p5E0OWIasRg2Sg93jR6aCT/WtoCTFJkN9sWc3dTC00YSBWSe GHmA== 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-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71599-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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.41.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 07:41:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71599-ouuuleilei=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-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71599-ouuuleilei=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 7F017284D42 for ; Mon, 19 Feb 2024 15:41:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 079E041C83; Mon, 19 Feb 2024 15:40:12 +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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791342463534032454 X-GMAIL-MSGID: 1791342463534032454 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: