commit eea9eb667177019786167e95a1b566b06c76f610
parent edf2a795b7208ea25881ce7eacd1828cdf3364fa
Author: agoloman <agoloman@mozilla.com>
Date: Thu, 30 Oct 2025 19:02:03 +0200
Revert "Bug 1906827 part 3 - make cppunittests run on AArch64 r=ci-and-tooling,taskgraph-reviewers,jmaher,yjuglaret" for causing snap failures.
This reverts commit a22f55826395d521135be2957d22c7500624041b.
Revert "Bug 1906827 part 2 - add tests and make all cppunittests pass on ARM64 r=yjuglaret"
This reverts commit ad7e8a051e7d4cb0d6fe468fdbf588095af4a957.
Revert "Bug 1906827 part 1 - correctly handle BR instructions for patching in ARM64 r=yjuglaret,win-reviewers"
This reverts commit 803b433de9ce925fe78fa9bd4d4e2e5dcff5b328.
Diffstat:
9 files changed, 13 insertions(+), 86 deletions(-)
diff --git a/taskcluster/gecko_taskgraph/transforms/test/worker.py b/taskcluster/gecko_taskgraph/transforms/test/worker.py
@@ -90,9 +90,6 @@ WINDOWS_WORKER_TYPES = {
"virtual": "win11-64-24h2",
"virtual-with-gpu": "win11-64-24h2-gpu",
},
- "windows11-aarch64-24h2": {
- "virtual": "win11-a64-24h2",
- },
}
# os x worker types keyed by test-platform
diff --git a/taskcluster/kinds/build/windows.yml b/taskcluster/kinds/build/windows.yml
@@ -1450,7 +1450,6 @@ win64-aarch64/debug:
max-run-time: 7200
env:
PERFHERDER_EXTRA_OPTIONS: aarch64
- MOZ_AUTOMATION_PACKAGE_TESTS: "1"
run:
actions: [get-secrets, build]
options: [append-env-variables-from-configs]
@@ -1503,7 +1502,6 @@ win64-aarch64/opt:
max-run-time: 7200
env:
PERFHERDER_EXTRA_OPTIONS: aarch64
- MOZ_AUTOMATION_PACKAGE_TESTS: "1"
run:
actions: [get-secrets, build]
options: [append-env-variables-from-configs]
diff --git a/taskcluster/test_configs/test-platforms.yml b/taskcluster/test_configs/test-platforms.yml
@@ -295,17 +295,6 @@ windows11-64-24h2-nightlyasrelease/opt:
test-sets:
- browsertime
-# windows11-64-aarch64
-windows11-aarch64-24h2/opt:
- build-platform: win64-aarch64/opt
- test-sets:
- - windows-aarch64-tests
-
-windows11-aarch64-24h2/debug:
- build-platform: win64-aarch64/debug
- test-sets:
- - windows-aarch64-tests
-
##
# MacOS X platforms (matching /macosx.*/)
diff --git a/taskcluster/test_configs/test-sets.yml b/taskcluster/test_configs/test-sets.yml
@@ -296,9 +296,6 @@ windows32-tests:
- web-platform-tests
- web-platform-tests-crashtest
-windows-aarch64-tests:
- - cppunittest
-
windows10-2009-tests:
- cppunittest
- gtest
diff --git a/testing/cppunittest.toml b/testing/cppunittest.toml
@@ -4,9 +4,6 @@
["TestAlgorithm"]
-["TestArm64Disassembler"]
-run-if = ["os == 'win' && processor == 'aarch64'"]
-
["TestArray"]
["TestArrayUtils"]
@@ -50,7 +47,10 @@ run-if = ["os == 'win'"]
run-if = ["os == 'win'"]
["TestDllInterceptorCrossProcess"]
-run-if = ["os == 'win' && processor != 'aarch64'"]
+run-if = [
+ "os == 'win' && processor == 'x86'",
+ "os == 'win' && processor == 'x86_64'",
+]
["TestDoublyLinkedList"]
@@ -75,7 +75,6 @@ run-if = ["os == 'win' && processor != 'aarch64'"]
["TestIATPatcher"]
run-if = ["os == 'win'"]
skip-if = [
- "processor == 'aarch64'", # requires administrator permission on aarch64
"win11_2009 && bits == 32", # fails on windows10x32
"os == 'win' && os_version == '11.26100' && processor == 'x86'", # fails on win/x86
]
diff --git a/toolkit/xre/dllservices/mozglue/interceptor/Arm64.cpp b/toolkit/xre/dllservices/mozglue/interceptor/Arm64.cpp
@@ -50,7 +50,6 @@ MFBT_API LoadOrBranch BUncondImmDecode(const uintptr_t aPC,
// Order is important here; more specific encoding tests must be placed before
// less specific encoding tests.
static const PCRelativeLoadTest gPCRelTests[] = {
- {0xFEFF0000, 0xD63F0000, nullptr}, // BLR branch w/ link (reg)
{0x9F000000, 0x10000000, nullptr}, // ADR
{0x9F000000, 0x90000000, &ADRPDecode}, // ADRP
{0xFF000000, 0x58000000, nullptr}, // LDR (literal) 64-bit GPR
@@ -59,6 +58,7 @@ static const PCRelativeLoadTest gPCRelTests[] = {
{0xFE000000, 0x54000000, nullptr}, // B.Cond
{0x7E000000, 0x34000000, nullptr}, // Compare and branch (imm)
{0x7E000000, 0x36000000, nullptr}, // Test and branch (imm)
+ {0xFE000000, 0xD6000000, nullptr} // Unconditional branch (reg)
};
/**
diff --git a/toolkit/xre/dllservices/tests/TestArm64Disassembler.cpp b/toolkit/xre/dllservices/tests/TestArm64Disassembler.cpp
@@ -26,13 +26,11 @@
using namespace mozilla;
using namespace mozilla::interceptor::arm64;
-constexpr uintptr_t kExamplePCValue = 0x7ff959a7ea80;
-
bool TestCheckForPCRelAdrp() {
// A real-world example from bug 1964688 comment 5:
// 00007ff9`59a7ea80 d0dfff11 adrp xip1,00007ff9`19a60000
Result<LoadOrBranch, PCRelCheckError> result =
- CheckForPCRel(kExamplePCValue, 0xd0dfff11);
+ CheckForPCRel(0x7ff959a7ea80, 0xd0dfff11);
if (result.isErr()) {
auto error = result.unwrapErr();
TEST_FAILED(
@@ -67,7 +65,7 @@ bool TestCheckForPCRelAdr() {
// Fictional example with adr:
// 00007ff959a7ea80 50dfff11 adr x17, #0x7ff959a3ea62
Result<LoadOrBranch, PCRelCheckError> result =
- CheckForPCRel(kExamplePCValue, 0x50dfff11);
+ CheckForPCRel(0x7ff959a7ea80, 0x50dfff11);
// For the moment we expect to recognize adr instructions but we don't have
// a decoder
@@ -92,56 +90,8 @@ bool TestCheckForPCRelAdr() {
return true;
}
-bool TestCheckForPCRelBlr() {
- // blr x16
- Result<LoadOrBranch, PCRelCheckError> result =
- CheckForPCRel(kExamplePCValue, 0xd63f0200);
-
- if (!result.isErr()) {
- TEST_FAILED(
- "Unexpectedly recognized blr as a PC-relative instruction with a "
- "decoder. If you have implemented a decoder for this instruction, "
- "please update TestArm64Disassembler.cpp.\n");
- }
-
- auto error = result.unwrapErr();
- if (error != PCRelCheckError::NoDecoderAvailable) {
- TEST_FAILED(
- "Failed to recognize blr as a PC-relative instruction, got "
- "PCRelCheckError %d.\n",
- error);
- }
-
- TEST_PASS(
- "Properly recognized blr as a PC-relative instruction without a "
- "decoder.\n");
- return true;
-}
-
-bool TestCheckForPCRelBr() {
- // br x16
- Result<LoadOrBranch, PCRelCheckError> result =
- CheckForPCRel(kExamplePCValue, 0xd61f0200);
-
- if (result.isErr()) {
- auto error = result.unwrapErr();
- if (error != PCRelCheckError::InstructionNotPCRel) {
- TEST_FAILED(
- "Failed to recognize br as a non-PC-relative instruction, got "
- "PCRelCheckError %d.\n",
- error);
- }
- } else {
- TEST_FAILED("Incorrectly recognized br as a PC-relative instruction.\n");
- }
-
- TEST_PASS("Properly recognized br as a non-PC-relative instruction.\n");
- return true;
-}
-
int wmain(int argc, wchar_t* argv[]) {
- if (!TestCheckForPCRelAdrp() || !TestCheckForPCRelAdr() ||
- !TestCheckForPCRelBlr() || !TestCheckForPCRelBr()) {
+ if (!TestCheckForPCRelAdrp() || !TestCheckForPCRelAdr()) {
return -1;
}
return 0;
diff --git a/toolkit/xre/dllservices/tests/TestDllInterceptor.cpp b/toolkit/xre/dllservices/tests/TestDllInterceptor.cpp
@@ -848,10 +848,10 @@ MOZ_GLOBINIT struct TestCase {
TestCase("LockPrefix", NoStubAddressCheck),
TestCase("LooksLikeLockPrefix", NoStubAddressCheck),
# endif
-# if !defined(_M_ARM64) && !defined(DEBUG)
+# if !defined(DEBUG)
// Skip on Debug build because it hits MOZ_ASSERT_UNREACHABLE.
TestCase("UnsupportedOp", ExpectedFail),
-# endif // !defined(_M_ARM64) && !defined(DEBUG)
+# endif // !defined(DEBUG)
#endif // defined(__clang__)
};
@@ -892,9 +892,7 @@ bool TestAssemblyFunctions() {
DetourResultCode::DETOUR_PATCHER_CREATE_TRAMPOLINE_ERROR) {
printf(
"TEST-FAILED | WindowsDllInterceptor | "
- "A wrong detour errorcode was set on detour error for %s. (got "
- "%d)\n",
- testCase.mFunctionName, maybeError.ref().mErrorCode);
+ "A wrong detour errorcode was set on detour error.\n");
return false;
}
#endif // defined(NIGHTLY_BUILD)
diff --git a/toolkit/xre/dllservices/tests/moz.build b/toolkit/xre/dllservices/tests/moz.build
@@ -8,6 +8,7 @@ GeckoCppUnitTests(
[
"TestDllBlocklistAssumptions",
"TestDllInterceptor",
+ "TestIATPatcher",
"TestMMPolicy",
"TestOleAut32Initialization",
],
@@ -15,12 +16,10 @@ GeckoCppUnitTests(
)
if CONFIG["TARGET_CPU"] in ("x86", "x86_64"):
+ # Cross-process interceptors not yet supported on aarch64
GeckoCppUnitTests(
[
- # Cross-process interceptors not yet supported on aarch64
"TestDllInterceptorCrossProcess",
- # Requires administrator permission on aarch64
- "TestIATPatcher",
],
linkage=None,
)