From 44c4db1b510d232a8c2fdd568a15f5fdbcce0b8b Mon Sep 17 00:00:00 2001 From: Songchun Fan Date: Fri, 25 Sep 2020 12:45:19 -0700 Subject: [PATCH] [am] respect ABI override when selecting ISA for new process When starting a new process, we used to ignore the value of abi override. This caused issues like b/169261423, when the abi override specified 32-bit, but the new process was still running as 64-bit. This CL fixes that. BUG: 169261423 BUG: 73555088 Test: (with ag/12720566 reverted) Test: atest CtsAbiOverrideHostTestCases Test: atest android.view.cts.ASurfaceControlTest#testSurfaceTransaction_setColorAndBuffer_bufferAlpha_0_5 -- --abi=armeabi-v7a Test: atest android.extractnativelibs.cts.CtsExtractNativeLibsHostTestAbiOverride Change-Id: I99a3c691c58948d6070c6ed9f81be746f492b84f --- services/core/java/com/android/server/am/ProcessList.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/am/ProcessList.java b/services/core/java/com/android/server/am/ProcessList.java index 5e6556339b43d..8e01c4f67689c 100644 --- a/services/core/java/com/android/server/am/ProcessList.java +++ b/services/core/java/com/android/server/am/ProcessList.java @@ -1918,7 +1918,9 @@ public final class ProcessList { String instructionSet = null; if (app.info.primaryCpuAbi != null) { - instructionSet = VMRuntime.getInstructionSet(app.info.primaryCpuAbi); + // If ABI override is specified, use the isa derived from the value of ABI override. + // Otherwise, use the isa derived from primary ABI + instructionSet = VMRuntime.getInstructionSet(requiredAbi); } app.gids = gids; @@ -1927,7 +1929,7 @@ public final class ProcessList { // If instructionSet is non-null, this indicates that the system_server is spawning a // process with an ISA that may be different from its own. System (kernel and hardware) - // compatililty for these features is checked in the decideTaggingLevel in the + // compatibility for these features is checked in the decideTaggingLevel in the // system_server process (not the child process). As both MTE and TBI are only supported // in aarch64, we can simply ensure that the new process is also aarch64. This prevents // the mismatch where a 64-bit system server spawns a 32-bit child that thinks it should