Re: [PATCH v5 07/15] iommupt: Add map_pages op

Jason Gunthorpe
2025-10-07T13:12:14Z

On Tue, Oct 07, 2025 at 05:38:48PM +0530, Vasant Hegde wrote:
> > + PT_WARN_ON(compute_best_pgsize(&pts, oa) != leaf_pgsize_lg2);
>
>
> If I select CONFIG_DEBUG_GENERIC_PT=y and boot AMD system with V1 (Host page
> table), in some cases we hit this warning. Code path looks ok. may be silence
> these warning?
>
> [ 31.985383] pt_iommu_amdv1_map_pages : oa 0x208b95d000 va 0xfef80000 last_va 0xfef9ffff pgsz_lg 0xc pgsize 0x1000 pgcount 0x20
^^^^
> [ 31.985384] __map_range_leaf oa 0x208b95e000 va 0xfef80000 last_va 0xfef9ffff pgsize 0xd leaf_pgsize 0xc possible_sz 0x1ff000
^^^^

oa advanced but va didn't. It's a a little bug in the warning,
since it doesn't recompute the va each iteration. I'm surprised the
random test didn't find it..

if (IS_ENABLED(CONFIG_DEBUG_GENERIC_PT)) {
pt_index_to_va(&pts);
PT_WARN_ON(compute_best_pgsize(&pts, oa) !=
leaf_pgsize_lg2);
}

Thanks,
Jason