Re: [PATCH v8 01/13] x86: export set_direct_map_valid_noflush to KVM module

Nikita Kalyazin
2026-01-14T13:57:14Z

On 05/12/2025 17:26, Dave Hansen wrote:
> On 12/5/25 08:57, Kalyazin, Nikita wrote:
> ...
>> +EXPORT_SYMBOL_FOR_MODULES(set_direct_map_valid_noflush, "kvm");
>
> I think this export is a bad idea. The interface is abhorrent enough,
> but exporting it just invites abuse and bugs.
>
> I think what this really needs is a pair of helpers that are just:
>
> folio_zap_direct_map()
> and
> folio_restore_direct_map()
>
> that take a folio. *Those* can get exported to modules and those should
> internally flush the TLB and not expect callers to do it.

Thanks, implemented in the v9.