[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230615201042.2291867-1-jonas@kwiboo.se>
Date: Thu, 15 Jun 2023 20:10:45 +0000 (UTC)
From: Jonas Karlman <jonas@...boo.se>
To: Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>,
Robin Murphy <robin.murphy@....com>,
Heiko Stuebner <heiko@...ech.de>
Cc: Benjamin Gaignard <benjamin.gaignard@...labora.com>,
iommu@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org,
Jonas Karlman <jonas@...boo.se>
Subject: [PATCH v2 0/3] iommu: rockchip: Fix discovery table address encoding
This is a re-send of a series sent out in January, see [1].
The address to the discovery table is currently encoded using an
incorrect bit layout when configured into the MMU_DTE_ADDR reg.
This currently do not cause any issue because the discovery and page
tables is allocated in memory below 4GB thanks to the GFP_DMA32 flag.
Testing has shown that the discovery table address should be encoded
using the same bit layout as the page table and memory page addresses.
Removing the GFP_DMA32 on a RK3568 with 8GB of memory will result in:
[ 0.907236] rk_iommu fe043e00.iommu: Page fault at 0x00000000ff801000 of type read
[ 0.907264] rk_iommu fe043e00.iommu: iova = 0x00000000ff801000: dte_index: 0x3fe pte_index: 0x1 page_offset: 0x0
[ 0.907281] rk_iommu fe043e00.iommu: mmu_dte_addr: 0x000000010189a000 dte@...00000010189aff8: 0x1722101 valid: 1 pte@...000000101722004: 0x2c01107 valid: 1 page@...000000102c01000 flags: 0x106
This series fixes this by using the existing mk_dtentries instead of the
dma_addr_dte ops to encode the discovery table address, removes unused
ops and finally removes the GFP_DMA32 flag to allow for discovery and
page tables to be allocated in memory above 4GB.
Changes in v2:
- no changes, rebased on next-20230615
This series can also be found at [2].
[1] https://lore.kernel.org/all/20230125221809.3275481-1-jonas@kwiboo.se/
[2] https://github.com/Kwiboo/linux-rockchip/commits/next-20230615-iommu
Jonas Karlman (3):
iommu: rockchip: Fix discovery table address encoding
iommu: rockchip: Remove unused variant ops
iommu: rockchip: Allocate tables from all available memory
drivers/iommu/rockchip-iommu.c | 45 +++++-----------------------------
1 file changed, 6 insertions(+), 39 deletions(-)
--
2.40.1
Powered by blists - more mailing lists