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 C21EFCFB440 for ; Mon, 7 Oct 2024 11:39:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3D4EB6B00DF; Mon, 7 Oct 2024 07:39:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 385476B00E1; Mon, 7 Oct 2024 07:39:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 24CD16B00E3; Mon, 7 Oct 2024 07:39:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 063F56B00DF for ; Mon, 7 Oct 2024 07:39:31 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 95C744170A for ; Mon, 7 Oct 2024 11:39:31 +0000 (UTC) X-FDA: 82646610942.15.6B8FEEF Received: from mailgate.ics.forth.gr (mailgate.ics.forth.gr [139.91.1.2]) by imf18.hostedemail.com (Postfix) with ESMTP id C9CF61C0006 for ; Mon, 7 Oct 2024 11:39:28 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=ics.forth.gr header.s=av header.b=MJYOtxH9; dmarc=pass (policy=none) header.from=ics.forth.gr; spf=pass (imf18.hostedemail.com: domain of mick@ics.forth.gr designates 139.91.1.2 as permitted sender) smtp.mailfrom=mick@ics.forth.gr ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1728301144; a=rsa-sha256; cv=none; b=dDimS82pymCei5w+KhrSvvvzQhMEtARBH3IklM3DFKOWRXviwoggnR5eMP9Q2CHXAdedCl EUZcJT58oORCJ/35IwXNJmAjV9MlI1g1rcTH71qctbCLfoS9Ws7vF9iGOxp+5x5hLYyfpk jG31OPftPfwCA7t+OSE2UBJt/ISDem4= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=ics.forth.gr header.s=av header.b=MJYOtxH9; dmarc=pass (policy=none) header.from=ics.forth.gr; spf=pass (imf18.hostedemail.com: domain of mick@ics.forth.gr designates 139.91.1.2 as permitted sender) smtp.mailfrom=mick@ics.forth.gr ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1728301144; 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:dkim-signature; bh=Ol7n4L6QTmzutttp8xst/KAAfvLM9cOKxjEdybR+X8k=; b=AbCTqcelLPmfLuowjOHrwQm0eyqcQzY0p+4cIWF96/huh+OswJXgc4p6JKb5ELeMLdG8XY NJClAPNpMtrrmYCdETYv2xBoTPrI1ik5Q+8X0fzueQ+tSoQU+Vj3vXHseyWf5vClxgug+c 7WqRFqG829lF7l8oKh2FDfV6pmolInA= Received: from av3.ics.forth.gr (av3in.ics.forth.gr [139.91.1.77]) by mailgate.ics.forth.gr (8.15.2/ICS-FORTH/V10-1.8-GATE) with ESMTP id 497BdLM0064118 for ; Mon, 7 Oct 2024 14:39:21 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; d=ics.forth.gr; s=av; c=relaxed/simple; q=dns/txt; i=@ics.forth.gr; t=1728301155; x=1730893155; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=590uzh9aLzLznOyhna0jGhP/FiZRHlR8TiU5dwNYA6I=; b=MJYOtxH9Div6bQIZa9NK4X/T3QCqEu/1zVp0Uf277XRKoosoO8RCB/cJ6siwUSNs vA09F1Q9A5BB0lbpdC9I0fcpzLpA2PQk0S8QXqT/h8dmANwqL/M2sfxMDwQbtm1L 8Gb44nMSHLKubZhqhsdzIFRa5A3OJ8yjL6HjZSeM/CuFOFYzG3d5l0Bpr3HD8p+W eUwuJE7JFTcG4Nqn/jw+kOtuEVGcOsj0m3qHofknxZH/T85+yB4QWNAPYnsVoNsp 1QIHGL0deo6+9TiGt9Yf8d3PJ4xZohNGJc7burJHD2OhNdmGxTDHUNH+9ZF0L3Ux 3+zuIvuvCG09PQLaltarbA==; X-AuditID: 8b5b014d-271fa70000001e4e-26-6703c863c44a Received: from enigma.ics.forth.gr (enigma-2.ics.forth.gr [139.91.151.35]) by av3.ics.forth.gr (Symantec Messaging Gateway) with SMTP id D3.43.07758.368C3076; Mon, 7 Oct 2024 14:39:15 +0300 (EEST) X-ICS-AUTH-INFO: Authenticated user: mick at ics.forth.gr Message-ID: <21feac2d-24e9-43f4-8a1b-728d4af6c4c7@ics.forth.gr> Date: Mon, 7 Oct 2024 14:39:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1] riscv: make ZONE_DMA32 optional To: Christoph Hellwig , Vladimir Kondratiev Cc: Alexandre Ghiti , Paul Walmsley , Palmer Dabbelt , Albert Ou , Andrew Morton , "linux-riscv@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" References: <20240827113611.537302-1-vladimir.kondratiev@mobileye.com> Content-Language: el-GR, en-US From: Nick Kossifidis In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrFLMWRmVeSWpSXmKPExsXSHT1dWTf5BHO6QeNnE4s569ewWTy785XV YuvvWewWpycsYrK4vGsOm8W9Nf9ZLbZ9bmGzeHm5h9mibRa/xe1FL9gcuDzevHzJ4nG44wu7 x70T01g9Nq/Q8tj0aRK7x4kZv1k8Ni+p92ibspHR41LzdXaPz5vkAriiuGxSUnMyy1KL9O0S uDImztvCXHBJoOLVyelMDYwHebsYOTkkBEwkZt76ytzFyMUhJHCcUWLG56dMEAlLic2fXrKA 2LwC9hLvTi5kB7FZBFQkrm79yw4RF5Q4OfMJWI2ogLzE/VszwOLCAuYS7/svAcU5OEQEsiR2 HaoFmc8ssIBZYu71+4wQy7YzS7xfcw+sgVlATuL9s+2sIDabgKbE/EsHwZo5BXQlVr6MgCgx k+ja2sUIYctLbH87h3kCo8AsJGfMQjJpFpKWWUhaFjCyrGIUSCwz1stMLtZLyy8qydBLL9rE CI4eRt8djLc3v9U7xMjEwXiIUYKDWUmEN2INY7oQb0piZVVqUX58UWlOavEhRmkOFiVx3hO2 C5KFBNITS1KzU1MLUotgskwcnFINTAxTe9h4qgTe5pw68Cr5lNQRjvmmH909hHpkMwqFmH9V L0gTUiyzWOK/QJi/N8lpg4/+ssk+unHp6rz2jf+ON/x6UzJRx8uqzyT9ROv1ylUNevELJIVv TsiZPGW5zJ7uXVO/xkX/EWt54nai5b9O+abDpyZ9fML8utuxWfue5NWuOs8vahaFRlHXWBx4 ny55czXP/c3epHvSns+XFG9sjDQ+LqfT+kak0MvjYLXypFzLZ1cZWha7FV2pWGEQcrWDreg9 R4RNje0pmco57bKPM1ij19w6c3LBpzdis53/md53CAlZNW3moZwHSWsetlUfnuGsvHYxe8gM q+f7roifLn/TPn3y9YlPJ77W3tu/RYmlOCPRUIu5qDgRAJ8lHyMNAwAA X-Rspam-User: X-Stat-Signature: jmfba3jaeaez37q5mzsni1fm9pgu87f3 X-Rspamd-Queue-Id: C9CF61C0006 X-Rspamd-Server: rspam02 X-HE-Tag: 1728301168-633962 X-HE-Meta: U2FsdGVkX1/g5EfrgHPkgQqgJLnJBk1L0aX3h5slIQAXP2xtJwRM+Xn96k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IWvdexepiZ2ZtftOJyX24pCDCV9Pdljjpab3JQ7J9gGfKe3K+pzf6axukjRh2GeRQROwFWspto4Pu+Fvdz9Cb6RONZItDcQ5EL3HaRBEzhmmTOm7H5PVj7XeLJgA0ligQDUs3weX0ANvxr/Pyp6oJ7qkbD5h3wjxyYTbPC6Psa40Oc3NFUJQfwg8a6xUHST9vd31UeJZE3VmkohSfyEaT16C0lDbax/mTtyp+tuV5V4SDI3dc73WrF7H8M87sNOPh89stVEtusqirFnt6OnPzLjenAbbmWv8J7cwMYS7TvfWUHlQQWUmEnwj0tA1sXO38SSA== 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: On 10/7/24 09:22, Christoph Hellwig wrote: > On Mon, Oct 07, 2024 at 06:17:14AM +0000, Vladimir Kondratiev wrote: >>> Well, this doesn't get any more true by just irgnoring the previous >>> discussion and just reposting :( >> >> Sorry, this wasn't the intention. Perhaps I messed with the message-id, I see my "patch v1" in one mail thread together with the previous discussion, but not in the other thread. >> >> Anyway, I think making ZONE_DMA32 selection depend on NONPORTABLE answers the concern >> that was raised > > It doesn't at all. > > For one not having ZONE_DMA32 is going to break a lot of things. > Drivers do expect 32-bit addressable memory. And because SOC designers > know this there usually is a way to provide it, e.g. by doing window > translations between cpu physical and bus physical address. Please go > back to your data sheet or talk to the designers. > > And if there really is not way to provide this, the right way is just > to stop the runtime allocation that triggered you to do this if > ZONE_DMA32 is empty, not to add a non-portable option. > I agree with Christoph on this one, by the time dma_atomic_pool_init() gets called we already know the system's DRAM base for example and if we have 32bit addressable regions (or aliases / translation windows as Christoph mentioned) or not. We could use this info to skip ZONE_DMA32, or just use a command line argument like this RFC proposed: https://lore.kernel.org/linux-arm-kernel/20230201040913.GA4959@hu-cgoldswo-sd.qualcomm.com/T/ There is no reason to configure this at compile time, and completely remove support for ZONE_DMA32. Also NONPORTABLE doesn't address Alex's point on distro kernels, since distro kernels won't set NONPORTABLE. BTW I tried reproducing this with a recent 6.10 kernel and couldn't, our system also has DRAM way above 32bits and this is also on a modified QEMU machine, here is the full log: https://pastebin.com/9HLcphgY You can use this script to reproduce our QEMU setup if interested: https://github.com/CARV-ICS-FORTH/yarvt/tree/eupilot Regards, Nick