Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5696667rwb; Mon, 14 Nov 2022 08:15:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf5yyrSooJvpw9V+DSOPGzDU4/MMZcSVuoR5svrrS3wjn/Ni4cBFm49p0CPer2OAjFfrJtr5 X-Received: by 2002:a17:906:f88d:b0:7ad:a2e9:a48c with SMTP id lg13-20020a170906f88d00b007ada2e9a48cmr10683720ejb.77.1668442544899; Mon, 14 Nov 2022 08:15:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668442544; cv=none; d=google.com; s=arc-20160816; b=brucpBjx3KTbnKzXURcfJows3syR2LLrPIemYO55b8GgiTBIAcLpUAGeQh1t7b0/UW ES5MA2t9UvINumv+jsT1g8E3j/iPjcpgYtAxOCvyG0JX7vtxHlZT0MppuzMlplwMEQTm /6dwktYytvK8xVBpqy1cyVjnbQHV60AFwDP5W82KFhzG+s4xcEddrx/snf/uoAaGMJgi 2N2fFnJCFxZW8XrC4F6rrEczV+zxX/gVhvJvZ0MFaAJ1u37E4d3B+M2wGC8cAFkoakUv V2fYsh2S++ecD0Wxd8ThjeZYJhfyoI6DoZriMHARjweJFznk7ddX/U0MLgcZ297pYzD0 WIvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=xMGs7F1w2XyvpYt437DIguG3F9rnOD65HrN1UzHop4M=; b=zGcTahHNSbEItdxnztq4qxmt5w993JzJp6w3NV9X6pRuBjrIjZmVv/KoVKCmkci2NA vCw7YiSe1Ya+9L1FBWJVzaHxAJsN8T12Q10qRLjh/4S+UZDjMSHEK0RTgqqjKY0V/mHr 0ckpbLxGCezSi1oH0dv+MIIk9DtSEy0N2Vbz07dGt4LAMOuX0EjaIxKvoPUfqaqfCOOn cq/M8hEDPDmY1jeELO6IwdeIJWw59V6vwwshCZHE5XbyqYqo7YHCM4/0t4wyRer/fjip GbroFzpy1AHCMlKvkBm1/APcqTJa/sOzVicFRH6zr3zVQJRe2usLY1uOrvMUg9te8Cxt GCqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V+kyaMbo; 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 h17-20020a170906855100b007addbdb9fbbsi7960533ejy.558.2022.11.14.08.15.21; Mon, 14 Nov 2022 08:15:44 -0800 (PST) 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=V+kyaMbo; 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 S235813AbiKNPZ4 (ORCPT + 87 others); Mon, 14 Nov 2022 10:25:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbiKNPZz (ORCPT ); Mon, 14 Nov 2022 10:25:55 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82EFC1A22E for ; Mon, 14 Nov 2022 07:25:54 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2B5166123C for ; Mon, 14 Nov 2022 15:25:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18B57C433D6; Mon, 14 Nov 2022 15:25:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668439553; bh=GZIeodh/tKHzRw2Ib47HyuuEsEyl1mclfUnUp+6XOS4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=V+kyaMbou7xF+5gq6vmScT40d3HqUhdgg84H871WsQ03EnASOqmsZkqAK1nmpCw1p OGjt5tAo7E9cQFakoqXmHS6zvo34YdYwQeFAR/672DJP2miPxep1YoG5827M4/6Mhc CocoZltQ+KvESRI8sUqCMnr7eCrZaA+WAEzkwCjQ6auu4h81XDoHpQkvWTVJIiVuED 7mDX7t4PaaKtYEgMA7SBjFkHn6T3N2ZH+cwiK4FxkaRbprEmtHyyEYHe5zdgmB2Y4J DEsCHDAMaoIPjg5PHZpGY+dnjP3ptSY62mebT7gfvd7xqCgnGB7cHEYBpReyTIgVdm 1lhRewu4yuveA== From: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= To: Alexandre Ghiti , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org Cc: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= , linux-kernel@vger.kernel.org Subject: Re: [PATCH] riscv: mm: Proper page permissions after initmem free In-Reply-To: References: <20221112113543.3165646-1-bjorn@kernel.org> Date: Mon, 14 Nov 2022 16:25:49 +0100 Message-ID: <871qq5tv5u.fsf@all.your.base.are.belong.to.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Alexandre Ghiti writes: >> + set_kernel_memory(__init_begin, __init_end, set_memory_rw_nx); > > > That's nits but for 64-bit kernels, do we really want to make the kernel= =20 > mapping writable? I think catching a write access here would be better=20 > because IMO that should not happen. Thanks for having a look! Hmm, so what you're suggesting is a "set_memory_r_nx" for CONFIG_64BIT? What do other archs do? Is it worth the extra ifdef clutter? Bj=C3=B6rn