{"id":1238801,"url":"http://patchwork.ozlabs.org/api/patches/1238801/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/patch/20200216193005.144157-2-jolsa@kernel.org/","project":{"id":7,"url":"http://patchwork.ozlabs.org/api/projects/7/?format=json","name":"Linux network development","link_name":"netdev","list_id":"netdev.vger.kernel.org","list_email":"netdev@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20200216193005.144157-2-jolsa@kernel.org>","list_archive_url":null,"date":"2020-02-16T19:29:48","name":"[01/18] x86/mm: Rename is_kernel_text to __is_kernel_text","commit_ref":null,"pull_url":null,"state":"changes-requested","archived":false,"hash":"c06d2dfcadfb03a941283938e1bd83bdb7d5aef8","submitter":{"id":73687,"url":"http://patchwork.ozlabs.org/api/people/73687/?format=json","name":"Jiri Olsa","email":"jolsa@kernel.org"},"delegate":{"id":77147,"url":"http://patchwork.ozlabs.org/api/users/77147/?format=json","username":"bpf","first_name":"BPF","last_name":"Maintainers","email":"bpf@iogearbox.net"},"mbox":"http://patchwork.ozlabs.org/project/netdev/patch/20200216193005.144157-2-jolsa@kernel.org/mbox/","series":[{"id":158829,"url":"http://patchwork.ozlabs.org/api/series/158829/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/list/?series=158829","date":"2020-02-16T19:29:47","name":"bpf: Add trampoline and dispatcher to /proc/kallsyms","version":1,"mbox":"http://patchwork.ozlabs.org/series/158829/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/1238801/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/1238801/checks/","tags":{},"related":[],"headers":{"Return-Path":"<bpf-owner@vger.kernel.org>","X-Original-To":"incoming-bpf@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-bpf@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org; spf=none (no SPF record)\n\tsmtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67;\n\thelo=vger.kernel.org; envelope-from=bpf-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=kernel.org"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 48LHJg2wQGz9sPK\n\tfor <incoming-bpf@patchwork.ozlabs.org>;\n\tMon, 17 Feb 2020 06:30:27 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1726652AbgBPTa0 convert rfc822-to-8bit (ORCPT\n\t<rfc822;incoming-bpf@patchwork.ozlabs.org>);\n\tSun, 16 Feb 2020 14:30:26 -0500","from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:55579 \"EHLO\n\tus-smtp-1.mimecast.com\" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org\n\twith ESMTP id S1725989AbgBPTa0 (ORCPT <rfc822; bpf@vger.kernel.org>); \n\tSun, 16 Feb 2020 14:30:26 -0500","from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com\n\t[209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id\n\tus-mta-298-in3Fuqo5OCqjY21H6HH3DA-1; Sun, 16 Feb 2020 14:30:20 -0500","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2E2EE8014D2;\n\tSun, 16 Feb 2020 19:30:18 +0000 (UTC)","from krava.redhat.com (ovpn-204-28.brq.redhat.com [10.40.204.28])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id EF7FD8574E;\n\tSun, 16 Feb 2020 19:30:13 +0000 (UTC)"],"From":"Jiri Olsa <jolsa@kernel.org>","To":"Alexei Starovoitov <ast@kernel.org>,\n\tDaniel Borkmann <daniel@iogearbox.net>","Cc":"kbuild test robot <lkp@intel.com>, netdev@vger.kernel.org,\n\tbpf@vger.kernel.org, Andrii Nakryiko <andriin@fb.com>, Yonghong Song\n\t<yhs@fb.com>, Song Liu <songliubraving@fb.com>, Martin KaFai Lau\n\t<kafai@fb.com>,         Jakub Kicinski <kuba@kernel.org>,\n\tDavid Miller <davem@redhat.com>, =?utf-8?b?QmrDtnJuIFTDtnBlbA==?=\n\t<bjorn.topel@intel.com>, John Fastabend <john.fastabend@gmail.com>,\n\tJesper Dangaard Brouer <hawk@kernel.org>, \n\tArnaldo Carvalho de Melo <acme@redhat.com>","Subject":"[PATCH 01/18] x86/mm: Rename is_kernel_text to __is_kernel_text","Date":"Sun, 16 Feb 2020 20:29:48 +0100","Message-Id":"<20200216193005.144157-2-jolsa@kernel.org>","In-Reply-To":"<20200216193005.144157-1-jolsa@kernel.org>","References":"<20200216193005.144157-1-jolsa@kernel.org>","MIME-Version":"1.0","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.11","X-MC-Unique":"in3Fuqo5OCqjY21H6HH3DA-1","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"kernel.org","Content-Type":"text/plain; charset=WINDOWS-1252","Content-Transfer-Encoding":"8BIT","Sender":"bpf-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<bpf.vger.kernel.org>","X-Mailing-List":"bpf@vger.kernel.org"},"content":"The kbuild test robot reported compile issue on x86 in one of\nthe following patches that adds <linux/kallsyms.h> include into\n<linux/bpf.h>, which is picked up by init_32.c object.\n\nThe problem is that <linux/kallsyms.h> defines global function\nis_kernel_text which colides with the static function of the\nsame name defined in init_32.c:\n\n  $ make ARCH=i386\n  ...\n  >> arch/x86/mm/init_32.c:241:19: error: redefinition of 'is_kernel_text'\n    static inline int is_kernel_text(unsigned long addr)\n                      ^~~~~~~~~~~~~~\n   In file included from include/linux/bpf.h:21:0,\n                    from include/linux/bpf-cgroup.h:5,\n                    from include/linux/cgroup-defs.h:22,\n                    from include/linux/cgroup.h:28,\n                    from include/linux/hugetlb.h:9,\n                    from arch/x86/mm/init_32.c:18:\n   include/linux/kallsyms.h:31:19: note: previous definition of 'is_kernel_text' was here\n    static inline int is_kernel_text(unsigned long addr)\n\nRenaming the init_32.c is_kernel_text function to __is_kernel_text.\n\nReported-by: kbuild test robot <lkp@intel.com>\nSigned-off-by: Jiri Olsa <jolsa@kernel.org>\n---\n arch/x86/mm/init_32.c | 14 +++++++++-----\n 1 file changed, 9 insertions(+), 5 deletions(-)","diff":"diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c\nindex 23df4885bbed..eb6ede2c3d43 100644\n--- a/arch/x86/mm/init_32.c\n+++ b/arch/x86/mm/init_32.c\n@@ -238,7 +238,11 @@ page_table_range_init(unsigned long start, unsigned long end, pgd_t *pgd_base)\n \t}\n }\n \n-static inline int is_kernel_text(unsigned long addr)\n+/*\n+ * The <linux/kallsyms.h> already defines is_kernel_text,\n+ * using '__' prefix not to get in conflict.\n+ */\n+static inline int __is_kernel_text(unsigned long addr)\n {\n \tif (addr >= (unsigned long)_text && addr <= (unsigned long)__init_end)\n \t\treturn 1;\n@@ -328,8 +332,8 @@ kernel_physical_mapping_init(unsigned long start,\n \t\t\t\taddr2 = (pfn + PTRS_PER_PTE-1) * PAGE_SIZE +\n \t\t\t\t\tPAGE_OFFSET + PAGE_SIZE-1;\n \n-\t\t\t\tif (is_kernel_text(addr) ||\n-\t\t\t\t    is_kernel_text(addr2))\n+\t\t\t\tif (__is_kernel_text(addr) ||\n+\t\t\t\t    __is_kernel_text(addr2))\n \t\t\t\t\tprot = PAGE_KERNEL_LARGE_EXEC;\n \n \t\t\t\tpages_2m++;\n@@ -354,7 +358,7 @@ kernel_physical_mapping_init(unsigned long start,\n \t\t\t\t */\n \t\t\t\tpgprot_t init_prot = __pgprot(PTE_IDENT_ATTR);\n \n-\t\t\t\tif (is_kernel_text(addr))\n+\t\t\t\tif (__is_kernel_text(addr))\n \t\t\t\t\tprot = PAGE_KERNEL_EXEC;\n \n \t\t\t\tpages_4k++;\n@@ -881,7 +885,7 @@ static void mark_nxdata_nx(void)\n \t */\n \tunsigned long start = PFN_ALIGN(_etext);\n \t/*\n-\t * This comes from is_kernel_text upper limit. Also HPAGE where used:\n+\t * This comes from __is_kernel_text upper limit. Also HPAGE where used:\n \t */\n \tunsigned long size = (((unsigned long)__init_end + HPAGE_SIZE) & HPAGE_MASK) - start;\n \n","prefixes":["01/18"]}