Skip to content

Commit

Permalink
xen: Set max SCHEDOP_shutdown events to 3
Browse files Browse the repository at this point in the history
In some instances, the guest may run in an infinite crash loop causing
the entire debug ring buffer to be filled with junk information. We now
limit this to 3 events, allowing us to view useful information.
  • Loading branch information
chp-io committed Nov 7, 2024
1 parent 3e66ebe commit 6d7b27b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions vmm/include/xen/vcpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ class xen_vcpu {
uint32_t m_apicid{};
uint32_t m_acpiid{};

uint32_t m_max_shutdown_events{};

public:
~xen_vcpu() = default;
xen_vcpu(xen_vcpu &&) = delete;
Expand Down
8 changes: 7 additions & 1 deletion vmm/src/xen/vcpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,13 @@ bool xen_vcpu::handle_sched_op()
* see how we got here.
*/
m_uv_vcpu->set_rax(-EINVAL);
return true;

if (++m_max_shutdown_events == 3) {
return false;
}
else {
return true;
}
}
default:
printv("%s: cmd=%lu unhandled\n", __func__, cmd);
Expand Down

0 comments on commit 6d7b27b

Please sign in to comment.