Commit graph

26687 commits

Author SHA1 Message Date
Treehugger Robot
fce5dae8a3 Merge "Make the resolver retry timeout configurable via __res_params" 2018-08-10 01:55:09 +00:00
Treehugger Robot
a2650eaf1c Merge "seccomp: Allow read(2) and getdents(2) in x86_64 for UBSan's sake" 2018-08-09 23:47:14 +00:00
Treehugger Robot
f0fae7d8e5 Merge "Use double-precision routines from arm-optimized-routines" 2018-08-09 21:42:18 +00:00
Luis Hector Chavez
ea82982b87 seccomp: Allow read(2) and getdents(2) in x86_64 for UBSan's sake
This change allows the use of read(2) and getdents(2) so that UBSan can
work correctly on x86_64.

Bug: 111999822
Test: CtsWrapWrapDebugTestCases
Change-Id: I44aac17fffdffc5c3f5d87fb3d876af28c8044b2
2018-08-09 12:32:01 -07:00
Adhemerval Zanella
f6b101d3ec Use double-precision routines from arm-optimized-routines
This patch ues exp, exp2, log, log2, and pow from arm optimized
routines.  For pow on x86_64, although slight slower it simplifies
the code required on both bionic and arm-optimized-routines (so
there is no need to select and export the symbol based on
architecture).

Performance-wise the improvements are:

  x86_64    throughput    latency
  exp            1.16x      1.16x
  log            1.08x      0.95x
  exp2           1.27x      1.55x
  log2           1.40x      1.43x
  pow            0.77x      0.89x *

  * I tried to check if AVX2/FMA but without success.

  aarch64   throughput     latency
  exp            2.33x      2.16x
  exp2           1.99x      1.50x
  log            1.79x      1.43x
  log2           2.15x      1.80x
  pow            3.81x      3.07x

Test: ran bionic tests on static mode.
Change-Id: Ib16bf3280c5329fd257a3b3f0b6c4f2f3cb34deb
2018-08-09 11:22:24 -03:00
Treehugger Robot
3652bcd775 Merge "Add pow benchmark" 2018-08-09 02:27:33 +00:00
Treehugger Robot
de8eb12517 Merge "Move unique_fd fdsan tests into bionic." 2018-08-09 02:14:48 +00:00
Josh Gao
7266e91f62 Move unique_fd fdsan tests into bionic.
EXPECT_DEATH requires special handling to work with fdsan, because of
our fork detection. Instead of duplicating the EXPECT_FDSAN_DEATH macro
in the libbase tests as well, move the unique_fd fdsan tests here.

Test: bionic_unit_tests
Change-Id: Ia7b65d4560601d5a78d143aced887a6773b401c0
2018-08-09 01:09:08 +00:00
Treehugger Robot
24c0eb1f30 Merge "Add log and log2 benchmark" 2018-08-09 00:33:42 +00:00
Adhemerval Zanella
72fe1c8df6 Add pow benchmark
As for exp/exp2 benchmark, this patch add two benchmark for pow:
one which measures thoughput and one which measures latency.

The input data is the same as powf.

Test: ran 32-bit and 64-bit x86 tests on host
Change-Id: I04335fac9e76fb3f39935323dacf6b7be6a6f917
2018-08-08 18:04:48 -03:00
Adhemerval Zanella
56f4511c39 Add log and log2 benchmark
Similar to exp/exp2, this patch add two benchmarks for log and log2:
one which measures thoughput and one which measures latency.

The input data is based on logf/log2f one (reduced trace based on 2.8
billion samples extracted from specpu2017 521.wrf_r benchmark).

Test: ran 32-bit and 64-bit x86 tests on host

Change-Id: I51a9e2960e45d5619585e685eaa7634cc7be901b
2018-08-08 18:04:48 -03:00
Treehugger Robot
099835ad2a Merge "Add exp and exp2 benchmark" 2018-08-08 20:18:16 +00:00
Adhemerval Zanella
10d330af34 Add exp and exp2 benchmark
This patch add two benchmarks for both exp and exp2, one which measures
thoughput and one which measures latency. The latency benchmark works by
creating a dependency on the previous iteration and with a zero multiply
to avoid changing the input value.

The input is based on expf/exp2f benchmark (reduced trace based on 2.4
billion samples extracted from specpu2017 521.wrf_r benchmark).

Test: ran 32-bit and 64-bit x86 tests on host
2018-08-08 15:06:09 -03:00
Elliott Hughes
b7b2884a21 Merge "Reland "Retire GCC FORTIFY."" 2018-08-08 15:26:37 +00:00
Bernie Innocenti
58d13622a5 Make the resolver retry timeout configurable via __res_params
The primary motivation is speeding up tests for non-responsive
nameservers. It's also base infrastructure for future work to compute
retry timeouts dynamically.

Using default timeouts (RES_TIMEOUT = 5 seconds):
  ResolverTest.GetAddrInfoV6_nonresponsive (45141 ms)

