diff --git a/Makefile b/Makefile index 2bd9bdfb..36d13abf 100644 --- a/Makefile +++ b/Makefile @@ -258,7 +258,7 @@ OBJECTS := \ isp.o \ j873.o \ kboot.o kboot_atc.o kboot_audio.o kboot_mte.o kboot_gpu_t8122.o kboot_gpu_t8122_power.o kboot_pmp_t8122.o \ - kboot_t6020_compat.o \ + kboot_t6020_compat.o kboot_t8132.o \ kboot_display_handoff.o kboot_display_facts.o kboot_gpu26.o kboot_gpu_t6031.o kboot_t6031.o \ main.o boot_options.o \ mitigations.o \ diff --git a/src/kboot.c b/src/kboot.c index 8d11319b..8aa11d9b 100644 --- a/src/kboot.c +++ b/src/kboot.c @@ -9019,16 +9019,23 @@ static int dt_reserve_t8132_aop_windows(const char *path) * DAPF, then reserve both segments at the IOVAs the firmware uses (their remap * addresses: EC0p for __ETEXT, the physical address for __OS_LOG) and the * DAPF windows. Without all of it the firmware cannot run, so on any failure - * the AOP is disabled. + * the AOP is disabled. No other M4 board's AOP handoff is qualified: there the + * AOP is disabled too, without touching it or its DART. */ static int dt_set_t8132_aop(const char *path) { const char *why; int node; + /* + * The J773g (Mac mini) tree states the same handoff contract and its 26.6.2 ADT has the same + * AOP, DART and segment layout; its headphone jack's audio runs on the AOP. + */ if (fdt_node_check_compatible(dt, 0, "apple,j713") && - fdt_node_check_compatible(dt, 0, "apple,j604")) - return 0; /* No other M4 board's AOP handoff is qualified. */ + fdt_node_check_compatible(dt, 0, "apple,j604") && !kboot_is_j773g(dt)) { + why = "no handoff is qualified for this board"; + goto disable; + } int chosen = fdt_path_offset(dt, "/chosen"); if (chosen < 0 || @@ -11452,6 +11459,12 @@ int kboot_prepare_dt(void *fdt) return -1; if (dt_set_aop_firmware()) return -1; + /* + * Before dt_set_isp(): on a Mac with no ISP in its ADT that disables the ISP but not its + * DARTs, and this rule leaves an ISP that is already disabled as it is. + */ + if (dt_disable_t8132_absent_isp(dt)) + return -1; if (dt_set_isp()) return -1; dt_set_j713_isp(); diff --git a/src/kboot.h b/src/kboot.h index f9a1d46a..cdeaf181 100644 --- a/src/kboot.h +++ b/src/kboot.h @@ -35,6 +35,12 @@ int kboot_boot(void *kernel); /* Reserve the DMA a USB controller that could not be stopped keeps (main.c, after USB shutdown). */ int kboot_reserve_usb_dma(void); +/* True only when the live J773g on 26.6.2 boots an OS tree that describes it. */ +bool kboot_is_j773g(const void *fdt); + +/* Disable the ISP and the DARTs only it uses on a T8132 Mac whose ADT has no camera. */ +int dt_disable_t8132_absent_isp(void *dt); + /* Boot-args RAM range and boot framebuffer base, for the kboot_* SoC helpers */ u64 kboot_ram_base(void); u64 kboot_ram_size(void); diff --git a/src/kboot_atc.c b/src/kboot_atc.c index a8ab9d94..e571e1ba 100644 --- a/src/kboot_atc.c +++ b/src/kboot_atc.c @@ -5,6 +5,7 @@ #include "kboot_atc.h" #include "adt.h" #include "devicetree.h" +#include "kboot.h" #include "malloc.h" #include "pmgr.h" #include "utils.h" @@ -872,9 +873,10 @@ static void dt_copy_atc_tunables(void *dt, const char *adt_path, const char *dt_ if (adt_node < 0) return; + /* The J773g's 26.6.2 ADT has every group of this bundle on all four PHYs. */ if (chip_id == T8132 && (!fdt_node_check_compatible(dt, 0, "apple,j713") || - !fdt_node_check_compatible(dt, 0, "apple,j604")) && + !fdt_node_check_compatible(dt, 0, "apple,j604") || kboot_is_j773g(dt)) && !fdt_node_check_compatible(dt, fdt_node, "apple,t8132-atcphy") && adt_is_compatible_at(adt, adt_node, "atc-phy,t8132", 0)) { dt_copy_t8132_usb3_tunables(dt, adt_node, fdt_node); diff --git a/src/kboot_t8132.c b/src/kboot_t8132.c new file mode 100644 index 00000000..e4e4d3c9 --- /dev/null +++ b/src/kboot_t8132.c @@ -0,0 +1,89 @@ +/* SPDX-License-Identifier: MIT */ +/* + * T8132 (M4) board rules. They live here, not in kboot.c: kboot.c's code is linked into Stage 1's + * .init slot (aura-raw.ld), which has almost no room left. + */ + +#include "kboot.h" +#include "adt.h" +#include "firmware.h" +#include "soc.h" +#include "utils.h" + +#include "libfdt/libfdt.h" + +#define bail(...) \ + do { \ + printf(__VA_ARGS__); \ + return -1; \ + } while (0) + +/* + * J773g (Mac mini, M4): the J773g admissions in this tree were checked against one ADT, that + * of 26.6.2 (target J773gAP, board-id 0x2a, iBoot mBoot-18000.161.10). Admit them only when + * the live machine, its firmware and the OS tree all say J773g. + */ +bool kboot_is_j773g(const void *fdt) +{ + return fdt && chip_id == T8132 && board_id == 0x2a && adt_is_compatible(adt, 0, "J773gAP") && + os_firmware.version == V26_6_2 && !fdt_node_check_compatible(fdt, 0, "apple,j773g") && + !fdt_node_check_compatible(fdt, 0, "apple,t8132"); +} + +/* Whether a node other than skip names the IOMMU phandle in its iommus list. */ +static bool dt_iommu_shared(const void *dt, u32 phandle, int skip) +{ + int node; + + for (node = fdt_next_node(dt, -1, NULL); node >= 0; node = fdt_next_node(dt, node, NULL)) { + int len; + const fdt32_t *iommus = node == skip ? NULL : fdt_getprop(dt, node, "iommus", &len); + + for (int i = 0; iommus && i + 1 < len / (int)sizeof(*iommus); i += 2) + if (fdt32_ld(&iommus[i]) == phandle) + return true; + } + return false; +} + +/* + * A T8132 Mac without a camera (the J773g) has no isp or isp0 in its ADT. A tree that enables + * the ISP there would have the OS probe a camera and power domains that do not exist: disable + * the ISP and the DARTs that only it uses. A tree that leaves it disabled is not changed. + */ +int dt_disable_t8132_absent_isp(void *dt) +{ + if (chip_id != T8132 || adt_path_offset(adt, "/arm-io/isp") >= 0 || + adt_path_offset(adt, "/arm-io/isp0") >= 0) + return 0; + + int isp = -1; + while ((isp = fdt_node_offset_by_compatible(dt, isp, "apple,t8132-isp")) >= 0) { + const char *status = fdt_getprop(dt, isp, "status", NULL); + if (status && !strcmp(status, "disabled")) + continue; + + /* One cell of stream ID per DART, as in t8132.dtsi. Decide before any write. */ + u32 darts[8]; + bool own[8]; + int len, count = 0; + const fdt32_t *iommus = fdt_getprop(dt, isp, "iommus", &len); + int cells = iommus && len > 0 && !(len % sizeof(*iommus)) ? len / sizeof(*iommus) : 0; + if (!(cells % 2) && cells / 2 <= (int)ARRAY_SIZE(darts)) + for (; count < cells / 2; count++) { + darts[count] = fdt32_ld(&iommus[2 * count]); + own[count] = !dt_iommu_shared(dt, darts[count], isp); + } + + if (fdt_setprop_string(dt, isp, "status", "disabled")) + bail("FDT: cannot disable the T8132 ISP\n"); + for (int i = 0; i < count; i++) { + int dart = own[i] ? fdt_node_offset_by_phandle(dt, darts[i]) : -1; + if (dart >= 0 && fdt_setprop_string(dt, dart, "status", "disabled")) + bail("FDT: cannot disable a T8132 ISP DART\n"); + } + printf("FDT: no ISP in the ADT; T8132 ISP disabled with the DARTs only it uses\n"); + isp = -1; /* Offsets moved; start over. Disabled nodes are skipped. */ + } + return 0; +} diff --git a/tests/python/test_j773g_board_gate.py b/tests/python/test_j773g_board_gate.py new file mode 100644 index 00000000..70dad0a8 --- /dev/null +++ b/tests/python/test_j773g_board_gate.py @@ -0,0 +1,61 @@ +# SPDX-License-Identifier: GPL-2.0-only +"""Admit J773g only when the live machine, its firmware and the OS tree all say so.""" +from pathlib import Path +import subprocess + +from test_j713_dapf_instance import block + + +def test_j773g_board_gate(tmp_path): + repo = Path(__file__).resolve().parents[2] + production = block((repo / "src/kboot_t8132.c").read_text(), "bool kboot_is_j773g(") + # Each case breaks one fact used by the J773g gate: target J773gAP, board-id 42, chip-id + # 0x8132, OS firmware 26.6.2, or the OS tree. + harness = r''' +#include +#include +#include +#include +#define T8132 0x8132 +enum fw_version { V_UNKNOWN, V26_6, V26_6_2, V26_7 }; +static struct { enum fw_version version; } os_firmware; +static unsigned chip_id, board_id; +static void *adt = (void *)1; +static const char *live, *board, *soc; +static bool adt_is_compatible(const void *tree, int node, const char *compatible) +{ + return tree == adt && node == 0 && !strcmp(compatible, live); +} +static int fdt_node_check_compatible(const void *fdt, int node, const char *compatible) +{ + assert(fdt && node == 0); + return strcmp(compatible, board) && strcmp(compatible, soc); +} +static void j773g(void) +{ + chip_id = T8132; board_id = 0x2a; os_firmware.version = V26_6_2; + live = "J773gAP"; board = "apple,j773g"; soc = "apple,t8132"; +} +''' + production + r''' +int main(void) +{ + static char tree; + j773g(); assert(kboot_is_j773g(&tree)); + assert(!kboot_is_j773g(NULL)); + j773g(); chip_id = 0x8122; assert(!kboot_is_j773g(&tree)); + j773g(); board_id = 0x2c; assert(!kboot_is_j773g(&tree)); + j773g(); live = "J713AP"; assert(!kboot_is_j773g(&tree)); + j773g(); board = "apple,j713"; assert(!kboot_is_j773g(&tree)); /* wrong OS tree */ + j773g(); soc = "apple,t8122"; assert(!kboot_is_j773g(&tree)); + j773g(); os_firmware.version = V26_6; assert(!kboot_is_j773g(&tree)); + j773g(); os_firmware.version = V26_7; assert(!kboot_is_j773g(&tree)); + j773g(); os_firmware.version = V_UNKNOWN; assert(!kboot_is_j773g(&tree)); + return 0; +} +''' + source = tmp_path / "j773g-board.c" + source.write_text(harness) + binary = tmp_path / "j773g-board" + subprocess.run(["cc", "-std=gnu11", "-Wall", "-Wextra", "-Werror", "-Wno-unused-parameter", + str(source), "-o", str(binary)], check=True) + subprocess.run([str(binary)], check=True) diff --git a/tests/python/test_t8132_aop_gate.py b/tests/python/test_t8132_aop_gate.py new file mode 100644 index 00000000..458dcd86 --- /dev/null +++ b/tests/python/test_t8132_aop_gate.py @@ -0,0 +1,111 @@ +# SPDX-License-Identifier: GPL-2.0-only +"""Run the production T8132 AOP handoff gate on J713, J604, J773g and boards it does not qualify.""" +from pathlib import Path + +from test_j713_dapf_instance import block +from test_siliconforest_handoff import run_c + +ROOT = Path(__file__).resolve().parents[2] + +# What can go wrong: an unqualified board keeps an enabled AOP that no loader handed over +# (the OS then starts it without its DAPF or its DRAM segments); the gate touches the AOP +# or its DART on a board it does not qualify; a J713 or J604 refusal leaves it enabled. +HARNESS = r''' +#include +#include +#include +#include +#include +#include "libfdt.h" +typedef uint32_t u32; +typedef unsigned long u64; +typedef struct { int unused; } asc_dev_t; +#define bail(...) do { printf(__VA_ARGS__); return -1; } while (0) +static void *dt; +static asc_dev_t the_asc; +static int touched, fail; +static bool running, live_j773g; +/* The live machine is a J773g on its qualified firmware and the tree says so. */ +static bool kboot_is_j773g(const void *fdt) +{ return live_j773g && !fdt_node_check_compatible(fdt, 0, "apple,j773g"); } +static asc_dev_t *asc_init(const char *path) +{ assert(!strcmp(path, "/arm-io/aop")); touched++; return fail == 1 ? NULL : &the_asc; } +static bool asc_cpu_running(asc_dev_t *asc) { return running; } +static void asc_free(asc_dev_t *asc) {} +static int dapf_init_t8132_halted(const char *path, int index) +{ assert(!strcmp(path, "/arm-io/dart-aop") && index == 1); touched++; return fail == 2 ? -1 : 0; } +static int dt_reserve_asc_segments(const char *adt_path, const char *alt, const char *path, + bool remap, u64 base, bool dram_only) +{ assert(!strcmp(adt_path, "/arm-io/aop/iop-aop-nub") && remap && dram_only); touched++; + return fail == 3 ? -1 : 0; } +static int dt_reserve_t8132_aop_windows(const char *path) { touched++; return fail == 4 ? -1 : 0; } +''' + +MAIN = r''' +static unsigned char blob[4096]; +static void tree(const char *board, bool requested) +{ + char compatible[64]; + int len = snprintf(compatible, sizeof(compatible), "%s%c%s", board, 0, "apple,t8132") + 1; + dt = blob; + assert(!fdt_create_empty_tree(dt, sizeof(blob))); + assert(!fdt_setprop(dt, 0, "compatible", compatible, len)); + int chosen = fdt_add_subnode(dt, 0, "chosen"); + if (requested) + assert(!fdt_setprop(dt, chosen, "linux-enablement-mac,dapf-handoff", + "/arm-io/aop\0/arm-io/pmp", sizeof("/arm-io/aop\0/arm-io/pmp"))); + int aop = fdt_add_subnode(dt, 0, "aop@390600000"); + assert(aop >= 0 && !fdt_setprop_string(dt, aop, "compatible", "apple,t8132-aop")); + assert(!fdt_setprop_string(dt, aop, "status", "okay")); + touched = fail = 0; + running = false; + live_j773g = !strcmp(board, "apple,j773g"); +} +static const char *status(void) +{ + return fdt_getprop(dt, fdt_path_offset(dt, "/aop@390600000"), "status", NULL); +} +int main(void) +{ + /* J713, J604 and a live J773g: a requested, halted AOP is handed over; any failed step + * disables it. */ + static const char *const qualified[] = {"apple,j713", "apple,j604", "apple,j773g"}; + for (unsigned i = 0; i < sizeof(qualified) / sizeof(*qualified); i++) { + tree(qualified[i], true); + assert(!dt_set_t8132_aop("/aop@390600000") && !strcmp(status(), "okay") && touched == 4); + for (int f = 1; f <= 4; f++) { + tree(qualified[i], true); + fail = f; + assert(!dt_set_t8132_aop("/aop@390600000") && !strcmp(status(), "disabled")); + } + tree(qualified[i], true); + running = true; + assert(!dt_set_t8132_aop("/aop@390600000") && !strcmp(status(), "disabled") && touched == 1); + tree(qualified[i], false); + assert(!dt_set_t8132_aop("/aop@390600000") && !strcmp(status(), "disabled") && !touched); + } + /* Other T8132 boards: the AOP ends disabled and neither it nor its DART is touched, + * whether or not the tree asks for the handoff. */ + static const char *const others[] = {"apple,j623", "apple,j624", "apple,j715", + "apple,j773g"}; + for (unsigned i = 0; i < sizeof(others) / sizeof(*others); i++) + for (int requested = 0; requested <= 1; requested++) { + tree(others[i], requested); + /* A J773g tree on any other machine or firmware is not qualified. */ + live_j773g = false; + assert(!dt_set_t8132_aop("/aop@390600000")); + assert(!strcmp(status(), "disabled") && !touched); + } + return 0; +} +''' + + +def production(): + kboot = (ROOT / "src/kboot.c").read_text() + return block(kboot, "static int dt_set_t8132_aop(") + "\n" + + +def test_t8132_aop_gate(tmp_path): + run_c(tmp_path, "t8132-aop-gate", + HARNESS + production() + MAIN) diff --git a/tests/python/test_t8132_isp_absent.py b/tests/python/test_t8132_isp_absent.py new file mode 100644 index 00000000..f7e40ff8 --- /dev/null +++ b/tests/python/test_t8132_isp_absent.py @@ -0,0 +1,177 @@ +# SPDX-License-Identifier: GPL-2.0-only +"""Run the production T8132 rule for a machine whose ADT has no camera (the J773g).""" +from pathlib import Path + +from test_j713_dapf_instance import block +from test_siliconforest_handoff import run_c + +ROOT = Path(__file__).resolve().parents[2] + +# What can go wrong: a tree that enables the T8132 ISP or its DARTs on a Mac with no ISP in +# its ADT (the J773g has none) makes the OS probe a camera and power domains that are not +# there; the rule touches a machine that does have an ISP, or another SoC; it disables a +# DART that another device shares; a malformed iommus list stops the boot; an earlier +# handoff step disables the ISP first, so the rule skips it and leaves its DARTs enabled. +TREE = r''' +static unsigned char blob[4096]; +static void tree(bool enabled, bool shared) +{ + dt = blob; + assert(!fdt_create_empty_tree(dt, sizeof(blob))); + int aliases = fdt_add_subnode(dt, 0, "aliases"); + assert(aliases >= 0 && !fdt_setprop_string(dt, aliases, "isp", "/isp@48c000000")); + static const char *const names[] = {"iommu@48e8c0000", "iommu@48e8e0000", "iommu@48e900000"}; + for (int i = 0; i < 3; i++) { + int dart = fdt_add_subnode(dt, 0, names[i]); + assert(dart >= 0 && !fdt_setprop_u32(dt, dart, "phandle", 10 + i)); + assert(!fdt_setprop_u32(dt, dart, "#iommu-cells", 1)); + } + int isp = fdt_add_subnode(dt, 0, "isp@48c000000"); + assert(isp >= 0 && !fdt_setprop(dt, isp, "compatible", "apple,t8132-isp\0apple,isp", + sizeof("apple,t8132-isp\0apple,isp"))); + fdt32_t iommus[] = {cpu_to_fdt32(10), 0, cpu_to_fdt32(11), 0, cpu_to_fdt32(12), 0}; + assert(!fdt_setprop(dt, isp, "iommus", iommus, sizeof(iommus))); + if (!enabled) + assert(!fdt_setprop_string(dt, isp, "status", "disabled")); + int other = fdt_add_subnode(dt, 0, "other@0"); + assert(other >= 0); + if (shared) { + fdt32_t ref[] = {cpu_to_fdt32(12), cpu_to_fdt32(1)}; + assert(!fdt_setprop(dt, other, "iommus", ref, sizeof(ref))); + } +} +static const char *status(const char *path) +{ + const char *s = fdt_getprop(dt, fdt_path_offset(dt, path), "status", NULL); + return s ? s : "okay"; +} +static bool off(const char *path) { return !strcmp(status(path), "disabled"); } +''' + +MAIN = TREE + r''' +int main(void) +{ + /* No ISP in the ADT: the ISP and its three DARTs end disabled. */ + tree(true, false); + assert(!dt_disable_t8132_absent_isp(dt)); + assert(off("/isp@48c000000") && off("/iommu@48e8c0000") && off("/iommu@48e8e0000") && + off("/iommu@48e900000") && !off("/other@0")); + /* A tree that already leaves it disabled is left exactly as it is. */ + tree(false, false); + unsigned char before[sizeof(blob)]; + memcpy(before, blob, sizeof(blob)); + assert(!dt_disable_t8132_absent_isp(dt) && !memcmp(before, blob, sizeof(blob))); + /* A DART another device also uses stays as it is. */ + tree(true, true); + assert(!dt_disable_t8132_absent_isp(dt)); + assert(off("/isp@48c000000") && off("/iommu@48e8c0000") && off("/iommu@48e8e0000") && + !off("/iommu@48e900000")); + /* A broken iommus list still leaves the ISP disabled. */ + tree(true, false); + assert(!fdt_setprop(dt, fdt_path_offset(dt, "/isp@48c000000"), "iommus", "\0\0\0\x63\0", 5)); + assert(!dt_disable_t8132_absent_isp(dt) && off("/isp@48c000000")); + assert(!off("/iommu@48e8c0000")); + /* A machine with an ISP (the J713), or another SoC, is not touched. */ + for (int c = 0; c < 3; c++) { + tree(true, false); + memcpy(before, blob, sizeof(blob)); + adt_isp = c == 0; adt_isp0 = c == 1; chip_id = c == 2 ? 0x8122 : T8132; + assert(!dt_disable_t8132_absent_isp(dt) && !memcmp(before, blob, sizeof(blob))); + adt_isp = adt_isp0 = false; chip_id = T8132; + } + return 0; +} +''' + + +HEADER = r''' +#include +#include +#include +#include +#include +#include "libfdt.h" +typedef uint32_t u32; +#define T8132 0x8132 +#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) +#define bail(...) do { printf(__VA_ARGS__); return -1; } while (0) +static void *dt, *adt; +static u32 chip_id = T8132; +static bool adt_isp, adt_isp0; +static int adt_path_offset(const void *tree, const char *path) +{ + if (!strcmp(path, "/arm-io/isp")) return adt_isp ? 1 : -1; + if (!strcmp(path, "/arm-io/isp0")) return adt_isp0 ? 2 : -1; + return -1; +} +''' + + +def rule(): + kboot = (ROOT / "src/kboot_t8132.c").read_text() + return (block(kboot, "static bool dt_iommu_shared(") + "\n" + + block(kboot, "int dt_disable_t8132_absent_isp(") + "\n") + + +def test_t8132_isp_absent(tmp_path): + run_c(tmp_path, "t8132-isp-absent", HEADER + rule() + MAIN) + + +# kboot_prepare_dt() runs the generic dt_set_isp() too. On a Mac with no ISP in its ADT it +# cannot reserve the ISP firmware and disables the node the isp alias names. Run the real +# dt_set_isp() and the real call sequence: the rule must still disable the DARTs only the +# ISP uses, and a machine with an ISP must still reach the generic step. +ORDER = r''' +#define T6040 0x6040 +#define T6050 0x6050 +#define T8140 0x8140 +#define T8142 0x8142 +typedef unsigned long u64; +static u32 board_id; +static int generic_ran; +static bool adt_is_compatible(const void *tree, int node, const char *c) { return false; } +static int dt_t6050_isp_transaction(void) { return -1; } +static int isp_get_heap(u64 *phys, u64 *iova, u64 *size) { return -1; } +static u64 isp_iova_base(void) { return 0; } +static int dt_set_isp_fwdata(void) { return 0; } +/* As dt_reserve_asc_segments_at(): no ADT node, no reservation. */ +static int dt_reserve_asc_firmware(const char *adt_path, const char *adt_path_alt, + const char *fdt_path, bool remap, u64 base) +{ + generic_ran++; + return adt_path_offset(adt, adt_path) < 0 && adt_path_offset(adt, adt_path_alt) < 0 ? -1 : 0; +} +static void dt_set_j713_isp(void) {} +''' + + +def test_t8132_isp_absent_in_handoff_order(tmp_path): + kboot = (ROOT / "src/kboot.c").read_text() + prepare = block(kboot, "int kboot_prepare_dt(") + start = prepare.index(" if (dt_set_aop_firmware())\n return -1;\n") + start = prepare.index("\n", prepare.index("return -1;", start)) + 1 + steps = prepare[start:prepare.index(" if (dt_set_pmgr())", start)] + assert "dt_set_isp()" in steps and "dt_disable_t8132_absent_isp(dt)" in steps + run_c(tmp_path, "t8132-isp-absent-order", HEADER + rule() + ORDER + + block(kboot, "static int dt_set_isp(void)") + TREE + + "static int handoff(void)\n{\n" + steps + " return 0;\n}\n" + r''' +int main(void) +{ + /* No ISP in the ADT: whichever step disables the ISP, its DARTs end disabled. */ + tree(true, false); + assert(!handoff() && generic_ran == 1); + assert(off("/isp@48c000000") && off("/iommu@48e8c0000") && off("/iommu@48e8e0000") && + off("/iommu@48e900000") && !off("/other@0")); + /* A DART another device also uses stays as it is. */ + tree(true, true); + assert(!handoff()); + assert(off("/iommu@48e8c0000") && off("/iommu@48e8e0000") && !off("/iommu@48e900000")); + /* With an ISP in the ADT the rule does nothing and the generic step reserves it. */ + adt_isp = true; + tree(true, false); + generic_ran = 0; + assert(!handoff() && generic_ran == 1); + assert(!off("/isp@48c000000") && !off("/iommu@48e8c0000")); + return 0; +} +''')