aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mod
diff options
context:
space:
mode:
authorJames Morris <james.morris@microsoft.com>2019-03-26 19:28:01 -0400
committerJames Morris <james.morris@microsoft.com>2019-03-26 19:28:01 -0400
commit9d7b7bfbafba5e6cad609f1188243a7f0cd0d293 (patch)
tree3bc87cf11ab44f10a2000bb8ab22ca361a944621 /scripts/mod
parent468e91cecb3218afd684b8c422490dfebe0691bb (diff)
parent8c2ffd9174779014c3fe1f96d9dc3641d9175f00 (diff)
Merge tag 'v5.1-rc2' into next-general
Merge to Linux 5.1-rc2 for subsystems to work with.
Diffstat (limited to 'scripts/mod')
-rw-r--r--scripts/mod/devicetable-offsets.c6
-rw-r--r--scripts/mod/file2alias.c47
-rw-r--r--scripts/mod/modpost.c27
3 files changed, 57 insertions, 23 deletions
diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c
index 293004499b4d..054405b90ba4 100644
--- a/scripts/mod/devicetable-offsets.c
+++ b/scripts/mod/devicetable-offsets.c
@@ -225,5 +225,11 @@ int main(void)
225 DEVID_FIELD(typec_device_id, svid); 225 DEVID_FIELD(typec_device_id, svid);
226 DEVID_FIELD(typec_device_id, mode); 226 DEVID_FIELD(typec_device_id, mode);
227 227
228 DEVID(tee_client_device_id);
229 DEVID_FIELD(tee_client_device_id, uuid);
230
231 DEVID(wmi_device_id);
232 DEVID_FIELD(wmi_device_id, guid_string);
233
228 return 0; 234 return 0;
229} 235}
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index a37af7d71973..e17a29ae2e97 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -37,6 +37,10 @@ typedef unsigned char __u8;
37typedef struct { 37typedef struct {
38 __u8 b[16]; 38 __u8 b[16];
39} uuid_le; 39} uuid_le;
40typedef struct {
41 __u8 b[16];
42} uuid_t;
43#define UUID_STRING_LEN 36
40 44
41/* Big exception to the "don't include kernel headers into userspace, which 45/* Big exception to the "don't include kernel headers into userspace, which
42 * even potentially has different endianness and word sizes, since 46 * even potentially has different endianness and word sizes, since
@@ -50,6 +54,9 @@ struct devtable {
50 int (*do_entry)(const char *filename, void *symval, char *alias); 54 int (*do_entry)(const char *filename, void *symval, char *alias);
51}; 55};
52 56
57/* Size of alias provided to do_entry functions */
58#define ALIAS_SIZE 500
59
53/* Define a variable f that holds the value of field f of struct devid 60/* Define a variable f that holds the value of field f of struct devid
54 * based at address m. 61 * based at address m.
55 */ 62 */
@@ -1287,6 +1294,42 @@ static int do_typec_entry(const char *filename, void *symval, char *alias)
1287 return 1; 1294 return 1;
1288} 1295}
1289 1296
1297/* Looks like: tee:uuid */
1298static int do_tee_entry(const char *filename, void *symval, char *alias)
1299{
1300 DEF_FIELD(symval, tee_client_device_id, uuid);
1301
1302 sprintf(alias, "tee:%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
1303 uuid.b[0], uuid.b[1], uuid.b[2], uuid.b[3], uuid.b[4],
1304 uuid.b[5], uuid.b[6], uuid.b[7], uuid.b[8], uuid.b[9],
1305 uuid.b[10], uuid.b[11], uuid.b[12], uuid.b[13], uuid.b[14],
1306 uuid.b[15]);
1307
1308 add_wildcard(alias);
1309 return 1;
1310}
1311
1312/* Looks like: wmi:guid */
1313static int do_wmi_entry(const char *filename, void *symval, char *alias)
1314{
1315 int len;
1316 DEF_FIELD_ADDR(symval, wmi_device_id, guid_string);
1317
1318 if (strlen(*guid_string) != UUID_STRING_LEN) {
1319 warn("Invalid WMI device id 'wmi:%s' in '%s'\n",
1320 *guid_string, filename);
1321 return 0;
1322 }
1323
1324 len = snprintf(alias, ALIAS_SIZE, WMI_MODULE_PREFIX "%s", *guid_string);
1325 if (len < 0 || len >= ALIAS_SIZE) {
1326 warn("Could not generate all MODULE_ALIAS's in '%s'\n",
1327 filename);
1328 return 0;
1329 }
1330 return 1;
1331}
1332
1290/* Does namelen bytes of name exactly match the symbol? */ 1333/* Does namelen bytes of name exactly match the symbol? */
1291static bool sym_is(const char *name, unsigned namelen, const char *symbol) 1334static bool sym_is(const char *name, unsigned namelen, const char *symbol)
1292{ 1335{
@@ -1303,7 +1346,7 @@ static void do_table(void *symval, unsigned long size,
1303 struct module *mod) 1346 struct module *mod)
1304{ 1347{
1305 unsigned int i; 1348 unsigned int i;
1306 char alias[500]; 1349 char alias[ALIAS_SIZE];
1307 1350
1308 device_id_check(mod->name, device_id, size, id_size, symval); 1351 device_id_check(mod->name, device_id, size, id_size, symval);
1309 /* Leave last one: it's the terminator. */ 1352 /* Leave last one: it's the terminator. */
@@ -1357,6 +1400,8 @@ static const struct devtable devtable[] = {
1357 {"fslmc", SIZE_fsl_mc_device_id, do_fsl_mc_entry}, 1400 {"fslmc", SIZE_fsl_mc_device_id, do_fsl_mc_entry},
1358 {"tbsvc", SIZE_tb_service_id, do_tbsvc_entry}, 1401 {"tbsvc", SIZE_tb_service_id, do_tbsvc_entry},
1359 {"typec", SIZE_typec_device_id, do_typec_entry}, 1402 {"typec", SIZE_typec_device_id, do_typec_entry},
1403 {"tee", SIZE_tee_client_device_id, do_tee_entry},
1404 {"wmi", SIZE_wmi_device_id, do_wmi_entry},
1360}; 1405};
1361 1406
1362/* Create MODULE_ALIAS() statements. 1407/* Create MODULE_ALIAS() statements.
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 26bf886bd168..0b0d1080b1c5 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -35,7 +35,6 @@ static int vmlinux_section_warnings = 1;
35static int warn_unresolved = 0; 35static int warn_unresolved = 0;
36/* How a symbol is exported */ 36/* How a symbol is exported */
37static int sec_mismatch_count = 0; 37static int sec_mismatch_count = 0;
38static int sec_mismatch_verbose = 1;
39static int sec_mismatch_fatal = 0; 38static int sec_mismatch_fatal = 0;
40/* ignore missing files */ 39/* ignore missing files */
41static int ignore_missing_files; 40static int ignore_missing_files;
@@ -1406,8 +1405,6 @@ static void report_sec_mismatch(const char *modname,
1406 char *prl_to; 1405 char *prl_to;
1407 1406
1408 sec_mismatch_count++; 1407 sec_mismatch_count++;
1409 if (!sec_mismatch_verbose)
1410 return;
1411 1408
1412 get_pretty_name(from_is_func, &from, &from_p); 1409 get_pretty_name(from_is_func, &from, &from_p);
1413 get_pretty_name(to_is_func, &to, &to_p); 1410 get_pretty_name(to_is_func, &to, &to_p);
@@ -1655,9 +1652,7 @@ static void extable_mismatch_handler(const char* modname, struct elf_info *elf,
1655 1652
1656 sec_mismatch_count++; 1653 sec_mismatch_count++;
1657 1654
1658 if (sec_mismatch_verbose) 1655 report_extable_warnings(modname, elf, mismatch, r, sym, fromsec, tosec);
1659 report_extable_warnings(modname, elf, mismatch, r, sym,
1660 fromsec, tosec);
1661 1656
1662 if (match(tosec, mismatch->bad_tosec)) 1657 if (match(tosec, mismatch->bad_tosec))
1663 fatal("The relocation at %s+0x%lx references\n" 1658 fatal("The relocation at %s+0x%lx references\n"
@@ -2433,7 +2428,7 @@ int main(int argc, char **argv)
2433 struct ext_sym_list *extsym_iter; 2428 struct ext_sym_list *extsym_iter;
2434 struct ext_sym_list *extsym_start = NULL; 2429 struct ext_sym_list *extsym_start = NULL;
2435 2430
2436 while ((opt = getopt(argc, argv, "i:I:e:mnsST:o:awE")) != -1) { 2431 while ((opt = getopt(argc, argv, "i:I:e:mnsT:o:awE")) != -1) {
2437 switch (opt) { 2432 switch (opt) {
2438 case 'i': 2433 case 'i':
2439 kernel_read = optarg; 2434 kernel_read = optarg;
@@ -2465,9 +2460,6 @@ int main(int argc, char **argv)
2465 case 's': 2460 case 's':
2466 vmlinux_section_warnings = 0; 2461 vmlinux_section_warnings = 0;
2467 break; 2462 break;
2468 case 'S':
2469 sec_mismatch_verbose = 0;
2470 break;
2471 case 'T': 2463 case 'T':
2472 files_source = optarg; 2464 files_source = optarg;
2473 break; 2465 break;
@@ -2525,18 +2517,9 @@ int main(int argc, char **argv)
2525 } 2517 }
2526 if (dump_write) 2518 if (dump_write)
2527 write_dump(dump_write); 2519 write_dump(dump_write);
2528 if (sec_mismatch_count) { 2520 if (sec_mismatch_count && sec_mismatch_fatal)
2529 if (!sec_mismatch_verbose) { 2521 fatal("modpost: Section mismatches detected.\n"
2530 warn("modpost: Found %d section mismatch(es).\n" 2522 "Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.\n");
2531 "To see full details build your kernel with:\n"
2532 "'make CONFIG_DEBUG_SECTION_MISMATCH=y'\n",
2533 sec_mismatch_count);
2534 }
2535 if (sec_mismatch_fatal) {
2536 fatal("modpost: Section mismatches detected.\n"
2537 "Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.\n");
2538 }
2539 }
2540 free(buf.p); 2523 free(buf.p);
2541 2524
2542 return err; 2525 return err;