With base_timeout_msec=100:
  ResolverTest.GetAddrInfoV6_nonresponsive (1264 ms)

Test: executed unsubmitted test from aosp/713993
Change-Id: Id902089ca69ca8d28032180ba51e8937262ef490
2018-08-08 15:45:19 +09:00
Treehugger Robot
f2fb3b11c6 Merge "seccomp: Generate the policy files at compile time" 2018-08-07 13:17:42 +00:00
Josh Gao
16d705671b Merge changes from topic "fdsan_debuggerd"
* changes:
  fdsan: expose the address of the table to the platform.
  fdsan: minor refactoring.
2018-08-07 10:02:16 +00:00
Josh Gao
e16082f717 fdsan: expose the address of the table to the platform.
Let the debuggerd handler get the address of the fdsan table so that
crash_dump can parse it and print it out in tombstones.

Test: debuggerd `pidof adbd`
Change-Id: I2297200cae52d0ff24479dba55d1ab4938583501
2018-08-06 18:48:52 -07:00
Josh Gao
e6dab7b55f fdsan: minor refactoring.
Make it easier for other code to parse the fdsan table themselves by
making it so that they can include the bionic_fdsan.h header to get a
struct definition with the layout without bringing in other
dependencies.

Test: treehugger
Change-Id: I3583ef113991234aa83cd193a4eb139ad06737c7
2018-08-06 18:47:29 -07:00
Treehugger Robot
fc97dafa86 Merge "fdsan: enable by default." 2018-08-07 00:08:43 +00:00
Christopher Ferris
9f93f22d7e Merge "Fix libc assembler documentation."
am: 5c14bf3932

Change-Id: I4376b8d8689a4e07c85d23d8a0097bbde4c2ca03
2018-08-06 15:32:27 -07:00
Josh Gao
4b7c1cc13f fdsan: enable by default.
Test: adb shell crasher fdsan_file
Change-Id: I6be0f7372ddb9d622a0bd8d1eeb80a4f747c99e3
2018-08-06 15:11:08 -07:00
Christopher Ferris
5c14bf3932 Merge "Fix libc assembler documentation." 2018-08-06 21:25:02 +00:00
Christopher Ferris
a473be2395 Fix libc assembler documentation.
Test: NA
Change-Id: I71485a3a44a56f2ff7ed590aec171464b57f56f6
2018-08-06 12:18:32 -07:00
Elliott Hughes
e9a8aa6515 Merge "Make all popen(3) file descriptors O_CLOEXEC."
am: f80e3f4413

Change-Id: I151a5abcc99acdecf4cbd6ccd369a30e31b15941
2018-08-06 12:05:24 -07:00
Elliott Hughes
f80e3f4413 Merge "Make all popen(3) file descriptors O_CLOEXEC." 2018-08-06 18:43:40 +00:00
Luis Hector Chavez
fa09b3c754 seccomp: Generate the policy files at compile time
This change avoids having to run the genseccomp.py script every time a
policy file is edited, and instead generates these files at
compile-time.

Bug: None
Test: m
Test: find out/soong/ -name x86_64_global_policy.cpp  # Shows files
Test: generated policies are equivalent to original policies
Change-Id: I12461fe0c5fb02c008c1b2503fbb994b8aa2f56b
2018-08-06 11:10:25 -07:00
Elliott Hughes
7601130f0e Merge "Revert "Move android-changes-for-ndk-developers.md into docs/.""
am: 782cd01b09

Change-Id: I0a1037287fc26b6148a93f419830e4a96abd1a08
2018-08-06 10:57:51 -07:00
Treehugger Robot
782cd01b09 Merge "Revert "Move android-changes-for-ndk-developers.md into docs/."" 2018-08-06 17:27:31 +00:00
Elliott Hughes
74866e160d Revert "Move android-changes-for-ndk-developers.md into docs/."
This reverts commit 1975196c87.

Reason for revert: https://android.googlesource.com/ doesn't follow symlinks :-(

Change-Id: I58038a03388ab5257d301debb494ce354013acfe
2018-08-06 15:40:04 +00:00
Luis Hector Chavez
c43bff9b8e Merge "genseccomp.py: Add a way to better find the clang prebuilt"
am: ea6aff66fa

Change-Id: I2b22aa39ef49dbc78f64e4f1310c184198a5455b
2018-08-03 20:02:20 -07:00
Treehugger Robot
ea6aff66fa Merge "genseccomp.py: Add a way to better find the clang prebuilt" 2018-08-04 02:54:36 +00:00
Josh Gao
321fb4a186 Merge "fdsan: improve errors some more."
am: 7245c08265

Change-Id: Iad4f079c88ad1a6585ea8a6aa99869a7666f4e8e
2018-08-03 17:24:29 -07:00
Treehugger Robot
7245c08265 Merge "fdsan: improve errors some more." 2018-08-04 00:14:46 +00:00
Ryan Prichard
121c824df7 Merge "Remove old workaround for unloading unversioned soinfo"
am: 594e594f05

