From: "Jan Beulich" Subject: [PATCH 3/5] x86: x2apic pre-enabled but intr-remapping is not enabled Date: Wed, 15 Dec 2010 11:18:35 +0000 Message-ID: <4D08B21B020000780002818D@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part92BEDA1B.1__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" Cc: Yinghai Lu List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part92BEDA1B.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Make it aligned with Linux kernel. Signed-off-by: Yinghai Lu Removed unnecessary bits from the original patch, and removed intremap_enabled() with its only caller gone. Signed-off-by: Jan Beulich --- 2010-11-09.orig/xen/arch/x86/apic.c +++ 2010-11-09/xen/arch/x86/apic.c @@ -972,15 +972,6 @@ void x2apic_setup(void) rdmsrl(MSR_IA32_APICBASE, msr_content); if ( msr_content & MSR_IA32_APICBASE_EXTD ) { - /* - * Interrupt remapping should be also enabled by BIOS when - * x2APIC is already enabled by BIOS, otherwise it's a BIOS - * bug - */ - if ( !intremap_enabled() ) - panic("Interrupt remapping is not enabled by BIOS while " - "x2APIC is already enabled by BIOS!\n"); - printk("x2APIC mode is already enabled by BIOS.\n"); x2apic_enabled =3D 1; } @@ -1023,6 +1014,10 @@ void x2apic_setup(void) =20 if ( iommu_enable_IR() ) { + if ( x2apic_enabled ) + panic("Interrupt remapping could not be enabled while " + "x2APIC is already enabled by BIOS!\n"); + printk("Would not enable x2APIC due to interrupt remapping " "cannot be enabled.\n"); goto restore_out; --- 2010-11-09.orig/xen/drivers/passthrough/vtd/intremap.c +++ 2010-11-09/xen/drivers/passthrough/vtd/intremap.c @@ -894,23 +894,3 @@ void iommu_disable_IR(void) for_each_drhd_unit ( drhd ) disable_qinval(drhd->iommu); } - -/* - * Check if interrupt remapping is enabled or not - * return 1: enabled - * return 0: not enabled - */ -int intremap_enabled(void) -{ - struct acpi_drhd_unit *drhd; - u32 sts; - - for_each_drhd_unit ( drhd ) - { - sts =3D dmar_readl(drhd->iommu->reg, DMAR_GSTS_REG); - if ( !(sts & DMA_GSTS_IRES) ) - return 0; - } - - return 1; -} --- 2010-11-09.orig/xen/include/xen/iommu.h +++ 2010-11-09/xen/include/xen/iommu.h @@ -62,7 +62,6 @@ int iommu_setup(void); int iommu_supports_eim(void); int iommu_enable_IR(void); void iommu_disable_IR(void); -int intremap_enabled(void); =20 int iommu_add_device(struct pci_dev *pdev); int iommu_remove_device(struct pci_dev *pdev); --=__Part92BEDA1B.1__= Content-Type: text/plain; name="x86-x2apic-preenabled.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-x2apic-preenabled.patch" x86: x2apic pre-enabled but intr-remapping is not enabled=0A=0AMake it = aligned with Linux kernel.=0A=0ASigned-off-by: Yinghai Lu =0A=0ARemoved unnecessary bits from the original patch, and removed=0Ain= tremap_enabled() with its only caller gone.=0A=0ASigned-off-by: Jan = Beulich =0A=0A--- 2010-11-09.orig/xen/arch/x86/apic.c= =0A+++ 2010-11-09/xen/arch/x86/apic.c=0A@@ -972,15 +972,6 @@ void = x2apic_setup(void)=0A rdmsrl(MSR_IA32_APICBASE, msr_content);=0A = if ( msr_content & MSR_IA32_APICBASE_EXTD )=0A {=0A- /*=0A- = * Interrupt remapping should be also enabled by BIOS when=0A- = * x2APIC is already enabled by BIOS, otherwise it's a BIOS=0A- * = bug=0A- */=0A- if ( !intremap_enabled() )=0A- = panic("Interrupt remapping is not enabled by BIOS while "=0A- = "x2APIC is already enabled by BIOS!\n");=0A-=0A printk("x2APIC = mode is already enabled by BIOS.\n");=0A x2apic_enabled =3D 1;=0A = }=0A@@ -1023,6 +1014,10 @@ void x2apic_setup(void)=0A =0A if ( = iommu_enable_IR() )=0A {=0A+ if ( x2apic_enabled )=0A+ = panic("Interrupt remapping could not be enabled while "=0A+ = "x2APIC is already enabled by BIOS!\n");=0A+=0A printk("Would = not enable x2APIC due to interrupt remapping "=0A "cannot = be enabled.\n");=0A goto restore_out;=0A--- 2010-11-09.orig/xen/dri= vers/passthrough/vtd/intremap.c=0A+++ 2010-11-09/xen/drivers/passthrough/vt= d/intremap.c=0A@@ -894,23 +894,3 @@ void iommu_disable_IR(void)=0A = for_each_drhd_unit ( drhd )=0A disable_qinval(drhd->iommu);=0A = }=0A-=0A-/*=0A- * Check if interrupt remapping is enabled or not=0A- * = return 1: enabled=0A- * return 0: not enabled=0A- */=0A-int intremap_enable= d(void)=0A-{=0A- struct acpi_drhd_unit *drhd;=0A- u32 sts;=0A-=0A- = for_each_drhd_unit ( drhd )=0A- {=0A- sts =3D dmar_readl(drhd->i= ommu->reg, DMAR_GSTS_REG);=0A- if ( !(sts & DMA_GSTS_IRES) )=0A- = return 0;=0A- }=0A-=0A- return 1;=0A-}=0A--- 2010-11-09.orig/= xen/include/xen/iommu.h=0A+++ 2010-11-09/xen/include/xen/iommu.h=0A@@ = -62,7 +62,6 @@ int iommu_setup(void);=0A int iommu_supports_eim(void);=0A = int iommu_enable_IR(void);=0A void iommu_disable_IR(void);=0A-int = intremap_enabled(void);=0A =0A int iommu_add_device(struct pci_dev = *pdev);=0A int iommu_remove_device(struct pci_dev *pdev);=0A --=__Part92BEDA1B.1__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part92BEDA1B.1__=--