On 23.07.2024 10:02, Oleksii Kurochko wrote: > On Mon, Jul 22, 2024 at 7:27 PM Julien Grall <jul...@xen.org> wrote: >>>> On 22/07/2024 15:44, Oleksii Kurochko wrote: >>> /* Map a 4k page in a fixmap entry */ >>> void set_fixmap(unsigned map, mfn_t mfn, unsigned int flags) >>> { >>> pte_t pte; >>> >>> pte = mfn_to_xen_entry(mfn, flags); >>> pte.pte |= PTE_LEAF_DEFAULT; >>> write_pte(&xen_fixmap[pt_index(0, FIXMAP_ADDR(map))], pte); >> >> It would be saner to check if you are not overwriting any existing >> mapping as otherwise you will probably need a TLB flush. >> >>> } >>> >>> /* Remove a mapping from a fixmap entry */ >>> void clear_fixmap(unsigned map) >>> { >>> pte_t pte = {0}; >>> write_pte(&xen_fixmap[pt_index(0, FIXMAP_ADDR(map))], pte); >> >> Don't you need a TLB flush? >> > Inside write_pte() there is "sfence.vma".
That's just a fence though, not a TLB flush. Jan