···10681068 earlyprintk=serial[,0x...[,baudrate]]10691069 earlyprintk=ttySn[,baudrate]10701070 earlyprintk=dbgp[debugController#]10711071- earlyprintk=pciserial,bus:device.function[,baudrate]10711071+ earlyprintk=pciserial[,force],bus:device.function[,baudrate]10721072 earlyprintk=xdbc[xhciController#]1073107310741074 earlyprintk is useful when the kernel crashes before···10991099 The xen output can only be used by Xen PV guests.1100110011011101 The sclp output can only be used on s390.11021102+11031103+ The optional "force" to "pciserial" enables use of a11041104+ PCI device even when its classcode is not of the11051105+ UART class.1102110611031107 edac_report= [HW,EDAC] Control how to report EDAC event11041108 Format: {"on" | "off" | "force"}
···213213 * early_pci_serial_init()214214 *215215 * This function is invoked when the early_printk param starts with "pciserial"216216- * The rest of the param should be ",B:D.F,baud" where B, D & F describe the217217- * location of a PCI device that must be a UART device.216216+ * The rest of the param should be "[force],B:D.F,baud", where B, D & F describe217217+ * the location of a PCI device that must be a UART device. "force" is optional218218+ * and overrides the use of an UART device with a wrong PCI class code.218219 */219220static __init void early_pci_serial_init(char *s)220221{···225224 u32 classcode, bar0;226225 u16 cmdreg;227226 char *e;227227+ int force = 0;228228229229-230230- /*231231- * First, part the param to get the BDF values232232- */233229 if (*s == ',')234230 ++s;235231236232 if (*s == 0)237233 return;238234235235+ /* Force the use of an UART device with wrong class code */236236+ if (!strncmp(s, "force,", 6)) {237237+ force = 1;238238+ s += 6;239239+ }240240+241241+ /*242242+ * Part the param to get the BDF values243243+ */239244 bus = (u8)simple_strtoul(s, &e, 16);240245 s = e;241246 if (*s != ':')···260253 s++;261254262255 /*263263- * Second, find the device from the BDF256256+ * Find the device from the BDF264257 */265258 cmdreg = read_pci_config(bus, slot, func, PCI_COMMAND);266259 classcode = read_pci_config(bus, slot, func, PCI_CLASS_REVISION);···271264 */272265 if (((classcode >> 16 != PCI_CLASS_COMMUNICATION_MODEM) &&273266 (classcode >> 16 != PCI_CLASS_COMMUNICATION_SERIAL)) ||274274- (((classcode >> 8) & 0xff) != 0x02)) /* 16550 I/F at BAR0 */275275- return;267267+ (((classcode >> 8) & 0xff) != 0x02)) /* 16550 I/F at BAR0 */ {268268+ if (!force)269269+ return;270270+ }276271277272 /*278273 * Determine if it is IO or memory mapped···298289 }299290300291 /*301301- * Lastly, initialize the hardware292292+ * Initialize the hardware302293 */303294 if (*s) {304295 if (strcmp(s, "nocfg") == 0)
+32-6
tools/objtool/check.c
···836836 struct symbol *pfunc = insn->func->pfunc;837837 unsigned int prev_offset = 0;838838839839- list_for_each_entry_from(rela, &file->rodata->rela->rela_list, list) {839839+ list_for_each_entry_from(rela, &table->rela_sec->rela_list, list) {840840 if (rela == next_table)841841 break;842842···926926{927927 struct rela *text_rela, *rodata_rela;928928 struct instruction *orig_insn = insn;929929+ struct section *rodata_sec;929930 unsigned long table_offset;930931931932 /*···954953 /* look for a relocation which references .rodata */955954 text_rela = find_rela_by_dest_range(insn->sec, insn->offset,956955 insn->len);957957- if (!text_rela || text_rela->sym != file->rodata->sym)956956+ if (!text_rela || text_rela->sym->type != STT_SECTION ||957957+ !text_rela->sym->sec->rodata)958958 continue;959959960960 table_offset = text_rela->addend;961961+ rodata_sec = text_rela->sym->sec;962962+961963 if (text_rela->type == R_X86_64_PC32)962964 table_offset += 4;963965···968964 * Make sure the .rodata address isn't associated with a969965 * symbol. gcc jump tables are anonymous data.970966 */971971- if (find_symbol_containing(file->rodata, table_offset))967967+ if (find_symbol_containing(rodata_sec, table_offset))972968 continue;973969974974- rodata_rela = find_rela_by_dest(file->rodata, table_offset);970970+ rodata_rela = find_rela_by_dest(rodata_sec, table_offset);975971 if (rodata_rela) {976972 /*977973 * Use of RIP-relative switch jumps is quite rare, and···10561052 struct symbol *func;10571053 int ret;1058105410591059- if (!file->rodata || !file->rodata->rela)10551055+ if (!file->rodata)10601056 return 0;1061105710621058 for_each_sec(file, sec) {···12021198 return 0;12031199}1204120012011201+static void mark_rodata(struct objtool_file *file)12021202+{12031203+ struct section *sec;12041204+ bool found = false;12051205+12061206+ /*12071207+ * This searches for the .rodata section or multiple .rodata.func_name12081208+ * sections if -fdata-sections is being used. The .str.1.1 and .str.1.812091209+ * rodata sections are ignored as they don't contain jump tables.12101210+ */12111211+ for_each_sec(file, sec) {12121212+ if (!strncmp(sec->name, ".rodata", 7) &&12131213+ !strstr(sec->name, ".str1.")) {12141214+ sec->rodata = true;12151215+ found = true;12161216+ }12171217+ }12181218+12191219+ file->rodata = found;12201220+}12211221+12051222static int decode_sections(struct objtool_file *file)12061223{12071224 int ret;12251225+12261226+ mark_rodata(file);1208122712091228 ret = decode_instructions(file);12101229 if (ret)···21982171 INIT_LIST_HEAD(&file.insn_list);21992172 hash_init(file.insn_hash);22002173 file.whitelist = find_section_by_name(file.elf, ".discard.func_stack_frame_non_standard");22012201- file.rodata = find_section_by_name(file.elf, ".rodata");22022174 file.c_file = find_section_by_name(file.elf, ".comment");22032175 file.ignore_unreachables = no_unreachable;22042176 file.hints = false;