]> Git Repo - linux.git/commitdiff
Merge tag 'x86_cpu_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <[email protected]>
Tue, 4 Oct 2022 16:21:30 +0000 (09:21 -0700)
committerLinus Torvalds <[email protected]>
Tue, 4 Oct 2022 16:21:30 +0000 (09:21 -0700)
Pull x86 cpu updates from Borislav Petkov:

 - Print the CPU number at segfault time.

   The number printed is not always accurate (preemption is enabled at
   that time) but the print string contains "likely" and after a lot of
   back'n'forth on this, this was the consensus that was reached. See
   thread at [1].

 - After a *lot* of testing and polishing, finally the clear_user()
   improvements to inline REP; STOSB by default

Link: https://lore.kernel.org/r/[email protected]
* tag 'x86_cpu_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/mm: Print likely CPU at segfault time
  x86/clear_user: Make it faster

1  2 
tools/objtool/check.c

diff --combined tools/objtool/check.c
index 48e18737a2d1850554493b950b35828855978fb3,4b2e11726f4e5e62f35effef7c5bd3a0610608b8..4a9ba6ab80d5a5d8918077b88fd88c33df5c023b
@@@ -162,34 -162,32 +162,34 @@@ static bool __dead_end_function(struct 
  
        /*
         * Unfortunately these have to be hard coded because the noreturn
 -       * attribute isn't provided in ELF data.
 +       * attribute isn't provided in ELF data. Keep 'em sorted.
         */
        static const char * const global_noreturns[] = {
 +              "__invalid_creds",
 +              "__module_put_and_kthread_exit",
 +              "__reiserfs_panic",
                "__stack_chk_fail",
 -              "panic",
 +              "__ubsan_handle_builtin_unreachable",
 +              "cpu_bringup_and_idle",
 +              "cpu_startup_entry",
                "do_exit",
 +              "do_group_exit",
                "do_task_dead",
 -              "kthread_exit",
 -              "make_task_dead",
 -              "__module_put_and_kthread_exit",
 +              "ex_handler_msr_mce",
 +              "fortify_panic",
                "kthread_complete_and_exit",
 -              "__reiserfs_panic",
 +              "kthread_exit",
 +              "kunit_try_catch_throw",
                "lbug_with_loc",
 -              "fortify_panic",
 -              "usercopy_abort",
                "machine_real_restart",
 +              "make_task_dead",
 +              "panic",
                "rewind_stack_and_make_dead",
 -              "kunit_try_catch_throw",
 -              "xen_start_kernel",
 -              "cpu_bringup_and_idle",
 -              "do_group_exit",
 +              "sev_es_terminate",
 +              "snp_abort",
                "stop_this_cpu",
 -              "__invalid_creds",
 -              "cpu_startup_entry",
 -              "__ubsan_handle_builtin_unreachable",
 -              "ex_handler_msr_mce",
 +              "usercopy_abort",
 +              "xen_start_kernel",
        };
  
        if (!func)
@@@ -1073,6 -1071,9 +1073,9 @@@ static const char *uaccess_safe_builtin
        "copy_mc_fragile_handle_tail",
        "copy_mc_enhanced_fast_string",
        "ftrace_likely_update", /* CONFIG_TRACE_BRANCH_PROFILING */
+       "clear_user_erms",
+       "clear_user_rep_good",
+       "clear_user_original",
        NULL
  };
  
@@@ -3316,10 -3317,6 +3319,10 @@@ static int validate_branch(struct objto
                next_insn = next_insn_to_validate(file, insn);
  
                if (func && insn->func && func != insn->func->pfunc) {
 +                      /* Ignore KCFI type preambles, which always fall through */
 +                      if (!strncmp(func->name, "__cfi_", 6))
 +                              return 0;
 +
                        WARN("%s() falls through to next function %s()",
                             func->name, insn->func->name);
                        return 1;
@@@ -4102,8 -4099,7 +4105,8 @@@ static int validate_ibt(struct objtool_
                 * These sections can reference text addresses, but not with
                 * the intent to indirect branch to them.
                 */
 -              if (!strncmp(sec->name, ".discard", 8)                  ||
 +              if ((!strncmp(sec->name, ".discard", 8) &&
 +                   strcmp(sec->name, ".discard.ibt_endbr_noseal"))    ||
                    !strncmp(sec->name, ".debug", 6)                    ||
                    !strcmp(sec->name, ".altinstructions")              ||
                    !strcmp(sec->name, ".ibt_endbr_seal")               ||
                    !strcmp(sec->name, "__bug_table")                   ||
                    !strcmp(sec->name, "__ex_table")                    ||
                    !strcmp(sec->name, "__jump_table")                  ||
 -                  !strcmp(sec->name, "__mcount_loc"))
 +                  !strcmp(sec->name, "__mcount_loc")                  ||
 +                  !strcmp(sec->name, ".kcfi_traps"))
                        continue;
  
                list_for_each_entry(reloc, &sec->reloc->reloc_list, list)
This page took 0.065191 seconds and 4 git commands to generate.