Skip to content

Commit

Permalink
Fix compatibility with Linux 6.5 and later
Browse files Browse the repository at this point in the history
Attempt to fix issue #70
  • Loading branch information
jovanbulck committed Jan 18, 2024
1 parent 982a183 commit cadeb57
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions kernel/sgxstep.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ int save_idt(void)
*/
int save_apic(void)
{
g_apic_lvtt_copy = apic_read(APIC_LVTT);
g_apic_tdcr_copy = apic_read(APIC_TDCR);
g_apic_lvtt_copy = apic->read(APIC_LVTT);
g_apic_tdcr_copy = apic->read(APIC_TDCR);
log("original APIC_LVTT=%#x/TDCR=%#x)", g_apic_lvtt_copy, g_apic_tdcr_copy);

return 0;
Expand Down Expand Up @@ -174,8 +174,8 @@ void restore_apic(void)
{
int delta = 100;

apic_write(APIC_LVTT, g_apic_lvtt_copy);
apic_write(APIC_TDCR, g_apic_tdcr_copy);
apic->write(APIC_LVTT, g_apic_lvtt_copy);
apic->write(APIC_TDCR, g_apic_tdcr_copy);
log("restored APIC_LVTT=%#x/TDCR=%#x)", g_apic_lvtt_copy, g_apic_tdcr_copy);

/* In xAPIC mode the memory-mapped write to LVTT needs to be serialized. */
Expand All @@ -190,7 +190,7 @@ void restore_apic(void)
else
{
log("restoring APIC timer one-shot/periodic operation");
apic_write(APIC_TMICT, delta);
apic->write(APIC_TMICT, delta);
}
}

Expand Down Expand Up @@ -271,7 +271,7 @@ long sgx_step_get_pt_mapping(struct file *filep, unsigned int cmd, unsigned long
if ( !pmd_present( *pmd ) )
return 0;

pte = pte_offset_map( pmd, virt );
pte = pte_offset_kernel( pmd, virt );
map->pte = *((uint64_t *) pte);

if ( !pte_present( *pte ) )
Expand Down

0 comments on commit cadeb57

Please sign in to comment.