From mboxrd@z Thu Jan 1 00:00:00 1970 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 542F7C83F07 for ; Mon, 7 Jul 2025 10:10:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B04B76B03F7; Mon, 7 Jul 2025 06:10:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ADC706B03F8; Mon, 7 Jul 2025 06:10:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9F23C6B03F9; Mon, 7 Jul 2025 06:10:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 8CF256B03F7 for ; Mon, 7 Jul 2025 06:10:51 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 35C8910A334 for ; Mon, 7 Jul 2025 10:10:51 +0000 (UTC) X-FDA: 83637049902.21.2B22F68 Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by imf16.hostedemail.com (Postfix) with ESMTP id 4F856180003 for ; Mon, 7 Jul 2025 10:10:47 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=csgroup.eu; spf=pass (imf16.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.236.30 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1751883049; a=rsa-sha256; cv=none; b=nEGqQV0mdEJQie5ou46ANXd3mmHUl/8KL/ki3FnpwyerKNJluxQXtHP3I7lIwFIAt/pRiI AT4kLq1zZ43mKrY4iz0Bwzs2zeWR/tFadwgEnGVqaxWtmvbpK7b8lP8T8R/QFvVRAbNZDV 7w/kcbolBwDmd7Km8bI8cg/m3zMqOiE= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=csgroup.eu; spf=pass (imf16.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.236.30 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1751883049; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vK8tihGZ1T5epHuGOJLncpLYyGUk+zLBQJa5GZPZAWw=; b=yuiqzvwEqc2usJQsE6pYIT8hahaHBt4zlLZQH/PbwG3Co4aTSVDRN44nB9CQF+tAlrZuiB Ia6BtWhA95wI0jQ40AU7oFUDowMNwySsiRyrXgPnzkLoeAD1H/NeOHqWYGrliK/7qLp95M ZkqnQm+hO+QoYZYjYA1dcrcAXqJwAU4= Received: from localhost (mailhub3.si.c-s.fr [192.168.12.233]) by localhost (Postfix) with ESMTP id 4bbKkY1qMhz9sq6; Mon, 7 Jul 2025 12:10:45 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id m-Y4tmPX2Nye; Mon, 7 Jul 2025 12:10:45 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4bbKkY117sz9snj; Mon, 7 Jul 2025 12:10:45 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 06D048B767; Mon, 7 Jul 2025 12:10:45 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id G1Qaq7PtQJLm; Mon, 7 Jul 2025 12:10:44 +0200 (CEST) Received: from [192.168.235.99] (unknown [192.168.235.99]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 13A378B763; Mon, 7 Jul 2025 12:10:44 +0200 (CEST) Message-ID: <7e52f721-1d8e-4c50-af33-bee3f0d2ac6e@csgroup.eu> Date: Mon, 7 Jul 2025 12:10:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/8] execmem: drop unused execmem_update_copy() To: Mike Rapoport , Andrew Morton Cc: Andy Lutomirski , Borislav Petkov , Daniel Gomez , Dave Hansen , Ingo Molnar , Luis Chamberlain , Mark Rutland , Masami Hiramatsu , "H. Peter Anvin" , Peter Zijlstra , Petr Pavlu , Sami Tolvanen , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, linux-trace-kernel@vger.kernel.org, x86@kernel.org References: <20250704134943.3524829-1-rppt@kernel.org> <20250704134943.3524829-2-rppt@kernel.org> Content-Language: fr-FR From: Christophe Leroy In-Reply-To: <20250704134943.3524829-2-rppt@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 4F856180003 X-Stat-Signature: 95cgs5hco3kfy4f4g85zdxagd6k818by X-Rspam-User: X-HE-Tag: 1751883047-596628 X-HE-Meta: U2FsdGVkX1+mZQgHo5xV8y+67IwKO/JPEB/viOdzcx2LNlTw5Ea5EZVLRTVKSqcGEtQWAX15eIDn9lZ/wrG0OvCwAbPAhYxQU8ecLcC624/1Vxs9DNn/osLxGPNNef2RLuX5Oa9hRmE+jgCuxGSNS3xMvTkNXoVv+LlF2ed/a+As2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TAhla4vX7SvqluFc+JhZ7bIritnr2Aj/KCMiU= 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: Le 04/07/2025 à 15:49, Mike Rapoport a écrit : > From: "Mike Rapoport (Microsoft)" > > The execmem_update_copy() that used text poking was required when memory > allocated from ROX cache was always read-only. Since now its permissions > can be switched to read-write there is no need in a function that updates > memory with text poking. Erm. Looks like I missed the patch that introduced this change. On some variant of powerpc, namely book3s/32, this is not feasible. The granularity for setting the NX (non exec) bit is 256 Mbytes sections. So the area dedicated to execmem [MODULES_VADDR; MODULES_END[ always have the NX bit unset. You can change any page within this area from ROX to RWX but you can't make it RW without X. If you want RW without X you must map it in the VMALLOC area, as VMALLOC area have NX bit always set. Christophe > > Remove it. > > Signed-off-by: Mike Rapoport (Microsoft) > --- > include/linux/execmem.h | 13 ------------- > mm/execmem.c | 5 ----- > 2 files changed, 18 deletions(-) > > diff --git a/include/linux/execmem.h b/include/linux/execmem.h > index 3be35680a54f..734fbe83d98e 100644 > --- a/include/linux/execmem.h > +++ b/include/linux/execmem.h > @@ -185,19 +185,6 @@ DEFINE_FREE(execmem, void *, if (_T) execmem_free(_T)); > struct vm_struct *execmem_vmap(size_t size); > #endif > > -/** > - * execmem_update_copy - copy an update to executable memory > - * @dst: destination address to update > - * @src: source address containing the data > - * @size: how many bytes of memory shold be copied > - * > - * Copy @size bytes from @src to @dst using text poking if the memory at > - * @dst is read-only. > - * > - * Return: a pointer to @dst or NULL on error > - */ > -void *execmem_update_copy(void *dst, const void *src, size_t size); > - > /** > * execmem_is_rox - check if execmem is read-only > * @type - the execmem type to check > diff --git a/mm/execmem.c b/mm/execmem.c > index 2b683e7d864d..0712ebb4eb77 100644 > --- a/mm/execmem.c > +++ b/mm/execmem.c > @@ -399,11 +399,6 @@ void execmem_free(void *ptr) > vfree(ptr); > } > > -void *execmem_update_copy(void *dst, const void *src, size_t size) > -{ > - return text_poke_copy(dst, src, size); > -} > - > bool execmem_is_rox(enum execmem_type type) > { > return !!(execmem_info->ranges[type].flags & EXECMEM_ROX_CACHE);