Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1691098ybh; Thu, 23 Jul 2020 15:35:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwq42ZpmiqcE0MPtUiNO2zrJAkRlzmVuNTCvni3Gc8RTbfLhpXE6js9NyQ467HnS1oeE8Vy X-Received: by 2002:aa7:d043:: with SMTP id n3mr6493956edo.102.1595543745130; Thu, 23 Jul 2020 15:35:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595543745; cv=none; d=google.com; s=arc-20160816; b=A1PELWaSQy5tYk8kJLDgLImg0u54ClzQ4WPm3YOYcuY6WQ1Yszq6jcqIaCOlRZ9cru 8IGg5iqdWUpefdYQ+tsy3/ni8K1VJ1Vd0oOAAApRSgH4vWFmDSoJgsnQr0YSO4mB/exp O5kCrQ3AQmxEwyTYIa7RnU1qg3fDpEuGqGW6UcCY+3v0pQOIhhJ8s3zZuMp06lR+ReXN UdhrNFr+F0pGLE//ZlKAwt0Pwlk6CWjy0RBkY6u1+E/2cxWj3g14L3CS3bU+6cu9SFBb W9VysIxcOsfHBM1z11DTqDnq/W9HH+ZD/+04wUwsJCyD/GkJ+9QhqZ0F08KsJCoIpq88 R4yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=RpqhRFjrL+uIem+wEEGlGrw9Emb/1ZrvVJA/zd3qeI4=; b=lf1xl/K/5lYBurhF+B3/f8TPMw6gXnhEcGHls17ww2DkoP/cPhfsgFb2Fve7i/lfdA g6OK4QzCtkLM1mcCypRZUnB19z8aJiYR7bxE1Xefg4Q12XhvrjQ00cPg/MnEw3+agnUK zAj9nS1/ArVOlpo7TgtKIiwQIpIKrKFllW51e5NnWUTveBn98Bo1fgHjAj3FFsnaqCOm gtr+c2uoYFdTgnMeDcyJ2Vau4fwbILoMAVPk7VcfvTcERkb5JOyNHaV3NxMyKm3jOiUz IaFO2227MqbCbfW+4Yvz8XxmbQWh9E9Dj2c62dX4We/6oDam3kjkVV02r9gOONzri6fO u6mQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o21si2708546ejb.37.2020.07.23.15.35.22; Thu, 23 Jul 2020 15:35:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727115AbgGWWe0 (ORCPT + 99 others); Thu, 23 Jul 2020 18:34:26 -0400 Received: from kernel.crashing.org ([76.164.61.194]:43108 "EHLO kernel.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727060AbgGWWe0 (ORCPT ); Thu, 23 Jul 2020 18:34:26 -0400 Received: from localhost (gate.crashing.org [63.228.1.57]) (authenticated bits=0) by kernel.crashing.org (8.14.7/8.14.7) with ESMTP id 06NMXDcm005863 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 23 Jul 2020 17:33:16 -0500 Message-ID: <418d5f3d3f42bbc79c5cf30e18ec89edfe2dbd26.camel@kernel.crashing.org> Subject: Re: [PATCH v5 1/4] riscv: Move kernel mapping to vmalloc zone From: Benjamin Herrenschmidt To: Alex Ghiti , Palmer Dabbelt Cc: mpe@ellerman.id.au, paulus@samba.org, Paul Walmsley , aou@eecs.berkeley.edu, Anup Patel , Atish Patra , zong.li@sifive.com, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-mm@kvack.org Date: Fri, 24 Jul 2020 08:33:12 +1000 In-Reply-To: References: <7cb2285e-68ba-6827-5e61-e33a4b65ac03@ghiti.fr> <54af168083aee9dbda1b531227521a26b77ba2c8.camel@kernel.crashing.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2020-07-23 at 01:21 -0400, Alex Ghiti wrote: > > works fine with huge pages, what is your problem there ? You rely on > > punching small-page size holes in there ? > > > > ARCH_HAS_STRICT_KERNEL_RWX prevents the use of a hugepage for the kernel > mapping in the direct mapping as it sets different permissions to > different part of the kernel (data, text..etc). Ah ok, that can be solved in a couple of ways... One is to use the linker script to ensure those sections are linked HUGE_PAGE_SIZE appart and moved appropriately by early boot code. One is to selectively degrade just those huge pages. I'm not familiar with the RiscV MMU (I should probably go have a look) but if it's a classic radix tree with huge pages at PUD/PMD level, then you could just degrade the one(s) that cross those boundaries. Cheers, Ben.