Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1202930

[PATCH v9 14/20] x86/asm/crypto: Move jump_table to .rodata section

From Josh Poimboeuf <jpoimboe@redhat.com>
Newsgroups linux.kernel
Subject [PATCH v9 14/20] x86/asm/crypto: Move jump_table to .rodata section
Date 2015-08-07 19:00 +0200
Message-ID <pUT9X-5pP-61@gated-at.bofh.it> (permalink)
References <pUT9U-5pP-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


stackvalidate reports the following warning:

  stackvalidate: arch/x86/crypto/crc32c-pcl-intel-asm_64.o: crc_pcl()+0x11dd: can't decode instruction

It gets confused when trying to decode jump_table data.  Move jump_table
to the .rodata section which is a more appropriate home for read-only
data.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
---
 arch/x86/crypto/crc32c-pcl-intel-asm_64.S | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/crypto/crc32c-pcl-intel-asm_64.S b/arch/x86/crypto/crc32c-pcl-intel-asm_64.S
index 225be06..dc05f01 100644
--- a/arch/x86/crypto/crc32c-pcl-intel-asm_64.S
+++ b/arch/x86/crypto/crc32c-pcl-intel-asm_64.S
@@ -170,8 +170,8 @@ continue_block:
 	## branch into array
 	lea	jump_table(%rip), bufp
 	movzxw  (bufp, %rax, 2), len
-	offset=crc_array-jump_table
-	lea     offset(bufp, len, 1), bufp
+	lea	crc_array(%rip), bufp
+	lea     (bufp, len, 1), bufp
 	jmp     *bufp
 
 	################################################################
@@ -310,7 +310,9 @@ do_return:
 	popq    %rdi
 	popq    %rbx
         ret
+ENDPROC(crc_pcl)
 
+.section	.rodata, "a", %progbits
         ################################################################
         ## jump table        Table is 129 entries x 2 bytes each
         ################################################################
@@ -324,13 +326,11 @@ JMPTBL_ENTRY %i
 	i=i+1
 .endr
 
-ENDPROC(crc_pcl)
 
 	################################################################
 	## PCLMULQDQ tables
 	## Table is 128 entries x 2 words (8 bytes) each
 	################################################################
-.section	.rotata, "a", %progbits
 .align 8
 K_table:
 	.long 0x493c7d27, 0x00000001
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v9 00/20] Compile-time stack validation Josh Poimboeuf <jpoimboe@redhat.com> - 2015-08-07 19:00 +0200
  [PATCH v9 05/20] x86/stackvalidate: Add ignore macros Josh Poimboeuf <jpoimboe@redhat.com> - 2015-08-07 19:00 +0200
  [PATCH v9 03/20] x86/stackvalidate: Compile-time stack validation Josh Poimboeuf <jpoimboe@redhat.com> - 2015-08-07 19:00 +0200
  [PATCH v9 18/20] x86/asm: Create stack frames in rwsem functions Josh Poimboeuf <jpoimboe@redhat.com> - 2015-08-07 19:00 +0200
  [PATCH v9 16/20] x86/asm/entry: Create stack frames in thunk functions Josh Poimboeuf <jpoimboe@redhat.com> - 2015-08-07 19:00 +0200
  [PATCH v9 13/20] x86/asm/crypto: Move .Lbswap_mask data to .rodata section Josh Poimboeuf <jpoimboe@redhat.com> - 2015-08-07 19:00 +0200
  [PATCH v9 01/20] x86/asm: Frame pointer macro cleanup Josh Poimboeuf <jpoimboe@redhat.com> - 2015-08-07 19:00 +0200
  [PATCH v9 08/20] x86/paravirt: Create a stack frame in PV_CALLEE_SAVE_REGS_THUNK Josh Poimboeuf <jpoimboe@redhat.com> - 2015-08-07 19:00 +0200
  [PATCH v9 11/20] x86/xen: Add xen_cpuid() and xen_setup_gdt() to stackvalidate whitelists Josh Poimboeuf <jpoimboe@redhat.com> - 2015-08-07 19:00 +0200
  [PATCH v9 09/20] x86/amd: Set ELF function type for vide() Josh Poimboeuf <jpoimboe@redhat.com> - 2015-08-07 19:00 +0200
  [PATCH v9 14/20] x86/asm/crypto: Move jump_table to .rodata section Josh Poimboeuf <jpoimboe@redhat.com> - 2015-08-07 19:00 +0200
  [PATCH v9 15/20] x86/asm/crypto: Create stack frames in clmul_ghash_mul/update() Josh Poimboeuf <jpoimboe@redhat.com> - 2015-08-07 19:00 +0200
  [PATCH v9 20/20] x86/asm/power: Create stack frames in hibernate_asm_64.S Josh Poimboeuf <jpoimboe@redhat.com> - 2015-08-07 19:00 +0200
    Re: [PATCH v9 20/20] x86/asm/power: Create stack frames in  hibernate_asm_64.S Pavel Machek <pavel@ucw.cz> - 2015-08-09 21:20 +0200
  [PATCH v9 10/20] x86/reboot: Add ljmp instructions to stackvalidate whitelist Josh Poimboeuf <jpoimboe@redhat.com> - 2015-08-07 19:00 +0200
  [PATCH v9 04/20] x86/stackvalidate: Add file and directory ignores Josh Poimboeuf <jpoimboe@redhat.com> - 2015-08-07 19:00 +0200

csiph-web