public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [Bug libdw/22452] New: Failed to obtain CFI data for a OP_call_frame_CFA when looking for func entrypoc in an s390 kernel module
@ 2017-11-17 14:29 brueckner at linux dot vnet.ibm.com
  2017-11-17 15:27 ` [Bug libdw/22452] " mark at klomp dot org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: brueckner at linux dot vnet.ibm.com @ 2017-11-17 14:29 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=22452

            Bug ID: 22452
           Summary: Failed to obtain CFI data for a OP_call_frame_CFA when
                    looking for func entrypoc in an s390 kernel module
           Product: elfutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libdw
          Assignee: unassigned at sourceware dot org
          Reporter: brueckner at linux dot vnet.ibm.com
                CC: elfutils-devel at sourceware dot org
  Target Milestone: ---

Created attachment 10612
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10612&action=edit
ko-func-call-frame-cfa.c

Problem
-------
The perf probe -m <mod> -V <func> fails when looking up variables for a
function defined in an s390 kernel module.  I have attached a simple test
program that performs these steps which results in problems to receive an CFI
frame.

Test Case and reproduction steps
--------------------------------

1. Iterate through the DIE to spot a particular function
2. Determine frame base attribute for that function
3. Obtain location expressions for the frame base and entry pc of the function
4. The returned location expression is a DW_OP_call_frame_cfa
5. Obtain CFI from either eh_frame or debug_frame, which fails.
6. Obtain ops from dwarf_frame_cfa()

The step 5 always fails for both, .eh_frame and debug_frame.  When using
dwarf_cfi_addrframe() on the .eh_frame, the resulting dwarf error message is
"no matching address range".

The attachment "ko-func-call-frame-cfa.c" contains this test case.  Compile and
link against ldw -lelf and issue with: ./ko-func-call-frame-cfa <func>
<module.ko>

Note that this affects kernel modules built for s390. Running the test program
against the s390 vmlinux image works fine, e.g., for the setup_arch function.

As I cannot attach binary code, you can obtain an s390 kernel module, for
example, from the kernel debuginfo packages of Fedora.  For example:

1.
https://download-ib01.fedoraproject.org/pub/fedora-secondary/releases/27/Server/s390x/debug/tree/Packages/k/kernel-debuginfo-4.13.9-300.fc27.s390x.rpm
2. rpm2cpio < kernel-debuginfo-4.13.9-300.fc27.s390x.rpm |cpio -id
3. Try to find details about the "xts_paes_crypt" function in
paes_s390.ko.debug

For example:
ko-func-call-frame-cfa xts_paes_crypt
kernel/arch/s390/crypto/paes_s390.ko.debug 
I: Looking up xts_paes_crypt@kernel/arch/s390/crypto/paes_s390.ko.debug
DIE: name=xts_paes_crypt tag=subprogram offset=58750 (0xe57e)
        low   pc: 10c18
        high  pc: 10dd6
        entry pc: 10c18
I: Frame Base: Number of locations: 1 (len=1)
I: Frame Base: Location operation 0: call_frame_cfa
E: No CFI data available

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2018-03-05 12:52 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-17 14:29 [Bug libdw/22452] New: Failed to obtain CFI data for a OP_call_frame_CFA when looking for func entrypoc in an s390 kernel module brueckner at linux dot vnet.ibm.com
2017-11-17 15:27 ` [Bug libdw/22452] " mark at klomp dot org
2017-11-17 15:38 ` brueckner at linux dot vnet.ibm.com
2017-11-17 15:44 ` brueckner at linux dot vnet.ibm.com
2017-11-17 15:53 ` mark at klomp dot org
2017-11-17 15:56 ` mark at klomp dot org
2017-11-17 16:02 ` brueckner at linux dot vnet.ibm.com
2017-11-17 16:03 ` brueckner at linux dot vnet.ibm.com
2017-11-17 16:04 ` brueckner at linux dot vnet.ibm.com
2017-11-17 16:46 ` mark at klomp dot org
2017-11-20  8:09 ` brueckner at linux dot vnet.ibm.com
2017-11-20  8:11 ` krebbel at linux dot vnet.ibm.com
2017-11-20  9:28 ` mark at klomp dot org
2017-11-20 10:08 ` krebbel at linux dot vnet.ibm.com
2017-11-20 14:00 ` brueckner at linux dot vnet.ibm.com
2017-12-10 15:45 ` [Bug libdw/22452] Extend ebl_reloc_ hooks with relocations against load address for use in libdwfl/relocate.c mark at klomp dot org
2018-03-05 12:52 ` mark at klomp dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).