Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1790038lqe; Mon, 8 Apr 2024 23:25:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUAxVSM6gjyhFRk344IDSUoXVq059KkRNxgbi8RSEBOBX1p8DOponlgt/KpV+A6moZqCNL9KXu0oddDVwyTdy3FM7I/OEJ2RvEYvTzAIA== X-Google-Smtp-Source: AGHT+IHG9hiMmrw5LGDy/3yY3SF38QAXQ6HMuMYFYivfD33CD1+9bAEvoZGQz6KL2fpeLV/78ZxE X-Received: by 2002:a17:902:c3c6:b0:1e2:5e32:4444 with SMTP id j6-20020a170902c3c600b001e25e324444mr9973373plj.10.1712643953401; Mon, 08 Apr 2024 23:25:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712643953; cv=pass; d=google.com; s=arc-20160816; b=nQPmDYWMw9NAw1F1nt5pUs07luVraKyw8Sj7+ntde4Wv+5ft/fp4HH+wPwkUkrgIqi ZDnY52NdW6X/y5ig/0dQFe/fBUbgybSbM1j9/veX7Yh1+SeW2UOsVLwOXStQS8w932Wa yPAVrknrSt0srs5NgqdMAmLhQV7Q0JpsibmpZJbYIYa5P0d40rPkxKCw3AvUsIvvWshZ CNNv9plA44jBvfY2OoZ8VAwu1f3HC8IravsmgsRvNCg9AdIRty8P02IiZLxfmQqWAyNh K3e/KgjkYk3XZUlJ665JU/LBhH93P5923J/QVhqcegxOKo6GKEH842YhNX8Msx6UhODX 1E+Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=9JaCsaj/kz98ZAsB0jG60D9Ow7+EEimNeRDYL/wjZ6U=; fh=W01kooGlvR+YDsYzxDGIyNTz6+GmZIMqcuUKjhMGsWY=; b=UVOTknbMlK1vYEYClYDqDdSL6B9xDB0JG9l31B4CT3i4FRAxCtONNX1doiuLD2iRfR aB9YHfcXlQSwmDUgIVQCMnb4C0iSsA8jqoBEHtEr2jgwf1HDe0vio+qzi8t9YGdqoqjZ E9mYGyueh3MLju1LkhhOtB2CRD65VndXld/BTZlPB/0ya36QJ3BO8/6NjymQtxPXjMjS JLIgs0wprajUoIo344OIkY4U8l6eL388/kTz9IqHT0incoVzJ/MD0MBryF3uELcCZJCS UWoH0m0LKDaEFFGFI0MVp6D8FoxYljMDks+Kz7i1yc+uTg1jMbQ43JGabM0zg/AqmWq/ LgVw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tkos.co.il header.s=default header.b=a4c9OXqG; arc=pass (i=1 spf=pass spfdomain=tkos.co.il dkim=pass dkdomain=tkos.co.il dmarc=pass fromdomain=tkos.co.il); spf=pass (google.com: domain of linux-kernel+bounces-136296-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136296-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=tkos.co.il Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id h5-20020a170902f7c500b001e4638cbd46si2055553plw.420.2024.04.08.23.25.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 23:25:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-136296-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@tkos.co.il header.s=default header.b=a4c9OXqG; arc=pass (i=1 spf=pass spfdomain=tkos.co.il dkim=pass dkdomain=tkos.co.il dmarc=pass fromdomain=tkos.co.il); spf=pass (google.com: domain of linux-kernel+bounces-136296-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136296-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=tkos.co.il Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1A5B3284DA6 for ; Tue, 9 Apr 2024 06:25:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 490C9762DE; Tue, 9 Apr 2024 06:25:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tkos.co.il header.i=@tkos.co.il header.b="a4c9OXqG" Received: from mail.tkos.co.il (wiki.tkos.co.il [84.110.109.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C5CA56E5EC; Tue, 9 Apr 2024 06:25:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=84.110.109.230 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712643940; cv=none; b=gyjOFi6dtkRW7iBG0PeZYhAb2RYdax/8B3SuAjp9BQfMriCmYPLXNFer8SN6MMQ0kie4G2CBvOYq/rah67yXDMn+8xfKR/z02XEGaDETFJhviEnYp9geu+jbwxqjLto+Wl23LezK9eo73aWZHfHf0HkEtdZ8xDqd4CZBu0SY8hQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712643940; c=relaxed/simple; bh=bnuGCfoRD/GHBH5oPlzJgRbdryYdtuyyryw5PvMST3k=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=DQIZqvm3X8KeZr+pY139s7hOL35L147hYAECCtNDAT6cf67S+Ps56K1tBYN0aG05droJK0UKWQ1xte3X9dBv1zckpOjXAdEJShlQD5Ths5oWivFvB/LdtHNuGfJdggOOmzvylvCnSUHglrZarUSqlAt5Asfcy3sr8JEpgR/D8OY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tkos.co.il; spf=pass smtp.mailfrom=tkos.co.il; dkim=pass (2048-bit key) header.d=tkos.co.il header.i=@tkos.co.il header.b=a4c9OXqG; arc=none smtp.client-ip=84.110.109.230 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tkos.co.il Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tkos.co.il Received: from tarshish.tkos.co.il (unknown [10.0.8.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.tkos.co.il (Postfix) with ESMTPS id 5C128440209; Tue, 9 Apr 2024 09:17:42 +0300 (IDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tkos.co.il; s=default; t=1712643462; bh=bnuGCfoRD/GHBH5oPlzJgRbdryYdtuyyryw5PvMST3k=; h=From:To:Cc:Subject:Date:From; b=a4c9OXqGbWvMqcGamtbGvNOylokFOW+P/K6pK1HJUkwAsoEkr11JAJ94N9DueCzUL Sh9pTDCYg72vzxXwwgo7aoVROdIbGvzuaSAzdizDy/f66CdkraK47/FHVX0aLnAylz bgZYDCW9qIt0nfbBWhnvW9LIjltl/WjI8PVkpsVa1LcktqpmDJo4MwsQO93eEn4bkp pD3oGKocfvAQF8y7xcMH/10bUZEagZl00KRqDBhV8dfGmtr7MUP90ka7K3D46nD30L t9hnstbzUOSxvqVeJL72Jv475/gjlo0tBTgGxCv2+6SrIF50HZzI/hnozSsPuc56BP 1euAVmAgJnV3w== From: Baruch Siach To: Christoph Hellwig , Marek Szyprowski , Rob Herring , Saravana Kannan , Catalin Marinas , Will Deacon Cc: Baruch Siach , Robin Murphy , iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, =?UTF-8?q?Petr=20Tesa=C5=99=C3=ADk?= , Ramon Fried , Elad Nachman Subject: [PATCH RFC v2 0/5] arm64: support DMA zone starting above 4GB Date: Tue, 9 Apr 2024 09:17:53 +0300 Message-ID: X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit DMA zones code assumes that DMA lower limit is zero. When there is no RAM below 4GB, arm64 platform code sets DMA/DMA32 zone limits to cover the entire RAM[0]. The platform I have has RAM starting at 32GB. Devices with 30-bit DMA mask are mapped to 1GB at the bottom of RAM, between 32GB - 33GB. A DMA zone over the entire RAM breaks DMA allocation for these devices. In response to a previous RFC hack[1] Catalin Marinas suggested to add a separate offset value as base address for the DMA zone. This RFC series attempts to implement that suggestion. With this series applied, the DMA zone covers the right RAM range for my platform. RFC v2: * Add patch from Catalin[2] changing zone_dma_bits to zone_dma_limit to simplify subsequent patches * Test on real hardware RFC v1: https://lore.kernel.org/all/cover.1703683642.git.baruch@tkos.co.il/ [0] See commit 791ab8b2e3db ("arm64: Ignore any DMA offsets in the max_zone_phys() calculation") [1] https://lore.kernel.org/all/9af8a19c3398e7dc09cfc1fbafed98d795d9f83e.1699464622.git.baruch@tkos.co.il/ [2] https://lore.kernel.org/all/ZZ2HnHJV3gdzu1Aj@arm.com/ Baruch Siach (4): of: get dma area lower limit of: unittest: add test for of_dma_get_cpu_limits() 'min' param dma-direct: add base offset to zone_dma_bits arm64: mm: take DMA zone offset into account Catalin Marinas (1): dma-mapping: replace zone_dma_bits by zone_dma_limit arch/arm64/mm/init.c | 34 ++++++++++++---------------------- arch/powerpc/mm/mem.c | 9 ++++----- arch/s390/mm/init.c | 2 +- drivers/of/address.c | 38 +++++++++++++++++++++++++++----------- drivers/of/unittest.c | 17 ++++++++++------- include/linux/dma-direct.h | 3 ++- include/linux/of.h | 11 ++++++++--- kernel/dma/direct.c | 11 ++++++----- kernel/dma/pool.c | 2 +- kernel/dma/swiotlb.c | 4 ++-- 10 files changed, 73 insertions(+), 58 deletions(-) -- 2.43.0