diff options
| author | Tao Cui <cuitao@kylinos.cn> | 2026-08-10 12:21:50 +0800 |
|---|---|---|
| committer | Huacai Chen <chenhuacai@loongson.cn> | 2026-08-10 12:21:50 +0800 |
| commit | 01c823f14ed4caac4bf1ceb90926f26d67d753ec (patch) | |
| tree | 001343cfb5314299fcc54613d36e23ec7469546c /tools/perf/scripts/python | |
| parent | fe41c0759b11b982f945633b7abb4b49dfaf8ce4 (diff) | |
| download | linux-01c823f14ed4caac4bf1ceb90926f26d67d753ec.tar.gz linux-01c823f14ed4caac4bf1ceb90926f26d67d753ec.zip | |
LoongArch: KVM: Prevent division by zero in periodic timer restore
A guest can write CSR.TCFG with the periodic bit set but a period value
of zero. When kvm_restore_timer() later enters the periodic branch,
period = cfg & CSR_TCFG_VAL evaluates to 0, causing (delta % period) to
trigger a division by zero and crash the host kernel.
Clamp the period to 1 to avoid the panic.
Fixes: a5857b9ff6e0 ("LoongArch: KVM: Implement vcpu timer operations")
Reviewed-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Tao Cui <cuitao@kylinos.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
