All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Zhang Haoyu <zhanghy@sangfor.com>,
	"Zhang, Yang Z" <yang.z.zhang@intel.com>,
	"Chen, Tiejun" <tiejun.chen@intel.com>,
	"Wang, Wei W" <wei.w.wang@intel.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH] KVM: x86: reset RVI upon system reset
Date: Thu, 11 Dec 2014 12:35:19 +0100	[thread overview]
Message-ID: <54898177.905@redhat.com> (raw)
In-Reply-To: <201412111615355608149@sangfor.com>



On 11/12/2014 09:15, Zhang Haoyu wrote:
>> >>         if (is_guest_mode(vcpu) && nested_exit_on_intr(vcpu))
>> >>                 return;
>> >>         if (!is_guest_mode(vcpu)) {
>> >>                 vmx_set_rvi(max_irr);
>> >>                 return;
>> >>         }
>> >>         
>> >>         if (max_irr == -1)
>> >>                 return;
>> >> and thus vmx_set_rvi() is never reached if is_guest_mode(vcpu) &&
>> >> !nested_exit_on_intr(vcpu).
>>
>>I don't think the above code is perfect. Since hwapic_irr_update() is a hot point, it's better to move the first check after the second check. In this case, Wei's patch looks more

The behavior for max_irr == -1 is different for is_guest_mode(vcpu)
(write 0 to RVI) and !is_guest_mode(vcpu) (do nothing).  So you have to
check is_guest_mode first, as in the patch that was applied.

Paolo

      parent reply	other threads:[~2014-12-11 11:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-05  2:53 [PATCH] KVM: x86: reset RVI upon system reset Wei Wang
2014-11-05  6:13 ` Chen, Tiejun
2014-11-05  7:39   ` Wang, Wei W
2014-11-05  8:06     ` Chen, Tiejun
2014-11-05  8:50       ` Wang, Wei W
2014-11-05  9:02         ` Chen, Tiejun
2014-11-05 10:02           ` Paolo Bonzini
2014-11-06  1:08             ` Zhang, Yang Z
2014-12-11  8:15               ` Zhang Haoyu
2014-12-11 11:06                 ` Zhang, Yang Z
2014-12-12  9:56                   ` Zhang Haoyu
2014-12-12 10:27                     ` Paolo Bonzini
2014-12-15  1:52                       ` Zhang Haoyu
2014-12-15  9:32                         ` Paolo Bonzini
2014-12-11 11:35                 ` Paolo Bonzini [this message]

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=54898177.905@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=tiejun.chen@intel.com \
    --cc=wei.w.wang@intel.com \
    --cc=yang.z.zhang@intel.com \
    --cc=zhanghy@sangfor.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 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.