Merge "Don't ask libc for PT feature w/o kernel support."
This commit is contained in:
committed by
Android (Google) Code Review
commit
60ec63d646
@@ -1065,4 +1065,11 @@ public final class Zygote {
|
||||
* Returns whether the hardware supports memory tagging (ARM MTE).
|
||||
*/
|
||||
public static native boolean nativeSupportsMemoryTagging();
|
||||
|
||||
/**
|
||||
* Returns whether the kernel supports tagged pointers. Present in the
|
||||
* Android Common Kernel from 4.14 and up. By default, you should prefer
|
||||
* fully-feature Memory Tagging, rather than the static Tagged Pointers.
|
||||
*/
|
||||
public static native boolean nativeSupportsTaggedPointers();
|
||||
}
|
||||
|
||||
@@ -754,9 +754,9 @@ public class ZygoteInit {
|
||||
/* The system server is more privileged than regular app processes, so it has async
|
||||
* tag checks enabled on hardware that supports memory tagging. */
|
||||
parsedArgs.mRuntimeFlags |= Zygote.MEMORY_TAG_LEVEL_ASYNC;
|
||||
} else {
|
||||
} else if (Zygote.nativeSupportsTaggedPointers()) {
|
||||
/* Enable pointer tagging in the system server. Hardware support for this is present
|
||||
* in all ARMv8 CPUs; this flag has no effect on other platforms. */
|
||||
* in all ARMv8 CPUs. */
|
||||
parsedArgs.mRuntimeFlags |= Zygote.MEMORY_TAG_LEVEL_TBI;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user