Lines Matching +full:vcpu +full:- +full:stall +full:- +full:detector

1 // SPDX-License-Identifier: GPL-2.0-only
3 // VCPU stall detector.
47 /* The vcpu stall configuration structure which applies to all the CPUs */
50 #define vcpu_stall_reg_write(vcpu, reg, value) \ argument
53 (vcpu) * VCPU_STALL_REG_LEN + (reg)))
63 /* Reload the stall detector counter register every in vcpu_stall_detect_timer_fn()
83 panic("vCPU stall detector"); in vcpu_stall_detector_irq()
92 struct hrtimer *vcpu_hrtimer = &vcpu_stall_detector->vcpu_hrtimer; in start_stall_detector_cpu()
97 /* Compute the number of ticks required for the stall detector in start_stall_detector_cpu()
105 /* Enable the internal clock and start the stall detector */ in start_stall_detector_cpu()
108 /* Pet the stall detector at half of its expiration timeout in start_stall_detector_cpu()
115 vcpu_stall_detector->is_initialized = true; in start_stall_detector_cpu()
128 if (!vcpu_stall_detector->is_initialized) in stop_stall_detector_cpu()
131 /* Disable the stall detector for the current CPU */ in stop_stall_detector_cpu()
132 hrtimer_cancel(&vcpu_stall_detector->vcpu_hrtimer); in stop_stall_detector_cpu()
134 vcpu_stall_detector->is_initialized = false; in stop_stall_detector_cpu()
146 struct device_node *np = pdev->dev.of_node; in vcpu_stall_detect_probe()
148 vcpu_stall_detectors = devm_alloc_percpu(&pdev->dev, in vcpu_stall_detect_probe()
151 return -ENOMEM; in vcpu_stall_detect_probe()
155 dev_err(&pdev->dev, "Failed to get memory resource\n"); in vcpu_stall_detect_probe()
159 if (!of_property_read_u32(np, "clock-frequency", &clock_freq_hz)) { in vcpu_stall_detect_probe()
162 dev_warn(&pdev->dev, "clk out of range\n"); in vcpu_stall_detect_probe()
167 if (!of_property_read_u32(np, "timeout-sec", &stall_timeout_sec)) { in vcpu_stall_detect_probe()
170 dev_warn(&pdev->dev, "stall timeout out of range\n"); in vcpu_stall_detect_probe()
179 .ppi_irq = -1, in vcpu_stall_detect_probe()
199 dev_err(&pdev->dev, "failed to install cpu hotplug"); in vcpu_stall_detect_probe()
227 { .compatible = "qemu,vcpu-stall-detector", },
246 MODULE_DESCRIPTION("VCPU stall detector");