Commit 6192029
committed
Merge: Updates for powerpc iommu
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/693
Description: Updates for powerpc iommu
JIRA: https://issues.redhat.com/browse/RHEL-85949
Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=67245031
Tested: Verified Brew build test kernel RPMs
Signed-off-by: Mamatha Inamdar <minamdar@redhat.com>
commit 6aa989a
Author: Gaurav Batra <gbatra@linux.ibm.com>
Date: Thu Jan 30 12:38:54 2025 -0600
powerpc/pseries/iommu: memory notifier incorrectly adds TCEs for pmemory
iommu_mem_notifier() is invoked when RAM is dynamically added/removed. This
notifier call is responsible to add/remove TCEs from the Dynamic DMA Window
(DDW) when TCEs are pre-mapped. TCEs are pre-mapped only for RAM and not
for persistent memory (pmemory). For DMA buffers in pmemory, TCEs are
dynamically mapped when the device driver instructs to do so.
The issue is 'daxctl' command is capable of adding pmemory as "System RAM"
after LPAR boot. The command to do so is -
daxctl reconfigure-device --mode=system-ram dax0.0 --force
This will dynamically add pmemory range to LPAR RAM eventually invoking
iommu_mem_notifier(). The address range of pmemory is way beyond the Max
RAM that the LPAR can have. Which means, this range is beyond the DDW
created for the device, at device initialization time.
As a result when TCEs are pre-mapped for the pmemory range, by
iommu_mem_notifier(), PHYP HCALL returns H_PARAMETER. This failed the
command, daxctl, to add pmemory as RAM.
The solution is to not pre-map TCEs for pmemory.
Signed-off-by: Gaurav Batra <gbatra@linux.ibm.com>
Tested-by: Donet Tom <donettom@linux.ibm.com>
Reviewed-by: Donet Tom <donettom@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20250130183854.92258-1-gbatra@linux.ibm.com
Signed-off-by: Mamatha Inamdar <minamdar@redhat.com>
Approved-by: Steve Best <sbest@redhat.com>
Approved-by: Rafael Aquini <raquini@redhat.com>
Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com>
Merged-by: Julio Faracco <jfaracco@redhat.com>3 files changed
+18
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1336 | 1336 | | |
1337 | 1337 | | |
1338 | 1338 | | |
1339 | | - | |
| 1339 | + | |
1340 | 1340 | | |
1341 | 1341 | | |
1342 | 1342 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1293 | 1293 | | |
1294 | 1294 | | |
1295 | 1295 | | |
1296 | | - | |
1297 | | - | |
| 1296 | + | |
1298 | 1297 | | |
1299 | | - | |
1300 | | - | |
1301 | | - | |
1302 | | - | |
1303 | | - | |
1304 | | - | |
1305 | | - | |
1306 | | - | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
1307 | 1303 | | |
1308 | 1304 | | |
1309 | 1305 | | |
| |||
1609 | 1605 | | |
1610 | 1606 | | |
1611 | 1607 | | |
1612 | | - | |
| 1608 | + | |
1613 | 1609 | | |
1614 | 1610 | | |
1615 | 1611 | | |
| |||
2355 | 2351 | | |
2356 | 2352 | | |
2357 | 2353 | | |
| 2354 | + | |
| 2355 | + | |
| 2356 | + | |
| 2357 | + | |
| 2358 | + | |
2358 | 2359 | | |
2359 | 2360 | | |
2360 | 2361 | | |
2361 | 2362 | | |
2362 | | - | |
| 2363 | + | |
| 2364 | + | |
2363 | 2365 | | |
2364 | 2366 | | |
2365 | 2367 | | |
| |||
2371 | 2373 | | |
2372 | 2374 | | |
2373 | 2375 | | |
2374 | | - | |
| 2376 | + | |
| 2377 | + | |
2375 | 2378 | | |
2376 | 2379 | | |
2377 | 2380 | | |
| |||
0 commit comments