Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/816360/?format=api
{ "id": 816360, "url": "http://patchwork.ozlabs.org/api/patches/816360/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20170920162910.32053-4-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": "<20170920162910.32053-4-sergey.senozhatsky@gmail.com>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20170920162910.32053-4-sergey.senozhatsky@gmail.com/", "date": "2017-09-20T16:29:05", "name": "[RFC,v2,3/7] ia64: Add .opd based function descriptor dereference", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": false, "hash": "019248630b0ed0bb8fe61aae86f9172ba677e6cf", "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/20170920162910.32053-4-sergey.senozhatsky@gmail.com/mbox/", "series": [ { "id": 4171, "url": "http://patchwork.ozlabs.org/api/series/4171/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=4171", "date": "2017-09-20T16:29:02", "name": "printk/ia64/ppc64/parisc64: let's deprecate %pF/%pf printk specifiers", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/4171/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/816360/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/816360/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 [IPv6:2401:3900:2:1::3])\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 3xy54j6gsPz9t2V\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 21 Sep 2017 02:37:25 +1000 (AEST)", "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xy54h5rnVzDqZ9\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 21 Sep 2017 02:37:24 +1000 (AEST)", "from mail-pg0-x243.google.com (mail-pg0-x243.google.com\n\t[IPv6:2607:f8b0:400e:c05::243])\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 3xy4vq4bLZzDqYG\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tThu, 21 Sep 2017 02:29:43 +1000 (AEST)", "by mail-pg0-x243.google.com with SMTP id i130so1920804pgc.0\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tWed, 20 Sep 2017 09:29:43 -0700 (PDT)", "from localhost.localdomain ([121.137.63.184])\n\tby smtp.gmail.com with ESMTPSA id\n\tc185sm8890567pfb.57.2017.09.20.09.29.37\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 20 Sep 2017 09:29:41 -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=\"jajmRc0Z\"; 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=\"jajmRc0Z\"; dkim-atps=neutral", "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gmail.com\n\t(client-ip=2607:f8b0:400e:c05::243; helo=mail-pg0-x243.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=\"jajmRc0Z\"; 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=IVAulDM2MKKdZk1OZegitOzApbierimhT0gYtTgDJWc=;\n\tb=jajmRc0ZwsnkFVu18tnfxCImmLKjOkv2J3cQnWjcnxLMLIaTxwNsBEoWzq4mqKDy2j\n\tBdNBQS+J3vJ/A70Tz8I36e13wX8ZTSL/TIWbqPvz6t6+EtYVBLN5ih/uA4xK5RRsYMt/\n\tn8hr/Bjx88YKXXN2iN65HO+GSWkfmHSrvhm+OTjeSrsZZjPyh2Z7UjQ80dRBnad19tfk\n\tAg5TQyEao/v266G6eiOaZN+HG41/1uhcW2QoLl1Pqj4Up14jQeYLapwZV2lxzNO4hqqB\n\taTlOZ3FT5cJu35ilAUPt00B+cIJx+yhrQkwI74Rex4ARpVENszlSJ+dVajmIuOKOjhD/\n\t2dtw==", "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=IVAulDM2MKKdZk1OZegitOzApbierimhT0gYtTgDJWc=;\n\tb=ne2jyuPYwDQsGIkkiQJzEdzoJOgBGKumf3fH27N4cOuor55UflULq2RVewnda+6D7w\n\t/fz44fQJEb7jwCCNIiMUzwyhfzpHna73DAWkuX6RQk7HEzxyROVX/q9oIFjQul0HyM9M\n\tsb5I7ASC/KHbPxNiqxNgPrB7Gulat2NE0EzpmHcuxCRe63wIEBzKl3D8E1AWurduAL/p\n\t705aDTGJVATMBwftnnNBQcUqJ3AlDz7mm1g2EEozUm2vHPyLRp4Z7MXDNvxqpf7EIrEO\n\tZjwxGSB/VwwHd2m4QcdzKMlJCTzaDy0QpW6QDmMoK6pMyC/I8za/yRUuN2zLyIn4u/AK\n\t3f1g==", "X-Gm-Message-State": "AHPjjUhwMv2GvjeH+OwpYmdBMV2b2T1JkErgciqd90qWm0z2P4DC+Ybu\n\t+DKDiKkx/pigVPso9QuJShQ=", "X-Google-Smtp-Source": "AOwi7QBP83WtIrL8LGb2FGXLigRnemasRkz5paUxfjDZz+Z9pZJ3qIlcuPqNOuhInxK7aoVNubFARg==", "X-Received": "by 10.99.123.17 with SMTP id w17mr2779371pgc.57.1505924981970;\n\tWed, 20 Sep 2017 09:29:41 -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\tJames Bottomley <jejb@parisc-linux.org>, Helge Deller <deller@gmx.de>", "Subject": "[RFC][PATCH v2 3/7] ia64: Add .opd based function descriptor\n\tdereference", "Date": "Thu, 21 Sep 2017 01:29:05 +0900", "Message-Id": "<20170920162910.32053-4-sergey.senozhatsky@gmail.com>", "X-Mailer": "git-send-email 2.14.1", "In-Reply-To": "<20170920162910.32053-1-sergey.senozhatsky@gmail.com>", "References": "<20170920162910.32053-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": "We are moving towards separate kernel and module function descriptor\ndereference callbacks. This patch enables it for IA64.\n\nFor pointers that belong to the kernel\n- Added __start_opd and __end_opd pointers, to track the kernel\n .opd section address range;\n\n- Added dereference_kernel_function_descriptor(). Now we\n will dereference only function pointers that are within\n [__start_opd, __end_opd];\n\nFor pointers that belong to a module\n- Added dereference_module_function_descriptor() to handle module\n function descriptor dereference. Now we will dereference only\n pointers that are within [module->opd.start, module->opd.end].\n\nSigned-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>\n---\n arch/ia64/include/asm/sections.h | 10 +++++++++-\n arch/ia64/kernel/module.c | 13 +++++++++++++\n arch/ia64/kernel/vmlinux.lds.S | 2 ++\n 3 files changed, 24 insertions(+), 1 deletion(-)", "diff": "diff --git a/arch/ia64/include/asm/sections.h b/arch/ia64/include/asm/sections.h\nindex de6bfa1ef8fb..3ba7ce9d8bc8 100644\n--- a/arch/ia64/include/asm/sections.h\n+++ b/arch/ia64/include/asm/sections.h\n@@ -37,6 +37,14 @@ static inline unsigned long dereference_function_descriptor(unsigned long ptr)\n \treturn ptr;\n }\n \n+#undef dereference_kernel_function_descriptor\n+static inline unsigned long\n+dereference_kernel_function_descriptor(unsigned long addr)\n+{\n+\tif (addr < (unsigned long)__start_opd ||\n+\t\t\taddr >= (unsigned long)__end_opd)\n+\t\treturn addr;\n+\treturn dereference_function_descriptor(addr);\n+}\n \n #endif /* _ASM_IA64_SECTIONS_H */\n-\ndiff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c\nindex d1d945c6bd05..0741ae6fa957 100644\n--- a/arch/ia64/kernel/module.c\n+++ b/arch/ia64/kernel/module.c\n@@ -35,6 +35,7 @@\n \n #include <asm/patch.h>\n #include <asm/unaligned.h>\n+#include <asm/sections.h>\n \n #define ARCH_MODULE_DEBUG 0\n \n@@ -917,3 +918,15 @@ module_arch_cleanup (struct module *mod)\n \tif (mod->arch.core_unw_table)\n \t\tunw_remove_unwind_table(mod->arch.core_unw_table);\n }\n+\n+unsigned long\n+dereference_module_function_descriptor(struct module *mod, unsigned long addr)\n+{\n+\tElf64_Shdr *opd = mod->arch.opd;\n+\n+\tif (addr < opd->sh_addr ||\n+\t\t\taddr >= (opd->sh_addr + opd->sh_size))\n+\t\treturn addr;\n+\n+\treturn dereference_function_descriptor(addr);\n+}\ndiff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S\nindex 798026dde52e..f872ba5ff82a 100644\n--- a/arch/ia64/kernel/vmlinux.lds.S\n+++ b/arch/ia64/kernel/vmlinux.lds.S\n@@ -107,7 +107,9 @@ SECTIONS {\n \tRODATA\n \n \t.opd : AT(ADDR(.opd) - LOAD_OFFSET) {\n+\t\t__start_opd = .;\n \t\t*(.opd)\n+\t\t__end_opd = .;\n \t}\n \n \t/*\n", "prefixes": [ "RFC", "v2", "3/7" ] }