#include #include #include #ifdef HAVE_BACKTRACE_SUPPORT #include #endif #include "../../util/cache.h" #include "../../util/debug.h" #include "../../util/util.h" #include "../browser.h" #include "../helpline.h" #include "../ui.h" #include "../util.h" #include "../libslang.h" #include "../keysyms.h" #include "tui.h" static volatile int ui__need_resize; extern struct perf_error_ops perf_tui_eops; extern bool tui_helpline__set; extern void hist_browser__init_hpp(void); void ui__refresh_dimensions(bool force) { if (force || ui__need_resize) { ui__need_resize = 0; pthread_mutex_lock(&ui__lock); SLtt_get_screen_size(); SLsmg_reinit_smg(); pthread_mutex_unlock(&ui__lock); } } static void ui__sigwinch(int sig __maybe_unused) { ui__need_resize = 1; } static void ui__setup_sigwinch(void) { static bool done; if (done) return; done = true; pthread__unblock_sigwinch(); signal(SIGWINCH, ui__sigwinch); } int ui__getch(int delay_secs) { struct timeval timeout, *ptimeout = delay_secs ? &timeout : NULL; fd_set read_set; int err, key; ui__setup_sigwinch(); FD_ZERO(&read_set); FD_SET(0, &read_set); if (delay_secs) { timeout.tv_sec = delay_secs; timeout.tv_usec = 0; } err = select(1, &read_set, NULL, NULL, ptimeout); if (err == 0) return K_TIMER; if (err == -1) { if (errno == EINTR) return K_RESIZE; return K_ERROR; } key = SLang_getkey(); if (key != K_ESC) return key; FD_ZERO(&read_set); FD_SET(0, &read_set); timeout.tv_sec = 0; timeout.tv_usec = 20; err = select(1, &read_set, NULL, NULL, &timeout); if (err == 0) return K_ESC; SLang_ungetkey(key); return SLkp_getkey(); } #ifdef HAVE_BACKTRACE_SUPPORT static void ui__signal_backtrace(int sig) { void *stackdump[32]; size_t size; ui__exit(false); psignal(sig, "perf"); printf("-------- backtrace --------\n"); size = backtrace(stackdump, ARRAY_SIZE(stackdump)); backtrace_symbols_fd(stackdump, size, STDOUT_FILENO); exit(0); } #else # define ui__signal_backtrace ui__signal #endif static void ui__signal(int sig) { ui__exit(false); psignal(sig, "perf"); exit(0); } int ui__init(void) { int err; SLutf8_enable(-1); SLtt_get_terminfo(); SLtt_get_screen_size(); err = SLsmg_init_smg(); if (err < 0) goto out; err = SLang_init_tty(-1, 0, 0); if (err < 0) goto out; err = SLkp_init(); if (err < 0) { pr_err("TUI initialization failed.\n"); goto out; } SLkp_define_keysym((char *)"^(kB)", SL_KEY_UNTAB); signal(SIGSEGV, ui__signal_backtrace); signal(SIGFPE, ui__signal_backtrace); signal(SIGINT, ui__signal); signal(SIGQUIT, ui__signal); signal(SIGTERM, ui__signal); perf_error__register(&perf_tui_eops); ui_helpline__init(); ui_browser__init(); tui_progress__init(); hist_browser__init_hpp(); out: return err; } void ui__exit(bool wait_for_ok) { if (wait_for_ok && tui_helpline__set) ui__question_window("Fatal Error", ui_helpline__last_msg, "Press any key...", 0); SLtt_set_cursor_visibility(1); SLsmg_refresh(); SLsmg_reset_smg(); SLang_reset_tty(); perf_error__unregister(&perf_tui_eops); } tools/perf/arch/arm64?id=c26665ab5c49ad3e142e0f054ca3204f259ba09c'>arm64
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2017-01-20 21:29:40 +0100
committerThomas Gleixner <tglx@linutronix.de>2017-01-23 09:39:55 +0100
commitc26665ab5c49ad3e142e0f054ca3204f259ba09c (patch)
tree3bab11918e18e9d25ef7544dba05cdf39d1abec5 /tools/perf/arch/arm64
parent7a308bb3016f57e5be11a677d15b821536419d36 (diff)
x86/microcode/intel: Drop stashed AP patch pointer optimization
This was meant to save us the scanning of the microcode containter in the initrd since the first AP had already done that but it can also hurt us: Imagine a single hyperthreaded CPU (Intel(R) Atom(TM) CPU N270, for example) which updates the microcode on the BSP but since the microcode engine is shared between the two threads, the update on CPU1 doesn't happen because it has already happened on CPU0 and we don't find a newer microcode revision on CPU1. Which doesn't set the intel_ucode_patch pointer and at initrd jettisoning time we don't save the microcode patch for later application. Now, when we suspend to RAM, the loaded microcode gets cleared so we need to reload but there's no patch saved in the cache. Removing the optimization fixes this issue and all is fine and dandy. Fixes: 06b8534cb728 ("x86/microcode: Rework microcode loading") Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/20170120202955.4091-2-bp@alien8.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'tools/perf/arch/arm64')