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_hrtimer->function = vcpu_stall_detect_timer_fn; in start_stall_detector_cpu()
116 vcpu_stall_detector->is_initialized = true; in start_stall_detector_cpu()
129 if (!vcpu_stall_detector->is_initialized) in stop_stall_detector_cpu()
132 /* Disable the stall detector for the current CPU */ in stop_stall_detector_cpu()
133 hrtimer_cancel(&vcpu_stall_detector->vcpu_hrtimer); in stop_stall_detector_cpu()
135 vcpu_stall_detector->is_initialized = false; in stop_stall_detector_cpu()
147 struct device_node *np = pdev->dev.of_node; in vcpu_stall_detect_probe()
149 vcpu_stall_detectors = devm_alloc_percpu(&pdev->dev, in vcpu_stall_detect_probe()
152 return -ENOMEM; in vcpu_stall_detect_probe()
156 dev_err(&pdev->dev, "Failed to get memory resource\n"); in vcpu_stall_detect_probe()
160 if (!of_property_read_u32(np, "clock-frequency", &clock_freq_hz)) { in vcpu_stall_detect_probe()
163 dev_warn(&pdev->dev, "clk out of range\n"); in vcpu_stall_detect_probe()
168 if (!of_property_read_u32(np, "timeout-sec", &stall_timeout_sec)) { in vcpu_stall_detect_probe()
171 dev_warn(&pdev->dev, "stall timeout out of range\n"); in vcpu_stall_detect_probe()
180 .ppi_irq = -1, in vcpu_stall_detect_probe()
200 dev_err(&pdev->dev, "failed to install cpu hotplug"); in vcpu_stall_detect_probe()
228 { .compatible = "qemu,vcpu-stall-detector", },
247 MODULE_DESCRIPTION("VCPU stall detector");