PT encoding ops
Hi, Lucas, Matt
IMO ideally we should try to keep all page-table-encoding bit definition usage in xe_pt.[ch] (or possibly a separate file if we expect a lot of hardware variation). Currently it's in xe_vm.c, which is intended for higher level vm stuff, although I didn't succeed in separatating it completely. I sort of stumbled on this while looking at encoding a single NULL mapping from the xe_migrate code.
Do you think it would be possible with only two ops:
pte_encode_addr() andpde_encode_addr()
And the rest of the current ops would simply be non-hardware-specific helpers that called one of the above. Those helpers could then be placed in xe_vm.c and xe_bo.c
That would mean a set of generic (non-device-specific) flags:
XE_PT_ENCODE_RWXE_PT_ENCODE_NULLXE_PT_ENCODE_DEVMEMXE_PT_ENCODE_XXX
/Thomas
Quoted 3 lines · Thomas Hellström
Hi, Lucas, Matt
IMO ideally we should try to keep all page-table-encoding bit definition usage in xe_pt.[ch] (or possibly a separate file if we
note that ggtt also has a different encoding for the entries
Quoted 1 line
expect a lot of hardware variation). Currently it's in
xe_vm.c, which is intended for higher level vm stuff, although I didn't succeed in separatating it completely. I sort of stumbled on this while looking at encoding a single NULL mapping from thexe_migratecode.
I stopped the abstraction where it is since I knew there was already work going on by Matt Auld wrt PAT indexes. I agree some of this stuff is incomplete.
Quoted 5 lines
Do you think it would be possible with only two ops:
pte_encode_addr()andpde_encode_addr()
even pte_ vs pde_ is kind of a misnomer IMO... pte_ is about leaf nodes, and also encodes a pde entry.
Quoted 9 lines
And the rest of the current ops would simply be non-hardware-specific helpers that called one of the above. Those helpers could then be placed in
xe_vm.candxe_bo.cThat would mean a set of generic (non-device-specific) flags:
XE_PT_ENCODE_RWXE_PT_ENCODE_NULLXE_PT_ENCODE_DEVMEMXE_PT_ENCODE_XXX
I will take a look and get back to you
Lucas De Marchi