Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: "Jörg Rödel" <joro@8bytes.org>
To: sashiko-reviews@lists.linux.dev
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH v4 3/7] KVM: SVM: Implement GET_AP_APIC_IDS NAE event
Date: Tue, 1 Dec 2026 11:23:24 +0100	[thread overview]
Message-ID: <aw6fSqxiKNIQkG0w@8bytes.org> (raw)
In-Reply-To: <sashiko-outbox-243025@kernel.org>

On Tue, Dec 01, 2026 at 10:00:56AM +0000, sashiko-bot@kernel.org wrote:
> > +		if (signal_pending(current))
> > +			return -EINTR;
> > +		cond_resched();
> 
> [Severity: High]
> Does returning -EINTR here leave the SVM_VMGEXIT_GET_APIC_IDS event
> uncompleted while telling the guest it succeeded?
> 
> Before dispatching to sev_snp_get_apic_ids(), sev_handle_vmgexit() clears
> ghcb->save.valid_bitmap in sev_es_sync_from_ghcb() and presets the GHCB
> return code to success via svm_vmgexit_success(svm, 0).  Hardware has
> already advanced the guest RIP past VMGEXIT, and no
> vcpu->arch.complete_userspace_io callback is installed when returning
> -EINTR.  On the next KVM_RUN, svm_prepare_switch_to_guest() syncs the
> preset success status back to the GHCB and resumes the guest past VMGEXIT
> without ever writing the APIC ID descriptor to guest memory.

Agreed, this hunk is over-cautious and can be trimmed down to the
cond_resched().

-Joerg

  reply	other threads:[~2026-12-01 10:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01  9:45 [PATCH v4 0/7] KVM: SVM: Support direct setting of VMSA for SEV-SNP guests Jörg Rödel
2026-12-01  9:45 ` [PATCH v4 1/7] KVM: SEV: Document SNP direct VMSA userspace ABI Jörg Rödel
2026-12-01  9:45 ` [PATCH v4 2/7] KVM: SEV: Add direct VMSA capability Jörg Rödel
2026-12-01  9:45 ` [PATCH v4 3/7] KVM: SVM: Implement GET_AP_APIC_IDS NAE event Jörg Rödel
2026-12-01 10:00   ` sashiko-bot
2026-12-01 10:23     ` Jörg Rödel [this message]
2026-12-01  9:45 ` [PATCH v4 4/7] KVM: SEV: Allow VMSA pages in SNP launch updates Jörg Rödel
2026-12-01  9:45 ` [PATCH v4 5/7] KVM: SEV: Add SNP vCPU state get and set commands Jörg Rödel
2026-12-01  9:45 ` [PATCH v4 6/7] KVM: selftests: Test SNP vCPU state and direct VMSA launch Jörg Rödel
2026-12-01  9:45 ` [PATCH v4 7/7] KVM: selftests: Test the SNP APIC-ID-list GHCB request Jörg Rödel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aw6fSqxiKNIQkG0w@8bytes.org \
    --to=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox