In the PeiCore part of OVMF's initialization, on real hardware, the IDT is used to store a pointer to an instance of EFI_PEI_SERVICES. When the pointer is needed, it is dereferenced by first executing SIDT, then reading the table pointer, and then dereferencing the first entry (which is not a real IDT entry, but rather a pointer to the service table). In Ghidra, this is nearly impossible to unmangle:
local_8 = local_10;
InterruptDescriptorTableRegister();
(**(code **)(**(int **)(iStack_e + -4) + 0x24))(*(int **)(iStack_e + -4),param_1);
Could support be added to transform this into a neater call, like:
InterruptDescriptorTableStore(idt);
idt->table->peiServices->PeiNotifyPpi(idt->table->peiServices, param_1)
In the PeiCore part of OVMF's initialization, on real hardware, the IDT is used to store a pointer to an instance of EFI_PEI_SERVICES. When the pointer is needed, it is dereferenced by first executing
SIDT, then reading the table pointer, and then dereferencing the first entry (which is not a real IDT entry, but rather a pointer to the service table). In Ghidra, this is nearly impossible to unmangle:Could support be added to transform this into a neater call, like: