On Tue, Jan 22, 2013 at 09:13:06PM -0200, Marcelo Tosatti wrote:
> On Tue, Jan 22, 2013 at 05:55:53PM +0200, Gleb Natapov wrote:
> > On Tue, Jan 22, 2013 at 12:21:47PM +0000, Zhang, Yang Z wrote:
> > > >> +static void vmx_set_msr_bitmap(struct kvm_vcpu *vcpu)
> > > >> +{
> > > >> + unsigned long *msr_bitmap;
> > > >> +
> > > >> + if (apic_x2apic_mode(vcpu->arch.apic))
> > > >
> > > > vcpu->arch.apic can be NULL.
> > > Actually, call apic_x2apic_mode to check whether use x2apic msr bitmap is
> > > wrong.
> > > VCPU uses x2apic but it may not set virtual x2apic mode bit due to TPR
> > > shadow not enabled or irqchip not in kernel. Check the virtual x2apic
> > > mode bit in vmcs directly should be a better choice. How about the follow
> > > code:
> > >
> > If TPR shadow it not enabled vmx_msr_bitmap_.*x2apic bitmap will have
> > x2apic MSRs intercepted.
>
> And what is the problem? APIC register virt depends on TPR shadow.
No problem. I am saying that it is safe to set exit bitmap to
vmx_msr_bitmap_.*x2apic in this case, so no need to check vmcs,
apic_x2apic_mode() is sufficient.
--
Gleb.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html