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.