#include "util/cache.h" #include "util/debug.h" #include "ui/browser.h" #include "ui/keysyms.h" #include "ui/ui.h" #include "ui/util.h" #include "ui/libslang.h" #include "util/header.h" #include "util/session.h" static void ui_browser__argv_write(struct ui_browser *browser, void *entry, int row) { char **arg = entry; char *str = *arg; char empty[] = " "; bool current_entry = ui_browser__is_current_entry(browser, row); unsigned long offset = (unsigned long)browser->priv; if (offset >= strlen(str)) str = empty; else str = str + offset; ui_browser__set_color(browser, current_entry ? HE_COLORSET_SELECTED : HE_COLORSET_NORMAL); ui_browser__write_nstring(browser, str, browser->width); } static int list_menu__run(struct ui_browser *menu) { int key; unsigned long offset; const char help[] = "h/?/F1 Show this window\n" "UP/DOWN/PGUP\n" "PGDN/SPACE\n" "LEFT/RIGHT Navigate\n" "q/ESC/CTRL+C Exit browser"; if (ui_browser__show(menu, "Header information", "Press 'q' to exit") < 0) return -1; while (1) { key = ui_browser__run(menu, 0); switch (key) { case K_RIGHT: offset = (unsigned long)menu->priv; offset += 10; menu->priv = (void *)offset; continue; case K_LEFT: offset = (unsigned long)menu->priv; if (offset >= 10) offset -= 10; menu->priv = (void *)offset; continue; case K_F1: case 'h': case '?': ui_browser__help_window(menu, help); continue; case K_ESC: case 'q': case CTRL('c'): key = -1; break; default: continue; } break; } ui_browser__hide(menu); return key; } static int ui__list_menu(int argc, char * const argv[]) { struct ui_browser menu = { .entries = (void *)argv, .refresh = ui_browser__argv_refresh, .seek = ui_browser__argv_seek, .write = ui_browser__argv_write, .nr_entries = argc, }; return list_menu__run(&menu); } int tui__header_window(struct perf_env *env) { int i, argc = 0; char **argv; struct perf_session *session; char *ptr, *pos; size_t size; FILE *fp = open_memstream(&ptr, &size); session = container_of(env, struct perf_session, header.env); perf_header__fprintf_info(session, fp, true); fclose(fp); for (pos = ptr, argc = 0; (pos = strchr(pos, '\n')) != NULL; pos++) argc++; argv = calloc(argc + 1, sizeof(*argv)); if (argv == NULL) goto out; argv[0] = pos = ptr; for (i = 1; (pos = strchr(pos, '\n')) != NULL; i++) { *pos++ = '\0'; argv[i] = pos; } BUG_ON(i != argc + 1); ui__list_menu(argc, argv); out: free(argv); free(ptr); return 0; } og msg
path: root/sound/soc/fsl/wm1133-ev1.c
tion value='25'>25
AgeCommit message (Expand)AuthorFilesLines
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2017-02-03 17:10:28 +1100
committerMichael Ellerman <mpe@ellerman.id.au>2017-02-08 23:36:29 +1100
commitd7df2443cd5f67fc6ee7c05a88e4996e8177f91b (patch)
tree098a7c0ca4fceb8a65cb1f693c9d71990388933d /sound/soc/codecs/wm8776.c
parenta0615a16f7d0ceb5804d295203c302d496d8ee91 (diff)
powerpc/mm: Fix spurrious segfaults on radix with autonuma
When autonuma (Automatic NUMA balancing) marks a PTE inaccessible it clears all the protection bits but leave the PTE valid. With the Radix MMU, an attempt at executing from such a PTE will take a fault with bit 35 of SRR1 set "SRR1_ISI_N_OR_G". It is thus incorrect to treat all such faults as errors. We should pass them to handle_mm_fault() for autonuma to deal with. The case of pages that are really not executable is handled by the existing test for VM_EXEC further down. That leaves us with catching the kernel attempts at executing user pages. We can catch that earlier, even before we do find_vma. It is never valid on powerpc for the kernel to take an exec fault to begin with. So fold that test with the existing test for the kernel faulting on kernel addresses to bail out early. Fixes: 1d18ad026844 ("powerpc/mm: Detect instruction fetch denied and report") Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Acked-by: Balbir Singh <bsingharora@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'sound/soc/codecs/wm8776.c')