@@ -130,26 +130,27 @@ static bool rate_limit_report(unsigned long frame1, unsigned long frame2)
130
130
* Special rules to skip reporting.
131
131
*/
132
132
static bool
133
- skip_report (bool value_change , unsigned long top_frame )
133
+ skip_report (enum kcsan_value_change value_change , unsigned long top_frame )
134
134
{
135
135
/*
136
- * The first call to skip_report always has value_change==true , since we
136
+ * The first call to skip_report always has value_change==TRUE , since we
137
137
* cannot know the value written of an instrumented access. For the 2nd
138
138
* call there are 6 cases with CONFIG_KCSAN_REPORT_VALUE_CHANGE_ONLY:
139
139
*
140
- * 1. read watchpoint, conflicting write (value_change==true ): report;
141
- * 2. read watchpoint, conflicting write (value_change==false ): skip;
142
- * 3. write watchpoint, conflicting write (value_change==true ): report;
143
- * 4. write watchpoint, conflicting write (value_change==false ): skip;
144
- * 5. write watchpoint, conflicting read (value_change==false ): skip;
145
- * 6. write watchpoint, conflicting read (value_change==true ): report;
140
+ * 1. read watchpoint, conflicting write (value_change==TRUE ): report;
141
+ * 2. read watchpoint, conflicting write (value_change==MAYBE ): skip;
142
+ * 3. write watchpoint, conflicting write (value_change==TRUE ): report;
143
+ * 4. write watchpoint, conflicting write (value_change==MAYBE ): skip;
144
+ * 5. write watchpoint, conflicting read (value_change==MAYBE ): skip;
145
+ * 6. write watchpoint, conflicting read (value_change==TRUE ): report;
146
146
*
147
147
* Cases 1-4 are intuitive and expected; case 5 ensures we do not report
148
148
* data races where the write may have rewritten the same value; case 6
149
149
* is possible either if the size is larger than what we check value
150
150
* changes for or the access type is KCSAN_ACCESS_ASSERT.
151
151
*/
152
- if (IS_ENABLED (CONFIG_KCSAN_REPORT_VALUE_CHANGE_ONLY ) && !value_change ) {
152
+ if (IS_ENABLED (CONFIG_KCSAN_REPORT_VALUE_CHANGE_ONLY ) &&
153
+ value_change == KCSAN_VALUE_CHANGE_MAYBE ) {
153
154
/*
154
155
* The access is a write, but the data value did not change.
155
156
*
@@ -245,7 +246,7 @@ static int sym_strcmp(void *addr1, void *addr2)
245
246
* Returns true if a report was generated, false otherwise.
246
247
*/
247
248
static bool print_report (const volatile void * ptr , size_t size , int access_type ,
248
- bool value_change , int cpu_id ,
249
+ enum kcsan_value_change value_change , int cpu_id ,
249
250
enum kcsan_report_type type )
250
251
{
251
252
unsigned long stack_entries [NUM_STACK_ENTRIES ] = { 0 };
@@ -258,7 +259,7 @@ static bool print_report(const volatile void *ptr, size_t size, int access_type,
258
259
/*
259
260
* Must check report filter rules before starting to print.
260
261
*/
261
- if (skip_report (true , stack_entries [skipnr ]))
262
+ if (skip_report (KCSAN_VALUE_CHANGE_TRUE , stack_entries [skipnr ]))
262
263
return false;
263
264
264
265
if (type == KCSAN_REPORT_RACE_SIGNAL ) {
@@ -477,7 +478,8 @@ static bool prepare_report(unsigned long *flags, const volatile void *ptr,
477
478
}
478
479
479
480
void kcsan_report (const volatile void * ptr , size_t size , int access_type ,
480
- bool value_change , int cpu_id , enum kcsan_report_type type )
481
+ enum kcsan_value_change value_change , int cpu_id ,
482
+ enum kcsan_report_type type )
481
483
{
482
484
unsigned long flags = 0 ;
483
485
0 commit comments