From patchwork Mon Oct 28 15:03:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 13853645 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18974D33995 for ; Mon, 28 Oct 2024 15:04:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A1A026B008C; Mon, 28 Oct 2024 11:04:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9C9D86B0093; Mon, 28 Oct 2024 11:04:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8B8B66B0098; Mon, 28 Oct 2024 11:04:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 6CB6D6B008C for ; Mon, 28 Oct 2024 11:04:05 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 32110160548 for ; Mon, 28 Oct 2024 15:04:05 +0000 (UTC) X-FDA: 82723330368.25.9A5C879 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf03.hostedemail.com (Postfix) with ESMTP id 7BCFC20020 for ; Mon, 28 Oct 2024 15:03:52 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=JJani4A8; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf03.hostedemail.com: domain of arnd@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=arnd@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730127801; a=rsa-sha256; cv=none; b=HDP5tUmav7Z7hnP9LX5Nn1+BiF1ke+xa2L8fA+NCl05wk3MeDVGfN44oxQH0UjIrZYxUvt D6FZbiSdYO4TWr79jPGrmfdfURKoMqkAQ1AXRR+aoQf1bAjwmcfHJGgZ3OZqrINt8fge2z iNlC9hlcVDlwp5Bh/xeRm0R4v5MruVY= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=JJani4A8; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf03.hostedemail.com: domain of arnd@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=arnd@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1730127801; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=yLAf3MzEcU7ky6butcOpdodV2+3VoprcM6AaOGPt+EM=; b=wvWNPCdQG3e+0c4/buhUe+O7iFpZGjDL3r/ilzbGy0UAQBsSXd51H0tx9NnGoIqHjXOKlp oRitWRRvjGCkvYHtlpWd59FKMlkaAnHSH4PznqqcgVoCqMpcmmC4pEZMqu3FxngD9/BM7d aN8SvvfH/VyKRyVvBaD2jvtkiYZGbbw= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 89A29A4272D; Mon, 28 Oct 2024 15:02:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06C1DC4CEC3; Mon, 28 Oct 2024 15:03:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730127842; bh=9DKucJAMVJnnAVsXS4EbUuo5VofsFWCwsQVHMFgdhCQ=; h=From:To:Cc:Subject:Date:From; b=JJani4A82gdCARix81qoV0FwX/XHiDTUO+8EQ/Q4TtsYJkxIjOTHs1FItrYCdO+B6 6NzfDRSEGNFMirHsAK0NW3dsWJ/OgmTgzj4yD45obmUDNp9iVf3FOKOuAyLMnT6aki VHlD849YOm2VwMz0r71/rpmYjUWdfHkYxbbXuvcqT2bBiOemt4iWYv3QHTjZbu5xdW VuQYjtH5HMdBw3rQTsLjdEPcw1BLUjSucbkIbyZvTch3A6WBCHeLg+A3azaDL7+txd n0ukrWp2mtaYHBQouNjm5W200INRBMC2UKtt7n/GsqL58mibGycl7yq2rF0+KhBELK gMS7/pUkQrgpA== From: Arnd Bergmann To: Andrew Morton , Pasha Tatashin , Suren Baghdasaryan Cc: Arnd Bergmann , Mike Rapoport , Luis Chamberlain , Song Liu , "Masami Hiramatsu (Google)" , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] [v2] alloc_tag: hide execmem_vmap() on !MMU Date: Mon, 28 Oct 2024 15:03:53 +0000 Message-Id: <20241028150355.2574425-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: ro3jt55a1r3ucsrdp8y4598mifab6u76 X-Rspamd-Queue-Id: 7BCFC20020 X-Rspamd-Server: rspam02 X-HE-Tag: 1730127832-731374 X-HE-Meta: U2FsdGVkX19ao5ofmzdUJdnzLlNBxr9YBZ/v30AkjRyCMfPxPl20JP/8w+Mg0P6HKI/8zghWq9M0wPvMlw1ImMg52O0CQdmdNCuo0ctPreLrctX3MN6XsHB7RgTjFP364Kr790V7T36GgEAcvaXRtbBCZPNvSs8Bx2SZ4qcorOrBhVtDmuzwJcgt+MIJ0j4VqEZATrYmDrDD3/X+jKSAWMWrZcRzRDrk16cVa9F6qZrKp0jc/QhibWn8kf4+wdEGNl2/gowWE/8Zdhydw6HLfb1cSOk5bpKPPtPlvbNSxORdX3soyVC0smCWbUwcTA57zdQsKQw4xzmWXndz1JPevbjVfdxix+4yszuW8DsEbVXkba5VdEKoBCJSCOJMoESSw1w6DkgkmFPGodV4iPGCgu0PmsXWsnDOcfP8M93/Ee56OOrBQdGLMI7MJD7KJyHMDD0QvFhuqHQ6UAhrw/u9JqAw4/OZ0fWRCti6CxP/9Gx44OLAZ8bg4xMd6S8+zDYZw1YIOLotI4EErDU9ZIdKL1OnniBi0YB93DY0pKVUX/8KcJX1yXq42/7+PK93bSq/XbCEME6jf4uuvb8McPXT8/ng8YB9XYYs+rkI7pOMwKdu3pI/ws2oWbtRqzGwxWuE7TkbtUaU1DYbVP3OJBG1/se2+Irk7SaSzBBR/RDLoZ1eilXZ/9GNYuNv6suSJv3aYaltd5xXAEJ/ipbaYYtAgtgnGzeLgao7kQT2VGdZJxQwF9qFHfgvby3cygLbqj5fc1aHl9sOWakMpBkkLw2M1N8Y8KxVAfgl3m/+fvn+oIsFWYXGkiRbtUMLSsaIX7TgDUagSYdtBLAHrVF/yqXoD1N5Mr+m8KwLEvl1QhelpXfkz9SGo9Hv3Vm7mBQrLSHsKmZ4slooRLMXRoZRJwU+B3Vb/EPcR4cCN/mg3OZptJprL2r0x3aIFp6sZ/VkoP//RGh9QjZhgxFsx+17QH+ adCszpeF AiDcqqClO8YptbMR8zLIUX8DaXIsnhSK2ZYkmMA99499H6gAp2m3TJEHtdOZyupTJP52Y0YhhTFIHRifEJbnfcaxIuX4V0L2o0cpPYPgmelJg0p/KZHsfA7EnfD2BNpQ/PUc2HmjvrUxAVNl3nRpKRmCdbCnXF35ECoLmT2EW7PGOOA783s57V8JIA+JWAuPR0AXw2LbpmvNrY3Md882K91Yl4XpuYoGE0Nll3lbQg5XTvQzuBk3qEUCtnTCQDVqeutFZ17dtW4ezZfI6qVaykGlHzRiHnKPy8bnHqXhvncAFEQhlL5E3RYJdw8RMEgceknx6 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Arnd Bergmann The newly added function fails to link on nommu kernels, but is also not needed there: ld.lld-20: error: undefined symbol: __get_vm_area_node >>> referenced by execmem.c >>> mm/execmem.o:(execmem_vmap) in archive vmlinux.a >>> referenced by execmem.c >>> mm/execmem.o:(execmem_vmap) in archive vmlinux.a Move it into the #ifdef block along with execmem_vmalloc(). Fixes: 57bc3834fb6f ("alloc_tag: populate memory for module tags as needed") Acked-by: Mike Rapoport (Microsoft) Signed-off-by: Arnd Bergmann --- mm/execmem.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/mm/execmem.c b/mm/execmem.c index 5c0f9f2d6f83..317b6a8d35be 100644 --- a/mm/execmem.c +++ b/mm/execmem.c @@ -64,6 +64,22 @@ static void *execmem_vmalloc(struct execmem_range *range, size_t size, return p; } + +struct vm_struct *execmem_vmap(size_t size) +{ + struct execmem_range *range = &execmem_info->ranges[EXECMEM_MODULE_DATA]; + struct vm_struct *area; + + area = __get_vm_area_node(size, range->alignment, PAGE_SHIFT, VM_ALLOC, + range->start, range->end, NUMA_NO_NODE, + GFP_KERNEL, __builtin_return_address(0)); + if (!area && range->fallback_start) + area = __get_vm_area_node(size, range->alignment, PAGE_SHIFT, VM_ALLOC, + range->fallback_start, range->fallback_end, + NUMA_NO_NODE, GFP_KERNEL, __builtin_return_address(0)); + + return area; +} #else static void *execmem_vmalloc(struct execmem_range *range, size_t size, pgprot_t pgprot, unsigned long vm_flags) @@ -368,22 +384,6 @@ void execmem_free(void *ptr) vfree(ptr); } -struct vm_struct *execmem_vmap(size_t size) -{ - struct execmem_range *range = &execmem_info->ranges[EXECMEM_MODULE_DATA]; - struct vm_struct *area; - - area = __get_vm_area_node(size, range->alignment, PAGE_SHIFT, VM_ALLOC, - range->start, range->end, NUMA_NO_NODE, - GFP_KERNEL, __builtin_return_address(0)); - if (!area && range->fallback_start) - area = __get_vm_area_node(size, range->alignment, PAGE_SHIFT, VM_ALLOC, - range->fallback_start, range->fallback_end, - NUMA_NO_NODE, GFP_KERNEL, __builtin_return_address(0)); - - return area; -} - void *execmem_update_copy(void *dst, const void *src, size_t size) { return text_poke_copy(dst, src, size);