kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Omar Sandoval <osandov@osandov.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	kvm@vger.kernel.org,  Gregory Price <gourry@gourry.net>,
	kernel-team@fb.com
Subject: Re: [PATCH v2] KVM: SVM: Don't skip unrelated instruction if INT3/INTO is replaced
Date: Fri, 31 Oct 2025 15:44:13 -0700	[thread overview]
Message-ID: <aQU7vR9_pf8uwqry@google.com> (raw)
In-Reply-To: <6ab4e8e5c5d6ea95f568a1ff8044779137dce428.1761774582.git.osandov@fb.com>

On Wed, Oct 29, 2025, Omar Sandoval wrote:
> @@ -2153,6 +2158,10 @@ u64 vcpu_tsc_khz(struct kvm_vcpu *vcpu);
>  #define EMULTYPE_PF		    (1 << 6)
>  #define EMULTYPE_COMPLETE_USER_EXIT (1 << 7)
>  #define EMULTYPE_WRITE_PF_TO_SP	    (1 << 8)
> +#define EMULTYPE_SKIP_SOFT_INT	    (1 << 9)
> +
> +#define EMULTYPE_SET_SOFT_INT_VECTOR(v)	(((v) & 0xff) << 16)
> +#define EMULTYPE_GET_SOFT_INT_VECTOR(e)	(((e) >> 16) & 0xff)
>  
>  static inline bool kvm_can_emulate_event_vectoring(int emul_type)
>  {

...

> +static int svm_update_soft_interrupt_rip(struct kvm_vcpu *vcpu, u8 vector)
>  {
> +	const int emul_type = EMULTYPE_SKIP | EMULTYPE_SKIP_SOFT_INT |
> +			      EMULTYPE_GET_SOFT_INT_VECTOR(vector);

Apparently our friendly neighborhood test bots[*] are the only ones that tested
this :-)

This should be EMULTYPE_SET_SOFT_INT_VECTOR()
                        ^
                        |

And I suspect EMULTYPE_SET_SOFT_INT_VECTOR() needs to cast (v) to a u32 so as
not to overflow the shift.


[*] https://lore.kernel.org/all/202510310909.y5ClH2qW-lkp@intel.com

  reply	other threads:[~2025-10-31 22:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-29 21:50 [PATCH v2] KVM: SVM: Don't skip unrelated instruction if INT3/INTO is replaced Omar Sandoval
2025-10-31 22:44 ` Sean Christopherson [this message]
2025-11-04 17:29   ` Omar Sandoval

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=aQU7vR9_pf8uwqry@google.com \
    --to=seanjc@google.com \
    --cc=gourry@gourry.net \
    --cc=kernel-team@fb.com \
    --cc=kvm@vger.kernel.org \
    --cc=osandov@osandov.com \
    --cc=pbonzini@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).