Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3178456rwd; Fri, 16 Jun 2023 13:29:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ51LyM2y7Ibsfq/a5pcpdIOPZK6g5OS/t4ilqVIejt7NTcKorXZe9iMf0iA0amt6KUAiHja X-Received: by 2002:a05:6358:e820:b0:129:c3a3:5efd with SMTP id gi32-20020a056358e82000b00129c3a35efdmr215844rwb.24.1686947355670; Fri, 16 Jun 2023 13:29:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686947355; cv=none; d=google.com; s=arc-20160816; b=qnt2dAm7d9ngLclesV6yu1gex6kxTDjASumHU7K2rYf27/Ns4NlVe5SdvoLvnIJSDm ZuPi/PUf1J4KvXHWOcObX/Xw8mzf0Y5vr5Df4Mf+sdk/MeIolzLFjo276nmmAY2+Lt3B g0IMCcFMp8P6eYsbPfdMVVHuSb9xTNiurKDYm6Ds3q2sx0u7252oMtsiYIR/jYwqNl+P r3h1JJGDvs7auUfVFqyBtIJyJzSKpk/5SaRqUc6zePmzFmlA/snTktffW3+/jihqwYrs XQfQBIiQfCwdyuAnP9afLJd5TRV5O5Th6THcT2EqIVGkfGp4VF737VWomCsS012YbItk BSzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=0syXvWVOMzE+crBjP45b/R3JjKKHEKyG53RAN5TCwtg=; b=MSIUG8/0eisBXTSfQdnzq7Zd2oUrHtMXoaHELpymvY9d9HFhrUjYNserBhrAcBmuZp PKALD0p6+LleqwD4HC3JTOBCkEm6ZD1OcDU+/xIKc0fx+roFcztcpIw+5UMLbS66UXUe +lvCiE/ZVjVUHBoWRjh8JuDNvaCLNA0cbiudL2EKOykzUy1tETQOOgSv81KIASPSIT7W XjuQF6y1mgQq6vPT/T3H2bkac+Fc23+eF2O3wHgIrqO7f8LFWJrl+Fy8j8kzzZSh9JCE rr7M34MklnJSGJ+f7tgg7hoY18biPQiJKRXp9OmMqxUmqsC/vipYpVltDL4x6XrXxRoO 9Uxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LmBJJScQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w22-20020a63af16000000b00543a881db09si4779110pge.402.2023.06.16.13.29.01; Fri, 16 Jun 2023 13:29:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LmBJJScQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345485AbjFPUSP (ORCPT + 99 others); Fri, 16 Jun 2023 16:18:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230022AbjFPUSO (ORCPT ); Fri, 16 Jun 2023 16:18:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59DC92D60; Fri, 16 Jun 2023 13:18:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D95BD63E33; Fri, 16 Jun 2023 20:18:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F4CCC433C0; Fri, 16 Jun 2023 20:18:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686946692; bh=U5Tl9qs4B0TBI/rIx4ZZgTkRwFm5uyKz4CPReQtXH/U=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=LmBJJScQlLvxsT8+Ta1tCpM4WXI6TR8l8c5jV/lF5ZOrowqAfZjtpNM41tcPHiArX +YH5I9st348UgQHncZvkjv1I8uf6/B9VIYKB/ZX5ShONmWppK4Z28CmWLldHUX++Co tQHCqBzRDW0rngL+0918l5A/LKDXSOHiSUfIz3m/CZC9iQ5hn0r0gJTm/FmWwj/qLn mAG9TY9iKVAQprNcopRBSELs+aKCJHBbKHSrnFdxygoqMhe72Gcymvj1seoYl1ETYg kF9uj767lw3HcyBO4F7SRQUsfNpsVMh+rYJU6mMVRBqQdXG9XPM9gyQIez8ST13ZvP VGJY2Pv9kdJTA== Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2b45a71c9caso13911621fa.3; Fri, 16 Jun 2023 13:18:12 -0700 (PDT) X-Gm-Message-State: AC+VfDzwqXFeWcpAfyNZDYJy/dEE3segkj31VXtM2BI04oZSYci1aCEf /ekDI9FrlcgdbzzOuE7aPn1PxICOrGvRVZFOatg= X-Received: by 2002:a05:651c:225:b0:2b3:4fb7:8991 with SMTP id z5-20020a05651c022500b002b34fb78991mr2815162ljn.43.1686946690319; Fri, 16 Jun 2023 13:18:10 -0700 (PDT) MIME-Version: 1.0 References: <20230616085038.4121892-1-rppt@kernel.org> <20230616085038.4121892-11-rppt@kernel.org> In-Reply-To: <20230616085038.4121892-11-rppt@kernel.org> From: Song Liu Date: Fri, 16 Jun 2023 13:17:57 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 10/12] arch: make execmem setup available regardless of CONFIG_MODULES To: Mike Rapoport Cc: linux-kernel@vger.kernel.org, Andrew Morton , Catalin Marinas , Christophe Leroy , "David S. Miller" , Dinh Nguyen , Heiko Carstens , Helge Deller , Huacai Chen , Kent Overstreet , Luis Chamberlain , Mark Rutland , Michael Ellerman , Nadav Amit , "Naveen N. Rao" , Palmer Dabbelt , Puranjay Mohan , Rick Edgecombe , Russell King , Steven Rostedt , Thomas Bogendoerfer , Thomas Gleixner , Will Deacon , bpf@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, netdev@vger.kernel.org, sparclinux@vger.kernel.org, x86@kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 16, 2023 at 1:52=E2=80=AFAM Mike Rapoport wro= te: > > From: "Mike Rapoport (IBM)" > > execmem does not depend on modules, on the contrary modules use > execmem. > > To make execmem available when CONFIG_MODULES=3Dn, for instance for > kprobes, split execmem_params initialization out from > arch/kernel/module.c and compile it when CONFIG_EXECMEM=3Dy > > Signed-off-by: Mike Rapoport (IBM) > --- [...] > + > +struct execmem_params __init *execmem_arch_params(void) > +{ > + u64 module_alloc_end; > + > + kaslr_init(); Aha, this addresses my comment on the earlier patch. Thanks! Acked-by: Song Liu > + > + module_alloc_end =3D module_alloc_base + MODULES_VSIZE; > + > + execmem_params.modules.text.pgprot =3D PAGE_KERNEL; > + execmem_params.modules.text.start =3D module_alloc_base; > + execmem_params.modules.text.end =3D module_alloc_end; > + > + execmem_params.jit.text.pgprot =3D PAGE_KERNEL_ROX; [...]