All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Mattson <jmattson@google.com>
To: stsp <stsp2@yandex.ru>
Cc: Maxim Levitsky <mlevitsk@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Joerg Roedel <joro@8bytes.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Jan Kiszka <jan.kiszka@siemens.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	kvm@vger.kernel.org
Subject: Re: [PATCH v2] KVM: X86: Fix exception untrigger on ret to user
Date: Mon, 28 Jun 2021 09:50:34 -0700	[thread overview]
Message-ID: <CALMp9eQyhPO_Dpg8J0ZQ7jEnobAT5ydngB+x9OnFRyBU030E6w@mail.gmail.com> (raw)
In-Reply-To: <9a7962d1-7eee-620b-5b30-ffcc123c324c@yandex.ru>

On Mon, Jun 28, 2021 at 8:09 AM stsp <stsp2@yandex.ru> wrote:
>
> 28.06.2021 17:29, Maxim Levitsky пишет:
> > I used to know that area very very well, and I basically combed
> > the whole thing back and forth,
> > and I have patch series to decouple injected and
> > pending exceptions.
>
> Yes, and also I dislike the fact
> that you can't easily distinguish
> the exception injected from
> user-space, with the PF coming
> from the guest itself. They occupy
> the same pending/injected fields.
> Some refactoring will definitely
> not hurt.
>
>
> > I'll refresh my memory on this and then I'll review your patch.
> >
> > My gut feeling is that you discovered too that injections of
> > exceptions from userspace is kind of broken and only works
> > because Qemu doesn't really inject much
>
> Actually I discovered that injecting
> _interrupts_ is kinda broken (on Core2),
> because they clash with guest's PF.
> Maybe if I would be using KVM-supplied
> injection APIs, I would avoid the problem.
> But I just use KVM_SET_REGS to inject
> the interrupt, which perhaps qemu doesn't
> do.
>

I don't know how you can inject an interrupt with KVM_SET_REGS, but I
suspect that you're doing something wrong. :-)

 If I wanted to inject an interrupt from userspace, I would use
KVM_SET_LAPIC (assuming that the local APIC is active) to set the
appropriate bit in IRRV. Before you can deliver an interrupt, you have
to check the local APIC anyway, to see whether or not your interrupt
would be blocked by PPR.

  reply	other threads:[~2021-06-28 16:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28 12:48 [PATCH v2] KVM: X86: Fix exception untrigger on ret to user Stas Sergeev
2021-06-28 14:29 ` Maxim Levitsky
2021-06-28 15:09   ` stsp
2021-06-28 16:50     ` Jim Mattson [this message]
2021-06-28 17:00       ` stsp
2021-07-06 11:49   ` Maxim Levitsky
2021-07-06 12:06     ` stsp
2021-07-06 20:29       ` Maxim Levitsky
2021-07-06 21:50         ` stsp
2021-07-06 23:00           ` Maxim Levitsky
2021-07-06 23:06             ` stsp
2021-07-06 23:45               ` Paolo Bonzini
2021-07-06 23:51                 ` stsp
2021-07-07  0:13                   ` Paolo Bonzini
2021-07-07 16:16               ` Jim Mattson
2021-07-07 16:34                 ` stsp
2021-07-07 16:46                   ` Jim Mattson
2021-07-07 16:58                     ` stsp
2021-07-07 17:39                       ` Jim Mattson

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=CALMp9eQyhPO_Dpg8J0ZQ7jEnobAT5ydngB+x9OnFRyBU030E6w@mail.gmail.com \
    --to=jmattson@google.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=jan.kiszka@siemens.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mlevitsk@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=stsp2@yandex.ru \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=x86@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.