On Thu, Aug 14, 2025 at 10:34:02PM -0400, Shixuan Zhao wrote:
Currently tdx_enc_status_changed uses __pa which will only acceptCould you tell more about use-case?
addresses within the linear mapping. This patch allows memory allocated
in the VM area to be used.
For VM area addresses, we do it page-by-page since there's no guarantee
that the physical pages are contiguous. If, however, the entire range
falls within the linear mapping, we provide a fast path that do the
entire range just like the current version so that the performance
would remain roughly the same as current.
Signed-off-by: Shixuan Zhao <shixuan.zhao@xxxxxxxxxxx>
---
Hi,
I recently ran into a problem where tdx_enc_status_changed was not
implemented to handle memory mapped in the kernel VM area (e.g., ioremap
or vmalloc). I have created a patch that tries to fix this problem. The
overall idea is to keep a fast path for the current __pa-based routine
if the range falls within the linear mapping, otherwise fall to a page-by-
page page table walk for those in the VM area.
I am not sure we ever want to convert vmalloc()ed memory to shared as it
will result in fracturing direct mapping.
And it seems to the wrong layer to make it. If we really need to go
this pass (I am not convinced) it has to be done in set_memory.c
Sathya, I remember you did something similar for REPORT, right?
--