Lines Matching +full:vcpu +full:- +full:stall +full:- +full:detector
1 // SPDX-License-Identifier: GPL-2.0-only
3 // VCPU stall detector.
46 /* The vcpu stall configuration structure which applies to all the CPUs */
49 #define vcpu_stall_reg_write(vcpu, reg, value) \ argument
52 (vcpu) * VCPU_STALL_REG_LEN + (reg)))
62 /* Reload the stall detector counter register every in vcpu_stall_detect_timer_fn()
85 struct hrtimer *vcpu_hrtimer = &vcpu_stall_detector->vcpu_hrtimer; in start_stall_detector_cpu()
90 /* Compute the number of ticks required for the stall detector in start_stall_detector_cpu()
98 /* Enable the internal clock and start the stall detector */ in start_stall_detector_cpu()
101 /* Pet the stall detector at half of its expiration timeout in start_stall_detector_cpu()
108 vcpu_hrtimer->function = vcpu_stall_detect_timer_fn; in start_stall_detector_cpu()
109 vcpu_stall_detector->is_initialized = true; in start_stall_detector_cpu()
122 if (!vcpu_stall_detector->is_initialized) in stop_stall_detector_cpu()
125 /* Disable the stall detector for the current CPU */ in stop_stall_detector_cpu()
126 hrtimer_cancel(&vcpu_stall_detector->vcpu_hrtimer); in stop_stall_detector_cpu()
128 vcpu_stall_detector->is_initialized = false; in stop_stall_detector_cpu()
140 struct device_node *np = pdev->dev.of_node; in vcpu_stall_detect_probe()
142 vcpu_stall_detectors = devm_alloc_percpu(&pdev->dev, in vcpu_stall_detect_probe()
145 return -ENOMEM; in vcpu_stall_detect_probe()
149 dev_err(&pdev->dev, "Failed to get memory resource\n"); in vcpu_stall_detect_probe()
153 if (!of_property_read_u32(np, "clock-frequency", &clock_freq_hz)) { in vcpu_stall_detect_probe()
156 dev_warn(&pdev->dev, "clk out of range\n"); in vcpu_stall_detect_probe()
161 if (!of_property_read_u32(np, "timeout-sec", &stall_timeout_sec)) { in vcpu_stall_detect_probe()
164 dev_warn(&pdev->dev, "stall timeout out of range\n"); in vcpu_stall_detect_probe()
180 dev_err(&pdev->dev, "failed to install cpu hotplug"); in vcpu_stall_detect_probe()
203 { .compatible = "qemu,vcpu-stall-detector", },
222 MODULE_DESCRIPTION("VCPU stall detector");