Skip to content

Commit 0f22431

Browse files
authored
Merge pull request #73 from jovanbulck/linux-compat-fix
Fix compatibility with Linux 6.5 and later
2 parents 982a183 + cadeb57 commit 0f22431

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

kernel/sgxstep.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ int save_idt(void)
117117
*/
118118
int save_apic(void)
119119
{
120-
g_apic_lvtt_copy = apic_read(APIC_LVTT);
121-
g_apic_tdcr_copy = apic_read(APIC_TDCR);
120+
g_apic_lvtt_copy = apic->read(APIC_LVTT);
121+
g_apic_tdcr_copy = apic->read(APIC_TDCR);
122122
log("original APIC_LVTT=%#x/TDCR=%#x)", g_apic_lvtt_copy, g_apic_tdcr_copy);
123123

124124
return 0;
@@ -174,8 +174,8 @@ void restore_apic(void)
174174
{
175175
int delta = 100;
176176

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

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

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

274-
pte = pte_offset_map( pmd, virt );
274+
pte = pte_offset_kernel( pmd, virt );
275275
map->pte = *((uint64_t *) pte);
276276

277277
if ( !pte_present( *pte ) )

0 commit comments

Comments
 (0)