diff --git a/drivers/thermal/apple-pmp-thermal.c b/drivers/thermal/apple-pmp-thermal.c index 21650a539ae39..1f7ed48c57fcf 100644 --- a/drivers/thermal/apple-pmp-thermal.c +++ b/drivers/thermal/apple-pmp-thermal.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -43,6 +44,7 @@ /* Inside the cooling slope window (50-250 ms); used while cool and idle. */ #define APPLE_PMP_SLOW_POLL_MS 100 #define APPLE_PMP_GOVERNOR_NS 100000000ULL +#define APPLE_PMP_POWER_POLL_MS 500 struct apple_pmp_cluster { struct cpufreq_policy *policy; @@ -55,10 +57,14 @@ static struct { struct thermal_zone_device *zone; struct apple_pmp_cluster clusters[2]; struct mutex lock; /* Serializes sensor reads, mode changes and guard updates. */ + struct mutex lifecycle_lock; /* Serializes setup, cleanup, prepare and complete. */ + spinlock_t poll_lock; /* Serializes poll_armed, fast_timer_armed and scheduling. */ + struct workqueue_struct *poll_wq; struct apple_pmp_cooling cooling; struct apple_pmp_power_policy power; struct delayed_work setup_work; struct delayed_work power_work; + struct delayed_work slow_poll_work; struct device *power_hwmon; unsigned int rail_mw[3]; u64 validated_smc_gen; @@ -79,6 +85,8 @@ static struct { struct hrtimer poll_timer; struct work_struct poll_work; bool polling; + bool poll_armed; + bool fast_timer_armed; bool fast_poll; bool owner; /* apple-soc-cpufreq's unmanaged cap is released */ bool critical_dumped; @@ -86,6 +94,8 @@ static struct { bool sleep_paused; } pmp_thermal = { .lock = __MUTEX_INITIALIZER(pmp_thermal.lock), + .lifecycle_lock = __MUTEX_INITIALIZER(pmp_thermal.lifecycle_lock), + .poll_lock = __SPIN_LOCK_UNLOCKED(pmp_thermal.poll_lock), }; /* Read-only cadence diagnostics: reading temperatures must not advance these. */ @@ -268,7 +278,8 @@ static void apple_pmp_power_work(struct work_struct *work) if (ret) pr_warn_ratelimited("apple-pmp-thermal: power telemetry error %d, retaining minimum CPU/GPU ceilings\n", ret); - schedule_delayed_work(&pmp_thermal.power_work, msecs_to_jiffies(500)); + queue_delayed_work(system_dfl_wq, &pmp_thermal.power_work, + msecs_to_jiffies(APPLE_PMP_POWER_POLL_MS)); } static umode_t apple_pmp_power_visible(const void *data, @@ -539,6 +550,30 @@ static void apple_pmp_critical(struct thermal_zone_device *zone) } } +static void apple_pmp_poll_ensure_fast(void) +{ + guard(spinlock_irqsave)(&pmp_thermal.poll_lock); + if (!pmp_thermal.poll_armed || !READ_ONCE(pmp_thermal.fast_poll) || + pmp_thermal.fast_timer_armed) + return; + cancel_delayed_work(&pmp_thermal.slow_poll_work); + pmp_thermal.fast_timer_armed = true; + hrtimer_start(&pmp_thermal.poll_timer, + ms_to_ktime(APPLE_PMP_POLL_MS), + HRTIMER_MODE_REL); +} + +static void apple_pmp_poll_stop(void) +{ + scoped_guard(spinlock_irqsave, &pmp_thermal.poll_lock) + pmp_thermal.poll_armed = false; + hrtimer_cancel(&pmp_thermal.poll_timer); + scoped_guard(spinlock_irqsave, &pmp_thermal.poll_lock) + pmp_thermal.fast_timer_armed = false; + cancel_delayed_work_sync(&pmp_thermal.slow_poll_work); + cancel_work_sync(&pmp_thermal.poll_work); +} + static void apple_pmp_poll_work(struct work_struct *work) { u64 now; @@ -552,6 +587,24 @@ static void apple_pmp_poll_work(struct work_struct *work) pmp_thermal.governor_count++; thermal_zone_device_update(pmp_thermal.zone, THERMAL_EVENT_UNSPECIFIED); } + apple_pmp_poll_ensure_fast(); +} + +static void apple_pmp_slow_poll_work(struct work_struct *work) +{ + guard(spinlock_irqsave)(&pmp_thermal.poll_lock); + if (!pmp_thermal.poll_armed || pmp_thermal.fast_timer_armed) + return; + queue_work(pmp_thermal.poll_wq, &pmp_thermal.poll_work); + if (READ_ONCE(pmp_thermal.fast_poll)) { + pmp_thermal.fast_timer_armed = true; + hrtimer_start(&pmp_thermal.poll_timer, + ms_to_ktime(APPLE_PMP_POLL_MS), + HRTIMER_MODE_REL); + return; + } + queue_delayed_work(system_dfl_wq, &pmp_thermal.slow_poll_work, + msecs_to_jiffies(APPLE_PMP_SLOW_POLL_MS)); } static enum hrtimer_restart apple_pmp_poll_timer(struct hrtimer *timer) @@ -559,22 +612,36 @@ static enum hrtimer_restart apple_pmp_poll_timer(struct hrtimer *timer) /* Sampling/QoS may sleep, so never perform either in timer context. * One work item coalesces missed ticks; no burst of stale confirmations. */ - queue_work(system_highpri_wq, &pmp_thermal.poll_work); - hrtimer_forward_now(timer, ms_to_ktime(READ_ONCE(pmp_thermal.fast_poll) ? - APPLE_PMP_POLL_MS : - APPLE_PMP_SLOW_POLL_MS)); - return HRTIMER_RESTART; + guard(spinlock_irqsave)(&pmp_thermal.poll_lock); + if (!pmp_thermal.poll_armed) { + pmp_thermal.fast_timer_armed = false; + return HRTIMER_NORESTART; + } + queue_work(pmp_thermal.poll_wq, &pmp_thermal.poll_work); + if (READ_ONCE(pmp_thermal.fast_poll)) { + hrtimer_forward_now(timer, ms_to_ktime(APPLE_PMP_POLL_MS)); + pmp_thermal.fast_timer_armed = true; + return HRTIMER_RESTART; + } + pmp_thermal.fast_timer_armed = false; + queue_delayed_work(system_dfl_wq, &pmp_thermal.slow_poll_work, + msecs_to_jiffies(APPLE_PMP_SLOW_POLL_MS)); + return HRTIMER_NORESTART; } static int apple_pmp_change_mode(struct thermal_zone_device *zone, enum thermal_device_mode mode) { + int ret; + guard(mutex)(&pmp_thermal.lock); pmp_thermal.enabled = mode == THERMAL_DEVICE_ENABLED; apple_pmp_gpu_publish(pmp_thermal.sensors, 0, 8, 0); apple_pmp_cooling_init(&pmp_thermal.cooling); WRITE_ONCE(pmp_thermal.fast_poll, true); - return apple_pmp_guard(8); + ret = apple_pmp_guard(8); + apple_pmp_poll_ensure_fast(); + return ret; } static bool apple_pmp_should_bind(struct thermal_zone_device *zone, @@ -676,10 +743,13 @@ static void apple_pmp_thermal_cleanup(void) pmp_thermal.power_hwmon = NULL; } if (pmp_thermal.polling) { - hrtimer_cancel(&pmp_thermal.poll_timer); - cancel_work_sync(&pmp_thermal.poll_work); + apple_pmp_poll_stop(); pmp_thermal.polling = false; } + if (pmp_thermal.poll_wq) { + destroy_workqueue(pmp_thermal.poll_wq); + pmp_thermal.poll_wq = NULL; + } /* Drain the publisher before the final invalidation. */ apple_pmp_gpu_publish(pmp_thermal.sensors, 0, 8, 0); if (pmp_thermal.zone) { @@ -917,13 +987,17 @@ static int apple_pmp_thermal_setup(void) pmp_thermal.power_hwmon = NULL; goto fail; } - pmp_thermal.power_polling = true; - schedule_delayed_work(&pmp_thermal.power_work, msecs_to_jiffies(500)); - pmp_thermal.polling = true; - pmp_thermal.fast_poll = true; - hrtimer_start(&pmp_thermal.poll_timer, ms_to_ktime(APPLE_PMP_POLL_MS), - HRTIMER_MODE_REL); - /* Both guards start at the minimum frequency: hand over the cpufreq cap. */ + pmp_thermal.poll_wq = alloc_workqueue("apple-pmp-thermal", + WQ_UNBOUND | WQ_HIGHPRI | WQ_MEM_RECLAIM, + 1); + if (!pmp_thermal.poll_wq) { + ret = -ENOMEM; + goto fail; + } + /* Both guards start at the minimum frequency: hand over the cpufreq cap + * before publishing live polling so a handoff failure never races with + * PM suspend/resume. + */ pmp_thermal.owner = true; for (i = 0; i < ARRAY_SIZE(pmp_thermal.clusters); i++) { ret = apple_soc_cpufreq_set_thermal_owner(pmp_thermal.clusters[i].policy, @@ -931,6 +1005,20 @@ static int apple_pmp_thermal_setup(void) if (ret) goto fail; } + pmp_thermal.power_polling = true; + pmp_thermal.polling = true; + WRITE_ONCE(pmp_thermal.fast_poll, true); + if (!pmp_thermal.sleep_paused) { + queue_delayed_work(system_dfl_wq, &pmp_thermal.power_work, + msecs_to_jiffies(APPLE_PMP_POWER_POLL_MS)); + scoped_guard(spinlock_irqsave, &pmp_thermal.poll_lock) { + pmp_thermal.poll_armed = true; + pmp_thermal.fast_timer_armed = true; + hrtimer_start(&pmp_thermal.poll_timer, + ms_to_ktime(APPLE_PMP_POLL_MS), + HRTIMER_MODE_REL); + } + } pr_info("apple-pmp-thermal: T8132 provisional policy: CPU/GPU cooling from 106 C, target 110 C, full protection 115 C, three >=120 C samples for shutdown, 5 ms sampling from 95 C or while cooling (100 ms below), 100 ms governor, %s\n", pmp_thermal.power.unbudgeted ? "no power budget (fan cooled; rail faults still restrict)" : @@ -944,7 +1032,10 @@ static int apple_pmp_thermal_setup(void) static void apple_pmp_thermal_setup_work(struct work_struct *work) { - int ret = apple_pmp_thermal_setup(); + int ret; + + scoped_guard(mutex, &pmp_thermal.lifecycle_lock) + ret = apple_pmp_thermal_setup(); /* cpufreq policy creation is not a driver bind, so it need not retrigger * deferred platform probes. Retry only this startup dependency while @@ -975,6 +1066,7 @@ static int apple_pmp_thermal_probe(struct platform_device *pdev) pmp_thermal.governor_ns = 0; INIT_DELAYED_WORK(&pmp_thermal.setup_work, apple_pmp_thermal_setup_work); INIT_DELAYED_WORK(&pmp_thermal.power_work, apple_pmp_power_work); + INIT_DELAYED_WORK(&pmp_thermal.slow_poll_work, apple_pmp_slow_poll_work); INIT_WORK(&pmp_thermal.poll_work, apple_pmp_poll_work); hrtimer_setup(&pmp_thermal.poll_timer, apple_pmp_poll_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); @@ -983,18 +1075,16 @@ static int apple_pmp_thermal_probe(struct platform_device *pdev) } /* - * A deep sleep stops the PMP: sampling on through it would read its sensors stopped and - * restrict the CPUs and the GPU for seconds after the wake. Nothing runs to heat the die - * from the first device callback to the last, so neither sampler runs in between. + * Deep sleep stops the PMP and s2idle parks all clusters in WFI: sampling on + * through either sleep would read stopped/dark sensors and restrict the CPUs + * and the GPU after wake. Nothing runs to heat the die from the first device + * callback to the last, so pause both samplers across every system sleep. */ static int apple_pmp_thermal_prepare(struct device *dev) { - if (!pm_suspend_via_firmware()) - return 0; - if (pmp_thermal.polling) { - hrtimer_cancel(&pmp_thermal.poll_timer); - cancel_work_sync(&pmp_thermal.poll_work); - } + guard(mutex)(&pmp_thermal.lifecycle_lock); + if (pmp_thermal.polling) + apple_pmp_poll_stop(); if (pmp_thermal.power_polling) cancel_delayed_work_sync(&pmp_thermal.power_work); pmp_thermal.sleep_paused = true; @@ -1005,6 +1095,7 @@ static void apple_pmp_thermal_complete(struct device *dev) { struct apple_pmp_power_policy *p = &pmp_thermal.power; + guard(mutex)(&pmp_thermal.lifecycle_lock); if (!pmp_thermal.sleep_paused) return; pmp_thermal.sleep_paused = false; @@ -1019,10 +1110,17 @@ static void apple_pmp_thermal_complete(struct device *dev) p->level[2], p->last_ns); } if (pmp_thermal.power_polling) - schedule_delayed_work(&pmp_thermal.power_work, msecs_to_jiffies(500)); - if (pmp_thermal.polling) - hrtimer_start(&pmp_thermal.poll_timer, ms_to_ktime(APPLE_PMP_POLL_MS), - HRTIMER_MODE_REL); + queue_delayed_work(system_dfl_wq, &pmp_thermal.power_work, + msecs_to_jiffies(APPLE_PMP_POWER_POLL_MS)); + if (pmp_thermal.polling) { + scoped_guard(spinlock_irqsave, &pmp_thermal.poll_lock) { + pmp_thermal.poll_armed = true; + pmp_thermal.fast_timer_armed = true; + hrtimer_start(&pmp_thermal.poll_timer, + ms_to_ktime(APPLE_PMP_POLL_MS), + HRTIMER_MODE_REL); + } + } } static const struct dev_pm_ops apple_pmp_thermal_pm_ops = { @@ -1033,6 +1131,7 @@ static const struct dev_pm_ops apple_pmp_thermal_pm_ops = { static void apple_pmp_thermal_remove(struct platform_device *pdev) { cancel_delayed_work_sync(&pmp_thermal.setup_work); + guard(mutex)(&pmp_thermal.lifecycle_lock); apple_pmp_thermal_cleanup(); } diff --git a/tools/asahi/pmp-thermal-poll-tests.py b/tools/asahi/pmp-thermal-poll-tests.py new file mode 100755 index 0000000000000..53609335ae13c --- /dev/null +++ b/tools/asahi/pmp-thermal-poll-tests.py @@ -0,0 +1,280 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: GPL-2.0-only OR MIT +"""Host tests for apple-pmp-thermal polling state machine and sleep pause/resume.""" +import os +import subprocess +import tempfile +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[2] +SRC = (ROOT / 'drivers/thermal/apple-pmp-thermal.c').read_text() + + +def extract_fn(name): + start = SRC.index(name) + end = SRC.index('\n}\n', start) + 3 + return SRC[start:end] + + +# Ensure prepare() never bypasses sleep pausing or cancels poll_timer outside apple_pmp_poll_stop(). +prep_fn = extract_fn('static int apple_pmp_thermal_prepare(') +assert 'pm_suspend_via_firmware' not in prep_fn, 'prepare() must pause samplers across s2idle too' +assert 'hrtimer_cancel' not in prep_fn, 'prepare() must stop polling via apple_pmp_poll_stop()' + +code = '\n'.join([ + extract_fn('static void apple_pmp_poll_ensure_fast('), + extract_fn('static void apple_pmp_poll_stop('), + extract_fn('static void apple_pmp_slow_poll_work('), + extract_fn('static enum hrtimer_restart apple_pmp_poll_timer('), + prep_fn, + extract_fn('static void apple_pmp_thermal_complete('), +]) + +HARNESS = r''' +#include +#include +#include +#include +#include + +typedef uint64_t u64; +typedef uint64_t ktime_t; +struct device { int dummy; }; +struct work_struct { int dummy; }; +struct delayed_work { struct work_struct work; }; +struct hrtimer { int dummy; }; +struct workqueue_struct { int dummy; }; +struct mutex { int locked; }; +typedef struct { int locked; } spinlock_t; +enum hrtimer_restart { HRTIMER_NORESTART = 0, HRTIMER_RESTART = 1 }; +#define HRTIMER_MODE_REL 0 +#define BIT(x) (1U << (x)) +#define APPLE_PMP_POLL_MS 5 +#define APPLE_PMP_SLOW_POLL_MS 100 +#define APPLE_PMP_POWER_POLL_MS 500 +#define READ_ONCE(x) (x) +#define WRITE_ONCE(x, v) ((x) = (v)) + +static struct workqueue_struct mock_dfl_wq, mock_poll_wq; +static struct workqueue_struct *system_dfl_wq = &mock_dfl_wq; + +static bool timer_active; +static bool slow_work_pending; +static bool power_work_pending; +static unsigned int poll_work_queued; +static unsigned int gpu_publishes; +static u64 mock_now_ns = 1000000000ULL; + +static u64 ktime_get_ns(void) { return mock_now_ns; } +static ktime_t ms_to_ktime(unsigned int ms) { return (ktime_t)ms * 1000000ULL; } +static unsigned long msecs_to_jiffies(unsigned int ms) { return ms; } + +static void hrtimer_start(struct hrtimer *t, ktime_t tim, int mode) +{ + (void)t; (void)tim; (void)mode; + timer_active = true; +} + +static int hrtimer_cancel(struct hrtimer *t) +{ + (void)t; + bool was = timer_active; + timer_active = false; + return was; +} + +static u64 hrtimer_forward_now(struct hrtimer *t, ktime_t interval) +{ + (void)t; (void)interval; + return 1; +} + +struct apple_pmp_power_policy { + u64 last_ns; + unsigned int active; + unsigned int level[3]; +}; + +static struct { + const void *sensors; + struct mutex lock; + struct mutex lifecycle_lock; + spinlock_t poll_lock; + struct workqueue_struct *poll_wq; + struct apple_pmp_power_policy power; + struct delayed_work power_work; + struct delayed_work slow_poll_work; + u64 gpu_epoch; + bool power_polling; + struct hrtimer poll_timer; + struct work_struct poll_work; + bool polling; + bool poll_armed; + bool fast_timer_armed; + bool fast_poll; + bool sleep_paused; +} pmp_thermal = { + .poll_wq = &mock_poll_wq, +}; + +static bool queue_work(struct workqueue_struct *wq, struct work_struct *w) +{ + assert(wq == pmp_thermal.poll_wq); + if (w == &pmp_thermal.poll_work) + poll_work_queued++; + return true; +} + +static bool queue_delayed_work(struct workqueue_struct *wq, + struct delayed_work *dw, unsigned long delay) +{ + assert(wq == system_dfl_wq); + (void)delay; + if (dw == &pmp_thermal.slow_poll_work) + slow_work_pending = true; + else if (dw == &pmp_thermal.power_work) + power_work_pending = true; + return true; +} + +static bool cancel_delayed_work(struct delayed_work *dw) +{ + if (dw == &pmp_thermal.slow_poll_work) { + bool was = slow_work_pending; + slow_work_pending = false; + return was; + } + if (dw == &pmp_thermal.power_work) { + bool was = power_work_pending; + power_work_pending = false; + return was; + } + return false; +} + +static bool cancel_delayed_work_sync(struct delayed_work *dw) +{ + return cancel_delayed_work(dw); +} + +static bool cancel_work_sync(struct work_struct *w) +{ + if (w == &pmp_thermal.poll_work) + poll_work_queued = 0; + return true; +} + +static void apple_pmp_gpu_publish(const void *s, u64 epoch, unsigned int level, u64 ns) +{ + (void)s; (void)epoch; (void)level; (void)ns; + gpu_publishes++; +} + +static inline struct mutex *guard_mutex_enter(struct mutex *m) +{ + assert(!m->locked); + m->locked = 1; + return m; +} +static inline void guard_mutex_exit(struct mutex **m) +{ + assert((*m)->locked); + (*m)->locked = 0; +} +static inline spinlock_t *guard_spin_enter(spinlock_t *s) +{ + assert(!s->locked); + s->locked = 1; + return s; +} +static inline void guard_spin_exit(spinlock_t **s) +{ + assert((*s)->locked); + (*s)->locked = 0; +} + +#define CONCAT2(a, b) a##b +#define CONCAT(a, b) CONCAT2(a, b) +#define guard_mutex(m) struct mutex *CONCAT(_gm_, __LINE__) __attribute__((cleanup(guard_mutex_exit))) = guard_mutex_enter(m) +#define guard_spinlock_irqsave(s) spinlock_t *CONCAT(_gs_, __LINE__) __attribute__((cleanup(guard_spin_exit))) = guard_spin_enter(s) +#define guard(type) guard_##type +#define scoped_guard_mutex(m) for (struct mutex *_sgm __attribute__((cleanup(guard_mutex_exit))) = guard_mutex_enter(m), *_once = (struct mutex *)1; _once; _once = NULL) +#define scoped_guard_spinlock_irqsave(s) for (spinlock_t *_sgs __attribute__((cleanup(guard_spin_exit))) = guard_spin_enter(s), *_once = (spinlock_t *)1; _once; _once = NULL) +#define scoped_guard(type, arg) scoped_guard_##type(arg) + +''' + code + r''' + +static void reset_live(bool fast) +{ + memset(&pmp_thermal, 0, sizeof(pmp_thermal)); + pmp_thermal.poll_wq = &mock_poll_wq; + pmp_thermal.polling = true; + pmp_thermal.power_polling = true; + pmp_thermal.poll_armed = true; + pmp_thermal.fast_poll = fast; + pmp_thermal.power.last_ns = 500000000ULL; + pmp_thermal.power.active = BIT(0) | BIT(1) | BIT(2); + pmp_thermal.power.level[2] = 3; + timer_active = fast; + pmp_thermal.fast_timer_armed = fast; + slow_work_pending = !fast; + power_work_pending = true; + poll_work_queued = 0; + gpu_publishes = 0; +} + +int main(void) +{ + struct device dev = {}; + + /* 1. Hot s2idle: prepare stops fast timer + power_work, complete re-arms both. */ + reset_live(true); + assert(apple_pmp_thermal_prepare(&dev) == 0); + assert(pmp_thermal.sleep_paused); + assert(!pmp_thermal.poll_armed && !pmp_thermal.fast_timer_armed); + assert(!timer_active && !slow_work_pending && !power_work_pending); + + mock_now_ns = 20000000000ULL; + apple_pmp_thermal_complete(&dev); + assert(!pmp_thermal.sleep_paused); + assert(pmp_thermal.poll_armed && pmp_thermal.fast_timer_armed); + assert(timer_active && power_work_pending); + assert(pmp_thermal.power.last_ns == mock_now_ns); + assert(gpu_publishes == 1); + assert(apple_pmp_poll_timer(&pmp_thermal.poll_timer) == HRTIMER_RESTART); + assert(poll_work_queued == 1 && timer_active && pmp_thermal.fast_timer_armed); + + /* 2. Cool s2idle: prepare stops slow_poll_work + power_work, complete re-arms and hands off. */ + reset_live(false); + assert(apple_pmp_thermal_prepare(&dev) == 0); + assert(pmp_thermal.sleep_paused && !timer_active && !slow_work_pending && !power_work_pending); + apple_pmp_thermal_complete(&dev); + assert(!pmp_thermal.sleep_paused && timer_active && power_work_pending); + assert(apple_pmp_poll_timer(&pmp_thermal.poll_timer) == HRTIMER_NORESTART); + assert(!pmp_thermal.fast_timer_armed && slow_work_pending); + + /* 3. Race: slow_poll_work enters after ensure_fast() armed poll_timer and fast_poll flipped false. */ + reset_live(false); + slow_work_pending = false; /* timer fired and worker is entering callback */ + pmp_thermal.fast_poll = true; + apple_pmp_poll_ensure_fast(); + assert(timer_active && pmp_thermal.fast_timer_armed); + pmp_thermal.fast_poll = false; + poll_work_queued = 0; + apple_pmp_slow_poll_work(&pmp_thermal.slow_poll_work.work); + assert(!slow_work_pending && poll_work_queued == 0 && timer_active && pmp_thermal.fast_timer_armed); + + puts("PASS pmp-thermal-poll: s2idle/sleep prepare+complete and fast/slow handoff invariants"); + return 0; +} +''' + +with tempfile.TemporaryDirectory() as td: + c = Path(td) / 'pmp-thermal-poll.c' + b = Path(td) / 'pmp-thermal-poll' + c.write_text(HARNESS) + subprocess.run([os.environ.get('CC', 'cc'), '-std=gnu11', '-Wall', '-Wextra', '-Werror', + '-Wno-unused-function', '-Wno-unused-parameter', + '-fsanitize=undefined', '-fno-sanitize-recover=all', + str(c), '-o', str(b)], check=True) + subprocess.run([str(b)], check=True) diff --git a/tools/asahi/run-host-tests.py b/tools/asahi/run-host-tests.py index be774fc6097ba..ddd5ade29d228 100755 --- a/tools/asahi/run-host-tests.py +++ b/tools/asahi/run-host-tests.py @@ -479,6 +479,7 @@ def mutations(flag, names, base, expect=KILL): 'pmp-agx-vote-tests.py': [(out('--output'), PASS), (out('--output') + ['--mutations'], PASS)], 'pmp-floor-tests.py': [([], PASS)] + mutations('--mutant', ['no-hold', 'no-rate', 'no-streak', 'bad-word', 'foreign-ok', 'no-names', 'no-sum', 'zero-ok', 'lane-wide', 'class-twice'], []), 'pmp-j613-hwmon-tests.py': [([], PASS)], + 'pmp-thermal-poll-tests.py': [([], PASS)], 'pmu-rtc-tests.py': [(out(), PASS)] + mutations('--mutation', ('ack-clobber', 'arm-ack', 'offset-seconds', 'offset-sign', 'event-bit', 'wrong-control',