From patchwork Wed Jan 31 14:49:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 194803 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1953445dyb; Wed, 31 Jan 2024 07:10:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IEfYVcf7m4YDyaEOeBjbVaduAjZSlnfeNpO+mhPx2YKeo6lYPJuIUNmBTo/Yn/G4FnjZgyL X-Received: by 2002:a17:90a:6c41:b0:294:4773:8481 with SMTP id x59-20020a17090a6c4100b0029447738481mr1940848pjj.1.1706713833035; Wed, 31 Jan 2024 07:10:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706713833; cv=pass; d=google.com; s=arc-20160816; b=BFFykFyuJne/2VdkXDvY4QTuIjkN9Ww7WeVz1Ps+t8zNWl1v2XlWaQ0KDF1VmmIIg5 Iyt47fg8kwUatXR5ywa5S8ZxJVc2yxvy4aOsU0s+HnHEVOiWTBzLIDS39d34IPAhx0ld GFa3JA12HE3Nrs4iuGqa2Yk5417N+KCluXJt3v5uG8EhF39tD2qEknUbLASD9fO2PqQG u+U8F9g8PKdxvypdpusWuttMPVwx0ABO+Y9wxyszlHN9UDowT0DyfL19bZB/MLlhE02G uGYVvT3AMuvmUI+LhEn1/kvNXSkTaL3BnPHB+4p7bomGsxsT6Pm8jOF1vax15/Dafhp/ xeJg== 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=sdyQr9oywwiCwCzVLHztAq9kauvS19ksjDmdRLsKvAE=; fh=qLnopTJ2izGpWhlkVqx4ywn2OeCSGoa5FPfLUPaePpM=; b=xMJ0yMr9o+tROuc9+dYd/QCHj9LhgEp2BFkotamReZ5fRA08GK+W4OGw6vvvQOF6Ec sDzA+l4Fx3o0JqBRyGwfifBWO+g1GYmfJh5zXLZ62+zUoNKb2vB5BfohssJhUydu9WYX AJlzSbmuZPGJ1+eWs7uDyrc+osuJPy8QmJDnnAfDypzd7qiWW5mXdDuc10uwu2Q7rige 5y51x1Qnx2gGiGM8engfD+SvYJmul802NsF+/HerGepUFs3JxyBBInKEXFkpYtqFNHnT IB492gP5IfDwl/rdlAUv2c9wjWyu9ByIxJfuq0ZEBaNxcBDDQOjHM8o3xPQQly7jNm1k xyWw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=WXJUOs9v; 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-46640-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46640-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com X-Forwarded-Encrypted: i=1; AJvYcCUiHSgtTjBFi2wgOR0bgi7wUUtYtk8Vz0r1d1yPoquUSZ03/4tMDEl3cenu/ZNh/knySB58qIIu75oA7qQ62NWCpejTrA== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id e11-20020a17090a9a8b00b0028ffa434c6asi1393962pjp.62.2024.01.31.07.10.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:10:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46640-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=WXJUOs9v; 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-46640-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46640-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 578CE2913F3 for ; Wed, 31 Jan 2024 14:53:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A0EA12CDAE; Wed, 31 Jan 2024 14:50:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="WXJUOs9v" Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (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 3971412BEB5 for ; Wed, 31 Jan 2024 14:50:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706712628; cv=none; b=RRiA0KNu7OZqO5xfK7rEH8VZY04sTNVHYFf4qDcZVUgl4e0rzMnciGst1vqNTiQ7bwcRHHgSDxS8VvPD3lpJi6NuIiVNYyoxd3wjYgDR0oTg6PWGJyRLWSjV/E+0+7XfQY3OwYyN0F74HvVB1UDCT3dpjmRN/vdbMSVBb9NDtP8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706712628; c=relaxed/simple; bh=40oREuaDf793HSspmnNkgOQBM5rh0Q0gFSvvbPlKexI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=LuKh/5vl9/f1aARKaitSr0LRJ7KwMg+hMTwhQuF12PRZdZWPK2bPubFy9k9f7pA/LjE0TTLFZdappS5CCSUiupczIGNcV9jWJa/+6H0qu5ZfCDooY9yuEIod9IZLtVKyAXbUbY5slSmw76agfWskM8/ldFGQsdWu/yhgfq91gCQ= 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=WXJUOs9v; arc=none smtp.client-ip=209.85.221.44 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-wr1-f44.google.com with SMTP id ffacd0b85a97d-33b0e5d1e89so74692f8f.0 for ; Wed, 31 Jan 2024 06:50:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1706712624; x=1707317424; 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=sdyQr9oywwiCwCzVLHztAq9kauvS19ksjDmdRLsKvAE=; b=WXJUOs9vA7i+Fgy2IreqqwfWOJHCkBlT0dRIZQHicELyf/b4gZytimmCXKBeaEXsFy VaiRJ/Z68M4dbDNlAqWhCLi4rS9TKGylF0QYthSXKdhsRhnli75Ps7fzX1ikpRScCbSB iQLMwTaD6Z/H0VgT6acpO7LNM0vEdmqA1bWntqM8rmxNwOtPZ7hDFgqd8a33bGYJPB+r bwx1kuMhSqO5ln+86FssyYn4MkN4UkyjbezXKeW7Y1hCeLgkQ9hEyol79Q5+8frpBkq6 Af1+XrtsQAtTyI6BktgNTUhE2B6TIV3TVhz49KgoqPWtpSTTF6KR4IPI6RKnNPMralw0 BYYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706712624; x=1707317424; 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=sdyQr9oywwiCwCzVLHztAq9kauvS19ksjDmdRLsKvAE=; b=L4brDH/UI14zeO97MVyLtBj7kldmZ0oydfX4JAFo+8Ipqq7WisWQL3cMk1Vqfyq8Vi H/0mUCd9NBRL+OVUYNnjSR1GyTR8XcDeGDqNSsrtzp4uTMA+sIGRG8Y12as/xDtgwN9P Tw6WrRagcfE4156b0d0y+oJdgDxIo/koGdMnlfL1ObNu51ZeEfiibxqmu2RUDWYE+Y2a alPIJWMRHL4BOxH3O9sqYf2Zh+QvdbBPkJftCbN3F5Xk7cnAOQPqEtbJLBc25MQ4I06N PrAne2cpqj/FmmofOD3f4H9jGDnvnZMqUfWG0dHt1Ci1jaV7rFNYSDW9c0R/rZI9B6q6 PCLg== X-Gm-Message-State: AOJu0Yw7yXK/CtzQcQ/iOffRKg3ceptedThrLDKZbUda4NFBHMKpvaLe z8dRmvcPj4a8PNUyOW5NMjBjKnPdy0zzPXXUSsaHIIYkeHZOH2K81xImaj8bfduCuENQKPs5hFN L X-Received: by 2002:adf:f552:0:b0:33a:ed59:c13f with SMTP id j18-20020adff552000000b0033aed59c13fmr1423082wrp.53.1706712624173; Wed, 31 Jan 2024 06:50:24 -0800 (PST) Received: from raven.blarg.de (p200300dc6f2f5c00023064fffe740809.dip0.t-ipconnect.de. [2003:dc:6f2f:5c00:230:64ff:fe74:809]) by smtp.gmail.com with ESMTPSA id ch15-20020a5d5d0f000000b0033905a60689sm13850173wrb.45.2024.01.31.06.50.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 06:50:22 -0800 (PST) From: Max Kellermann To: linux-kernel@vger.kernel.org Cc: Max Kellermann Subject: [PATCH 10/28] uprobes.h: move declarations to uprobes_types.h Date: Wed, 31 Jan 2024 15:49:50 +0100 Message-Id: <20240131145008.1345531-11-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240131145008.1345531-1-max.kellermann@ionos.com> References: <20240131145008.1345531-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: 1789619164440547402 X-GMAIL-MSGID: 1789619164440547402 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 0e8beb3349ea..8990975d0c37 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 6ee90f81e01d..88bbb724080f 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -12,7 +12,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 64fdaf79d113..1f314e6461e5 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 8d14ba440929..909a98b3d142 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -70,6 +70,7 @@ #include #include #include +#include #include #include #include