@@ -299,6 +299,8 @@ static int __sbi_rfence_v02(int fid, const struct cpumask *cpu_mask,
299
299
return 0 ;
300
300
}
301
301
302
+ static bool sbi_fwft_supported ;
303
+
302
304
struct fwft_set_req {
303
305
u32 feature ;
304
306
unsigned long value ;
@@ -326,7 +328,15 @@ static void cpu_sbi_fwft_set(void *arg)
326
328
*/
327
329
int sbi_fwft_set (u32 feature , unsigned long value , unsigned long flags )
328
330
{
329
- return - EOPNOTSUPP ;
331
+ struct sbiret ret ;
332
+
333
+ if (!sbi_fwft_supported )
334
+ return - EOPNOTSUPP ;
335
+
336
+ ret = sbi_ecall (SBI_EXT_FWFT , SBI_EXT_FWFT_SET ,
337
+ feature , value , flags , 0 , 0 , 0 );
338
+
339
+ return sbi_err_map_linux_errno (ret .error );
330
340
}
331
341
332
342
/**
@@ -348,6 +358,9 @@ int sbi_fwft_set_cpumask(const cpumask_t *mask, u32 feature,
348
358
.error = ATOMIC_INIT (0 ),
349
359
};
350
360
361
+ if (!sbi_fwft_supported )
362
+ return - EOPNOTSUPP ;
363
+
351
364
if (feature & SBI_FWFT_GLOBAL_FEATURE_BIT )
352
365
return - EINVAL ;
353
366
@@ -679,6 +692,11 @@ void __init sbi_init(void)
679
692
pr_info ("SBI DBCN extension detected\n" );
680
693
sbi_debug_console_available = true;
681
694
}
695
+ if (sbi_spec_version >= sbi_mk_version (3 , 0 ) &&
696
+ sbi_probe_extension (SBI_EXT_FWFT )) {
697
+ pr_info ("SBI FWFT extension detected\n" );
698
+ sbi_fwft_supported = true;
699
+ }
682
700
} else {
683
701
__sbi_set_timer = __sbi_set_timer_v01 ;
684
702
__sbi_send_ipi = __sbi_send_ipi_v01 ;
0 commit comments