Change-Id: Icabf9d448adcf99cd6b32d2f3018d3ee322385e6
2018-08-03 16:56:53 -07:00
Treehugger Robot
594e594f05 Merge "Remove old workaround for unloading unversioned soinfo" 2018-08-03 23:25:53 +00:00
Yi Kong
b9b97393a7 Merge "Modernize codebase by replacing NULL with nullptr"
am: 35bb46188c

Change-Id: I0d021686fff922b5750c66c60a66e460dc55615e
2018-08-03 16:10:36 -07:00
Luis Hector Chavez
7c1d7d4650 Merge "seccomp: Allow readlink(2) in x86_64 for UBSan's sake"
am: d7d5c9778d

Change-Id: I722eb02c2568693cbbbf7adad642fdd0c0a74c40
2018-08-03 16:07:42 -07:00
Elliott Hughes
9b6fefd89b Make all popen(3) file descriptors O_CLOEXEC.
POSIX says "The popen() function shall ensure that any streams from
previous popen() calls that remain open in the parent process are closed
in the new child process". It doesn't appear to disallow all popen(3) file
descriptors from being O_CLOEXEC, and it's not obvious why anyone would want
them inherited. Let's see if we can make the stricter guarantee...

Bug: N/A
Test: ran tests
Change-Id: I2c85170d730b211637afb8ba10df150ca3237262
2018-08-03 15:54:18 -07:00
Josh Gao
08b7a4008f fdsan: improve errors some more.
Add handling for all 4 cases of failure of exchange_owner_tag. Also,
mask off and sign extend the type byte of the owner tag, and add a
test for that.

Test: bionic_unit_tests
Change-Id: Ic7c49f0ee5498623f05c49b5b4cd055db48a4b9f
2018-08-03 15:03:41 -07:00
Ryan Prichard
006d137d0d Remove old workaround for unloading unversioned soinfo
This code path is/was a workaround for poorly-behaved apps. AFAIK it isn't
needed anymore.

The (needed != nullptr) condition should have been (needed == nullptr), so
rather than unload a library, it tends to do nothing instead. If it can't
find the library, it would segfault.

Bug: http://b/112154263
Test: /data/nativetest/bionic-unit-tests/bionic-unit-tests
Test: /data/nativetest/linker-unit-tests/linker-unit-tests32
Test: apply patch to pi-dev, verify that apps from b/72143978 still work
Change-Id: Ic598cb3dcead9f88005764a9b8746ed6b35f5f38
2018-08-03 13:50:29 -07:00
Yi Kong
35bb46188c Merge "Modernize codebase by replacing NULL with nullptr" 2018-08-03 20:07:44 +00:00
Treehugger Robot
d7d5c9778d Merge "seccomp: Allow readlink(2) in x86_64 for UBSan's sake" 2018-08-03 20:03:36 +00:00
Luis Hector Chavez
fd3f6d7126 genseccomp.py: Add a way to better find the clang prebuilt
This change makes it possible to invoke this tool without having to
fiddle with the path.

Bug: None
Test: ./bionic/libc/tools/genseccomp.py  # Succeeded
Change-Id: Ib24d70abc973fe774cda4209e46a5b66ae7617be
2018-08-03 12:57:21 -07:00
Elliott Hughes
8c8d3ba37d Merge "Start using libarm-optimized-routines in libm."
am: e2cab6422a

Change-Id: I2b16dc5d11bd970ec20163110e1372ebdef90310
2018-08-03 10:57:09 -07:00
Treehugger Robot
e2cab6422a Merge "Start using libarm-optimized-routines in libm." 2018-08-03 17:48:33 +00:00
Luis Hector Chavez
ef1a34c85d seccomp: Allow readlink(2) in x86_64 for UBSan's sake
This change allows the use of readlink(2) so that UBSan can work
correctly on x86_64.

Bug: 111999822
Test: CtsWrapWrapDebugTestCases
Change-Id: I7f3013c712e3e41567a0d8e1bbb9d378c04b4433
2018-08-03 10:36:02 -07:00
Yi Kong
32bc0fcf69 Modernize codebase by replacing NULL with nullptr
Fixes -Wzero-as-null-pointer-constant warning.

Test: m
Bug: 68236239
Change-Id: I5b4123bc6709641315120a191e36cc57541349b2
2018-08-02 18:09:44 -07:00
Christopher Ferris
3529b35e3f Merge "Add doc about verifying libc assembler routines."
am: 65f82092a1

Change-Id: Ia441eda52d7f77b00058382c7ca482a46ea2725e
2018-08-02 12:40:15 -07:00
Christopher Ferris
65f82092a1 Merge "Add doc about verifying libc assembler routines." 2018-08-02 19:27:05 +00:00