All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: "Zhang, Yang Z" <yang.z.zhang@intel.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"Shan, Haitao" <haitao.shan@intel.com>,
	"Tian, Kevin" <kevin.tian@intel.com>
Subject: Re: [PATCH v7 3/3] x86, apicv: add virtual x2apic support
Date: Tue, 25 Dec 2012 09:31:43 +0200	[thread overview]
Message-ID: <20121225073143.GA17584@redhat.com> (raw)
In-Reply-To: <A9667DDFB95DB7438FA9D7D576C3D87E2E991D@SHSMSX101.ccr.corp.intel.com>

On Tue, Dec 25, 2012 at 07:25:15AM +0000, Zhang, Yang Z wrote:
> Gleb Natapov wrote on 2012-12-25:
> > On Tue, Dec 25, 2012 at 06:42:59AM +0000, Zhang, Yang Z wrote:
> >> Gleb Natapov wrote on 2012-12-25:
> >>> On Mon, Dec 24, 2012 at 11:53:37PM +0000, Zhang, Yang Z wrote:
> >>>> Gleb Natapov wrote on 2012-12-24:
> >>>>> On Mon, Dec 24, 2012 at 02:35:35AM +0000, Zhang, Yang Z wrote:
> >>>>>> Zhang, Yang Z wrote on 2012-12-24:
> >>>>>>> Gleb Natapov wrote on 2012-12-20:
> >>>>>>>> On Mon, Dec 17, 2012 at 01:30:50PM +0800, Yang Zhang wrote:
> >>>>>>>>> basically to benefit from apicv, we need clear MSR bitmap for
> >>>>>>>>> corresponding x2apic MSRs:
> >>>>>>>>>     0x800 - 0x8ff: no read intercept for apicv register virtualization
> >>>>>>>>>     TPR,EOI,SELF-IPI: no write intercept for virtual interrupt delivery
> >>>>>>>> We do not set "Virtualize x2APIC mode" bit in secondary execution
> >>>>>>>> control. If I read the spec correctly without that those MSR read/writes
> >>>>>>>> will go straight to physical local APIC.
> >>>>>>> Right. Now it cannot get benefit, but we may enable it in future and
> >>>>>>> then we can benefit from it.
> >>>>> Without enabling it you cannot disable MSR intercept for x2apic MSRs.
> >>>>> 
> >>>>>> how about to add the following check:
> >>>>>> if (apicv_enabled && virtual_x2apic_enabled)
> >>>>>> 	clear_msr();
> >>>>>> 
> >>>>> I do not understand what do you mean here.
> >>>> In this patch, it will clear MSR bitmap(0x800 -0x8ff) when apicv enabled. As
> > you
> >>> said, since kvm doesn't set "virtualize x2apic mode", APIC register
> >>> virtualization never take effect. So we need to clear MSR bitmap only
> >>> when apicv enabled and virtualize x2apic mode set.
> >>>> 
> >>> But currently it is never set.
> >> So you think the third patch is not necessary currently? Unless we
> >> enabled "virtualize x2apic mode".
> >> 
> > Without third patch vid will not work properly if a guest is in x2apic
> > mode. Actually second and third patches need to be reordered to not have
> > a windows where x2apic is broken. The problem is that this patch itself
> > is buggy since it does not set "virtualize x2apic mode" flag. It should
> > set the flag if vid is enabled and if the flag cannot be set vid should
> > be forced off.
> In what conditions this flag cannot be set? I think the only case is that KVM doesn't expose the x2apic capability to guest, if this is true, the guest will never use x2apic and we still can use vid.
> 
We can indeed set "virtualize x2apic mode" unconditionally since it does
not take any effect if x2apic MSRs are intercepted.

--
			Gleb.

  reply	other threads:[~2012-12-25  7:31 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-17  5:30 [PATCH v7 0/3] x86, apicv: Add APIC virtualization support Yang Zhang
2012-12-17  5:30 ` [PATCH v7 1/3] x86, apicv: add APICv register " Yang Zhang
2012-12-17  5:30 ` [PATCH v7 2/3] x86, apicv: add virtual interrupt delivery support Yang Zhang
2012-12-20  0:59   ` Marcelo Tosatti
2012-12-20  1:01     ` Marcelo Tosatti
2012-12-20  6:42     ` Gleb Natapov
2012-12-20 12:53       ` Marcelo Tosatti
2012-12-20 13:12         ` Gleb Natapov
2012-12-20 23:07           ` Marcelo Tosatti
2012-12-25  7:49             ` Zhang, Yang Z
2012-12-20  1:26   ` Marcelo Tosatti
2012-12-20  6:51     ` Gleb Natapov
2012-12-20 13:01       ` Marcelo Tosatti
2012-12-20 13:02         ` Marcelo Tosatti
2012-12-20 22:00   ` Marcelo Tosatti
2012-12-27  3:32     ` Zhang, Yang Z
2012-12-27  6:20       ` Gleb Natapov
2012-12-27  6:34         ` Zhang, Yang Z
2012-12-27  6:38           ` Gleb Natapov
2012-12-27  6:50             ` Zhang, Yang Z
2012-12-20 22:59   ` Marcelo Tosatti
2012-12-21  7:51     ` Gleb Natapov
2012-12-21 11:39       ` Marcelo Tosatti
2012-12-21 12:08         ` Gleb Natapov
2012-12-27  2:24           ` Zhang, Yang Z
2012-12-27  6:23             ` Gleb Natapov
2012-12-27  6:25               ` Zhang, Yang Z
2012-12-31 15:02                 ` Marcelo Tosatti
2012-12-17  5:30 ` [PATCH v7 3/3] x86, apicv: add virtual x2apic support Yang Zhang
2012-12-20  8:31   ` Gleb Natapov
2012-12-24  1:41     ` Zhang, Yang Z
2012-12-24  2:35     ` Zhang, Yang Z
2012-12-24  9:23       ` Gleb Natapov
2012-12-24 23:53         ` Zhang, Yang Z
2012-12-25  6:38           ` Gleb Natapov
2012-12-25  6:42             ` Zhang, Yang Z
2012-12-25  6:50               ` Gleb Natapov
2012-12-25  7:25                 ` Zhang, Yang Z
2012-12-25  7:31                   ` Gleb Natapov [this message]
2012-12-25  7:46                     ` Zhang, Yang Z
2012-12-25  7:52                       ` Gleb Natapov
2012-12-25  8:24                         ` Zhang, Yang Z
2012-12-25 11:58                           ` Gleb Natapov

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=20121225073143.GA17584@redhat.com \
    --to=gleb@redhat.com \
    --cc=haitao.shan@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=yang.z.zhang@intel.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.