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


Groups > linux.kernel > #1341627

Re: [PATCH v8 8/8] livepatch: Detect offset for the ftrace location during build

From Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH v8 8/8] livepatch: Detect offset for the ftrace location during build
Date 2016-02-24 09:00 +0100
Message-ID <r5Cwx-1gD-9@gated-at.bofh.it> (permalink)
References (5 earlier) <r2Ld0-6Dh-13@gated-at.bofh.it> <r2Ld0-6Dh-11@gated-at.bofh.it> <r2OkB-8F-57@gated-at.bofh.it> <r30F4-d2-1@gated-at.bofh.it> <r5oDf-8rG-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


* Torsten Duwe <duwe@lst.de> [2016-02-23 18:00:17]:

> On Wed, Feb 17, 2016 at 02:08:41PM +1100, Michael Ellerman wrote:
> > 
> > That stub uses r2 to find the location of itself, but it only works if r2 holds
> > the TOC for scsi_mod.ko. In this case r2 still contains ibmvscsi.ko's TOC.
> 
> Here's my solution, a bit rough still. This replaces the module_64.c change
> from patch 2/8:
> 
> I shuffle the trampoline instructions so the R2-save-to-stack comes first.
> This allows me to construct a profiling trampoline code that
> looks very similar. The first instruction, harmful to -mprofile-kernel
> can now be replaced with a load of the *kernel* TOC value via paca.
> Arithmetic is done in r11, to keep it bitwise identical where possible.
> Likewise the result is "moved" to r12 via an addi.
> 
> What do you think?
> 

Hi Torsten,

 I hit build failure, after replacing this patch with patch 2/8 module_64.c
hunk.

  CC      arch/powerpc/kernel/module.o
  CC      arch/powerpc/kernel/module_64.o
In file included from ./arch/powerpc/include/asm/asm-offsets.h:1:0,
                 from arch/powerpc/kernel/module_64.c:30:
include/generated/asm-offsets.h:14:0: error: "NMI_MASK" redefined [-Werror]
 #define NMI_MASK 1048576 /* NMI_MASK  # */
 ^
In file included from include/linux/spinlock.h:50:0,
                 from include/linux/seqlock.h:35,
                 from include/linux/time.h:5,
                 from include/linux/stat.h:18,
                 from include/linux/module.h:10,
                 from arch/powerpc/kernel/module_64.c:21:
include/linux/preempt.h:46:0: note: this is the location of the previous definition
 #define NMI_MASK (__IRQ_MASK(NMI_BITS)     << NMI_SHIFT)
 ^
In file included from ./arch/powerpc/include/asm/asm-offsets.h:1:0,
                 from arch/powerpc/kernel/module_64.c:30:
include/generated/asm-offsets.h:148:0: error: "CLONE_VM" redefined [-Werror]
 #define CLONE_VM 256 /* CLONE_VM  # */
 ^
In file included from include/linux/sched.h:4:0,
                 from ./arch/powerpc/include/asm/elf.h:12,
                 from include/linux/elf.h:4,
                 from include/linux/module.h:15,
                 from arch/powerpc/kernel/module_64.c:21:
include/uapi/linux/sched.h:8:0: note: this is the location of the previous definition
 #define CLONE_VM 0x00000100 /* set if VM shared between processes */
 ^
In file included from ./arch/powerpc/include/asm/asm-offsets.h:1:0,
                 from arch/powerpc/kernel/module_64.c:30:
include/generated/asm-offsets.h:149:0: error: "CLONE_UNTRACED" redefined [-Werror]
 #define CLONE_UNTRACED 8388608 /* CLONE_UNTRACED  # */
 ^
In file included from include/linux/sched.h:4:0,
                 from ./arch/powerpc/include/asm/elf.h:12,
                 from include/linux/elf.h:4,
                 from include/linux/module.h:15,
                 from arch/powerpc/kernel/module_64.c:21:
include/uapi/linux/sched.h:22:0: note: this is the location of the previous definition
 #define CLONE_UNTRACED  0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */
 ^
In file included from ./arch/powerpc/include/asm/asm-offsets.h:1:0,
                 from arch/powerpc/kernel/module_64.c:30:
include/generated/asm-offsets.h:185:0: error: "NSEC_PER_SEC" redefined [-Werror]
 #define NSEC_PER_SEC 1000000000 /* NSEC_PER_SEC  # */
 ^
In file included from include/linux/time.h:7:0,
                 from include/linux/stat.h:18,
                 from include/linux/module.h:10,
                 from arch/powerpc/kernel/module_64.c:21:
include/linux/time64.h:35:0: note: this is the location of the previous definition
 #define NSEC_PER_SEC 1000000000L
 ^
In file included from ./arch/powerpc/include/asm/asm-offsets.h:1:0,
                 from arch/powerpc/kernel/module_64.c:30:
include/generated/asm-offsets.h:188:0: error: "PGD_TABLE_SIZE" redefined [-Werror]
 #define PGD_TABLE_SIZE 32768 /* PGD_TABLE_SIZE  # */
 ^
In file included from ./arch/powerpc/include/asm/book3s/64/hash.h:58:0,
                 from ./arch/powerpc/include/asm/book3s/64/pgtable.h:8,
                 from ./arch/powerpc/include/asm/mmu-hash64.h:24,
                 from ./arch/powerpc/include/asm/mmu.h:185,
                 from ./arch/powerpc/include/asm/lppaca.h:36,
                 from ./arch/powerpc/include/asm/paca.h:21,
                 from ./arch/powerpc/include/asm/hw_irq.h:42,
                 from ./arch/powerpc/include/asm/irqflags.h:11,
                 from include/linux/irqflags.h:15,
                 from include/linux/spinlock.h:53,
                 from include/linux/seqlock.h:35,
                 from include/linux/time.h:5,
                 from include/linux/stat.h:18,
                 from include/linux/module.h:10,
                 from arch/powerpc/kernel/module_64.c:21:
./arch/powerpc/include/asm/book3s/64/hash-64k.h:133:0: note: this is the location of the previous definition
 #define PGD_TABLE_SIZE (sizeof(pgd_t) << PGD_INDEX_SIZE)
 ^
cc1: all warnings being treated as errors
scripts/Makefile.build:258: recipe for target 'arch/powerpc/kernel/module_64.o' failed
make[1]: *** [arch/powerpc/kernel/module_64.o] Error 1
Makefile:950: recipe for target 'arch/powerpc/kernel' failed
make: *** [arch/powerpc/kernel] Error 2

Thanks,
Kamalesh.

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


Thread

Re: [PATCH v8 8/8] livepatch: Detect offset for the ftrace  location during build Torsten Duwe <duwe@lst.de> - 2016-02-23 18:10 +0100
  Re: [PATCH v8 8/8] livepatch: Detect offset for the ftrace location  during build Balbir Singh <bsingharora@gmail.com> - 2016-02-24 07:40 +0100
    Re: [PATCH v8 8/8] livepatch: Detect offset for the ftrace location  during build Balbir Singh <bsingharora@gmail.com> - 2016-02-24 08:00 +0100
      Re: [PATCH v8 8/8] livepatch: Detect offset for the ftrace  location during build Torsten Duwe <duwe@lst.de> - 2016-02-24 10:30 +0100
        Re: [PATCH v8 8/8] livepatch: Detect offset for the ftrace location  during build Balbir Singh <bsingharora@gmail.com> - 2016-02-24 12:30 +0100
  Re: [PATCH v8 8/8] livepatch: Detect offset for the ftrace location  during build Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> - 2016-02-24 09:00 +0100

csiph-web