From patchwork Mon Feb 12 11:54:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 199674 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp2377467dyd; Mon, 12 Feb 2024 03:56:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IHMgdBiUqUpASN6FDSEIF6LmWIP7iu+mEyE0TTV6Ockq4EOcJN3SgWLoDT2+Jx1BPV20lZ6 X-Received: by 2002:a05:620a:1a27:b0:785:c033:8b74 with SMTP id bk39-20020a05620a1a2700b00785c0338b74mr7005963qkb.58.1707738986853; Mon, 12 Feb 2024 03:56:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707738986; cv=pass; d=google.com; s=arc-20160816; b=CBc/P7DLtMO404zf8uINlU4X2CzGmMrcecJ9H7SXHyg0EAJLVqnU1y60fJdJodBw76 /I1o7zliQ7rbD/XZdoyzOvwtwUIOZKgDcMuGheidhMcGT66Ji9Syx4HDBZCj465mEhww 2BEVj4xWi9S5/coEcYroWsYtb/4wB/8zmltmLYFHadRZwIrbkdxvGvvHe4+xsBVn7tvi JRbPWpLdpdDn3N4EtUfIghbGpg88SG9C0WicZgg4NFBiLRgOZ+Tr8/cWWYfy/pd7z5DJ Pijcf6Ws1U64aSNr4YHDakK1PWUOfSNvTYBjNq345ozEWn8TylWBkG2Y963glgkfpYZQ KVSQ== 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:from:dkim-signature; bh=VVvOwBrSuMtITWpqoDUBeLSYkEYOwFFiivjQgOkA3M0=; fh=Nd3YwZvOkmkgPQUXTCf6w99qgJP0ep4MQ9Q3xLBqAtg=; b=bFQ19cK9g8tWIzHuQzk1CMRHLrjA+cpOO7dcXF/fnDdp6xkKmNNGNZdehWqkHNq9H9 qTaKhKUEDY6GipXxNcVbp3VCr2DeHpItVEe+ky1ndoJ4gnah4iuYgwdZP0uukKzr8qL6 2hilNqH6nhZzM8zyso48h5QnFJh6w2aA28mliA8aqINc2+/oe06GpR0BWelu1p1zhw8c ZcYRmVz61rZTiIKJLMC5GuEQXlZ/qVbhuaCI26LhBLMmedtJgCseJZn8RnK6xVCO4un8 bOzDTJNWoLRPUaEH4uNvOjH+a9DEYq17TU+TberZSCLkDBW3cm0wjSOJq5v4m/ZlT3Rr AXGg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=JxVqIPVY; arc=pass (i=1 spf=pass spfdomain=ionos.com dkim=pass dkdomain=ionos.com dmarc=pass fromdomain=ionos.com); spf=pass (google.com: domain of linux-kernel+bounces-61468-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61468-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com X-Forwarded-Encrypted: i=2; AJvYcCVhcD9grlP1OSJNf9Kx1TLKLpdj62W4LUk483+8tEJfEbpLaoqGl1aq/Ysgy0st4aUxXDT/XSick5ESw4FlQLtjfy9tUA== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id g23-20020a05620a13d700b0078575911c72si5741812qkl.671.2024.02.12.03.56.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 03:56:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61468-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=JxVqIPVY; arc=pass (i=1 spf=pass spfdomain=ionos.com dkim=pass dkdomain=ionos.com dmarc=pass fromdomain=ionos.com); spf=pass (google.com: domain of linux-kernel+bounces-61468-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61468-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id EFFDC1C2206F for ; Mon, 12 Feb 2024 11:56:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 63E723A1C6; Mon, 12 Feb 2024 11:55:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="JxVqIPVY" Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B0E5A39FCC for ; Mon, 12 Feb 2024 11:55:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707738926; cv=none; b=Cl53nD5csR2hr0Sxt8P0xUXJw4yvod27aGW6eJXAhNRjz4WwoKOIf0dGieRcjIB7cb9FW7P7ta5dGdd+KFz6m3o+gJ2Svi/iIsl67vLSdo71JECzjiruvtvAftVf6oPMWZDRZMdGS/qFEPpdsP5aEBVN6dhlGzbejkwHOMkajEI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707738926; c=relaxed/simple; bh=dOlTuXKsYcsEMhZKV2ceENM9VxEjCmjj6RlMrSCfXDs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ggok+kcvGHN9Gxc19GmmmqrQ9/9tpr9TWECcMhg4MCuw2jBTfHMLa9dhuz1JpE2Z3Pbq2cvPUYNRexft1aBiAPsr1PU7Hza6+v0KsglSQITX4vuxoNM1v3HSeNC3C2/g7eAST/7zt3oFFFE9/BuG9SThbNVdWgZqtk6N1g/jAHo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ionos.com; spf=pass smtp.mailfrom=ionos.com; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b=JxVqIPVY; arc=none smtp.client-ip=209.85.208.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ionos.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ionos.com Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-55c2cf644f3so4016122a12.1 for ; Mon, 12 Feb 2024 03:55:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1707738922; x=1708343722; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VVvOwBrSuMtITWpqoDUBeLSYkEYOwFFiivjQgOkA3M0=; b=JxVqIPVYAqpg/J8kR/i67x4jI4LXhQo3QMRSeVI3WzMAbQdtn6MvjeBe4YD0p3yPNR AqFkfVCLfQq190+YCJ5DsC725lp0DhP9Iqql/rKidplAe/mZ6eO2izD45svYUmUzjxDt vQ4RC2/Kj971uVdnAjV3jUhyq3HtIrSOY4nfdeLG0SV+dZCO/h+1eBuOnYzQ6XsNg/xS gX7JosUfGJsvAPeurcNYohJxoM4JxiTdDY1ZAr4DVSFrB1ndxk9WeZ5spxJzqv9JyyGe cTZoGuNv3WRuBCMk2IQMvBQ0MmwkV5a0vvKerOlnbEhYi3DNkDwrHPiHm2Kf1qTlJ8iG K1Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707738922; x=1708343722; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VVvOwBrSuMtITWpqoDUBeLSYkEYOwFFiivjQgOkA3M0=; b=jho7Ke9/XeFn675Bf+uKilXgv8U8btmPuec3B5gYV+bAGXWH6ls1cDr5odVeWWoldN FD4XCg/kiAUtLu93Cb+GDiDkboddJMf5UTusNyEOol3GajAIV8BHtbYW2f5bjOb6GakT q9Svc9tvMrfO7GCw3GTmpfsZkXUH8SbDPBIa/H1Op0bSEOKQAMdVu+NjMDGXqwxztXyW 9aLStQOGuLkzkVu6c8qn275gR+wVh17su16LFnr5Q+jgmSKpKsvUZzud+Ez9BilEP8LS Yf/yARWsg1J7YdPvPIE+7jjMlCDC36DbLxzIbKcXzjWvLpARnMR/v03AHuPG9SWJhdAC Hr1w== X-Gm-Message-State: AOJu0Yzif71lYDgai48mQy39y9OJ0+Jh3VR7dLJwbW2Ov2pi5/PqY4cb GneX5cQksg+xUOhVqoAK4AjXe4R02Nl3SnSNU1GEGvPGTFZYknNilEA7dQHkrLl7rUU/cJNr9uJ Z X-Received: by 2002:a17:906:fc01:b0:a38:3693:aea1 with SMTP id ov1-20020a170906fc0100b00a383693aea1mr4118831ejb.52.1707738922297; Mon, 12 Feb 2024 03:55:22 -0800 (PST) Received: from raven.blarg.de (p200300dc6f267100023064fffe740809.dip0.t-ipconnect.de. [2003:dc:6f26:7100:230:64ff:fe74:809]) by smtp.gmail.com with ESMTPSA id m1-20020a17090607c100b00a36c3e2e52dsm139203ejc.61.2024.02.12.03.55.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 03:55:21 -0800 (PST) From: Max Kellermann To: linux-kernel@vger.kernel.org Cc: Max Kellermann Subject: [PATCH v5 10/35] uprobes.h: move declarations to uprobes_types.h Date: Mon, 12 Feb 2024 12:54:35 +0100 Message-Id: <20240212115500.2078463-11-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240212115500.2078463-1-max.kellermann@ionos.com> References: <20240212115500.2078463-1-max.kellermann@ionos.com> 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: 1790694115788941797 X-GMAIL-MSGID: 1790694115788941797 By providing declarations in a lean header, we can reduce header dependencies. Signed-off-by: Max Kellermann --- arch/arm64/kernel/signal.c | 1 + include/linux/mm_types.h | 2 +- include/linux/uprobes.h | 10 +--------- include/linux/uprobes_types.h | 25 +++++++++++++++++++++++++ kernel/entry/common.c | 1 + kernel/trace/bpf_trace.c | 1 + mm/memory.c | 1 + 7 files changed, 31 insertions(+), 10 deletions(-) create mode 100644 include/linux/uprobes_types.h diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c index 425b1bc17a3f..e54be587723d 100644 --- a/arch/arm64/kernel/signal.c +++ b/arch/arm64/kernel/signal.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index ed764511bc23..54caee378e77 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h index a76155cf8ceb..6ab950cce8a9 100644 --- a/include/linux/uprobes.h +++ b/include/linux/uprobes.h @@ -11,6 +11,7 @@ * Copyright (C) 2011-2012 Red Hat, Inc., Peter Zijlstra */ +#include #include #include @@ -94,12 +95,6 @@ enum rp_check { RP_CHECK_RET, }; -struct xol_area; - -struct uprobes_state { - struct xol_area *xol_area; -}; - extern void __init uprobes_init(void); extern int set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); extern int set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); @@ -137,9 +132,6 @@ extern bool arch_uprobe_ignore(struct arch_uprobe *aup, struct pt_regs *regs); extern void arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr, void *src, unsigned long len); #else /* !CONFIG_UPROBES */ -struct uprobes_state { -}; - static inline void uprobes_init(void) { } diff --git a/include/linux/uprobes_types.h b/include/linux/uprobes_types.h new file mode 100644 index 000000000000..0ce0fe3801ea --- /dev/null +++ b/include/linux/uprobes_types.h @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +#ifndef _LINUX_UPROBES_TYPES_H +#define _LINUX_UPROBES_TYPES_H +/* + * User-space Probes (UProbes) + * + * Copyright (C) IBM Corporation, 2008-2012 + * Authors: + * Srikar Dronamraju + * Jim Keniston + * Copyright (C) 2011-2012 Red Hat, Inc., Peter Zijlstra + */ + +#ifdef CONFIG_UPROBES + +struct xol_area; + +struct uprobes_state { + struct xol_area *xol_area; +}; +#else /* !CONFIG_UPROBES */ +struct uprobes_state { +}; +#endif /* !CONFIG_UPROBES */ +#endif /* _LINUX_UPROBES_TYPES_H */ diff --git a/kernel/entry/common.c b/kernel/entry/common.c index 88cb3c88aaa5..364ea38c868e 100644 --- a/kernel/entry/common.c +++ b/kernel/entry/common.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "common.h" diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c index 241ddf5e3895..e74430389877 100644 --- a/kernel/trace/bpf_trace.c +++ b/kernel/trace/bpf_trace.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include diff --git a/mm/memory.c b/mm/memory.c index 7c3ca41a7610..68abe5dccb5b 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -70,6 +70,7 @@ #include #include #include +#include #include #include #include