This patch would enable Xen to handle x2APIC MSR accessing of HVM guest, which is faster(avoid decoding of MMIO accessing). The credit comes to Gleb Natapov who complete the work for KVM. Have tested with 4 vcpus guest, with/without x2apic support. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 12/02/2010 03:09 AM, Yang, Sheng wrote:> This patch would enable Xen to handle x2APIC MSR accessing of HVM guest, which is > faster(avoid decoding of MMIO accessing). The credit comes to Gleb Natapov who > complete the work for KVM.Compared to Gleb''s patch, I think yours is missing support for directed EOI in the LAPIC emulation. Linux doesn''t use it, but I think it''s easy enough that it''s better to do it early. Paolo _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Thursday 02 December 2010 13:31:09 Paolo Bonzini wrote:> On 12/02/2010 03:09 AM, Yang, Sheng wrote: > > This patch would enable Xen to handle x2APIC MSR accessing of HVM guest, > > which is faster(avoid decoding of MMIO accessing). The credit comes to > > Gleb Natapov who complete the work for KVM. > > Compared to Gleb''s patch, I think yours is missing support for directed > EOI in the LAPIC emulation. Linux doesn''t use it, but I think it''s easy > enough that it''s better to do it early.I think we can do it step by step. This patch is big enough. And also, directed EOI is indicated by one bit in APIC version register, so it won''t affect us here. I''d like to work the direct EOI patch out, but I am thinking about how to test it... -- regards Yang, Sheng> > Paolo_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 12/02/2010 06:43 AM, Yang, Sheng wrote:> I think we can do it step by step. This patch is big enough.Yes, I agree it can go in as a separate patch.> I''d like to work the direct EOI patch out, but I am thinking about how to test > it...Maybe you can run Xen inside an HVM guest, forcing x2apic mode to be enabled? You do not need nested VMX if you only run PV guests in the guest hypervisor. Paolo _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Thursday 02 December 2010 13:48:15 Paolo Bonzini wrote:> On 12/02/2010 06:43 AM, Yang, Sheng wrote: > > I think we can do it step by step. This patch is big enough. > > Yes, I agree it can go in as a separate patch. > > > I''d like to work the direct EOI patch out, but I am thinking about how to > > test it... > > Maybe you can run Xen inside an HVM guest, forcing x2apic mode to be > enabled? You do not need nested VMX if you only run PV guests in the > guest hypervisor.I don''t know how much work need to be done for this, and if it''s worth to do for something was not be used in practice(if it would be used in practice, then it would be easy for us to test)... Anyway I would prepare the code later. -- regards Yang, Sheng> > Paolo_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 12/02/2010 07:23 AM, Yang, Sheng wrote:> On Thursday 02 December 2010 13:48:15 Paolo Bonzini wrote: >> On 12/02/2010 06:43 AM, Yang, Sheng wrote: >>> I think we can do it step by step. This patch is big enough. >> >> Yes, I agree it can go in as a separate patch. >> >>> I''d like to work the direct EOI patch out, but I am thinking about how to >>> test it... >> >> Maybe you can run Xen inside an HVM guest, forcing x2apic mode to be >> enabled? You do not need nested VMX if you only run PV guests in the >> guest hypervisor. > > I don''t know how much work need to be done for this, and if it''s worth to do for > something was not be used in practice(if it would be used in practice, then it > would be easy for us to test)...Maybe it''s as easy as this: diff --git a/xen/arch/x86/genapic/x2apic.c b/xen/arch/x86/genapic/x2apic.c --- a/xen/arch/x86/genapic/x2apic.c +++ b/xen/arch/x86/genapic/x2apic.c @@ -41,13 +41,13 @@ int x2apic_cmdline_disable(void) static int probe_x2apic_phys(void) { return x2apic && x2apic_phys && x2apic_is_available() && - iommu_supports_eim(); + 1; } static int probe_x2apic_cluster(void) { return x2apic && !x2apic_phys && x2apic_is_available() && - iommu_supports_eim(); + 1; } const struct genapic apic_x2apic_phys = { The original Xen x2apic code was not conditional on iommu_supports_eim(). Paolo _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Thursday 02 December 2010 14:44:05 Paolo Bonzini wrote:> On 12/02/2010 07:23 AM, Yang, Sheng wrote: > > On Thursday 02 December 2010 13:48:15 Paolo Bonzini wrote: > >> On 12/02/2010 06:43 AM, Yang, Sheng wrote: > >>> I think we can do it step by step. This patch is big enough. > >> > >> Yes, I agree it can go in as a separate patch. > >> > >>> I''d like to work the direct EOI patch out, but I am thinking about how > >>> to test it... > >> > >> Maybe you can run Xen inside an HVM guest, forcing x2apic mode to be > >> enabled? You do not need nested VMX if you only run PV guests in the > >> guest hypervisor. > > > > I don''t know how much work need to be done for this, and if it''s worth to > > do for something was not be used in practice(if it would be used in > > practice, then it would be easy for us to test)... > > Maybe it''s as easy as this: > > diff --git a/xen/arch/x86/genapic/x2apic.c b/xen/arch/x86/genapic/x2apic.c > --- a/xen/arch/x86/genapic/x2apic.c > +++ b/xen/arch/x86/genapic/x2apic.c > @@ -41,13 +41,13 @@ int x2apic_cmdline_disable(void) > static int probe_x2apic_phys(void) > { > return x2apic && x2apic_phys && x2apic_is_available() && > - iommu_supports_eim(); > + 1; > } > > static int probe_x2apic_cluster(void) > { > return x2apic && !x2apic_phys && x2apic_is_available() && > - iommu_supports_eim(); > + 1; > } > > const struct genapic apic_x2apic_phys = { > > The original Xen x2apic code was not conditional on iommu_supports_eim().I didn''t mean this part. I am just not sure if xen can run as HVM guest smoothly... Would check that later. -- regards Yang, Sheng _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 12/02/2010 07:49 AM, Yang, Sheng wrote:> I didn''t mean this part. I am just not sure if xen can run as HVM guest > smoothly...Yes, it does (or at least it did, and it definitely runs under KVM). Paolo _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Thursday 02 December 2010 10:09:36 Yang, Sheng wrote:> This patch would enable Xen to handle x2APIC MSR accessing of HVM guest, > which is faster(avoid decoding of MMIO accessing). The credit comes to > Gleb Natapov who complete the work for KVM. > > Have tested with 4 vcpus guest, with/without x2apic support.Keir? -- regards Yang, Sheng _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel