Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions src/rtkit.c
Original file line number Diff line number Diff line change
Expand Up @@ -968,39 +968,6 @@ static bool rtkit_switch_power_state(rtkit_dev_t *rtk, enum rtkit_power_state ap
return true;
}

/*
* Stop the IOP sending syslog, ioreport and oslog traffic to the AP while the
* IOP itself keeps running, for a next stage that uses the coprocessor without
* servicing its mailbox.
*/
bool rtkit_quiesce_ap(rtkit_dev_t *rtk)
{
struct rtkit_message msg;
int ret;

if (rtk->crashed)
return false;

while ((ret = rtkit_recv(rtk, &msg)) > 0)
rtkit_printf("dropping message to non-system endpoint 0x%02x before AP quiesce: %lx\n",
msg.ep, msg.msg);
if (ret < 0 || !rtkit_quiesce_ap_power(rtk, RTKIT_POWER_QUIESCED))
return false;

/* Acknowledge anything the IOP sent along with the transition. */
u64 timeout = timeout_calculate(50000);
while (!timeout_expired(timeout)) {
ret = rtkit_recv(rtk, &msg);
if (ret < 0)
return false;
if (ret > 0)
rtkit_printf("dropping message to non-system endpoint 0x%02x after AP quiesce: %lx\n",
msg.ep, msg.msg);
}

return true;
}

bool rtkit_quiesce(rtkit_dev_t *rtk)
{
return rtkit_switch_power_state(rtk, RTKIT_POWER_QUIESCED, RTKIT_POWER_QUIESCED);
Expand Down
1 change: 0 additions & 1 deletion src/rtkit.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ struct rtkit_buffer {
rtkit_dev_t *rtkit_init(const char *name, asc_dev_t *asc, dart_dev_t *dart,
iova_domain_t *dart_iovad, sart_dev_t *sart, bool sram);
bool rtkit_quiesce(rtkit_dev_t *rtk);
bool rtkit_quiesce_ap(rtkit_dev_t *rtk);
bool rtkit_sleep(rtkit_dev_t *rtk);
bool rtkit_idle(rtkit_dev_t *rtk);
int rtkit_probe_hello(asc_dev_t *asc);
Expand Down
5 changes: 0 additions & 5 deletions src/secboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,6 @@ bool secboot_host_proxy_allowed(void)
}
#endif

const char *secboot_flavour(void)
{
return flavour_name;
}

bool secboot_allow_unverified(const char *what)
{
all_verified = false;
Expand Down
1 change: 0 additions & 1 deletion src/secboot.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ bool secboot_host_proxy_allowed(void);
#endif

/* "dev" or "secure" (SECBOOT_FLAVOUR). */
const char *secboot_flavour(void);

/* Build /chosen/aurora,boot-security in the FDT handed to the next stage. */
void secboot_export_fdt(void *dt);
Expand Down
5 changes: 0 additions & 5 deletions src/stage1_proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ enum stage1_payload_action stage1_proxy_payload_action(enum stage1_proxy_result
return STAGE1_PAYLOAD_HALT;
}

bool stage1_proxy_action_needs_cleanup(enum stage1_payload_action action)
{
return action == STAGE1_PAYLOAD_NATIVE;
}

/*
* The previous boot ended without a clean shutdown before an OS started: a Stage 2 or a later
* loader that hangs, faults or is forced off. Linux clears the counts once it runs, so this holds
Expand Down
1 change: 0 additions & 1 deletion src/stage1_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ enum stage1_proxy_result stage1_proxy_window_step(struct stage1_proxy_window *wi
enum stage1_payload_action stage1_proxy_payload_action(enum stage1_proxy_result window_result,
bool payload_valid, bool cdc_live,
bool kis_live);
bool stage1_proxy_action_needs_cleanup(enum stage1_payload_action action);

/*
* iBoot's record of the previous boot in the PMU scratchpad: the counts byte (failed boots in the
Expand Down
18 changes: 0 additions & 18 deletions src/uartproxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,24 +89,6 @@ static bool uartproxy_sync_iodev(iodev_id_t iodev)
return false;
}

bool uartproxy_wait_dockchannel(unsigned int timeout_ms)
{
const iodev_id_t iodev = IODEV_DOCKCHANNEL_UART;
if (!(iodev_get_usage(iodev) & USAGE_UARTPROXY)) {
printf("Proxy: DockChannel unavailable; skipping host window\n");
return false;
}
for (unsigned int ms = 0; ms < timeout_ms; ms++) {
if (uartproxy_sync_iodev(iodev)) {
presynced_iodev = iodev;
wdt_host_attached();
return true;
}
mdelay(1);
}
return false;
}

enum stage1_proxy_result uartproxy_wait_stage1(unsigned int timeout_ms)
{
struct stage1_proxy_window window;
Expand Down
1 change: 0 additions & 1 deletion src/uartproxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ struct uartproxy_msg_start {
};

int uartproxy_run(struct uartproxy_msg_start *start);
bool uartproxy_wait_dockchannel(unsigned int timeout_ms);
enum stage1_proxy_result uartproxy_wait_stage1(unsigned int timeout_ms);
int uartproxy_run_presynced(void);
void uartproxy_send_event(u16 event_type, void *data, u16 length);
Expand Down
6 changes: 1 addition & 5 deletions tests/python/test_stage1_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ def proxy_lib(tmp_path):
lib.stage1_proxy_window_step.restype = ctypes.c_int
lib.stage1_proxy_payload_action.argtypes = [ctypes.c_int] + [ctypes.c_bool] * 3
lib.stage1_proxy_payload_action.restype = ctypes.c_int
lib.stage1_proxy_action_needs_cleanup.argtypes = [ctypes.c_int]
lib.stage1_proxy_action_needs_cleanup.restype = ctypes.c_bool
return lib


Expand All @@ -36,15 +34,14 @@ def step(lib, window, elapsed, ready=False, failed=False, taken=False,
)


def test_no_host_expires_to_native_and_requires_cleanup(tmp_path):
def test_no_host_expires_to_native(tmp_path):
lib = proxy_lib(tmp_path)
window = Window()
lib.stage1_proxy_window_init(ctypes.byref(window), 10_000)
assert step(lib, window, 9_999, ready=True, taken=True) == 0
assert step(lib, window, 10_000, ready=True, taken=True) == 3
action = lib.stage1_proxy_payload_action(3, True, True, False)
assert action == 0
assert lib.stage1_proxy_action_needs_cleanup(action)


def test_cdc_is_primary_when_both_syncs_are_observed(tmp_path):
Expand Down Expand Up @@ -82,7 +79,6 @@ def test_failed_cdc_start_has_bounded_safe_ownership(tmp_path):
def test_missing_path_keeps_live_cdc_as_safe_proxy_fallback(tmp_path):
lib = proxy_lib(tmp_path)
assert lib.stage1_proxy_payload_action(3, False, True, False) == 1
assert not lib.stage1_proxy_action_needs_cleanup(1)
assert lib.stage1_proxy_payload_action(3, False, False, True) == 2


Expand Down
2 changes: 0 additions & 2 deletions tests/python/test_wdt_boot_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ def test_a_host_disarms_it_as_soon_as_it_is_seen():
assert checked < run_body.index('wdt_host_attached();') < run_body.index('switch (request.type)')
wait = function_body(proxy, 'enum stage1_proxy_result uartproxy_wait_stage1(')
assert wait.count('wdt_host_attached();') == 2
dock = function_body(proxy, 'bool uartproxy_wait_dockchannel(')
assert 'wdt_host_attached();' in dock


def test_host_windows_are_shorter_than_the_watchdog():
Expand Down
Loading