Skip to content

virt_kvm: Set flags to accept values in set_activity#4014

Open
smalis-msft wants to merge 2 commits into
microsoft:mainfrom
smalis-msft:kvm-set-flags
Open

virt_kvm: Set flags to accept values in set_activity#4014
smalis-msft wants to merge 2 commits into
microsoft:mainfrom
smalis-msft:kvm-set-flags

Conversation

@smalis-msft

Copy link
Copy Markdown
Contributor

On KVM the nmi_pending and interrupt_shadow values ignored by set_vcpu_events unless flags are specified saying to accept them. This is because these values can be modified by other processors asynchronously, and the caller may not want to accidentally overwrite these. In our case when these values are true we do in fact want them to be set, so pass in the flags to do so. However when they're false, we don't want to accidentally clear a signal from another VP, so check first.

@smalis-msft
smalis-msft requested a review from a team as a code owner July 23, 2026 19:36
Copilot AI review requested due to automatic review settings July 23, 2026 19:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes virt_kvm’s x86_64 VP activity update path so that KVM actually applies nmi_pending and interrupt_shadow when requested, by setting the required kvm_vcpu_events.flags bits. It also avoids accidentally clearing asynchronous signals by only marking those fields as valid when their values are true.

Changes:

  • Compute kvm_vcpu_events.flags to include KVM_VCPUEVENT_VALID_NMI_PENDING when nmi_pending is true.
  • Compute kvm_vcpu_events.flags to include KVM_VCPUEVENT_VALID_SHADOW when interrupt_shadow is true.
  • Pass the computed flags into set_vcpu_events so KVM honors those fields.

@smalis-msft smalis-msft added the backport_1.8.2607 Change should be backported to the release/1.8.2607 branch label Jul 23, 2026
@github-actions

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport_1.8.2607 Change should be backported to the release/1.8.2607 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants