Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2321774rdb; Thu, 21 Sep 2023 15:26:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEGONeM/BEpbOv7Ot2eQatN+aAkflvIUEYEs9h+z+ebgOtuWrSTFfm+p1k56C0kJQbc+g/v X-Received: by 2002:a05:6808:1890:b0:3a4:8ac7:3407 with SMTP id bi16-20020a056808189000b003a48ac73407mr8250425oib.42.1695335195888; Thu, 21 Sep 2023 15:26:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695335195; cv=none; d=google.com; s=arc-20160816; b=o28STS6AmvNVDyY87hDgtRQFOJvFy8MEmwt6RE0DDat+h9C01m9TpGz6rwnR+i0Raq gYr3umDWTwCfrY0M1w8GKKK50NplgL+uPtUMITy5012bER0DqFj7lOy1GQpjIdB6RDVY hK6pc4rGlt+2LBae70IHQab+BVvLWF2pTNKuzmDeV4+x3CliGcQNc4b0G9nKGAdLOShV BRwKBsNil9Y/0N4Z/Hr5imDZm9Rkpy+Ry8ao2AnTbVRlGFkqmuJ8vTd73g6yQ3H263Xn tvsJusnfbzUEuCi0aynKzRM/G2M2eiK3EkxDXM5wBwBVx+GV3NGV4xYpn31YEQBRCAFN 4iHA== 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=4gm9kECJPrwbkx/PJKfMUmrPOlrLEM+GHFD0ttjutOQ=; fh=nux99dLKaQZPtWtkuy2/AW/ozv3Qzao1Xyv3eoLFGu0=; b=ufCKbyAOpM4yI1cMXh08fPPRT1kuIvXfoMGgMa5GC7qHmTKfT3wzOSsC/CamTNudzU uXR2tkJNAIaw9FMdZW9xUpPI4s6dMBaC3eLzYCGlJm7swbKBPPCSigC5gCceIFuWRVve DoHK+EMdq9qWV7fD/ehFNlyzbI4rMVnSE7G53vsGNrfvTg5fZNPchS8niv4BRNzfVDdm h52MyK6bg2w1+UwMt3vtu9H79uutIXQ+gqKrCfQi2Z8yscMCapch93n8ATyVdvCT8AMm kHwjZxO/fDNX43RuTOxQSxLKLDiQeJ25/mTMw8lmrp8TTy4Ojc1rlDLy2BlJ2wb0W7m3 OJDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Wvqk0n6j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id j24-20020a63cf18000000b005655e87c8aasi2331495pgg.192.2023.09.21.15.26.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 15:26:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Wvqk0n6j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id DBFC0831E040; Thu, 21 Sep 2023 15:13:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232879AbjIUWNq (ORCPT + 99 others); Thu, 21 Sep 2023 18:13:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232874AbjIUWN3 (ORCPT ); Thu, 21 Sep 2023 18:13:29 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C42F61BD; Thu, 21 Sep 2023 15:10:40 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D5E4C433CB; Thu, 21 Sep 2023 22:10:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695334240; bh=N5hdFpyXSiGpYG0511NDyp6fv24cJcs4QSVnP7w1UAU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Wvqk0n6jq0ct52sblCUd8L/Xq8+N+SorW8zAWVSuS8RApVD17k7plQRRz/k5AtqcZ GfT0CHWwJxWi4gUehtxR+8ljjuQTqjvYKgxWb2XNuVdjKevxRu1ENJFvPX5YXAHSbF Ix9CdbGlyzCm8uVsj2Qxltwpt5fiLP3w48irVYCfZTdJDqTfRku6xjijf57j/ZypWU 97yg0mO2y5J78oLs+yCmKD+nXRc3T+EFcvHppUt3wuFXOaWZdvIvQ4j8dq0mhxHV1+ hn7FVpnRYo4KhRE7dodDocdh21fQMMb+Di7kRnH5vPdK32pTNVgx3GHtydByNaiHSX 2EmQpYW6b+alA== Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-5041bb9ce51so2466137e87.1; Thu, 21 Sep 2023 15:10:40 -0700 (PDT) X-Gm-Message-State: AOJu0YxFcVtmEm3oEWo8idFtMNYq2G4WIU9xIxKGAeDSLaC8XzC5nHA6 A/Os7unXe6c0ie2bw3wFW2fEWkGcW0nssbBNJ5k= X-Received: by 2002:a19:6903:0:b0:4fe:2d93:2b50 with SMTP id e3-20020a196903000000b004fe2d932b50mr5173357lfc.31.1695334238605; Thu, 21 Sep 2023 15:10:38 -0700 (PDT) MIME-Version: 1.0 References: <20230918072955.2507221-1-rppt@kernel.org> <20230918072955.2507221-3-rppt@kernel.org> In-Reply-To: <20230918072955.2507221-3-rppt@kernel.org> From: Song Liu Date: Thu, 21 Sep 2023 15:10:26 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 02/13] mm: introduce execmem_text_alloc() and execmem_free() To: Mike Rapoport Cc: linux-kernel@vger.kernel.org, Andrew Morton , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , 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=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 21 Sep 2023 15:13:51 -0700 (PDT) On Mon, Sep 18, 2023 at 12:30=E2=80=AFAM Mike Rapoport wr= ote: > [...] > + > +#include > +#include > +#include > +#include > + > +static void *execmem_alloc(size_t size) > +{ > + return module_alloc(size); > +} > + > +void *execmem_text_alloc(enum execmem_type type, size_t size) > +{ > + return execmem_alloc(size); > +} execmem_text_alloc (and later execmem_data_alloc) both take "type" as input. I guess we can just use execmem_alloc(type, size) for everything? Thanks, Song > + > +void execmem_free(void *ptr) > +{ > + /* > + * This memory may be RO, and freeing RO memory in an interrupt i= s not > + * supported by vmalloc. > + */ > + WARN_ON(in_interrupt()); > + vfree(ptr); > +} > -- > 2.39.2 >