diff for duplicates of <20180704075923.GF3701@osiris> diff --git a/a/1.txt b/N1/1.txt index 1e37e14..593f0d3 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -22,137 +22,3 @@ feel free to add the patch below which adds support for s390 to your series. FWIW, kernel modules on s390 are since ages more than 2GB away from the core kernel text. So this is required for s390 as well. - -From 77d87236f3d5474f33c25534d8ba2c7c54c88c55 Mon Sep 17 00:00:00 2001 -From: Heiko Carstens <heiko.carstens@de.ibm.com> -Date: Wed, 4 Jul 2018 09:13:37 +0200 -Subject: [PATCH] s390/jump_label: switch to relative references - -Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> ---- - arch/s390/Kconfig | 1 + - arch/s390/include/asm/jump_label.h | 40 +++++++++++++++----------------------- - arch/s390/kernel/jump_label.c | 11 ++++++----- - 3 files changed, 23 insertions(+), 29 deletions(-) - -diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig -index baed39772c84..0349fb06a2ec 100644 ---- a/arch/s390/Kconfig -+++ b/arch/s390/Kconfig -@@ -121,6 +121,7 @@ config S390 - select HAVE_ALIGNED_STRUCT_PAGE if SLUB - select HAVE_ARCH_AUDITSYSCALL - select HAVE_ARCH_JUMP_LABEL -+ select HAVE_ARCH_JUMP_LABEL_RELATIVE - select CPU_NO_EFFICIENT_FFS if !HAVE_MARCH_Z9_109_FEATURES - select HAVE_ARCH_SECCOMP_FILTER - select HAVE_ARCH_SOFT_DIRTY -diff --git a/arch/s390/include/asm/jump_label.h b/arch/s390/include/asm/jump_label.h -index 40f651292aa7..e2d3e6c43395 100644 ---- a/arch/s390/include/asm/jump_label.h -+++ b/arch/s390/include/asm/jump_label.h -@@ -14,41 +14,33 @@ - * We use a brcl 0,2 instruction for jump labels at compile time so it - * can be easily distinguished from a hotpatch generated instruction. - */ --static __always_inline bool arch_static_branch(struct static_key *key, bool branch) -+static inline bool arch_static_branch(struct static_key *key, bool branch) - { -- asm_volatile_goto("0: brcl 0,"__stringify(JUMP_LABEL_NOP_OFFSET)"\n" -- ".pushsection __jump_table, \"aw\"\n" -- ".balign 8\n" -- ".quad 0b, %l[label], %0\n" -- ".popsection\n" -- : : "X" (&((char *)key)[branch]) : : label); -- -+ asm_volatile_goto("0: brcl 0,"__stringify(JUMP_LABEL_NOP_OFFSET)"\n" -+ ".pushsection __jump_table,\"aw\"\n" -+ ".balign 8\n" -+ ".long 0b-.,%l[label]-.\n" -+ ".quad %0-.\n" -+ ".popsection\n" -+ : : "X" (&((char *)key)[branch]) : : label); - return false; - label: - return true; - } - --static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch) -+static inline bool arch_static_branch_jump(struct static_key *key, bool branch) - { -- asm_volatile_goto("0: brcl 15, %l[label]\n" -- ".pushsection __jump_table, \"aw\"\n" -- ".balign 8\n" -- ".quad 0b, %l[label], %0\n" -- ".popsection\n" -- : : "X" (&((char *)key)[branch]) : : label); -- -+ asm_volatile_goto("0: brcl 15,%l[label]\n" -+ ".pushsection __jump_table,\"aw\"\n" -+ ".balign 8\n" -+ ".long 0b-.,%l[label]-.\n" -+ ".quad %0-.\n" -+ ".popsection\n" -+ : : "X" (&((char *)key)[branch]) : : label); - return false; - label: - return true; - } - --typedef unsigned long jump_label_t; -- --struct jump_entry { -- jump_label_t code; -- jump_label_t target; -- jump_label_t key; --}; -- - #endif /* __ASSEMBLY__ */ - #endif -diff --git a/arch/s390/kernel/jump_label.c b/arch/s390/kernel/jump_label.c -index 43f8430fb67d..50a1798604a8 100644 ---- a/arch/s390/kernel/jump_label.c -+++ b/arch/s390/kernel/jump_label.c -@@ -33,13 +33,13 @@ static void jump_label_make_branch(struct jump_entry *entry, struct insn *insn) - { - /* brcl 15,offset */ - insn->opcode = 0xc0f4; -- insn->offset = (entry->target - entry->code) >> 1; -+ insn->offset = (jump_entry_target(entry) - jump_entry_code(entry)) >> 1; - } - - static void jump_label_bug(struct jump_entry *entry, struct insn *expected, - struct insn *new) - { -- unsigned char *ipc = (unsigned char *)entry->code; -+ unsigned char *ipc = (unsigned char *)jump_entry_code(entry); - unsigned char *ipe = (unsigned char *)expected; - unsigned char *ipn = (unsigned char *)new; - -@@ -59,6 +59,7 @@ static void __jump_label_transform(struct jump_entry *entry, - enum jump_label_type type, - int init) - { -+ void *code = (void *)jump_entry_code(entry); - struct insn old, new; - - if (type == JUMP_LABEL_JMP) { -@@ -69,13 +70,13 @@ static void __jump_label_transform(struct jump_entry *entry, - jump_label_make_nop(entry, &new); - } - if (init) { -- if (memcmp((void *)entry->code, &orignop, sizeof(orignop))) -+ if (memcmp(code, &orignop, sizeof(orignop))) - jump_label_bug(entry, &orignop, &new); - } else { -- if (memcmp((void *)entry->code, &old, sizeof(old))) -+ if (memcmp(code, &old, sizeof(old))) - jump_label_bug(entry, &old, &new); - } -- s390_kernel_write((void *)entry->code, &new, sizeof(new)); -+ s390_kernel_write(code, &new, sizeof(new)); - } - - static int __sm_arch_jump_label_transform(void *data) --- -2.16.4 diff --git a/a/content_digest b/N1/content_digest index 512c5ce..3bf89e5 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -42,140 +42,6 @@ "> is appropriate for x86 as well.\n" "\n" "FWIW, kernel modules on s390 are since ages more than 2GB away from the\n" - "core kernel text. So this is required for s390 as well.\n" - "\n" - "From 77d87236f3d5474f33c25534d8ba2c7c54c88c55 Mon Sep 17 00:00:00 2001\n" - "From: Heiko Carstens <heiko.carstens@de.ibm.com>\n" - "Date: Wed, 4 Jul 2018 09:13:37 +0200\n" - "Subject: [PATCH] s390/jump_label: switch to relative references\n" - "\n" - "Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>\n" - "---\n" - " arch/s390/Kconfig | 1 +\n" - " arch/s390/include/asm/jump_label.h | 40 +++++++++++++++-----------------------\n" - " arch/s390/kernel/jump_label.c | 11 ++++++-----\n" - " 3 files changed, 23 insertions(+), 29 deletions(-)\n" - "\n" - "diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig\n" - "index baed39772c84..0349fb06a2ec 100644\n" - "--- a/arch/s390/Kconfig\n" - "+++ b/arch/s390/Kconfig\n" - "@@ -121,6 +121,7 @@ config S390\n" - " \tselect HAVE_ALIGNED_STRUCT_PAGE if SLUB\n" - " \tselect HAVE_ARCH_AUDITSYSCALL\n" - " \tselect HAVE_ARCH_JUMP_LABEL\n" - "+\tselect HAVE_ARCH_JUMP_LABEL_RELATIVE\n" - " \tselect CPU_NO_EFFICIENT_FFS if !HAVE_MARCH_Z9_109_FEATURES\n" - " \tselect HAVE_ARCH_SECCOMP_FILTER\n" - " \tselect HAVE_ARCH_SOFT_DIRTY\n" - "diff --git a/arch/s390/include/asm/jump_label.h b/arch/s390/include/asm/jump_label.h\n" - "index 40f651292aa7..e2d3e6c43395 100644\n" - "--- a/arch/s390/include/asm/jump_label.h\n" - "+++ b/arch/s390/include/asm/jump_label.h\n" - "@@ -14,41 +14,33 @@\n" - " * We use a brcl 0,2 instruction for jump labels at compile time so it\n" - " * can be easily distinguished from a hotpatch generated instruction.\n" - " */\n" - "-static __always_inline bool arch_static_branch(struct static_key *key, bool branch)\n" - "+static inline bool arch_static_branch(struct static_key *key, bool branch)\n" - " {\n" - "-\tasm_volatile_goto(\"0:\tbrcl 0,\"__stringify(JUMP_LABEL_NOP_OFFSET)\"\\n\"\n" - "-\t\t\".pushsection __jump_table, \\\"aw\\\"\\n\"\n" - "-\t\t\".balign 8\\n\"\n" - "-\t\t\".quad 0b, %l[label], %0\\n\"\n" - "-\t\t\".popsection\\n\"\n" - "-\t\t: : \"X\" (&((char *)key)[branch]) : : label);\n" - "-\n" - "+\tasm_volatile_goto(\"0:\tbrcl\t0,\"__stringify(JUMP_LABEL_NOP_OFFSET)\"\\n\"\n" - "+\t\t\t \".pushsection __jump_table,\\\"aw\\\"\\n\"\n" - "+\t\t\t \".balign\t8\\n\"\n" - "+\t\t\t \".long\t0b-.,%l[label]-.\\n\"\n" - "+\t\t\t \".quad\t%0-.\\n\"\n" - "+\t\t\t \".popsection\\n\"\n" - "+\t\t\t : : \"X\" (&((char *)key)[branch]) : : label);\n" - " \treturn false;\n" - " label:\n" - " \treturn true;\n" - " }\n" - " \n" - "-static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch)\n" - "+static inline bool arch_static_branch_jump(struct static_key *key, bool branch)\n" - " {\n" - "-\tasm_volatile_goto(\"0:\tbrcl 15, %l[label]\\n\"\n" - "-\t\t\".pushsection __jump_table, \\\"aw\\\"\\n\"\n" - "-\t\t\".balign 8\\n\"\n" - "-\t\t\".quad 0b, %l[label], %0\\n\"\n" - "-\t\t\".popsection\\n\"\n" - "-\t\t: : \"X\" (&((char *)key)[branch]) : : label);\n" - "-\n" - "+\tasm_volatile_goto(\"0:\tbrcl 15,%l[label]\\n\"\n" - "+\t\t\t \".pushsection __jump_table,\\\"aw\\\"\\n\"\n" - "+\t\t\t \".balign\t8\\n\"\n" - "+\t\t\t \".long\t0b-.,%l[label]-.\\n\"\n" - "+\t\t\t \".quad\t%0-.\\n\"\n" - "+\t\t\t \".popsection\\n\"\n" - "+\t\t\t : : \"X\" (&((char *)key)[branch]) : : label);\n" - " \treturn false;\n" - " label:\n" - " \treturn true;\n" - " }\n" - " \n" - "-typedef unsigned long jump_label_t;\n" - "-\n" - "-struct jump_entry {\n" - "-\tjump_label_t code;\n" - "-\tjump_label_t target;\n" - "-\tjump_label_t key;\n" - "-};\n" - "-\n" - " #endif /* __ASSEMBLY__ */\n" - " #endif\n" - "diff --git a/arch/s390/kernel/jump_label.c b/arch/s390/kernel/jump_label.c\n" - "index 43f8430fb67d..50a1798604a8 100644\n" - "--- a/arch/s390/kernel/jump_label.c\n" - "+++ b/arch/s390/kernel/jump_label.c\n" - "@@ -33,13 +33,13 @@ static void jump_label_make_branch(struct jump_entry *entry, struct insn *insn)\n" - " {\n" - " \t/* brcl 15,offset */\n" - " \tinsn->opcode = 0xc0f4;\n" - "-\tinsn->offset = (entry->target - entry->code) >> 1;\n" - "+\tinsn->offset = (jump_entry_target(entry) - jump_entry_code(entry)) >> 1;\n" - " }\n" - " \n" - " static void jump_label_bug(struct jump_entry *entry, struct insn *expected,\n" - " \t\t\t struct insn *new)\n" - " {\n" - "-\tunsigned char *ipc = (unsigned char *)entry->code;\n" - "+\tunsigned char *ipc = (unsigned char *)jump_entry_code(entry);\n" - " \tunsigned char *ipe = (unsigned char *)expected;\n" - " \tunsigned char *ipn = (unsigned char *)new;\n" - " \n" - "@@ -59,6 +59,7 @@ static void __jump_label_transform(struct jump_entry *entry,\n" - " \t\t\t\t enum jump_label_type type,\n" - " \t\t\t\t int init)\n" - " {\n" - "+\tvoid *code = (void *)jump_entry_code(entry);\n" - " \tstruct insn old, new;\n" - " \n" - " \tif (type == JUMP_LABEL_JMP) {\n" - "@@ -69,13 +70,13 @@ static void __jump_label_transform(struct jump_entry *entry,\n" - " \t\tjump_label_make_nop(entry, &new);\n" - " \t}\n" - " \tif (init) {\n" - "-\t\tif (memcmp((void *)entry->code, &orignop, sizeof(orignop)))\n" - "+\t\tif (memcmp(code, &orignop, sizeof(orignop)))\n" - " \t\t\tjump_label_bug(entry, &orignop, &new);\n" - " \t} else {\n" - "-\t\tif (memcmp((void *)entry->code, &old, sizeof(old)))\n" - "+\t\tif (memcmp(code, &old, sizeof(old)))\n" - " \t\t\tjump_label_bug(entry, &old, &new);\n" - " \t}\n" - "-\ts390_kernel_write((void *)entry->code, &new, sizeof(new));\n" - "+\ts390_kernel_write(code, &new, sizeof(new));\n" - " }\n" - " \n" - " static int __sm_arch_jump_label_transform(void *data)\n" - "-- \n" - 2.16.4 + core kernel text. So this is required for s390 as well. -c294f05f200db111cb9d6c44de074337ee53fcbf21d110e232128cfdb0b7c796 +1ed992ea9c04a4d13575e6733721873de824df3be700be4ea486ba40def62cfd
diff --git a/a/1.txt b/N2/1.txt index 1e37e14..a05c911 100644 --- a/a/1.txt +++ b/N2/1.txt @@ -23,7 +23,7 @@ feel free to add the patch below which adds support for s390 to your series. FWIW, kernel modules on s390 are since ages more than 2GB away from the core kernel text. So this is required for s390 as well. -From 77d87236f3d5474f33c25534d8ba2c7c54c88c55 Mon Sep 17 00:00:00 2001 +>From 77d87236f3d5474f33c25534d8ba2c7c54c88c55 Mon Sep 17 00:00:00 2001 From: Heiko Carstens <heiko.carstens@de.ibm.com> Date: Wed, 4 Jul 2018 09:13:37 +0200 Subject: [PATCH] s390/jump_label: switch to relative references diff --git a/a/content_digest b/N2/content_digest index 512c5ce..d74786a 100644 --- a/a/content_digest +++ b/N2/content_digest @@ -1,22 +1,8 @@ "ref\020180702181145.4799-1-ard.biesheuvel@linaro.org\0" - "From\0Heiko Carstens <heiko.carstens@de.ibm.com>\0" - "Subject\0Re: [PATCH v2 0/8] add support for relative references in jump tables\0" + "From\0heiko.carstens@de.ibm.com (Heiko Carstens)\0" + "Subject\0[PATCH v2 0/8] add support for relative references in jump tables\0" "Date\0Wed, 4 Jul 2018 09:59:23 +0200\0" - "To\0Ard Biesheuvel <ard.biesheuvel@linaro.org>\0" - "Cc\0linux-arm-kernel@lists.infradead.org" - linux-kernel@vger.kernel.org - linux-s390@vger.kernel.org - linux-arch@vger.kernel.org - Arnd Bergmann <arnd@arndb.de> - Kees Cook <keescook@chromium.org> - Will Deacon <will.deacon@arm.com> - Thomas Gleixner <tglx@linutronix.de> - Catalin Marinas <catalin.marinas@arm.com> - Ingo Molnar <mingo@redhat.com> - Steven Rostedt <rostedt@goodmis.org> - Martin Schwidefsky <schwidefsky@de.ibm.com> - Jessica Yu <jeyu@kernel.org> - " Peter Zijlstra <peterz@infradead.org>\0" + "To\0linux-arm-kernel@lists.infradead.org\0" "\00:1\0" "b\0" "On Mon, Jul 02, 2018 at 08:11:37PM +0200, Ard Biesheuvel wrote:\n" @@ -44,7 +30,7 @@ "FWIW, kernel modules on s390 are since ages more than 2GB away from the\n" "core kernel text. So this is required for s390 as well.\n" "\n" - "From 77d87236f3d5474f33c25534d8ba2c7c54c88c55 Mon Sep 17 00:00:00 2001\n" + ">From 77d87236f3d5474f33c25534d8ba2c7c54c88c55 Mon Sep 17 00:00:00 2001\n" "From: Heiko Carstens <heiko.carstens@de.ibm.com>\n" "Date: Wed, 4 Jul 2018 09:13:37 +0200\n" "Subject: [PATCH] s390/jump_label: switch to relative references\n" @@ -178,4 +164,4 @@ "-- \n" 2.16.4 -c294f05f200db111cb9d6c44de074337ee53fcbf21d110e232128cfdb0b7c796 +a2e8a9de0a9648d8842116ed94e479adddfbba5da9ecafa3818c76308f9e4e52
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.