[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 05/10] x86/HVM/SVM: Add AVIC initialization code
> + > +#define AVIC_DOORBELL 0xc001011b MSR_AVIC_DOORBELL (and it should probably go to include/asm-x86/msr-index.h) > + > +#define AVIC_HPA_SHIFT 12 Is there a reason not to use regular PAGE_SHIFT? > +#define AVIC_HPA_MASK (((1ULL << 40) - 1) << AVIC_HPA_SHIFT) > +#define AVIC_VAPIC_BAR_MASK AVIC_HPA_MASK > + > +/* > + * Note: > + * Currently, svm-avic mode is not supported with nested virtualization. > + * Therefore, it is not yet currently enabled by default. Once the support > + * is in-place, this should be enabled by default. > + */ > +bool svm_avic = 0; > +boolean_param("svm-avic", svm_avic); > + > +static struct avic_phy_apic_id_ent * > +avic_get_phy_apic_id_ent(const struct vcpu *v, unsigned int index) Something like phys_apicid might be more descriptive. > +{ > + struct avic_phy_apic_id_ent *avic_phy_apic_id_table; > + struct svm_domain *d = &v->domain->arch.hvm_domain.svm; > + > + if ( !d->avic_phy_apic_id_table_mfn ) > + return NULL; > + > + /* > + * Note: APIC ID = 0xff is used for broadcast. > + * APIC ID > 0xff is reserved. > + */ > + if ( index >= 0xff ) > + return NULL; > + > + avic_phy_apic_id_table = mfn_to_virt(d->avic_phy_apic_id_table_mfn); > + > + return &avic_phy_apic_id_table[index]; > +} > +} > + > +static inline u32 * > +avic_get_bk_page_entry(const struct vcpu *v, u32 offset) > +{ > + const struct vlapic *vlapic = vcpu_vlapic(v); > + char *tmp; > + > + if ( !vlapic || !vlapic->regs_page ) Should this be changed to an ASSERT? I think this is only called from places that already tested this or from places that you wouldn't get to unless these both were true (like VMEXIT handler). -boris _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |