Print this page
11972 resync smatch
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/tools/smatch/src/smatch_type_val.c
+++ new/usr/src/tools/smatch/src/smatch_type_val.c
1 1 /*
2 2 * Copyright (C) 2013 Oracle.
3 3 *
4 4 * This program is free software; you can redistribute it and/or
5 5 * modify it under the terms of the GNU General Public License
6 6 * as published by the Free Software Foundation; either version 2
7 7 * of the License, or (at your option) any later version.
8 8 *
9 9 * This program is distributed in the hope that it will be useful,
10 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 * GNU General Public License for more details.
13 13 *
14 14 * You should have received a copy of the GNU General Public License
15 15 * along with this program; if not, see http://www.gnu.org/copyleft/gpl.txt
16 16 */
17 17
18 18 /*
19 19 * The plan here is to save all the possible values store to a given struct
20 20 * member.
21 21 *
22 22 * We will load all the values in to the function_type_val table first then
23 23 * run a script on that and load all the resulting values into the type_val
24 24 * table.
25 25 *
26 26 * So in this file we want to take the union of everything assigned to the
27 27 * struct member and insert it into the function_type_val at the end.
28 28 *
29 29 * You would think that we could use smatch_modification_hooks.c or
30 30 * extra_modification_hook() here to get the information here but in the end we
31 31 * need to code everything again a third time.
32 32 *
33 33 */
34 34
35 35 #include "smatch.h"
36 36 #include "smatch_slist.h"
37 37 #include "smatch_extra.h"
38 38
39 39 static int my_id;
40 40
41 41 struct stree_stack *fn_type_val_stack;
42 42 struct stree *fn_type_val;
43 43 struct stree *global_type_val;
44 44
45 45 static int get_vals(void *_db_vals, int argc, char **argv, char **azColName)
46 46 {
47 47 char **db_vals = _db_vals;
48 48
49 49 *db_vals = alloc_string(argv[0]);
50 50 return 0;
51 51 }
52 52
53 53 static void match_inline_start(struct expression *expr)
54 54 {
55 55 push_stree(&fn_type_val_stack, fn_type_val);
56 56 fn_type_val = NULL;
57 57 }
58 58
59 59 static void match_inline_end(struct expression *expr)
60 60 {
61 61 free_stree(&fn_type_val);
62 62 fn_type_val = pop_stree(&fn_type_val_stack);
63 63 }
64 64
65 65 struct expr_rl {
66 66 struct expression *expr;
67 67 struct range_list *rl;
68 68 };
69 69 static struct expr_rl cached_results[10];
70 70 static int res_idx;
71 71
72 72 static int get_cached(struct expression *expr, struct range_list **rl, int *ret)
73 73 {
74 74 int i;
75 75
76 76 *ret = 0;
77 77
78 78 for (i = 0; i < ARRAY_SIZE(cached_results); i++) {
79 79 if (expr == cached_results[i].expr) {
80 80 if (cached_results[i].rl) {
81 81 *rl = clone_rl(cached_results[i].rl);
82 82 *ret = 1;
83 83 }
84 84 return 1;
85 85 }
86 86 }
87 87
88 88 return 0;
89 89 }
90 90
91 91 int get_db_type_rl(struct expression *expr, struct range_list **rl)
92 92 {
93 93 char *db_vals = NULL;
94 94 char *member;
95 95 struct range_list *tmp;
96 96 struct symbol *type;
97 97 int ret;
98 98
99 99 if (get_cached(expr, rl, &ret))
100 100 return ret;
101 101
102 102 member = get_member_name(expr);
103 103 if (!member)
104 104 return 0;
105 105
106 106 res_idx = (res_idx + 1) % ARRAY_SIZE(cached_results);
107 107 cached_results[res_idx].expr = expr;
108 108 cached_results[res_idx].rl = NULL;
109 109
110 110 run_sql(get_vals, &db_vals,
111 111 "select value from type_value where type = '%s';", member);
112 112 free_string(member);
113 113 if (!db_vals)
114 114 return 0;
115 115 type = get_type(expr);
116 116 str_to_rl(type, db_vals, &tmp);
117 117 free_string(db_vals);
118 118 if (is_whole_rl(tmp))
119 119 return 0;
120 120
121 121 *rl = tmp;
122 122 cached_results[res_idx].rl = clone_rl(tmp);
123 123
124 124 return 1;
125 125 }
126 126
127 127 static void add_type_val(char *member, struct range_list *rl)
128 128 {
129 129 struct smatch_state *old, *add, *new;
130 130
131 131 member = alloc_string(member);
132 132 old = get_state_stree(fn_type_val, my_id, member, NULL);
133 133 add = alloc_estate_rl(rl);
134 134 if (old)
135 135 new = merge_estates(old, add);
136 136 else
137 137 new = add;
138 138 set_state_stree(&fn_type_val, my_id, member, NULL, new);
139 139 }
140 140
141 141 static void add_fake_type_val(char *member, struct range_list *rl, int ignore)
142 142 {
143 143 struct smatch_state *old, *add, *new;
144 144
145 145 member = alloc_string(member);
146 146 old = get_state_stree(fn_type_val, my_id, member, NULL);
147 147 if (old && strcmp(old->name, "min-max") == 0)
148 148 return;
149 149 if (ignore && old && strcmp(old->name, "ignore") == 0)
150 150 return;
151 151 add = alloc_estate_rl(rl);
152 152 if (old) {
153 153 new = merge_estates(old, add);
154 154 } else {
155 155 new = add;
156 156 if (ignore)
157 157 new->name = alloc_string("ignore");
158 158 else
159 159 new->name = alloc_string("min-max");
160 160 }
161 161 set_state_stree(&fn_type_val, my_id, member, NULL, new);
162 162 }
163 163
164 164 static void add_global_type_val(char *member, struct range_list *rl)
165 165 {
166 166 struct smatch_state *old, *add, *new;
167 167
168 168 member = alloc_string(member);
169 169 old = get_state_stree(global_type_val, my_id, member, NULL);
170 170 add = alloc_estate_rl(rl);
171 171 if (old)
172 172 new = merge_estates(old, add);
173 173 else
174 174 new = add;
175 175 new = clone_estate_perm(new);
176 176 set_state_stree_perm(&global_type_val, my_id, member, NULL, new);
177 177 }
178 178
179 179 static int has_link_cb(void *has_link, int argc, char **argv, char **azColName)
180 180 {
181 181 *(int *)has_link = 1;
182 182 return 0;
183 183 }
184 184
185 185 static int is_ignored_fake_assignment(void)
186 186 {
187 187 struct expression *expr;
188 188 struct symbol *type;
189 189 char *member_name;
190 190 int has_link = 0;
191 191
192 192 expr = get_faked_expression();
193 193 if (!expr || expr->type != EXPR_ASSIGNMENT)
194 194 return 0;
195 195 if (!is_void_pointer(expr->right))
196 196 return 0;
197 197 member_name = get_member_name(expr->right);
198 198 if (!member_name)
199 199 return 0;
200 200
201 201 type = get_type(expr->left);
202 202 if (!type || type->type != SYM_PTR)
203 203 return 0;
204 204 type = get_real_base_type(type);
205 205 if (!type || type->type != SYM_STRUCT)
206 206 return 0;
207 207
208 208 run_sql(has_link_cb, &has_link,
209 209 "select * from data_info where type = %d and data = '%s' and value = '%s';",
210 210 TYPE_LINK, member_name, type_to_str(type));
211 211 return has_link;
212 212 }
213 213
214 214 static int is_container_of(void)
215 215 {
216 216 /* We already check the macro name in is_ignored_macro() */
217 217 struct expression *expr;
218 218 int offset;
219 219
↓ open down ↓ |
219 lines elided |
↑ open up ↑ |
220 220 expr = get_faked_expression();
221 221 if (!expr || expr->type != EXPR_ASSIGNMENT)
222 222 return 0;
223 223
224 224 offset = get_offset_from_container_of(expr->right);
225 225 if (offset < 0)
226 226 return 0;
227 227 return 1;
228 228 }
229 229
230 -static int is_ignored_macro(void)
230 +static bool is_driver_data(void)
231 231 {
232 + static struct expression *prev_expr;
232 233 struct expression *expr;
233 234 char *name;
235 + static bool prev_ret;
236 + bool ret = false;
234 237
235 238 expr = get_faked_expression();
236 239 if (!expr || expr->type != EXPR_ASSIGNMENT)
240 + return false;
241 +
242 + if (expr == prev_expr)
243 + return prev_ret;
244 + prev_expr = expr;
245 +
246 + name = expr_to_str(expr->right);
247 + if (!name) {
248 + prev_ret = false;
249 + return false;
250 + }
251 +
252 + if (strstr(name, "get_drvdata(") ||
253 + strstr(name, "dev.driver_data") ||
254 + strstr(name, "dev->driver_data"))
255 + ret = true;
256 +
257 + free_string(name);
258 +
259 + prev_ret = ret;
260 + return ret;
261 +}
262 +
263 +static int is_ignored_macro(void)
264 +{
265 + struct expression *expr;
266 + char *name;
267 +
268 + expr = get_faked_expression();
269 + if (!expr || expr->type != EXPR_ASSIGNMENT || expr->op != '=')
237 270 return 0;
238 271 name = get_macro_name(expr->right->pos);
239 272 if (!name)
240 273 return 0;
241 274 if (strcmp(name, "container_of") == 0)
242 275 return 1;
243 276 if (strcmp(name, "rb_entry") == 0)
244 277 return 1;
245 278 if (strcmp(name, "list_entry") == 0)
246 279 return 1;
247 280 if (strcmp(name, "list_first_entry") == 0)
248 281 return 1;
249 282 if (strcmp(name, "hlist_entry") == 0)
250 283 return 1;
284 + if (strcmp(name, "per_cpu_ptr") == 0)
285 + return 1;
286 + if (strcmp(name, "raw_cpu_ptr") == 0)
287 + return 1;
288 + if (strcmp(name, "this_cpu_ptr") == 0)
289 + return 1;
290 +
291 + if (strcmp(name, "TRACE_EVENT") == 0)
292 + return 1;
293 + if (strcmp(name, "DECLARE_EVENT_CLASS") == 0)
294 + return 1;
295 + if (strcmp(name, "DEFINE_EVENT") == 0)
296 + return 1;
297 +
251 298 if (strstr(name, "for_each"))
252 299 return 1;
253 300 return 0;
254 301 }
255 302
256 303 static int is_ignored_function(void)
257 304 {
258 305 struct expression *expr;
259 306
260 307 expr = get_faked_expression();
261 308 if (!expr || expr->type != EXPR_ASSIGNMENT)
262 309 return 0;
263 310 expr = strip_expr(expr->right);
264 311 if (!expr || expr->type != EXPR_CALL || expr->fn->type != EXPR_SYMBOL)
265 312 return 0;
266 313
267 314 if (sym_name_is("kmalloc", expr->fn))
268 315 return 1;
316 + if (sym_name_is("vmalloc", expr->fn))
317 + return 1;
318 + if (sym_name_is("kvmalloc", expr->fn))
319 + return 1;
320 + if (sym_name_is("kmalloc_array", expr->fn))
321 + return 1;
322 + if (sym_name_is("vmalloc_array", expr->fn))
323 + return 1;
324 + if (sym_name_is("kvmalloc_array", expr->fn))
325 + return 1;
326 +
327 + if (sym_name_is("mmu_memory_cache_alloc", expr->fn))
328 + return 1;
329 + if (sym_name_is("kmem_alloc", expr->fn))
330 + return 1;
331 + if (sym_name_is("alloc_pages", expr->fn))
332 + return 1;
333 +
269 334 if (sym_name_is("netdev_priv", expr->fn))
270 335 return 1;
271 336 if (sym_name_is("dev_get_drvdata", expr->fn))
272 337 return 1;
338 + if (sym_name_is("i2c_get_clientdata", expr->fn))
339 + return 1;
273 340
274 341 return 0;
275 342 }
276 343
277 344 static int is_uncasted_pointer_assign(void)
278 345 {
279 346 struct expression *expr;
280 347 struct symbol *left_type, *right_type;
281 348
282 349 expr = get_faked_expression();
283 350 if (!expr)
284 351 return 0;
285 352 if (expr->type == EXPR_PREOP || expr->type == EXPR_POSTOP) {
286 353 if (expr->op == SPECIAL_INCREMENT || expr->op == SPECIAL_DECREMENT)
↓ open down ↓ |
4 lines elided |
↑ open up ↑ |
287 354 return 1;
288 355 }
289 356 if (expr->type != EXPR_ASSIGNMENT)
290 357 return 0;
291 358 left_type = get_type(expr->left);
292 359 right_type = get_type(expr->right);
293 360
294 361 if (!left_type || !right_type)
295 362 return 0;
296 363
364 + if (left_type->type == SYM_STRUCT && left_type == right_type)
365 + return 1;
366 +
297 367 if (left_type->type != SYM_PTR &&
298 368 left_type->type != SYM_ARRAY)
299 369 return 0;
300 370 if (right_type->type != SYM_PTR &&
301 371 right_type->type != SYM_ARRAY)
302 372 return 0;
303 373 left_type = get_real_base_type(left_type);
304 374 right_type = get_real_base_type(right_type);
305 375
306 376 if (left_type == right_type)
307 377 return 1;
308 378 return 0;
309 379 }
310 380
311 381 static int set_param_type(void *_type_str, int argc, char **argv, char **azColName)
312 382 {
313 383 char **type_str = _type_str;
314 384 static char type_buf[128];
315 385
316 386 if (*type_str) {
317 387 if (strcmp(*type_str, argv[0]) == 0)
318 388 return 0;
319 389 strncpy(type_buf, "unknown", sizeof(type_buf));
320 390 return 0;
321 391 }
322 392 strncpy(type_buf, argv[0], sizeof(type_buf));
323 393 *type_str = type_buf;
324 394
325 395 return 0;
326 396 }
327 397
328 398 static char *db_get_parameter_type(int param)
329 399 {
330 400 char *ret = NULL;
331 401
332 402 if (!cur_func_sym)
333 403 return NULL;
334 404
335 405 run_sql(set_param_type, &ret,
336 406 "select value from fn_data_link where "
337 407 "file = '%s' and function = '%s' and static = %d and type = %d and parameter = %d and key = '$';",
338 408 (cur_func_sym->ctype.modifiers & MOD_STATIC) ? get_base_file() : "extern",
339 409 cur_func_sym->ident->name,
340 410 !!(cur_func_sym->ctype.modifiers & MOD_STATIC),
341 411 PASSES_TYPE, param);
342 412
343 413 return ret;
344 414 }
345 415
346 416 static int is_uncasted_fn_param_from_db(void)
347 417 {
348 418 struct expression *expr, *right;
349 419 struct symbol *left_type;
350 420 char left_type_name[128];
351 421 int param;
352 422 char *right_type_name;
353 423 static struct expression *prev_expr;
354 424 static int prev_ans;
355 425
356 426 expr = get_faked_expression();
357 427
358 428 if (expr == prev_expr)
359 429 return prev_ans;
360 430 prev_expr = expr;
361 431 prev_ans = 0;
362 432
363 433 if (!expr || expr->type != EXPR_ASSIGNMENT)
364 434 return 0;
365 435 left_type = get_type(expr->left);
366 436 if (!left_type || left_type->type != SYM_PTR)
367 437 return 0;
368 438 left_type = get_real_base_type(left_type);
369 439 if (!left_type || left_type->type != SYM_STRUCT)
370 440 return 0;
371 441 snprintf(left_type_name, sizeof(left_type_name), "%s", type_to_str(left_type));
372 442
373 443 right = strip_expr(expr->right);
374 444 param = get_param_num(right);
375 445 if (param < 0)
376 446 return 0;
377 447 right_type_name = db_get_parameter_type(param);
378 448 if (!right_type_name)
379 449 return 0;
380 450
381 451 if (strcmp(right_type_name, left_type_name) == 0) {
382 452 prev_ans = 1;
383 453 return 1;
384 454 }
385 455
386 456 return 0;
387 457 }
388 458
↓ open down ↓ |
82 lines elided |
↑ open up ↑ |
389 459 static void match_assign_value(struct expression *expr)
390 460 {
391 461 char *member, *right_member;
392 462 struct range_list *rl;
393 463 struct symbol *type;
394 464
395 465 if (!cur_func_sym)
396 466 return;
397 467
398 468 type = get_type(expr->left);
469 + if (type && type->type == SYM_STRUCT)
470 + return;
399 471 member = get_member_name(expr->left);
400 472 if (!member)
401 473 return;
402 474
403 475 /* if we're saying foo->mtu = bar->mtu then that doesn't add information */
404 476 right_member = get_member_name(expr->right);
405 477 if (right_member && strcmp(right_member, member) == 0)
406 478 goto free;
407 479
408 480 if (is_fake_call(expr->right)) {
409 481 if (is_ignored_macro())
410 482 goto free;
411 483 if (is_ignored_function())
412 484 goto free;
413 485 if (is_uncasted_pointer_assign())
414 486 goto free;
415 487 if (is_uncasted_fn_param_from_db())
416 488 goto free;
417 489 if (is_container_of())
418 490 goto free;
491 + if (is_driver_data())
492 + goto free;
419 493 add_fake_type_val(member, alloc_whole_rl(get_type(expr->left)), is_ignored_fake_assignment());
420 494 goto free;
421 495 }
422 496
423 497 if (expr->op == '=') {
424 498 get_absolute_rl(expr->right, &rl);
425 499 rl = cast_rl(type, rl);
426 500 } else {
427 501 /*
428 502 * This is a bit cheating. We order it so this will already be set
429 503 * by smatch_extra.c and we just look up the value.
430 504 */
431 505 get_absolute_rl(expr->left, &rl);
432 506 }
433 507 add_type_val(member, rl);
434 508 free:
435 509 free_string(right_member);
436 510 free_string(member);
437 511 }
438 512
439 513 /*
440 514 * If we too: int *p = &my_struct->member then abandon all hope of tracking
441 515 * my_struct->member.
442 516 */
443 517 static void match_assign_pointer(struct expression *expr)
444 518 {
445 519 struct expression *right;
446 520 char *member;
447 521 struct range_list *rl;
448 522 struct symbol *type;
449 523
450 524 right = strip_expr(expr->right);
451 525 if (right->type != EXPR_PREOP || right->op != '&')
452 526 return;
453 527 right = strip_expr(right->unop);
454 528
455 529 member = get_member_name(right);
456 530 if (!member)
457 531 return;
458 532 type = get_type(right);
459 533 rl = alloc_whole_rl(type);
460 534 add_type_val(member, rl);
461 535 free_string(member);
462 536 }
463 537
464 538 static void match_global_assign(struct expression *expr)
465 539 {
466 540 char *member;
467 541 struct range_list *rl;
468 542 struct symbol *type;
469 543
470 544 type = get_type(expr->left);
471 545 if (type && (type->type == SYM_ARRAY || type->type == SYM_STRUCT))
472 546 return;
473 547 member = get_member_name(expr->left);
474 548 if (!member)
475 549 return;
476 550 get_absolute_rl(expr->right, &rl);
477 551 rl = cast_rl(type, rl);
478 552 add_global_type_val(member, rl);
479 553 free_string(member);
480 554 }
481 555
482 556 static void unop_expr(struct expression *expr)
483 557 {
484 558 struct range_list *rl;
485 559 char *member;
486 560
487 561 if (expr->op != SPECIAL_DECREMENT && expr->op != SPECIAL_INCREMENT)
488 562 return;
489 563
490 564 expr = strip_expr(expr->unop);
491 565 member = get_member_name(expr);
492 566 if (!member)
493 567 return;
↓ open down ↓ |
65 lines elided |
↑ open up ↑ |
494 568 rl = alloc_whole_rl(get_type(expr));
495 569 add_type_val(member, rl);
496 570 free_string(member);
497 571 }
498 572
499 573 static void asm_expr(struct statement *stmt)
500 574 {
501 575 struct expression *expr;
502 576 struct range_list *rl;
503 577 char *member;
504 - int state = 0;
505 578
506 579 FOR_EACH_PTR(stmt->asm_outputs, expr) {
507 - switch (state) {
508 - case 0: /* identifier */
509 - case 1: /* constraint */
510 - state++;
580 + member = get_member_name(expr->expr);
581 + if (!member)
511 582 continue;
512 - case 2: /* expression */
513 - state = 0;
514 - member = get_member_name(expr);
515 - if (!member)
516 - continue;
517 - rl = alloc_whole_rl(get_type(expr));
518 - add_type_val(member, rl);
519 - free_string(member);
520 - continue;
521 - }
583 + rl = alloc_whole_rl(get_type(expr->expr));
584 + add_type_val(member, rl);
585 + free_string(member);
522 586 } END_FOR_EACH_PTR(expr);
523 587 }
524 588
525 589 static void db_param_add(struct expression *expr, int param, char *key, char *value)
526 590 {
527 591 struct expression *arg;
528 592 struct symbol *type;
529 593 struct range_list *rl;
530 594 char *member;
531 595
532 596 if (strcmp(key, "*$") != 0)
533 597 return;
534 598
↓ open down ↓ |
3 lines elided |
↑ open up ↑ |
535 599 while (expr->type == EXPR_ASSIGNMENT)
536 600 expr = strip_expr(expr->right);
537 601 if (expr->type != EXPR_CALL)
538 602 return;
539 603
540 604 arg = get_argument_from_call_expr(expr->args, param);
541 605 arg = strip_expr(arg);
542 606 if (!arg)
543 607 return;
544 608 type = get_member_type_from_key(arg, key);
609 + /*
610 + * The situation here is that say we memset() a void pointer to zero
611 + * then that's returned to the called as "*$ = 0;" but on the caller's
612 + * side it's not void, it's a struct.
613 + *
614 + * So the question is should we be passing that slightly bogus
615 + * information back to the caller? Maybe, maybe not, but either way we
616 + * are not going to record it here because a struct can't be zero.
617 + *
618 + */
619 + if (type && type->type == SYM_STRUCT)
620 + return;
621 +
545 622 if (arg->type != EXPR_PREOP || arg->op != '&')
546 623 return;
547 624 arg = strip_expr(arg->unop);
548 625
549 626 member = get_member_name(arg);
550 627 if (!member)
551 628 return;
552 629 call_results_to_rl(expr, type, value, &rl);
553 630 add_type_val(member, rl);
554 631 free_string(member);
555 632 }
556 633
557 634 static void match_end_func_info(struct symbol *sym)
558 635 {
559 636 struct sm_state *sm;
560 637
561 638 FOR_EACH_SM(fn_type_val, sm) {
562 639 sql_insert_function_type_value(sm->name, sm->state->name);
563 640 } END_FOR_EACH_SM(sm);
564 641 }
565 642
566 643 static void clear_cache(struct symbol *sym)
567 644 {
568 645 memset(cached_results, 0, sizeof(cached_results));
569 646 }
570 647
571 648 static void match_after_func(struct symbol *sym)
572 649 {
573 650 free_stree(&fn_type_val);
574 651 }
575 652
576 653 static void match_end_file(struct symbol_list *sym_list)
577 654 {
578 655 struct sm_state *sm;
579 656
580 657 FOR_EACH_SM(global_type_val, sm) {
581 658 sql_insert_function_type_value(sm->name, sm->state->name);
582 659 } END_FOR_EACH_SM(sm);
583 660 }
584 661
585 662 void register_type_val(int id)
586 663 {
587 664 my_id = id;
588 665 add_hook(&clear_cache, AFTER_FUNC_HOOK);
589 666
590 667 if (!option_info)
591 668 return;
592 669
593 670 add_hook(&match_assign_value, ASSIGNMENT_HOOK_AFTER);
594 671 add_hook(&match_assign_pointer, ASSIGNMENT_HOOK);
595 672 add_hook(&unop_expr, OP_HOOK);
596 673 add_hook(&asm_expr, ASM_HOOK);
597 674 select_return_states_hook(PARAM_ADD, &db_param_add);
598 675 select_return_states_hook(PARAM_SET, &db_param_add);
599 676
600 677
601 678 add_hook(&match_inline_start, INLINE_FN_START);
602 679 add_hook(&match_inline_end, INLINE_FN_END);
603 680
604 681 add_hook(&match_end_func_info, END_FUNC_HOOK);
605 682 add_hook(&match_after_func, AFTER_FUNC_HOOK);
606 683
607 684 add_hook(&match_global_assign, GLOBAL_ASSIGNMENT_HOOK);
608 685 add_hook(&match_end_file, END_FILE_HOOK);
609 686 }
↓ open down ↓ |
55 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX