Pages are added to the TLB with add. Process context identifier, linear and physical address for translation specified using arguments hint, laddr and paddr correspondingly. The fields in attrs argument used for specification of allowed access types and additional page attributes.
lookup is used by the CPU when a memory access misses the STC. It returns the matching TLB entry if the memory operation specified in mem_tr hits the TLB and does not raise an exception. Otherwise NULL is returned. The hint argument specifies process context identifier. The mode, linear_address, and type fields in mem_tr need to be valid when the method is invoked. The other fields passed through mem_tr are not to be used by the method and can carry any value. If the method returns not NULL, the s.physical_address, pat_type, and mtrr_type fields of mem_tr must be updated by lookup.
itlb_lookup is a simplified version of lookup used only for instruction TLB lookups. If the lookup is successful valid and paddr should be set, otherwise valid should be cleared.
invalidate_page is used to remove from TLB page corresponding to given linear address specified by argument laddr in process context with identifier from argument hint.
invalidate is invoked when value of CR4.PCIDE bit set and CPU executes INVPCID instruction. Direct and indirect operands of instruction transferred in hint, la and type arguments. TLB entries flushed according to INVPCID instruction description. New invalidation type X86_Tlb_Invalidate_Address_Space added to implement flush_all function from previous interfaces. The method also can be used to flush required TLB entries in any required cases.
The class implementing the interface must make sure that only addresses mapped in the TLB are present in the STCs.
SIM_INTERFACE(x86_tlb_v3) {
void (*add)(conf_object_t *obj,
uint64 hint,
linear_address_t laddr,
physical_address_t paddr,
x86_tlb_attrs_v3_t attrs);
const x86_tlb_entry_v3_t *(*lookup)(conf_object_t *obj,
uint64 hint,
x86_memory_transaction_t *mem_tr);
tagged_physical_address_t (*itlb_lookup)(conf_object_t *obj,
uint64 hint,
linear_address_t laddr,
processor_mode_t mode);
void (*invalidate_page)(conf_object_t *obj,
uint64 hint,
linear_address_t laddr);
void (*invalidate)(conf_object_t *obj,
uint32 type,
uint64 hint,
linear_address_t la);
};
#define X86_TLB_V3_INTERFACE "x86_tlb_v3"