Skip to content

RFC xen/arm: fix "xen_add_mach_to_phys_entry: cannot add" problem

David Vrabel linux-arm-kernel xen-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest0 of 2 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 2 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Xen-devel] [RFC PATCH 0/2] xen/arm: fix "xen_add_mach_to_phys_entry: cannot add" problem
Quoted 8 lines · Stefano Stabellini

Hi all,
Xen support in Linux for ARM and ARM64 suffers from lack of support for multiple mfn to pfn mappings: whenever a frontend grants the same page multiple times to the backend, the mfn to pfn accounting in arch/arm/xen/p2m.c fails. The issue has become critical since v3.15, when xen-netfront/xen-netback switched from grant copies to grant mappings, therefore causing the issue to happen much more often.

Quoted 8 lines

Fixing the mfn to pfn accounting in p2m.c is difficult and expensive, therefore we are looking for alternative solutions. One idea is avoiding mfn to pfn conversions altogether. The only code path that needs them is swiotlb-xen:unmap_page (and single_for_cpu and single_for_device).

To avoid mfn to pfn conversions we rely on a second p2m mapping done by Xen, see the attached patch. In Linux we use it to perform the cache maintenance operations without mfns conversions.

This will only work with PIPT caches (or certain types of VIPT that also have alias detection). Do all the CPUs that Xen runs on have these type of cache?

David