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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 43252C02183 for ; Fri, 17 Jan 2025 08:39:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=P1dhaIn/GxueYjP9Vpp7lyfoHMjzRqV41iv5Ld8udsQ=; b=Fm57MhekqXMsnD eoNW9d5ZBNiFAviKF4kqP/AOmg6nffKO3dY0SBx8CQkKIXdnsxwrMJpFdZe8swQA4ex4P/4d3QkhD 4tzx9fXP/eozPE0XQMoPU/ZE/soXUtRxPxSOmyWNyPK7pchcAQH6V/o4BD/U7N8/Y6Y6vouOOSm24 ab33mhq47HXo90OUgjddSGBzSShjeMCI1Creqehpo22V8NhxzTJ1xTDWRcoR7+00MVmtXBOpNsBWR sN5b2tY5o3BaJa8JWBqY1fJMpxSSZq2+J92Ed5ZF+wys07mhAXqcrmbefWFEV7lk1GEARisdN/fwx iSmZ4S3nCWGyG9JM39Nw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tYhtD-0000000HM6L-2Ja7; Fri, 17 Jan 2025 08:39:39 +0000 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tYhsV-0000000HLxu-4A0J for linux-riscv@lists.infradead.org; Fri, 17 Jan 2025 08:38:57 +0000 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-5401bd6ccadso1925294e87.2 for ; Fri, 17 Jan 2025 00:38:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737103134; x=1737707934; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=phCkAThSkaHv33wSw1qeoZNPv9mc+Clzmmzr3CFp7bY=; b=OrtoJaVZSEDnJ7WLhyYJMjm4Uvk/Y5Z/NX/Qn3v/NvsI95h08OQNA4oe1W7C6bPNYm BT4A/4SxM38QIj9uVVtnBXbovYUpyp23ePRvZpj06+vwBbSCmt3kLKYEG8bWiXlXPJ7k 61wkhHjDQ0p8GiijbYuSCN76GRJVIdaIWIsef6WH2SBr68FUd4xgpvnqLYfKIYByO58M MIHjZxcsF+dAq3URlP58jdo3InJxFFdzAkf2WEHIirkRgionYsDZPUa//3pHwHopX02j T0U/pDOlVqq80RUj+6cGd5s0JQ4difKaafhbKxvVuX9zCOvYEjAWDx12fjzzdhMMeL+n HzFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737103134; x=1737707934; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=phCkAThSkaHv33wSw1qeoZNPv9mc+Clzmmzr3CFp7bY=; b=TDVxv1wel0Di4Q6bXx5qPBmXaXM/6Tl3GKl4wpHO+1TLYU2iqqve7SUZ8jwgaqgSks X43/Tvz+aDeTzO7JG1j+zHZASqLp88qahc79KarJ6PYJaNoTaoM56XsCj4O6qzCqh/WI Ca1PyFESyPaDE1UuDbUy/0AXm4M2UttyaCdoKLhv3iTqsUq44FFIyzKyVt2fQljTDaxx VyEmh3uSOD0VC0AtGWYTkg5MKaePiWeRM0Vd94ZUFXPNn1hw5TjglN/+/YR8re/02rnR 2RBOOs9II85YaCj5y9eMWow3DiseHJgstb+J1EpToUFlTAKwjtkfgr3dfoqKBOuaGzwI 3ysQ== X-Gm-Message-State: AOJu0YwuVaI7LDs5mkmTuiFveWjcwU5MswxcDVhHBJ59+Mp5Kswl3BqW JKKVxl1LU/9xa0svOfKYZr24tIpVE8FM8gvm4HJca+Umg9BokmEl X-Gm-Gg: ASbGncvPL13IPCml6uUlQ1mO5z7x+RcUiE/FgoLJ+ouVfLjE2pLkEn1xCK5hOBarEb2 hEomBc055qYkoNikVZy2EcG6LLBvxW7KS4qL89IWrj4acHiCuC9TuvryFPwGkz8H8nv3tWvZXck gqbRHfMu5D15VPVb4d+Sd4lJULut/5DCS3WBd8YuowdGYS4LksUs7M7Dw8HfLJIKVA4T7WosKCE 26qkdjRHYcl6IU0ZJE7ixJevXmBV+K/1XBcg82OeOiabjA= X-Google-Smtp-Source: AGHT+IGPR58JXW2CvqeP3ZEGQz9M1pTPGCM8DkLCSABZ1gi9AN7l3rZqU3//sE5p59h8unREvgAsMQ== X-Received: by 2002:a05:6512:3e28:b0:540:1f7d:8b9c with SMTP id 2adb3069b0e04-5439c286bbdmr514239e87.45.1737103133760; Fri, 17 Jan 2025 00:38:53 -0800 (PST) Received: from curiosity ([5.188.167.4]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5439af60c4esm275733e87.128.2025.01.17.00.38.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 00:38:51 -0800 (PST) Date: Fri, 17 Jan 2025 11:38:47 +0300 From: Sergey Matyukevich To: Christoph Hellwig Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Palmer Dabbelt , Paul Walmsley , Albert Ou , Alexandre Ghiti , Conor Dooley , Robin Murphy , Lad Prabhakar , Geert Uytterhoeven Subject: Re: [PATCH] riscv: select DMA_DIRECT_REMAP by RISCV_ISA_SVPBMT and ERRATA_THEAD_MAE Message-ID: References: <20250116172950.1989748-1-geomatsi@gmail.com> <20250117075238.GA25422@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20250117075238.GA25422@lst.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250117_003856_030444_91611C7A X-CRM114-Status: GOOD ( 16.61 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Fri, Jan 17, 2025 at 08:52:38AM +0100, Christoph Hellwig wrote: > On Thu, Jan 16, 2025 at 08:29:35PM +0300, Sergey Matyukevich wrote: > > Select DMA_DIRECT_REMAP for the RISC-V extensions that allow to set > > page-based memory types in PTEs according to the requested DMA > > attributes. This is the purpose of Svpbmt or XTheadMae extensions. > > Zicbom or XTheadCmo serve a different purpose, providing instructions > > to flush/invalidate cache blocks. > > Please explain what this is supposed to solve, because the above > explanation dosn't make any sense. DMA_DIRECT_REMAP is one > of the implementations supporting dma coherent allocatiosn for > non-coherent devices. So selecting it from something that > just keyes off support for an extension, but not the dma > implementation is wrong. Now DMA_DIRECT_REMAP is selected either by Zicbom (standard) or XTheadCmo (vendor) RISC-V extensions. However neither of them can help to implement DMA_DIRECT_REMAP on RISC-V. So selection of DMA_DIRECT_REMAP has been moved in Kconfigs to Svpbmt and XTheadMae extensions. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EDCA282890 for ; Fri, 17 Jan 2025 08:38:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737103137; cv=none; b=TJeNAvgrWq6Zkbulvz2ftMPrmETuGgNhLcpwF+/wR0qN4jEDtHc7QYgXZhXL1WsML5TfIF+edXs/hWroYo659Ivuesk5NrbYlwEXqMFlrlcm3PDgWm19c0gaktqiX59dpcz1XbagJYOFi7AGSLVZYX8xz2HXQbRXHVIg4xTOwqE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737103137; c=relaxed/simple; bh=Nn+j9tQL0J42kFEQP7mHCSFEJNaobYfLgXsflRAJypo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=muPMvBbiIhU+ZqOfqwuKOelSpdmH8RMSxl1XmI7RsDdu7Nq8aHR0Flk+McS4yHpw14kUrEwvrguSl4AgR0fcbDyizJT03k9Ab6BNHGYmrklUnUy/UoUUfKVyk/I095+9V+VT1ZISMaNf8GSF5JpOpjApYecBYg+Or369OZlF5v4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UsvTvHxQ; arc=none smtp.client-ip=209.85.167.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UsvTvHxQ" Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-5401d3ea5a1so1799028e87.3 for ; Fri, 17 Jan 2025 00:38:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737103134; x=1737707934; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=phCkAThSkaHv33wSw1qeoZNPv9mc+Clzmmzr3CFp7bY=; b=UsvTvHxQgiAYTX8I3s1aTVy2eLpD81RHI2x+8+k+H57B1QSYzEBvCnvc13qVCf9cbX Z+3trOdAt9v8LisXRrfWvgs6ynK+YjHPyhPE0cQXq46vATtnzhPoT9jQivoGi8VT+XQp ag4jcUX/Kt18whedt3i9Iywq7V9T27KjG842rC09bDK89caF9K88bOCEf3ZUrjolFMrk JlLui/vhT3d7FxEALvCk496BZckDSeCKN5s+nSqfeWi+EY9CX+HdhrRQivjhevMJQCLK 2Vp4lyH0zY9nia51AGAQieQakagSIBTGMKS36r3+A8P4mKx4sHDUf9LbQc7hjMk46pSl S0Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737103134; x=1737707934; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=phCkAThSkaHv33wSw1qeoZNPv9mc+Clzmmzr3CFp7bY=; b=scvkAPjD1xuv9Phpjs7RG8wyy26bn6yf7V+xtzD5XaptWkps8Jii6pAhMAxgxcl4XQ BTBuOozSMOhtAbdIvJS4/mfk6qcgrQhl369LrhbT3zsX0o5sf4RPGid/5VXCvfnOFXld QQs4iiN1Z70tnytcTU8NTuEv26biy108Xj7Cu2nFhJpu/wzVZEHAXRvKkqKlVigtFp6r hKE0Ps1VBHEp+9Ybi3LusTW4vJL9ylX4p54MEehK5Irx9PrcJ+mwtUU72qzYZSyDuW6p JB79a1MH0+QB9PnQhKK5ItdArSAZbWMOVggIJ9VPB2/+7TuLsxoexdu3Xo0g77U6C7+b U5Bg== X-Forwarded-Encrypted: i=1; AJvYcCWeamxgK//c8qMZUXCzWF0MUQhhwzxTbsWmwltUz6IAu4/m+iZ0Ehp0xnvXBwQR4HPDP5nb3/zR9Nf6VtQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzqJZplUhYSuEGGPK2jsS8AzdbdF/kI5rieS8jE5DwT5nZRH9Dm 8A+gZC8f05AWKVW/lX8XLAegvHIEA4J994VmU4AlZmcLrTAiFeF+ X-Gm-Gg: ASbGnctN6257So76kkHMpJJBThtmV3hjn7OEnFBaZiMkoGsU8+4CoMeNpe2WInP4gmY TE1ob0nmgoRyzCr0mRa6m3LxvA5pjZ14L2S6EoKUxtE+T18nUn6wKZRToSPcFj/gKgx3QFplZEt GVxlp/7BU2l8ZSjlIWzXHzyPICxV8LB521NukpYLjTZ8ZAcxojLhgEBLpJDLbyFUMVGnwgFRs1Q RGb6Nh3LaQ/+4JyBmEvxQiotQ3Las11nGK4CoTq82ceMHU= X-Google-Smtp-Source: AGHT+IGPR58JXW2CvqeP3ZEGQz9M1pTPGCM8DkLCSABZ1gi9AN7l3rZqU3//sE5p59h8unREvgAsMQ== X-Received: by 2002:a05:6512:3e28:b0:540:1f7d:8b9c with SMTP id 2adb3069b0e04-5439c286bbdmr514239e87.45.1737103133760; Fri, 17 Jan 2025 00:38:53 -0800 (PST) Received: from curiosity ([5.188.167.4]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5439af60c4esm275733e87.128.2025.01.17.00.38.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 00:38:51 -0800 (PST) Date: Fri, 17 Jan 2025 11:38:47 +0300 From: Sergey Matyukevich To: Christoph Hellwig Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Palmer Dabbelt , Paul Walmsley , Albert Ou , Alexandre Ghiti , Conor Dooley , Robin Murphy , Lad Prabhakar , Geert Uytterhoeven Subject: Re: [PATCH] riscv: select DMA_DIRECT_REMAP by RISCV_ISA_SVPBMT and ERRATA_THEAD_MAE Message-ID: References: <20250116172950.1989748-1-geomatsi@gmail.com> <20250117075238.GA25422@lst.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250117075238.GA25422@lst.de> On Fri, Jan 17, 2025 at 08:52:38AM +0100, Christoph Hellwig wrote: > On Thu, Jan 16, 2025 at 08:29:35PM +0300, Sergey Matyukevich wrote: > > Select DMA_DIRECT_REMAP for the RISC-V extensions that allow to set > > page-based memory types in PTEs according to the requested DMA > > attributes. This is the purpose of Svpbmt or XTheadMae extensions. > > Zicbom or XTheadCmo serve a different purpose, providing instructions > > to flush/invalidate cache blocks. > > Please explain what this is supposed to solve, because the above > explanation dosn't make any sense. DMA_DIRECT_REMAP is one > of the implementations supporting dma coherent allocatiosn for > non-coherent devices. So selecting it from something that > just keyes off support for an extension, but not the dma > implementation is wrong. Now DMA_DIRECT_REMAP is selected either by Zicbom (standard) or XTheadCmo (vendor) RISC-V extensions. However neither of them can help to implement DMA_DIRECT_REMAP on RISC-V. So selection of DMA_DIRECT_REMAP has been moved in Kconfigs to Svpbmt and XTheadMae extensions.