Skip to contentSkip to conversation

PT encoding ops

Intel-xe Thomas Hellström 2 participants 2 messages Nov 14, 2023

lore
Share & tools
lore
#0 lore raw

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() and
pde_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_RW
XE_PT_ENCODE_NULL
XE_PT_ENCODE_DEVMEM
XE_PT_ENCODE_XXX

/Thomas

#1 lore raw
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 the xe_migrate code.

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() and
pde_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.c and xe_bo.c

That would mean a set of generic (non-device-specific) flags:

XE_PT_ENCODE_RW
XE_PT_ENCODE_NULL
XE_PT_ENCODE_DEVMEM
XE_PT_ENCODE_XXX

I will take a look and get back to you

Lucas De Marchi