mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Maxim Levitsky <mlevitsk@redhat.com>, kvm@vger.kernel.org
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	linux-kernel@vger.kernel.org
Subject: Re: AVIC related warning in enable_irq_window
Date: Sat, 2 May 2020 18:42:03 +0200	[thread overview]
Message-ID: <758b27a8-74c0-087d-d90b-d95faee2f561@redhat.com> (raw)
In-Reply-To: <9ce7bb5c4fb8bcc4ac21103f7534a6edfcbe195d.camel@redhat.com>

On 02/05/20 15:58, Maxim Levitsky wrote:
> The AVIC is disabled by svm_toggle_avic_for_irq_window, which calls
> kvm_request_apicv_update, which broadcasts the KVM_REQ_APICV_UPDATE vcpu request,
> however it doesn't broadcast it to CPU on which now we are running, which seems OK,
> because the code that handles that broadcast runs on each VCPU entry, thus
> when this CPU will enter guest mode it will notice and disable the AVIC.
> 
> However later in svm_enable_vintr, there is test 'WARN_ON(kvm_vcpu_apicv_active(&svm->vcpu));'
> which is still true on current CPU because of the above.

Good point!  We can just remove the WARN_ON I think.  Can you send a patch?

svm_set_vintr also has a rather silly

static void svm_set_vintr(struct vcpu_svm *svm)
{
       set_intercept(svm, INTERCEPT_VINTR);
       if (is_intercept(svm, INTERCEPT_VINTR))
               svm_enable_vintr(svm);
}

so I'm thinking of just inlining svm_enable_vintr and renaming
svm_{set,clear}_vintr to svm_{enable,disable}_vintr_window.  Would you
like to send two patches for this, the first to remove the WARN_ON and
the second to do the cleanup?

Thanks,

Paolo

> The code containing this warning was added in commit
> 
> 64b5bd27042639dfcc1534f01771b7b871a02ffe
> KVM: nSVM: ignore L1 interrupt window while running L2 with V_INTR_MASKING=1


  reply	other threads:[~2020-05-02 16:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-02 13:58 Maxim Levitsky
2020-05-02 16:42 ` Paolo Bonzini [this message]
2020-05-02 16:43   ` Maxim Levitsky
2020-05-03 19:18     ` Suravee Suthikulpanit
2020-05-04  8:46   ` Suravee Suthikulpanit
2020-05-04  9:13     ` Maxim Levitsky
2020-05-04  9:25       ` Paolo Bonzini
2020-05-04 10:37         ` Suravee Suthikulpanit
2020-05-04 10:49           ` Paolo Bonzini
2020-05-05  7:55             ` Suravee Suthikulpanit
2020-05-05 11:40               ` Maxim Levitsky
2020-05-05 12:12               ` Paolo Bonzini
2020-05-06  0:42                 ` Suravee Suthikulpanit

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=758b27a8-74c0-087d-d90b-d95faee2f561@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlevitsk@redhat.com \
    --cc=suravee.suthikulpanit@amd.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

all inboxes | Powered by JetHome®