Bug 1555397 - backport s390 -mpic-data-is-text-relative feature
Summary: backport s390 -mpic-data-is-text-relative feature
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: gcc
Version: 7.6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Marek Polacek
QA Contact: Michael Petlan
Vladimír Slávik
URL:
Whiteboard:
Depends On:
Blocks: 1505884
TreeView+ depends on / blocked
 
Reported: 2018-03-14 15:40 UTC by Joe Lawrence
Modified: 2018-10-30 07:28 UTC (History)
7 users (show)

Fixed In Version: gcc-4.8.5-31.el7
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
Environment:
Last Closed: 2018-10-30 07:27:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3016 0 None None None 2018-10-30 07:28:48 UTC

Description Joe Lawrence 2018-03-14 15:40:45 UTC
In order to support kpatch on s390x architecture, we'd like to have the -mpic-data-is-text-relative feature backported to RHEL7.

Quick background of how kpatch works: kpatch patches code on a per-function basis and relies on ftrace for function redirection from old to new funcs.  The patched binary code containing the new functions is placed in a kernel module, and kpatch manually applies relocations to the new code at module load time.

On s390x, things become interesting when we stick patched code for vmlinux in a kernel module. One obstacle we've run into is when the compiled code uses R_390_PC32DBL relocations, which utilize 32-bit relative displacements.  However, kernel modules are placed at the tail end of the kernel address space, rendering these relocations non-functional, since the displacement to vmlinux symbols on the other end of the address space is larger than what can fit in a 32-bit field.

To work around this issue, we worked upstream with Martin Schwidefsky and Andreas Krebbel to add 9852c8ae7856 ("S/390: New option -mpic-data-is-text-relative").  That option ensures that data references are not relative, but rather via GOT.  The change seems pretty small and hopefully easy to backport to RHEL7's gcc.

Comment 7 Michael Petlan 2018-07-17 11:11:36 UTC
Related tests passed with gcc-4.8.5-36.el7.s390x.
VERIFIED.

Comment 9 errata-xmlrpc 2018-10-30 07:27:17 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:3016


Note You need to log in before you can comment on or make changes to this bug.