aboutsummaryrefslogtreecommitdiff
path: root/vm/native
Commit message (Collapse)AuthorAgeFilesLines
* dalvik: use memmove_words for word atomic memmoveWei Wang2014-07-231-4/+4
| | | | | | use memmove_words for word atomic memmove Change-Id: Ife31c217f7038f5054969b4bbe1108b351881b3b
* Remove old fork-and-specialize APIDave Platt2014-02-211-18/+1
| | | | | | | | | As promised, this is the cleanup patch-set which removes the old native "fork and specialize" API, which has been replaced by a slightly-enhanced one which can close the Zygote socket descriptors in the Zygote child. Change-Id: I33f504afd242e268863270139b4e421d4b0728f2
* Finish fixing Zygote descriptor leakage problemDave Platt2014-02-211-3/+76
| | | | | | | | | | | | | | | | | | In order to prevent Zygote descriptors from leaking into the child environment, they should be closed by the forked-off child process before the child switches to the application UID. These changes close the descriptors via dup2(), substituting a descriptor open to /dev/null in their place; this allows the Zygote Java code to close the FileDescriptor objects cleanly. This is a multi-project change: dalvik, art, libcore, frameworks/base, and external/sepolicy are affected. The CLs need to be approved together, lest the build break or the software fail to boot. Round 2: whitespace Bug: 12114500 Change-Id: I989c83291d0c42d4cad63f24a3e98a93e231c9d3
* setting RLIMIT to INFINITY.Uday Kumar Sundar2014-01-281-1/+12
| | | | | | This is to generate coredumps for processes spawned by zygote Change-Id: I2dbac76fbcaa7be3845ba5e12ad064548a25e2e3
* A char array copy optimization (dalvik).Hiroshi Yamauchi2014-01-191-0/+37
| | | | | | | | Bug: 7103825 (cherry picked from commit dc6cb9c7cb4ef636aa6f542615410b56a67b94dc) Change-Id: I0b8ab789ffb8702bc134b32398c120cc3ed29b9c
* Retry mount() if it fails with EINTRKoji Fukui2013-12-211-3/+6
| | | | | | | mount() may fail EINTR, and when it does this causes dalvik to crash. Use the regular retry macro to avoid these problems. Change-Id: I436fe4f0fab36c8172b43b8b9caedcb6d8167a4f
* dalvik: use bioinc memmoveWei Wang2013-12-211-0/+5
| | | | | | use memmove from bioinc if it is halfword atomic. Change-Id: I81c38c2b504483b69b0b1c1e4ffb63cb81d347d5
* Use RETURN_PTR(NULL) instead of RETURN_VOID in newNonMovableArray.Mathieu Chartier2013-12-181-3/+3
| | | | | | | | RETURN_VOID doesn't set the return value. This means that we are returning random garbage when the allocation doesn't succeed. Bug: 11971220 Change-Id: I570562c7bb9dc573161294916f582709774b35fd
* Set Processes comm name to package nameWilliam Roberts2013-12-181-0/+8
| | | | | | | | | | | When debugging audit logs, it is often helpful to have the packages name. Bear in mind that the package name is the right most chars up to TASK_COMM_LEN. Although a possibility of truncation exists, it can be useful for narrowing down the possibilities. Change-Id: Ia735b03f64352d155f8b96e1d47f48e6519b1d4f
* Merge branch 'kk_2.7_rb1.11' of git://codeaurora.org/platform/dalvik into ↵Steve Kondik2013-11-301-5/+7
|\ | | | | | | cm-11.0
| * Use 64-bit Linux capabilities when starting ZygoteDavid Ng2013-11-081-5/+7
| | | | | | | | | | | | | | Enable 64-bit capabilities when starting Zygote to allow >32-bit capabilties to be set, such as CAP_BLOCK_SUSPEND. Change-Id: I2821a2a393dc521c7b99a7283ba17b3ae3b375fd
| * GC triggering performance optimizationsWei Wang2013-10-311-0/+36
| | | | | | | | | | | | | | | | | | | | Copy the correct starting heap size at process init. Interfaces to set GC/managed heap parameters. Change-Id: I454b1985a3225d7dbdea9c5d4e6f0c9f5e24352e (cherry picked from commit ea59f91c8559dee1710f38a27db10f76f4753fea) (cherry picked from commit 12fc949d46e988ce6877ad4c60f5fc983c5dc202) (cherry picked from commit 73a1dac0b14ab5159453c2d696049e233e7476b0)
* | Merge tag 'android-4.4_r1' into cm-11.0Ricardo Cerqueira2013-11-016-135/+521
|\| | | | | | | Android 4.4 Release 1.0
| * Fix static method preloadingBrian Carlstrom2013-10-161-9/+11
| | | | | | | | | | | | Bug: 11045348 Change-Id: Ib13f96563f3b7ead17620e409735a0e9abb2a109
| * Preload DexCachesBrian Carlstrom2013-10-081-1/+314
| | | | | | | | | | Bug: 11045348 Change-Id: I287703eaa964dcbd2e8d5a6c7db7ac378e19e2c1
| * Invert sense of a test.Ian Rogers2013-09-241-1/+1
| | | | | | | | | | | | Bug 10907247 Change-Id: I0665cce648dd892db4cc59e82c325b376dad97dd
| * Narrow the scope of a lock on dex to avoid deadlock.Ian Rogers2013-09-231-5/+6
| | | | | | | | | | Bug: 10899202. Change-Id: I6247f895a11b41a70d7f43562d868dd91e8b1a91
| * Remove OBB bind mounts, now provided by FUSE.Jeff Sharkey2013-09-101-21/+1
| | | | | | | | | | | | | | | | | | | | The OBB storage area is now presented on a per-user basis by the FUSE daemon, so we no longer need to create bind mounts. (In fact, we must use the FUSE daemon since it now correctly synthesizes UID ownership on a per-user basis.) Bug: 10506809 Change-Id: I2d6c5643d7c89d7a15ceb28af871e44618ad33ad
| * Change IsMethodTracingActive to GetMethodTracingMode.Jeff Hao2013-08-301-6/+6
| | | | | | | | | | | | | | | | | | | | This allows traceview to tell whether tracing is active, and whether it is sampling or method tracing. Bug: 9968521 Change-Id: I72100d1536ea3168998110ec1cfa5a183b55a67c (cherry picked from commit 9d3a0a2e253aecd07c4a053c19cf9b0ccaa2db49)
| * Add dalvik support for sample profiling from traceview gui.Jeff Hao2013-08-281-30/+59
| | | | | | | | | | | | (cherry picked from commit 86bb14a3e4d7ef3b8b4240bbc2a8b989a1b8c7c0) Change-Id: Ifece45f6a6644c20b6681a58dd3eae3534ad47e4
| * Tracking DexFile rename of defineClass to defineClassNativeBrian Carlstrom2013-08-141-8/+8
| | | | | | | | | | Bug: 9071417 Change-Id: I49429db9bde41065281512915cd1fbb18de6f951
| * If CheckJNI is enabled don't allow app workaroundsIan Rogers2013-08-131-3/+7
| | | | | | | | | | | | (cherry picked from commit 46963dff1d1592729ba1e8b274835bf6c80a50bd) Change-Id: I2d054bf0824ec8378291d2035fc0586c6ec9aa2e
| * Remove updateProcessState.Mathieu Chartier2013-08-101-9/+0
| | | | | | | | Change-Id: I46588f15f92c8298130c49773951c62b05b44a4f (cherry picked from commit 6d6dfeaa7f9d22fcf323f35712ab82d541ca3030)
| * Merge "Show size/alloc/free per Dalvik heap space in dumpsys"Brian Carlstrom2013-07-311-0/+40
| |\
| | * Show size/alloc/free per Dalvik heap space in dumpsysHiroshi Yamauchi2013-07-311-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the heap size/alloc/free stats to the Dalvik heap space breakdown section in dumpsys meminfo. Also, now the zygote heap has a distict ashmem region name. Bug: 9532137 Bug: 8266259 (cherry picked from commit 3edfe0b32753309ad7dcccd894239cb0a8aefb85) Change-Id: I9b32727e4211f571a5205b6b7281958514d245d4
| * | am 58de514b: Merge "Fix Class.getDex."Elliott Hughes2013-07-311-1/+1
| |\ \ | | |/ | |/| | | | | | | * commit '58de514b160674a483bcb912d367072c7354cc1e': Fix Class.getDex.
| | * Fix Class.getDex.Elliott Hughes2013-07-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Dalvik doesn't check its own .so when looking for JNI methods, so manually register Class.getDex. Also fix a bug in that native method's implementation. Change-Id: Ic87484fac888e9eea0e5d51a2d2447eee860ece5
| | * Implement the dalvik side of libcore.reflect.Elliott Hughes2013-07-291-1/+47
| | | | | | | | | | | | | | | | | | (Cherry-pick of b4d5cf78d4731ffc6211d07a0d69c92c559ba792.) Change-Id: I5d1b41f029c9c49a2d60a066a5fb0ed0f52f4b52
| * | Implement the dalvik side of libcore.reflect.Elliott Hughes2013-07-251-1/+47
| | | | | | | | | | | | Change-Id: I9ef0da6f715e2727d8530aa7a8edee97b5bfa48d
| * | Add updateProcessState to VMRuntimeMathieu Chartier2013-07-181-0/+9
| | | | | | | | | | | | | | | | | | | | | updateProcessState is called from the ActivityManager. It is used in ART to help determine GC behavior. Change-Id: I65662708ffd8443fff0c3d0e320bf8922e22d7cf
| * | Backport native allocation tracking.Mathieu Chartier2013-07-161-0/+29
| | | | | | | | | | | | | | | | | | | | | From: https://googleplex-android-review.googlesource.com/#/c/328818/ Change-Id: I5a930e629c5a2062f01f870b4a44dcd98cb4ffe9
| * | add dalvik.system.VMRuntime.vmLibrary implementation for DalvikBrian Carlstrom2013-07-091-0/+8
| |/ | | | | | | | | | | (cherry picked from commit 70c799fc91564b497dedc408943065ed58a275bb) Change-Id: I8392e9f9dd92420b5d5c61f83a32fae6e23ebee3
| * Lose System.currentTimeMillis, nanoTime, and mapLibraryName to the library.Elliott Hughes2013-06-071-65/+0
| | | | | | | | | | | | (cherry picked from commit 0f526895f34904784e3d2ef964b016d2764cb662) Change-Id: I4f6f22e782e58a9b21af68aab1cebc21b3437976
| * vm: vmruntime: remove obsolete dependency on array.hDima Zavin2013-05-071-1/+0
| | | | | | | | | | Change-Id: Ib1a0143752e701bf2f1e0b7edb4ea7829aa4edc3 Signed-off-by: Dima Zavin <dima@android.com>
| * Fix a leak in Dalvik_dalvik_system_DexFile_openDexFileYou Kim2013-04-031-0/+1
| | | | | | | | Change-Id: I2b394c620af31914606763b35847b7f412774cf4
* | Revert "Zygote: Restrict slave mountspace so Dalvik apps can mount ↵Mike Kasick2013-09-031-22/+0
| | | | | | | | | | | | | | | | | | | | | | system-wide volumes" No longer needed as su calls piped through the Superuser daemon run outside zygote mountspaces. This reverts commit a4c574321cfe9d874e69d365b1326ccc27f4e9dd. Change-Id: I39ad8842604b5067dc3e735bcbe5fce1f3454ca8
* | GC triggering performance optimizationsWei Wang2013-07-251-0/+36
| | | | | | | | | | | | | | Copy the correct starting heap size at process init. Interfaces to set GC/managed heap parameters. Change-Id: I454b1985a3225d7dbdea9c5d4e6f0c9f5e24352e
* | Zygote: Restrict slave mountspace so Dalvik apps can mount system-wide volumesMike Kasick2013-07-241-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Android 4.2 implements multi-user storage using per-process mount namespaces. Originally, everything under "/" (the entire filesystem hierarchy) is marked as a recursive-slave mountspace for all zygote instances. This is done so that user-storage sandbox mounts under /storage/emulated are hidden from other apps and users. Unfortunately this means that any Dalvik app (actually, any program whose clone/fork ancestry includes a Dalvik zygote, which is everything except services spawned directly from init) cannot mount system-wide volumes. Thus, apps like CifsManager are effectively broken in Android 4.2, since its cifs mounts are only visible to the CifsManager app itself. All other apps see empty mountpoints instead of the mounted volume. Furthermore, Linux provides no provision for a process to "escape" a recursive-slave mountspace in versions prior to Linux 3.8 (setns syscall). Here, we restrict the slave mountspace to /storage (and, due to a possible kernel bug, /mnt/shell/emulated) so that Dalvik apps can mount system-wide volumes elsewhere (with appropriate permission, as in earlier versions of Android), while retaining full multi-user storage compatibility. This change requires that a tmpfs volume is mounted as /storage in init.rc. If this volume is unavailable, then Zygote falls back to the previous behavior of marking the entire filesystem hierarchy as slave. It also implicitly requires that EMULATED_STORAGE_TARGET is path-prefixed by (part of the subhierarchy of) ANDROID_STORAGE, which is the typical case.
* | Added missing <include sys/resource.h> for gcc-4.7.1xkonni2013-07-241-0/+3
| | | | | | | | | | | | Patch Set 2: Added gcc version check as suggested by jeagoss Change-Id: I7743d5fab8d026e12ad9e9ef4d4fbabe0a9bded7
* | [PATCH] Basic KSM Supportshowp19842013-07-241-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Be sure to add '#define MADV_MERGEABLE 12' to bionic/libc/include/sys/mman.h so we can have a central place for this parse the process memory map and inform madvise common HEAP/Stack regions on fork from zygote These then can be used by the kernel KSM module to re-join (copy on write) pages between the various dalvik processes. As is on a fully loaded system you can expect ~12MB to be indicated to be scanned by KSM.. of this 10-15% will be saved; as such a recommend a very slow scan until as any logic to stop scanning while sleeping will require another process and remove all memory savings provided by this logic. To activate on a KSM kernel (2min for full scan of ~16m and 1%CPU): echo 4000 > /sys/kernel/mm/ksm/sleep_millisecs echo 128 > /sys/kernel/mm/ksm/pages_to_scan echo 1 > /sys/kernel/mm/ksm/run Newer kernels only require the last line. In future additional memory regions and kernel logic may improve this. Change-Id: I271cbee74a1f02a89c34c6ee9006a4ea81360154
* | Fix a leak in Dalvik_dalvik_system_DexFile_openDexFileYou Kim2013-04-021-0/+1
|/ | | | | | (cherry-pick of 7bf47d1d0d95c3ea9dfa7472e473edc820f21009.) Change-Id: I0d4b96125e185b37767873e6fd88a59b63b6f7bd
* Merge "Zygote: use proper header file."Nick Kralevich2013-02-271-1/+1
|\
| * Zygote: use proper header file.Nick Kralevich2013-02-271-1/+1
| | | | | | | | | | | | capset is defined in <sys/capability.h> Change-Id: Ifb340cfb3506830242749456706d4eddb73fb2aa
* | Remove CAP_NET_RAW from zygoteNick Kralevich2013-02-271-4/+0
|/ | | | | | | | | | | | ping no longer needs CAP_NET_RAW. See: * http://lwn.net/Articles/443051/ * https://android-review.googlesource.com/52090 * https://android-review.googlesource.com/52072 Eliminate the CAP_NET_RAW special case in zygote. Change-Id: Ie4b1d2b65a27051bbd2825d288f9838762ae31c8
* Zygote: replace set?id() with setres?id()Nick Kralevich2013-02-201-4/+4
| | | | | | | setuid -> setresuid() setgid -> setresgid() Change-Id: I319a6a0ea63cf5bd3755ec8371064365be30872b
* Merge "Move the arraycopy implementation out of bionic and into dalvik."Elliott Hughes2013-02-151-46/+120
|\
| * Move the arraycopy implementation out of bionic and into dalvik.Elliott Hughes2013-02-151-46/+120
| | | | | | | | Change-Id: I5b7964e53eca6f2da949d6ef24d42a9c6ed3996c
* | Zygote: address comments from previous review.Nick Kralevich2013-02-141-4/+9
| | | | | | | | | | | | Previous review at https://android-review.googlesource.com/51731 Change-Id: Idfe6c95976cc8f82ec473bcb630678fa9ec9486a
* | Zygote: limit the bounding capability set to CAP_NET_RAWNick Kralevich2013-02-141-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prevent a zygote spawned application from acquiring capabilities other than CAP_NET_RAW. The only Zygote accessible program on Android which grants capabilities is /system/bin/ping (CAP_NET_RAW), so we don't need to keep the other capabilities in our bounding set. If the kernel doesn't support file capabilities, we end up printing approx 30 lines of warning messages. Hopefully this will encourage kernel developers to upgrade. In a future change, we can turn a prctl(PR_CAPBSET_DROP) failure into a fatal error. Change-Id: I8560fa5ad125bf31f0d13be513431697bc7d22bb
* | Revert "Zygote: limit the bounding capability set to CAP_NET_RAW"Elliott Hughes2013-02-141-13/+0
|/ | | | | | This reverts commit 921e9aea72bc2aa99a52ccdb90573bbd3bf3508f, which prevents the emulator from booting. Change-Id: I73b7afba38d4087d552dd685c56d4e5ddb3103cf