Use __builtin_clzl on POWER

Bug #1458434 reported by Daniel Axtens
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
php
Unknown
Unknown
php5 (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Zend/zend_alloc.c uses __builtin_clzl in zend_mm_high_bit and zend_mm_low_but, but only if (defined(__arm__) || defined(__aarch64__)). This is overly restrictive: it's also usable if __defined__(__powerpc__).

This causes a bump to speed on POWER systems: previously zend_mm_high_bit shows up on perf reports, with this patch the functions drop out of the profile entirely.

This bug has also been reported upstream (https://bugs.php.net/bug.php?id=69703), but I've sent you this report, along with a `dpkg-source --commit` style patch, in the hopes that you'll pick it up, so that Ubuntu users get the performance improvement sooner.

This patch was built and tested on Vivid, but is applicable to a range of PHP versions.

Tags: patch vivid

CVE References

Revision history for this message
Daniel Axtens (daxtens) wrote :
Robie Basak (racb)
Changed in php5 (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
tags: added: patch vivid
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "__builtin_clzl.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

Revision history for this message
Robie Basak (racb) wrote :

Uploaded 5.6.11+dfsg-1ubuntu1 to Wily which includes this fix from upstream.

If you need a fix for an existing stable release, please comment with a justification against https://wiki.ubuntu.com/StableReleaseUpdates#When and complete steps 1 through 4 in https://wiki.ubuntu.com/StableReleaseUpdates#Procedure - and go ahead with all the steps if you can. Note that that SRU team would need to make a final decision.

Changed in php5 (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package php5 - 5.6.11+dfsg-1ubuntu1

---------------
php5 (5.6.11+dfsg-1ubuntu1) wily; urgency=medium

  * Merge from Debian. Remaining changes:
    - Drop support for firebird, c-client, mcrypt, onig and qdbm as they
      are in universe:
      + d/control: drop Build-Depends on firebird-dev, libc-client-dev,
        libmcrypt-dev, libonig-dev, libqdbm-dev.
      + d/control: drop binary packages php5-imap, php5-interbase and
        php5-mcrypt and their reverse dependencies.
      + d/rules: drop configuration of qdgm, onig, imap, mcrypt.
      + d/rules: drop CONFIGURE_APACHE_ARGS settings since now we don't
        build interbase or firebird.
      + d/modulelist: drop imap, interbase and mcrypt.
    - d/control: switch Build-Depends of netcat-traditional to
      netcat-openbsd as only the latter is in main.
    - d/source_php5.py, d/rules: add apport hook.
  * New upstream version uses __builtin_clzl when __powerpc__ is defined,
    improving performance on POWER systems (LP: #1458434).
  * Drop changes (patches included upstream): CVE-2015-4598.patch,
    CVE-2015-4643.patch, CVE-2015-4644.patch.

 -- Robie Basak <email address hidden> Mon, 27 Jul 2015 11:15:34 +0000

Changed in php5 (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.