Received: by 2002:ab2:1c04:0:b0:1f7:53ba:1ebe with SMTP id f4csp172010lqg; Fri, 26 Apr 2024 11:54:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVUp6Yh744Frf95/wyhZQ0Extw5nMkfj+3xty2f8B/AlGr7GBA7fBcxjLp6mts3BcvH7BVCMje/U/tFqE74c+nln6oHDSpA8WAMSPQ24g== X-Google-Smtp-Source: AGHT+IGMw2WrykNWv1K8vrum+qJfkcGqokgV6YGp7mOqVPY4Jh+H2iPYoPgsdMgRxg56HwYPVl0v X-Received: by 2002:aca:b04:0:b0:3c8:5553:3beb with SMTP id 4-20020aca0b04000000b003c855533bebmr3517737oil.2.1714157674002; Fri, 26 Apr 2024 11:54:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714157673; cv=pass; d=google.com; s=arc-20160816; b=t3xINAazAdGUnOhUP9jOiPmVtrzh457wlL9GvCeOVGRZoN0PVcE5gNZ7zolXs3AfH2 x3gQzFf06eTiBebeMJgN/nxEWXD1+KhxjkdoOGt1ADE8o8IxyptzH/7PUMN/sQTO9SJ/ w3yeaQ8hZMzYCrDSwl/pFFCyj7Eg9O9DWJQmJoRD18MjVzfUEMpXXS/+H6HmVY1kbN+e QHzrTP4u9rLOFyFaZjmzi3uwxNJ4ra8l3zjcnqKAK5vyvMkX7WI1uAFtQ6ja2z4QWr/h tbavGMLne944ThT8lTiAnhbrYhfFBTkiOBTpu8yAw3cDVN7ROKRnW19gVdjZoPWMTBCA 2TCw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=MLNOvSrXHkACDy514K7KTRvjgoCy4wXWSD50ElolVqA=; fh=4Ps5RXY4PVM7ov1LaIbmsmYfDJJ2TF5almi2tttLYe4=; b=W3CyA7JtgbVtdEelNG5PlR3/kwZIj7dJ1hV8N5PTJIx4TAxD12m76O6JIDsA0Rn91F 0YA/Xi7Zky1GhpHZUw+sxdYUbxYYz327CiJkLHY9Wn4kGsytenSzMp+qTy2KdtXboDmT mCR0Sp/Ssj2z/g2Oc3ByvNPCI6TdGACjN99CsFYpPT5uV0Bxid1lP8ovqiqsIAp6fY0Q QfCgnCDDkuZpPDF6BY+Tttt/Bbsx0lgGZNrlUoSYV7L3hDkbXOsoGx+DKnId8zH8rADi HBz9pF1/Pf05w1I+ny4Nmb1uaatAz4vqhu0bLKRHvajFzjrRLD1fvZwiZIyARpBuzs/2 akfA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PtIGLkVI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-160589-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160589-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id i10-20020a37c20a000000b007909b882b52si4720595qkm.602.2024.04.26.11.54.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 11:54:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160589-linux.lists.archive=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=@kernel.org header.s=k20201202 header.b=PtIGLkVI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-160589-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160589-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 AEF651C21D51 for ; Fri, 26 Apr 2024 18:54:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4911C14A96; Fri, 26 Apr 2024 18:54:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PtIGLkVI" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 370C4BE47; Fri, 26 Apr 2024 18:54:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714157659; cv=none; b=iIsS1ltRFP+46ejY/wX+KloXu086hcV88c+P2ejt/NeisOsUlfsblotq/T7it4PWhc98ymhfYpWkbSOueoLQZLGkTd/pkpMk8a/udmxr6nIy7OprHuvf8uFDUsNBggJ6zFJKQThopnIzNmh4WnnQGJFbUNGz8Qgfa1HHqztv+dA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714157659; c=relaxed/simple; bh=Erw8uuVUeGio0PshYx2zkVsumWpV4GynBPxpYdsctHY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=hjaTFsMKPJsd6ECpK5eJQMtHHBBrcQy2bNWholG/aQpWcw5tyLpA0MlqtYWKsy2PKxCaduDlhtwlvHtsEkm2ua6onJ0QLT9zCsP8Xny/LkJyJ+eW98yy2bXfdwQHF10gtW9C1MzTifLqPQozN/DFe85Nx99iJLFUlga+IFlYGHs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PtIGLkVI; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9CD5C2BD10; Fri, 26 Apr 2024 18:54:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714157658; bh=Erw8uuVUeGio0PshYx2zkVsumWpV4GynBPxpYdsctHY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=PtIGLkVIeqBKR9XEnfi6oa2ABiJCHDWkMcxnQH6NsAziRnrm6MjyOXSpNcpzr5Bpj E/+DTDMfi551f7rzH24rHY27M/wW2GL5thq60UidmW3gekcOw/Lw7WAfRzWyd8GkUc AMCRC/bEKdhEkcE8BUKVSsq3i6jRXE/rRiDch/q2swRdO1P0u026aiMTpNhht44wJL UIPWzKzyFzPlmxNLqcd/AT/DShSQyLxRDyOuWXTPLByxMvQzpvRUI5+5WtOVbnGLoN udeSsSYdjr9fYuzLauYRgGtv2ybIbSepMhbtSmBkkZI6dcFW/TNhf3zMRdYQbw+V8+ QrxzekJFRuwhA== Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-516d3a470d5so3047934e87.3; Fri, 26 Apr 2024 11:54:18 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCVM8ZypdlDMPCN05MdpxMV/6rLXZtcthQG9/QpcKsMGYUW2eevOcSli1y6SfRPpMwlSeJ5Ttu7Q9+dNZhAyBiR4QkZUkqmOumo7kUtTyFxqylnBV8403zaKDMwrz9d+0rzOJ7EeoPir879K7bAePY0UV1X3Kxlt53BrN7nKffn6fBhw5G9GaTPXHR89gjaJnSViXXQK/Z9e9pQHQ8Jt8rSgZR1X6robljV/3F4iOHMlCgBxtP8PhAJFmxUu8Ut/sE1zZ6ZSxabtH2pDjyUvZUbF6bGI5xWFEnY4kJGn4UgnJjaXxnuQz2GIyHVYtA1Dj6npO2OIQvhrvq8Ld93BZeeC6GqDt9Kk3KPka02dfbHrV3kmRYmKQLTzAh8GWguMVXabpy9ArdcBgbOt4RU= X-Gm-Message-State: AOJu0YyvMBvKSJznNwb3zf29G4NMrsHTe0pHsgQ0tK6coE0MNUuAnslp 82BY0/S5+qI3Zb/qoPqVT2tbiMpbK5Me0kJTbRkyDFC6Z2n9yugCCqm0i+zlRbcVvmtb7ETHP3d 5qgcUSYU+VsKePNbi2/nxlYntOHQ= X-Received: by 2002:ac2:5202:0:b0:51c:1fb4:2327 with SMTP id a2-20020ac25202000000b0051c1fb42327mr2189866lfl.24.1714157657105; Fri, 26 Apr 2024 11:54:17 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240426082854.7355-1-rppt@kernel.org> <20240426082854.7355-8-rppt@kernel.org> In-Reply-To: <20240426082854.7355-8-rppt@kernel.org> From: Song Liu Date: Fri, 26 Apr 2024 11:54:06 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 07/16] mm/execmem, arch: convert simple overrides of module_alloc to execmem To: Mike Rapoport Cc: linux-kernel@vger.kernel.org, Alexandre Ghiti , Andrew Morton , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Catalin Marinas , Christophe Leroy , "David S. Miller" , Dinh Nguyen , Donald Dutile , Eric Chanudet , Heiko Carstens , Helge Deller , Huacai Chen , Kent Overstreet , Luis Chamberlain , Mark Rutland , Masami Hiramatsu , Michael Ellerman , Nadav Amit , Palmer Dabbelt , Peter Zijlstra , Rick Edgecombe , Russell King , Sam Ravnborg , Steven Rostedt , Thomas Bogendoerfer , Thomas Gleixner , Will Deacon , bpf@vger.kernel.org, linux-arch@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 On Fri, Apr 26, 2024 at 1:30=E2=80=AFAM Mike Rapoport wro= te: > > From: "Mike Rapoport (IBM)" > > Several architectures override module_alloc() only to define address > range for code allocations different than VMALLOC address space. > > Provide a generic implementation in execmem that uses the parameters for > address space ranges, required alignment and page protections provided > by architectures. > > The architectures must fill execmem_info structure and implement > execmem_arch_setup() that returns a pointer to that structure. This way t= he > execmem initialization won't be called from every architecture, but rathe= r > from a central place, namely a core_initcall() in execmem. > > The execmem provides execmem_alloc() API that wraps __vmalloc_node_range(= ) > with the parameters defined by the architectures. If an architecture doe= s > not implement execmem_arch_setup(), execmem_alloc() will fall back to > module_alloc(). > > Signed-off-by: Mike Rapoport (IBM) Acked-by: Song Liu