tree:
https://github.com/avpatel/linux.git riscv_kvm_v10
head: adf8e35ae72bfdf0ce6f00f7c30923ea8f791748
commit: 522547d7acac1b1d65bb7567415ea038ba02381d [6/31] RISC-V: Implement new SBI v0.2
extensions
config: riscv-allnoconfig (attached as .config)
compiler: riscv64-linux-gcc (GCC) 7.4.0
reproduce:
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 522547d7acac1b1d65bb7567415ea038ba02381d
# save the attached .config to linux build tree
GCC_VERSION=7.4.0 make.cross ARCH=riscv
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
%u
In file included from include/linux/printk.h:7:0,
from include/linux/kernel.h:15,
from include/linux/list.h:9,
from include/linux/pm.h:11,
from arch/riscv/kernel/sbi.c:4:
arch/riscv/kernel/sbi.c: In function '__sbi_send_ipi_dummy_warn':
include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of
type 'long unsigned int', but argument 2 has type 'int' [-Wformat=]
#define KERN_SOH "\001" /* ASCII Start Of Header */
^
include/linux/kern_levels.h:12:22: note: in expansion of macro 'KERN_SOH'
#define KERN_WARNING KERN_SOH "4" /* warning conditions */
^~~~~~~~
include/linux/printk.h:306:9: note: in expansion of macro 'KERN_WARNING'
printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~~
include/linux/printk.h:307:17: note: in expansion of macro 'pr_warning'
#define pr_warn pr_warning
^~~~~~~~~~
arch/riscv/kernel/sbi.c:71:2: note: in expansion of macro 'pr_warn'
pr_warn("IPI extension is not available in SBI v%lu.%lu\n",
^~~~~~~
arch/riscv/kernel/sbi.c:71:52: note: format string is defined here
pr_warn("IPI extension is not available in SBI v%lu.%lu\n",
~~^
%u
In file included from include/linux/printk.h:7:0,
from include/linux/kernel.h:15,
from include/linux/list.h:9,
from include/linux/pm.h:11,
from arch/riscv/kernel/sbi.c:4:
include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of
type 'long unsigned int', but argument 3 has type 'int' [-Wformat=]
#define KERN_SOH "\001" /* ASCII Start Of Header */
^
include/linux/kern_levels.h:12:22: note: in expansion of macro 'KERN_SOH'
#define KERN_WARNING KERN_SOH "4" /* warning conditions */
^~~~~~~~
include/linux/printk.h:306:9: note: in expansion of macro 'KERN_WARNING'
printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~~
include/linux/printk.h:307:17: note: in expansion of macro 'pr_warning'
#define pr_warn pr_warning
^~~~~~~~~~
arch/riscv/kernel/sbi.c:71:2: note: in expansion of macro 'pr_warn'
pr_warn("IPI extension is not available in SBI v%lu.%lu\n",
^~~~~~~
arch/riscv/kernel/sbi.c:71:56: note: format string is defined here
pr_warn("IPI extension is not available in SBI v%lu.%lu\n",
~~^
%u
In file included from include/linux/printk.h:7:0,
from include/linux/kernel.h:15,
from include/linux/list.h:9,
from include/linux/pm.h:11,
from arch/riscv/kernel/sbi.c:4:
arch/riscv/kernel/sbi.c: In function '__sbi_rfence_dummy_warn':
include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of
type 'long unsigned int', but argument 2 has type 'int' [-Wformat=]
#define KERN_SOH "\001" /* ASCII Start Of Header */
^
include/linux/kern_levels.h:12:22: note: in expansion of macro 'KERN_SOH'
#define KERN_WARNING KERN_SOH "4" /* warning conditions */
^~~~~~~~
include/linux/printk.h:306:9: note: in expansion of macro 'KERN_WARNING'
printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~~
include/linux/printk.h:307:17: note: in expansion of macro 'pr_warning'
#define pr_warn pr_warning
^~~~~~~~~~
arch/riscv/kernel/sbi.c:83:2: note: in expansion of macro 'pr_warn'
pr_warn("remote fence extension is not available in SBI v%lu.%lu\n",
^~~~~~~
arch/riscv/kernel/sbi.c:83:61: note: format string is defined here
pr_warn("remote fence extension is not available in SBI v%lu.%lu\n",
~~^
%u
In file included from include/linux/printk.h:7:0,
from include/linux/kernel.h:15,
from include/linux/list.h:9,
from include/linux/pm.h:11,
from arch/riscv/kernel/sbi.c:4:
include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of
type 'long unsigned int', but argument 3 has type 'int' [-Wformat=]
#define KERN_SOH "\001" /* ASCII Start Of Header */
^
include/linux/kern_levels.h:12:22: note: in expansion of macro 'KERN_SOH'
#define KERN_WARNING KERN_SOH "4" /* warning conditions */
^~~~~~~~
include/linux/printk.h:306:9: note: in expansion of macro 'KERN_WARNING'
printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~~
include/linux/printk.h:307:17: note: in expansion of macro 'pr_warning'
#define pr_warn pr_warning
^~~~~~~~~~
arch/riscv/kernel/sbi.c:83:2: note: in expansion of macro 'pr_warn'
pr_warn("remote fence extension is not available in SBI v%lu.%lu\n",
^~~~~~~
arch/riscv/kernel/sbi.c:83:65: note: format string is defined here
pr_warn("remote fence extension is not available in SBI v%lu.%lu\n",
~~^
%u
arch/riscv/kernel/sbi.c: In function '__sbi_set_timer_v02':
> arch/riscv/kernel/sbi.c:214:12: error: 'SBI_EXT_TIME'
undeclared (first use in this function); did you mean 'STA_PPSTIME'?
sbi_ecall(SBI_EXT_TIME, SBI_EXT_TIME_SET_TIMER, stime_value, 0,
^~~~~~~~~~~~
STA_PPSTIME
> arch/riscv/kernel/sbi.c:214:26: error:
'SBI_EXT_TIME_SET_TIMER' undeclared (first use in this function); did you mean
'SBI_EXT_TIME'?
sbi_ecall(SBI_EXT_TIME, SBI_EXT_TIME_SET_TIMER,
stime_value, 0,
^~~~~~~~~~~~~~~~~~~~~~
SBI_EXT_TIME
arch/riscv/kernel/sbi.c: In function '__sbi_send_ipi_v02':
> arch/riscv/kernel/sbi.c:222:9: error: variable 'ret' has
initializer but incomplete type
struct sbiret ret = {0};
^~~~~~
arch/riscv/kernel/sbi.c:222:23: warning: excess elements in struct initializer
struct sbiret ret = {0};
^
arch/riscv/kernel/sbi.c:222:23: note: (near initialization for 'ret')
arch/riscv/kernel/sbi.c:222:16: error: storage size of 'ret' isn't known
struct sbiret ret = {0};
^~~
> arch/riscv/kernel/sbi.c:230:18: error: 'SBI_EXT_IPI'
undeclared (first use in this function)
ret = sbi_ecall(SBI_EXT_IPI,
SBI_EXT_IPI_SEND_IPI, hmask_val,
^~~~~~~~~~~
arch/riscv/kernel/sbi.c:230:31: error: 'SBI_EXT_IPI_SEND_IPI' undeclared (first
use in this function); did you mean 'SBI_EXT_IPI'?
ret = sbi_ecall(SBI_EXT_IPI, SBI_EXT_IPI_SEND_IPI, hmask_val,
^~~~~~~~~~~~~~~~~~~~
SBI_EXT_IPI
arch/riscv/kernel/sbi.c:222:16: warning: unused variable 'ret'
[-Wunused-variable]
struct sbiret ret = {0};
^~~
arch/riscv/kernel/sbi.c: In function '__sbi_rfence_v02':
arch/riscv/kernel/sbi.c:249:9: error: variable 'ret' has initializer but
incomplete type
struct sbiret ret = {0};
^~~~~~
arch/riscv/kernel/sbi.c:249:23: warning: excess elements in struct initializer
struct sbiret ret = {0};
^
arch/riscv/kernel/sbi.c:249:23: note: (near initialization for 'ret')
arch/riscv/kernel/sbi.c:249:16: error: storage size of 'ret' isn't known
struct sbiret ret = {0};
^~~
> arch/riscv/kernel/sbi.c:251:22: error: 'SBI_EXT_RFENCE'
undeclared (first use in this function); did you mean 'RISCV_FENCE'?
unsigned long ext = SBI_EXT_RFENCE;
^~~~~~~~~~~~~~
RISCV_FENCE
> arch/riscv/kernel/sbi.c:259:7: error:
'SBI_EXT_RFENCE_REMOTE_FENCE_I' undeclared (first use in this function)
case SBI_EXT_RFENCE_REMOTE_FENCE_I:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> arch/riscv/kernel/sbi.c:262:7: error:
'SBI_EXT_RFENCE_REMOTE_SFENCE_VMA' undeclared (first use in this function); did
you mean 'SBI_EXT_RFENCE_REMOTE_FENCE_I'?
case
SBI_EXT_RFENCE_REMOTE_SFENCE_VMA:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SBI_EXT_RFENCE_REMOTE_FENCE_I
> arch/riscv/kernel/sbi.c:266:7: error:
'SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID' undeclared (first use in this function);
did you mean 'SBI_EXT_RFENCE_REMOTE_SFENCE_VMA'?
case
SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SBI_EXT_RFENCE_REMOTE_SFENCE_VMA
arch/riscv/kernel/sbi.c:271:7: error: 'SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA'
undeclared (first use in this function); did you mean
'SBI_EXT_RFENCE_REMOTE_SFENCE_VMA'?
case SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SBI_EXT_RFENCE_REMOTE_SFENCE_VMA
arch/riscv/kernel/sbi.c:275:7: error: 'SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID'
undeclared (first use in this function); did you mean
'SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID'?
case SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID
arch/riscv/kernel/sbi.c:279:7: error: 'SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA'
undeclared (first use in this function); did you mean
'SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA'?
case SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA
arch/riscv/kernel/sbi.c:283:7: error: 'SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID'
undeclared (first use in this function); did you mean
'SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID'?
case SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID
arch/riscv/kernel/sbi.c:249:16: warning: unused variable 'ret'
[-Wunused-variable]
struct sbiret ret = {0};
^~~
arch/riscv/kernel/sbi.c: In function 'sbi_remote_fence_i':
arch/riscv/kernel/sbi.c:335:15: error: 'SBI_EXT_0_1_REMOTE_FENCE_I' undeclared
(first use in this function)
__sbi_rfence(SBI_EXT_0_1_REMOTE_FENCE_I, SBI_EXT_RFENCE_REMOTE_FENCE_I,
^~~~~~~~~~~~~~~~~~~~~~~~~~
> arch/riscv/kernel/sbi.c:335:43: error:
'SBI_EXT_RFENCE_REMOTE_FENCE_I' undeclared (first use in this function); did you
mean 'SBI_EXT_0_1_REMOTE_FENCE_I'?
__sbi_rfence(SBI_EXT_0_1_REMOTE_FENCE_I, SBI_EXT_RFENCE_REMOTE_FENCE_I,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SBI_EXT_0_1_REMOTE_FENCE_I
arch/riscv/kernel/sbi.c: In function 'sbi_remote_sfence_vma':
arch/riscv/kernel/sbi.c:353:15: error: 'SBI_EXT_0_1_REMOTE_SFENCE_VMA'
undeclared (first use in this function)
__sbi_rfence(SBI_EXT_0_1_REMOTE_SFENCE_VMA,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/riscv/kernel/sbi.c:354:8: error: 'SBI_EXT_RFENCE_REMOTE_SFENCE_VMA'
undeclared (first use in this function); did you mean
'SBI_EXT_0_1_REMOTE_SFENCE_VMA'?
SBI_EXT_RFENCE_REMOTE_SFENCE_VMA,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SBI_EXT_0_1_REMOTE_SFENCE_VMA
arch/riscv/kernel/sbi.c: In function 'sbi_remote_sfence_vma_asid':
arch/riscv/kernel/sbi.c:375:15: error: 'SBI_EXT_0_1_REMOTE_SFENCE_VMA_ASID'
undeclared (first use in this function)
__sbi_rfence(SBI_EXT_0_1_REMOTE_SFENCE_VMA_ASID,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/riscv/kernel/sbi.c:376:8: error: 'SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID'
undeclared (first use in this function); did you mean
'SBI_EXT_0_1_REMOTE_SFENCE_VMA_ASID'?
SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SBI_EXT_0_1_REMOTE_SFENCE_VMA_ASID
arch/riscv/kernel/sbi.c: In function 'sbi_remote_hfence_gvma':
arch/riscv/kernel/sbi.c:394:22: error: 'SBI_EXT_RFENCE' undeclared (first use
in this function); did you mean 'RISCV_FENCE'?
return __sbi_rfence(SBI_EXT_RFENCE, SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA,
^~~~~~~~~~~~~~
RISCV_FENCE
> arch/riscv/kernel/sbi.c:394:38: error:
'SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA' undeclared (first use in this function)
return __sbi_rfence(SBI_EXT_RFENCE, SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/riscv/kernel/sbi.c: In function 'sbi_remote_hfence_gvma_vmid':
arch/riscv/kernel/sbi.c:415:22: error: 'SBI_EXT_RFENCE' undeclared (first use
in this function); did you mean 'RISCV_FENCE'?
return __sbi_rfence(SBI_EXT_RFENCE,
^~~~~~~~~~~~~~
RISCV_FENCE
> arch/riscv/kernel/sbi.c:416:8: error:
'SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID' undeclared (first use in this function)
SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/riscv/kernel/sbi.c: In function 'sbi_remote_hfence_vvma':
arch/riscv/kernel/sbi.c:434:22: error: 'SBI_EXT_RFENCE' undeclared (first use
in this function); did you mean 'RISCV_FENCE'?
return __sbi_rfence(SBI_EXT_RFENCE, SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA,
^~~~~~~~~~~~~~
RISCV_FENCE
> arch/riscv/kernel/sbi.c:434:38: error:
'SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA' undeclared (first use in this function)
return __sbi_rfence(SBI_EXT_RFENCE, SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/riscv/kernel/sbi.c: In function 'sbi_remote_hfence_vvma_asid':
arch/riscv/kernel/sbi.c:456:22: error: 'SBI_EXT_RFENCE' undeclared (first use
in this function); did you mean 'RISCV_FENCE'?
return __sbi_rfence(SBI_EXT_RFENCE,
^~~~~~~~~~~~~~
RISCV_FENCE
> arch/riscv/kernel/sbi.c:457:8: error:
'SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID' undeclared (first use in this function)
SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/riscv/kernel/sbi.c: In function 'sbi_probe_extension':
arch/riscv/kernel/sbi.c:470:16: error: storage size of 'ret' isn't known
struct sbiret ret;
^~~
arch/riscv/kernel/sbi.c:472:18: error: 'SBI_EXT_BASE' undeclared (first use in
this function); did you mean 'BIT_MASK'?
ret = sbi_ecall(SBI_EXT_BASE, SBI_BASE_PROBE_EXT, extid, 0, 0, 0, 0, 0);
^~~~~~~~~~~~
BIT_MASK
arch/riscv/kernel/sbi.c:472:32: error: 'SBI_BASE_PROBE_EXT' undeclared (first
use in this function)
ret = sbi_ecall(SBI_EXT_BASE, SBI_BASE_PROBE_EXT, extid, 0, 0, 0, 0, 0);
^~~~~~~~~~~~~~~~~~
arch/riscv/kernel/sbi.c:470:16: warning: unused variable 'ret'
[-Wunused-variable]
struct sbiret ret;
^~~
arch/riscv/kernel/sbi.c: In function 'sbi_get_spec_version':
arch/riscv/kernel/sbi.c:483:16: error: storage size of 'ret' isn't known
struct sbiret ret;
^~~
arch/riscv/kernel/sbi.c:485:18: error: 'SBI_EXT_BASE' undeclared (first use in
this function); did you mean 'BIT_MASK'?
ret = sbi_ecall(SBI_EXT_BASE, SBI_BASE_GET_SPEC_VERSION,
^~~~~~~~~~~~
BIT_MASK
arch/riscv/kernel/sbi.c:485:32: error: 'SBI_BASE_GET_SPEC_VERSION' undeclared
(first use in this function)
ret = sbi_ecall(SBI_EXT_BASE, SBI_BASE_GET_SPEC_VERSION,
^~~~~~~~~~~~~~~~~~~~~~~~~
arch/riscv/kernel/sbi.c:483:16: warning: unused variable 'ret'
[-Wunused-variable]
struct sbiret ret;
^~~
arch/riscv/kernel/sbi.c: In function 'sbi_get_firmware_id':
arch/riscv/kernel/sbi.c:495:16: error: storage size of 'ret' isn't known
struct sbiret ret;
^~~
arch/riscv/kernel/sbi.c:497:18: error: 'SBI_EXT_BASE' undeclared (first use in
this function); did you mean 'BIT_MASK'?
ret = sbi_ecall(SBI_EXT_BASE, SBI_BASE_GET_IMP_ID,
^~~~~~~~~~~~
BIT_MASK
arch/riscv/kernel/sbi.c:497:32: error: 'SBI_BASE_GET_IMP_ID' undeclared (first
use in this function)
ret = sbi_ecall(SBI_EXT_BASE, SBI_BASE_GET_IMP_ID,
^~~~~~~~~~~~~~~~~~~
arch/riscv/kernel/sbi.c:495:16: warning: unused variable 'ret'
[-Wunused-variable]
struct sbiret ret;
^~~
arch/riscv/kernel/sbi.c: In function 'sbi_get_firmware_version':
arch/riscv/kernel/sbi.c:507:16: error: storage size of 'ret' isn't known
struct sbiret ret;
^~~
arch/riscv/kernel/sbi.c:509:18: error: 'SBI_EXT_BASE' undeclared (first use in
this function); did you mean 'BIT_MASK'?
ret = sbi_ecall(SBI_EXT_BASE, SBI_BASE_GET_IMP_VERSION,
^~~~~~~~~~~~
BIT_MASK
arch/riscv/kernel/sbi.c:509:32: error: 'SBI_BASE_GET_IMP_VERSION' undeclared
(first use in this function); did you mean '__GXX_ABI_VERSION'?
ret = sbi_ecall(SBI_EXT_BASE, SBI_BASE_GET_IMP_VERSION,
^~~~~~~~~~~~~~~~~~~~~~~~
__GXX_ABI_VERSION
arch/riscv/kernel/sbi.c:507:16: warning: unused variable 'ret'
[-Wunused-variable]
struct sbiret ret;
^~~
arch/riscv/kernel/sbi.c: In function 'sbi_power_off':
arch/riscv/kernel/sbi.c:519:2: error: implicit declaration of function
'sbi_shutdown' [-Werror=implicit-function-declaration]
sbi_shutdown();
^~~~~~~~~~~~
In file included from include/linux/printk.h:7:0,
from include/linux/kernel.h:15,
from include/linux/list.h:9,
from include/linux/pm.h:11,
from arch/riscv/kernel/sbi.c:4:
arch/riscv/kernel/sbi.c: In function 'sbi_init':
include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of
type 'long unsigned int', but argument 2 has type 'int' [-Wformat=]
#define KERN_SOH "\001" /* ASCII Start Of Header */
^
include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
#define KERN_INFO KERN_SOH "6" /* informational */
^~~~~~~~
include/linux/printk.h:311:9: note: in expansion of macro 'KERN_INFO'
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~
arch/riscv/kernel/sbi.c:531:2: note: in expansion of macro 'pr_info'
pr_info("SBI specification v%lu.%lu detected\n",
^~~~~~~
arch/riscv/kernel/sbi.c:531:32: note: format string is defined here
pr_info("SBI specification v%lu.%lu detected\n",
~~^
%u
In file included from include/linux/printk.h:7:0,
from include/linux/kernel.h:15,
from include/linux/list.h:9,
from include/linux/pm.h:11,
from arch/riscv/kernel/sbi.c:4:
include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of
type 'long unsigned int', but argument 3 has type 'int' [-Wformat=]
#define KERN_SOH "\001" /* ASCII Start Of Header */
^
include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
#define KERN_INFO KERN_SOH "6" /* informational */
^~~~~~~~
include/linux/printk.h:311:9: note: in expansion of macro 'KERN_INFO'
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~
arch/riscv/kernel/sbi.c:531:2: note: in expansion of macro 'pr_info'
vim +214 arch/riscv/kernel/sbi.c
75
76 static int __sbi_rfence_dummy_warn(unsigned long extid,
77 unsigned long fid,
78 const unsigned long *hart_mask,
79 unsigned long hbase, unsigned long start,
80 unsigned long size, unsigned long arg4,
81 unsigned long arg5)
82 {
83 pr_warn("remote fence extension is not available in SBI
v%lu.%lu\n",
84 sbi_major_version(), sbi_minor_version());
85 return 0;
86 }
87
88 #ifdef CONFIG_RISCV_SBI_V01
89 /**
90 * sbi_console_putchar() - Writes given character to the console device.
91 * @ch: The data to be written to the console.
92 *
93 * Return: None
94 */
95 void sbi_console_putchar(int ch)
96 {
97 sbi_ecall(SBI_EXT_0_1_CONSOLE_PUTCHAR, 0, ch, 0, 0, 0, 0, 0);
98 }
99 EXPORT_SYMBOL(sbi_console_putchar);
100
101 /**
102 * sbi_console_getchar() - Reads a byte from console device.
103 *
104 * Returns the value read from console.
105 */
106 int sbi_console_getchar(void)
107 {
108 struct sbiret ret;
109
110 ret = sbi_ecall(SBI_EXT_0_1_CONSOLE_GETCHAR, 0, 0, 0, 0, 0, 0, 0);
111
112 return ret.error;
113 }
114 EXPORT_SYMBOL(sbi_console_getchar);
115
116 /**
117 * sbi_shutdown() - Remove all the harts from executing supervisor code.
118 *
119 * Return: None
120 */
121 void sbi_shutdown(void)
122 {
123 sbi_ecall(SBI_EXT_0_1_SHUTDOWN, 0, 0, 0, 0, 0, 0, 0);
124 }
125 EXPORT_SYMBOL(sbi_set_timer);
126
127 /**
128 * sbi_clear_ipi() - Clear any pending IPIs for the calling hart.
129 *
130 * Return: None
131 */
132 void sbi_clear_ipi(void)
133 {
134 sbi_ecall(SBI_EXT_0_1_CLEAR_IPI, 0, 0, 0, 0, 0, 0, 0);
135 }
136 EXPORT_SYMBOL(sbi_shutdown);
137
138 /**
139 * sbi_set_timer_v01() - Program the timer for next timer event.
140 * @stime_value: The value after which next timer event should fire.
141 *
142 * Return: None
143 */
144 static void __sbi_set_timer_v01(uint64_t stime_value)
145 {
146 #if __riscv_xlen == 32
147 sbi_ecall(SBI_EXT_0_1_SET_TIMER, 0, stime_value,
148 stime_value >> 32, 0, 0, 0, 0);
149 #else
150 sbi_ecall(SBI_EXT_0_1_SET_TIMER, 0, stime_value, 0, 0, 0, 0, 0);
151 #endif
152 }
153
154 static int __sbi_send_ipi_v01(const unsigned long *hart_mask)
155 {
156 sbi_ecall(SBI_EXT_0_1_SEND_IPI, 0, (unsigned long)hart_mask,
157 0, 0, 0, 0, 0);
158 return 0;
159 }
160
161 static int __sbi_rfence_v01(unsigned long ext, unsigned long fid,
162 const unsigned long *hart_mask,
163 unsigned long hbase, unsigned long start,
164 unsigned long size, unsigned long arg4,
165 unsigned long arg5)
166 {
167 switch (ext) {
168 case SBI_EXT_0_1_REMOTE_FENCE_I:
169 sbi_ecall(SBI_EXT_0_1_REMOTE_FENCE_I, 0,
170 (unsigned long)hart_mask, 0, 0, 0, 0, 0);
171 break;
172 case SBI_EXT_0_1_REMOTE_SFENCE_VMA:
173 sbi_ecall(SBI_EXT_0_1_REMOTE_SFENCE_VMA, 0,
174 (unsigned long)hart_mask, start, size,
175 0, 0, 0);
176 break;
177 case SBI_EXT_0_1_REMOTE_SFENCE_VMA_ASID:
178 sbi_ecall(SBI_EXT_0_1_REMOTE_SFENCE_VMA_ASID, 0,
179 (unsigned long)hart_mask, start, size,
180 arg4, 0, 0);
181 break;
182 default:
183 pr_err("extid [%lu]not supported in SBI v0.1\n", ext);
184 }
185
186 return 0;
187 }
188 #else
189 static void __sbi_set_timer_v01(uint64_t stime_value)
190 {
191 __sbi_set_timer_dummy_warn(0);
192 }
193 static int __sbi_send_ipi_v01(const unsigned long *hart_mask)
194 {
195 return __sbi_send_ipi_dummy_warn(NULL);
196 }
197 static int __sbi_rfence_v01(unsigned long ext, unsigned long fid,
198 const unsigned long *hart_mask,
199 unsigned long hbase, unsigned long start,
200 unsigned long size, unsigned long arg4,
201 unsigned long arg5)
202 {
203 return __sbi_rfence_dummy_warn(0, 0, 0, 0, 0, 0, 0, 0);
204
205 }
206 #endif /* CONFIG_RISCV_SBI_V01 */
207
208 static void __sbi_set_timer_v02(uint64_t stime_value)
209 {
210 #if __riscv_xlen == 32
211 sbi_ecall(SBI_EXT_TIME, SBI_EXT_TIME_SET_TIMER, stime_value,
212 stime_value >> 32, 0, 0, 0, 0);
213 #else
214 sbi_ecall(SBI_EXT_TIME, SBI_EXT_TIME_SET_TIMER, stime_value, 0,
215 0, 0, 0, 0);
216 #endif
217 }
218
219 static int __sbi_send_ipi_v02(const unsigned long *hart_mask)
220 {
221 unsigned long hmask_val;
222 struct sbiret ret = {0};
223 int result;
224
225 if (!hart_mask)
226 hmask_val = *(cpumask_bits(cpu_online_mask));
227 else
228 hmask_val = *hart_mask;
229
230 ret = sbi_ecall(SBI_EXT_IPI, SBI_EXT_IPI_SEND_IPI, hmask_val,
231 0, 0, 0, 0, 0);
232 if (ret.error) {
233 pr_err("%s: failed with error [%d]\n", __func__,
234 sbi_err_map_linux_errno(ret.error));
235 result = ret.error;
236 } else
237 result = ret.value;
238
239 return result;
240 }
241
242 static int __sbi_rfence_v02(unsigned long extid, unsigned long fid,
243 const unsigned long *hart_mask,
244 unsigned long hbase, unsigned long start,
245 unsigned long size, unsigned long arg4,
246 unsigned long arg5)
247 {
248 unsigned long hmask_val;
249 struct sbiret ret = {0};
250 int result;
251 unsigned long ext = SBI_EXT_RFENCE;
252
253 if (!hart_mask)
254 hmask_val = *(cpumask_bits(cpu_online_mask));
255 else
256 hmask_val = *hart_mask;
257
258 switch (fid) {
259 case SBI_EXT_RFENCE_REMOTE_FENCE_I:
260 ret =
sbi_ecall(ext, fid, hmask_val, 0, 0, 0, 0, 0);
261 break;
262 case SBI_EXT_RFENCE_REMOTE_SFENCE_VMA:
263 ret =
sbi_ecall(ext, fid, hmask_val, 0, start,
264 size, 0, 0);
265 break;
266 case SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID:
267 ret =
sbi_ecall(ext, fid, hmask_val, 0, start,
268 size, arg4, 0);
269 break;
270 /*TODO: Handle non zero hbase cases */
271 case SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA:
272 ret = sbi_ecall(ext, fid, hmask_val, 0, start,
273 size, 0, 0);
274 break;
275 case SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID:
276 ret = sbi_ecall(ext, fid, hmask_val, 0, start,
277 size, arg4, 0);
278 break;
279 case SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA:
280 ret = sbi_ecall(ext, fid, hmask_val, 0, start,
281 size, 0, 0);
282 break;
283 case SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID:
284 ret = sbi_ecall(ext, fid, hmask_val, 0, start,
285 size, arg4, 0);
286 break;
287 default:
288 pr_err("unknown function ID [%lu] for SBI extension [%lu]\n",
289 fid, ext);
290 result = -EINVAL;
291 }
292
293 if (ret.error) {
294 pr_err("%s: failed with error [%d]\n", __func__,
295 sbi_err_map_linux_errno(ret.error));
296 result = ret.error;
297 } else
298 result = ret.value;
299
300 return result;
301 }
302
303 /**
304 * sbi_set_timer() - Program the timer for next timer event.
305 * @stime_value: The value after which next timer event should fire.
306 *
307 * Return: None
308 */
309 void sbi_set_timer(uint64_t stime_value)
310 {
311 __sbi_set_timer(stime_value);
312 }
313
314 /**
315 * sbi_send_ipi() - Send an IPI to any hart.
316 * @hart_mask: A cpu mask containing all the target harts.
317 *
318 * Return: None
319 */
320 void sbi_send_ipi(const unsigned long *hart_mask)
321 {
322 __sbi_send_ipi(hart_mask);
323 }
324 EXPORT_SYMBOL(sbi_send_ipi);
325
326
327 /**
328 * sbi_remote_fence_i() - Execute FENCE.I instruction on given remote harts.
329 * @hart_mask: A cpu mask containing all the target harts.
330 *
331 * Return: None
332 */
333 void sbi_remote_fence_i(const unsigned long *hart_mask)
334 {
335 __sbi_rfence(SBI_EXT_0_1_REMOTE_FENCE_I,
SBI_EXT_RFENCE_REMOTE_FENCE_I,
336 hart_mask, 0, 0, 0, 0, 0);
337 }
338 EXPORT_SYMBOL(sbi_remote_fence_i);
339
340 /**
341 * sbi_remote_sfence_vma() - Execute SFENCE.VMA instructions on given remote
342 * harts for the specified virtual address range.
343 * @hart_mask: A cpu mask containing all the target harts.
344 * @start: Start of the virtual address
345 * @size: Total size of the virtual address range.
346 *
347 * Return: None
348 */
349 void sbi_remote_sfence_vma(const unsigned long *hart_mask,
350 unsigned long start,
351 unsigned long size)
352 {
353 __sbi_rfence(SBI_EXT_0_1_REMOTE_SFENCE_VMA,
354 SBI_EXT_RFENCE_REMOTE_SFENCE_VMA,
355 hart_mask, 0, start, size, 0, 0);
356 }
357 EXPORT_SYMBOL(sbi_remote_sfence_vma);
358
359 /**
360 * sbi_remote_sfence_vma_asid() - Execute SFENCE.VMA instructions on given
361 * remote harts for a virtual address range belonging to a specific ASID.
362 *
363 * @hart_mask: A cpu mask containing all the target harts.
364 * @start: Start of the virtual address
365 * @size: Total size of the virtual address range.
366 * @asid: The value of address space identifier (ASID).
367 *
368 * Return: None
369 */
370 void sbi_remote_sfence_vma_asid(const unsigned long *hart_mask,
371 unsigned long start,
372 unsigned long size,
373 unsigned long asid)
374 {
375 __sbi_rfence(SBI_EXT_0_1_REMOTE_SFENCE_VMA_ASID,
376 SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID,
377
hart_mask, 0, start, size, asid, 0);
378 }
379 EXPORT_SYMBOL(sbi_remote_sfence_vma_asid);
380
381 /**
382 * sbi_remote_hfence_gvma() - Execute HFENCE.GVMA instructions on given remote
383 * harts for the specified guest physical address range.
384 * @hart_mask: A cpu mask containing all the target harts.
385 * @start: Start of the guest physical address
386 * @size: Total size of the guest physical address range.
387 *
388 * Return: None
389 */
390 int sbi_remote_hfence_gvma(const unsigned long *hart_mask,
391 unsigned long start,
392 unsigned long size)
393 {
394 return __sbi_rfence(SBI_EXT_RFENCE,
SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA,
395 hart_mask, 0, start, size, 0, 0);
396 }
397 EXPORT_SYMBOL_GPL(sbi_remote_hfence_gvma);
398
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation