xe_pte_hugepage_possible issue
in atsm, c9607f0b fails on large-binds-1073741824 & large-binds-2147483648
xe_vm --r large-binds-1073741824
IGT-Version: 1.26-g7566ace8 (x86_64) (Linux: 5.19.0-0410+ x86_64)
Starting subtest: large-binds-1073741824
VM=0xb61000
xe_bo_create 0x40000000
** verif: ./page_table -a 0xb61000 -q
L3: index:0 [0xb62003]
L2: index:1 [0xc00883] 1G | 0x40000000
xe_vm --r large-binds-2147483648
user@hp380g10:/DATA/XE_0410/igt-gpu-tools$ sudo ./build/tests/xe/xe_vm --r large-binds-2147483648
IGT-Version: 1.26-g7566ace8 (x86_64) (Linux: 5.19.0-0410+ x86_64)
Starting subtest: large-binds-2147483648
VM=0xb61000
xe_bo_create 0x80000000
** verif: ./page_table -a 0xb61000 -q
L3: index:0 [0xb62003]
L2: index:1 [0xc00883] 1G | 0x40000000
L2: index:2 [0x40c00883] 1G | 0x80000000
user@hp380g10:/DATA/XE_0410/igt-gpu-tools$ sudo ./build/tests/xe/xe_vm --r large-binds-1073741824
IGT-Version: 1.26-g7566ace8 (x86_64) (Linux: 5.19.0-0410+ x86_64)
Starting subtest: large-binds-1073741824
VM=0xb61000
xe_bo_create 0x40000000
** verif: ./page_table -a 0xb61000 -q
L3: index:0 [0xb62003]
L2: index:1 [0xb63003]
L1: index:0 [0xc00883] 2M | 0x40000000
L1: index:1 [0xe00883] 2M | 0x40200000
...
Looks like 1G (or even 2M), we would need to verify the alignement.
as proof point, this allow the test to pass:
diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
index 079e5e0d2177..231bfe1b87a1 100644
--- a/drivers/gpu/drm/xe/xe_bo.c
+++ b/drivers/gpu/drm/xe/xe_bo.c
@@ -760,6 +760,10 @@ struct xe_bo *__xe_bo_create_locked(struct xe_device *xe, struct xe_bo *bo,
size = ALIGN(size, SZ_64K);
flags |= XE_BO_INTERNAL_64K;
alignment = SZ_64K >> PAGE_SHIFT;
+
+ if (size >= SZ_1G) {
+ alignment = SZ_1G >> PAGE_SHIFT;
+ }
} else {
alignment = SZ_4K >> PAGE_SHIFT;
}
using:
+#if 1
+if (level == 2) {
+ u64 pte;
+ bool is_lmem;
+ bo_ofs = 0;
+pte = vma_addr(vma, bo_ofs, GEN8_PAGE_SIZE, &is_lmem);
+printk("xe_pte_hugepage_possible pagesize=0x%llx / 0x%llx\n", pagesize, pte);
+}
without:
[78964.985352] [IGT] xe_vm: starting subtest large-binds-1073741824
[78966.758443] xe_pte_hugepage_possible pagesize=0x40000000 / 0x1800000
-> FAIL
with the align:
[79569.383036] [IGT] xe_vm: starting subtest large-binds-1073741824
[79571.160267] xe_pte_hugepage_possible pagesize=0x40000000 / 0x40000000
-> PASS