Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/814463/?format=api
{ "id": 814463, "url": "http://patchwork.ozlabs.org/api/patches/814463/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20170916035347.19705-6-sergey.senozhatsky@gmail.com/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api", "name": "Linux PPC development", "link_name": "linuxppc-dev", "list_id": "linuxppc-dev.lists.ozlabs.org", "list_email": "linuxppc-dev@lists.ozlabs.org", "web_url": "https://github.com/linuxppc/wiki/wiki", "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git", "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/", "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/", "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}" }, "msgid": "<20170916035347.19705-6-sergey.senozhatsky@gmail.com>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20170916035347.19705-6-sergey.senozhatsky@gmail.com/", "date": "2017-09-16T03:53:47", "name": "[5/5] symbol lookup: use new kernel and module dereference functions", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": false, "hash": "565f4fdacf0ae3dcc19eedc5be0dcfc733b90481", "submitter": { "id": 3905, "url": "http://patchwork.ozlabs.org/api/people/3905/?format=api", "name": "Sergey Senozhatsky", "email": "sergey.senozhatsky@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20170916035347.19705-6-sergey.senozhatsky@gmail.com/mbox/", "series": [ { "id": 3413, "url": "http://patchwork.ozlabs.org/api/series/3413/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=3413", "date": "2017-09-16T03:53:42", "name": "printk/ia64/ppc64/parisc64: let's deprecate %pF/%pf printk specifiers", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/3413/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/814463/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/814463/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>", "X-Original-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Delivered-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Received": [ "from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xvJgl3Hqfz9t16\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 16 Sep 2017 14:09:39 +1000 (AEST)", "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xvJgl22HmzDrp3\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 16 Sep 2017 14:09:39 +1000 (AEST)", "from mail-pf0-x242.google.com (mail-pf0-x242.google.com\n\t[IPv6:2607:f8b0:400e:c00::242])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xvJRg34q5zDrhx\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tSat, 16 Sep 2017 13:59:11 +1000 (AEST)", "by mail-pf0-x242.google.com with SMTP id g65so2071349pfe.1\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri, 15 Sep 2017 20:59:11 -0700 (PDT)", "from localhost.localdomain ([121.137.63.184])\n\tby smtp.gmail.com with ESMTPSA id\n\t76sm4448230pfp.158.2017.09.15.20.59.04\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 15 Sep 2017 20:59:08 -0700 (PDT)" ], "Authentication-Results": [ "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"oiBW2WKd\"; dkim-atps=neutral", "lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"oiBW2WKd\"; dkim-atps=neutral", "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gmail.com\n\t(client-ip=2607:f8b0:400e:c00::242; helo=mail-pf0-x242.google.com;\n\tenvelope-from=sergey.senozhatsky@gmail.com; receiver=<UNKNOWN>)", "lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"oiBW2WKd\"; dkim-atps=neutral" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=jqMjDFZPlndvRBevPf6/l+Sbczz31K9fx87lxL4edT4=;\n\tb=oiBW2WKdxlwW9vsvbFYtD7e8dUTs1YXu3AFEShaY4CzfbJ/yOB9nIQlqztpnapR1BE\n\tqQjUprLVJnlEFlhwJ6ut07uJCp7cxRVUDQx6VirY4/Qz63Lk8u35eE8lbHZZe05Dv+pZ\n\tMR9IyqhhAez2WVnPxWl3ZqrIWWtfc1yCQfb9HH0jMa5xb1a5nAKYC4z704CdUmjwXmp/\n\tfWFROfT/meCHa4RD3on2hGDW799q07nbiX9SBxFLLyKkC6gNJm7ArJM+woSlix1P/bvB\n\td5kvMogyTS2DoFYY308UWMStKo81zKDWeLEr+q5t2uoRlZX9tBm5EQ0Kitdd2JqajMUO\n\th4WA==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=jqMjDFZPlndvRBevPf6/l+Sbczz31K9fx87lxL4edT4=;\n\tb=lsGJ7ws+4Lu/fV+okjfN9Q7I4hlZDUPn+bZtz7mEz5sSnoaEPVB3z4cy2KAq8dGAIc\n\tK6M366skaVc4q6kkgjngt5x6a+gFL5CIDTNbEsVzNu/bdQXi+Yhc3K7XXCfLmr48BzDn\n\tWlLRNkIB86m5j4PnQQ27LZw/nlONprXXmZpe48OJuFGv8x4PPH0KmnhUhdkhNie4zipl\n\tyJyWazXtkhCqeycNdcOGgpCzHVMcUYp1gV/QGbxTFrrJ1lv0NK3TqvUFImA0FPSSWazV\n\tuxfh1igjvt1nU+E3GRELCeBSp/2XnpItlxdBoFDjaqCy8DnBNH3EMv7ymz0VCIbLVJ4g\n\t/aVA==", "X-Gm-Message-State": "AHPjjUhWEnSWRLXHu8ICxjcW9bm3raeFiC9d1+J0x9AutkeAfnnaozj/\n\tqXxIbKLiT+UpdQ==", "X-Google-Smtp-Source": "ADKCNb4X5vFccnXsuJlsc4soNewupyWR/oxNEKfrTixQS056WWEFvtXUduzjurNjJIeQc+SqxXbJrA==", "X-Received": "by 10.84.174.67 with SMTP id q61mr29826581plb.242.1505534349202; \n\tFri, 15 Sep 2017 20:59:09 -0700 (PDT)", "From": "Sergey Senozhatsky <sergey.senozhatsky@gmail.com>", "To": "Tony Luck <tony.luck@intel.com>, Fenghua Yu <fenghua.yu@intel.com>,\n\tBenjamin Herrenschmidt <benh@kernel.crashing.org>,\n\tPaul Mackerras <paulus@samba.org>,\n\tMichael Ellerman <mpe@ellerman.id.au>, \n\t\"James E . J . Bottomley\" <jejb@parisc-linux.org>,\n\tHelge Deller <deller@gmx.de>", "Subject": "[PATCH 5/5] symbol lookup: use new kernel and module dereference\n\tfunctions", "Date": "Sat, 16 Sep 2017 12:53:47 +0900", "Message-Id": "<20170916035347.19705-6-sergey.senozhatsky@gmail.com>", "X-Mailer": "git-send-email 2.14.1", "In-Reply-To": "<20170916035347.19705-1-sergey.senozhatsky@gmail.com>", "References": "<20170916035347.19705-1-sergey.senozhatsky@gmail.com>", "X-BeenThere": "linuxppc-dev@lists.ozlabs.org", "X-Mailman-Version": "2.1.24", "Precedence": "list", "List-Id": "Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>", "List-Unsubscribe": "<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>", "List-Archive": "<http://lists.ozlabs.org/pipermail/linuxppc-dev/>", "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>", "List-Help": "<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>", "List-Subscribe": "<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>", "Cc": "Petr Mladek <pmladek@suse.com>, linux-ia64@vger.kernel.org,\n\tlinux-parisc@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,\n\tSteven Rostedt <rostedt@goodmis.org>, linux-kernel@vger.kernel.org,\n\tSergey Senozhatsky <sergey.senozhatsky@gmail.com>,\n\tJessica Yu <jeyu@kernel.org>, Andrew Morton <akpm@linux-foundation.org>, \n\tlinuxppc-dev@lists.ozlabs.org", "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org", "Sender": "\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>" }, "content": "Call appropriate function descriptor dereference ARCH callbacks:\n- dereference_kernel_function_descriptor() if the pointer is a\n kernel symbol;\n\n- dereference_module_function_descriptor() if the pointer is a\n module symbol.\n\nThis patch also removes dereference_function_descriptor() from\n'%pF/%pf' vsprintf handler, because it has the same behavior with\n'%pS/%ps' now.\n\nSigned-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>\n---\n Documentation/printk-formats.txt | 15 +++++----------\n kernel/kallsyms.c | 1 +\n kernel/module.c | 1 +\n lib/vsprintf.c | 5 +----\n 4 files changed, 8 insertions(+), 14 deletions(-)", "diff": "diff --git a/Documentation/printk-formats.txt b/Documentation/printk-formats.txt\nindex 361789df51ec..b2afafc84638 100644\n--- a/Documentation/printk-formats.txt\n+++ b/Documentation/printk-formats.txt\n@@ -50,26 +50,23 @@ Symbols/Function Pointers\n \n ::\n \n+\t%pS\tversatile_init+0x0/0x110\n+\t%ps\tversatile_init\n \t%pF\tversatile_init+0x0/0x110\n \t%pf\tversatile_init\n-\t%pS\tversatile_init+0x0/0x110\n \t%pSR\tversatile_init+0x9/0x110\n \t\t(with __builtin_extract_return_addr() translation)\n-\t%ps\tversatile_init\n \t%pB\tprev_fn_of_versatile_init+0x88/0x88\n \n-The ``F`` and ``f`` specifiers are for printing function pointers,\n-for example, f->func, &gettimeofday. They have the same result as\n-``S`` and ``s`` specifiers. But they do an extra conversion on\n-ia64, ppc64 and parisc64 architectures where the function pointers\n-are actually function descriptors.\n-\n The ``S`` and ``s`` specifiers can be used for printing symbols\n from direct addresses, for example, __builtin_return_address(0),\n (void *)regs->ip. They result in the symbol name with (``S``) or\n without (``s``) offsets. If KALLSYMS are disabled then the symbol\n address is printed instead.\n \n+Note, that the ``F`` and ``f`` specifiers are identical to ``S`` (``s``)\n+and thus deprecated.\n+\n The ``B`` specifier results in the symbol name with offsets and should be\n used when printing stack backtraces. The specifier takes into\n consideration the effect of compiler optimisations which may occur\n@@ -77,8 +74,6 @@ when tail-call``s are used and marked with the noreturn GCC attribute.\n \n Examples::\n \n-\tprintk(\"Going to call: %pF\\n\", gettimeofday);\n-\tprintk(\"Going to call: %pF\\n\", p->func);\n \tprintk(\"%s: called from %pS\\n\", __func__, (void *)_RET_IP_);\n \tprintk(\"%s: called from %pS\\n\", __func__,\n \t\t\t\t(void *)__builtin_return_address(0));\ndiff --git a/kernel/kallsyms.c b/kernel/kallsyms.c\nindex 127e7cfafa55..e2fc09ea9509 100644\n--- a/kernel/kallsyms.c\n+++ b/kernel/kallsyms.c\n@@ -322,6 +322,7 @@ const char *kallsyms_lookup(unsigned long addr,\n \tif (is_ksym_addr(addr)) {\n \t\tunsigned long pos;\n \n+\t\taddr = dereference_kernel_function_descriptor(addr);\n \t\tpos = get_symbol_pos(addr, symbolsize, offset);\n \t\t/* Grab name */\n \t\tkallsyms_expand_symbol(get_symbol_offset(pos),\ndiff --git a/kernel/module.c b/kernel/module.c\nindex 87cdb46863cd..4f591f2bbf5a 100644\n--- a/kernel/module.c\n+++ b/kernel/module.c\n@@ -3948,6 +3948,7 @@ const char *module_address_lookup(unsigned long addr,\n \tpreempt_disable();\n \tmod = __module_address(addr);\n \tif (mod) {\n+\t\taddr = dereference_module_function_descriptor(mod, addr);\n \t\tif (modname)\n \t\t\t*modname = mod->name;\n \t\tret = get_ksymbol(mod, addr, size, offset);\ndiff --git a/lib/vsprintf.c b/lib/vsprintf.c\nindex 86c3385b9eb3..bf04b4f5d8e7 100644\n--- a/lib/vsprintf.c\n+++ b/lib/vsprintf.c\n@@ -40,7 +40,6 @@\n #include \"../mm/internal.h\"\t/* For the trace_print_flags arrays */\n \n #include <asm/page.h>\t\t/* for PAGE_SIZE */\n-#include <asm/sections.h>\t/* for dereference_function_descriptor() */\n #include <asm/byteorder.h>\t/* cpu_to_le16 */\n \n #include <linux/string_helpers.h>\n@@ -1721,10 +1720,8 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,\n \t}\n \n \tswitch (*fmt) {\n-\tcase 'F':\n+\tcase 'F': /* %pF and %pf are kept for compatibility reasons only */\n \tcase 'f':\n-\t\tptr = dereference_function_descriptor(ptr);\n-\t\t/* Fallthrough */\n \tcase 'S':\n \tcase 's':\n \tcase 'B':\n", "prefixes": [ "5/5" ] }