All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] xen: Don't register GSI in pre-setup
@ 2010-03-24 11:54 Bastian Blank
  2010-03-24 17:54 ` Jeremy Fitzhardinge
  0 siblings, 1 reply; 3+ messages in thread
From: Bastian Blank @ 2010-03-24 11:54 UTC (permalink / raw)
  To: xen-devel

Xen behaves the same way that native Linux, it only allows any IO-APIC
pin to be setup once.  Therefor we must not set it up in the initial run
over all legacy interrupts.

Signed-off-by: Bastian Blank <waldi@debian.org>
---
 arch/x86/include/asm/xen/pci.h |    1 +
 arch/x86/xen/pci.c             |   31 ++++++++++++++++++++++---------
 2 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/arch/x86/include/asm/xen/pci.h b/arch/x86/include/asm/xen/pci.h
index d68637f..6286bbb 100644
--- a/arch/x86/include/asm/xen/pci.h
+++ b/arch/x86/include/asm/xen/pci.h
@@ -64,6 +64,7 @@ static inline int xen_pci_setup_msi_irqs(struct pci_dev *dev, int nvec, int type
 #endif /* CONFIG_PCI_MSI */
 
 #ifdef CONFIG_XEN_DOM0_PCI
+int xen_register_pirq(u32 gsi, int triggering);
 int xen_register_gsi(u32 gsi, int triggering, int polarity);
 int xen_find_device_domain_owner(struct pci_dev *dev);
 int xen_register_device_domain_owner(struct pci_dev *dev, uint16_t domain);
diff --git a/arch/x86/xen/pci.c b/arch/x86/xen/pci.c
index eabb512..3e95f76 100644
--- a/arch/x86/xen/pci.c
+++ b/arch/x86/xen/pci.c
@@ -16,10 +16,9 @@
 
 #include "xen-ops.h"
 
-int xen_register_gsi(u32 gsi, int triggering, int polarity)
+int xen_register_pirq(u32 gsi, int triggering)
 {
 	int rc, irq;
-	struct physdev_setup_gsi setup_gsi;
 	struct physdev_map_pirq map_irq;
 	int shareable = 0;
 	char *name;
@@ -27,9 +26,6 @@ int xen_register_gsi(u32 gsi, int triggering, int polarity)
 	if (!xen_domain())
 		return -1;
 
-	printk(KERN_DEBUG "xen: registering gsi %u triggering %d polarity %d\n",
-			gsi, triggering, polarity);
-
 	if (triggering == ACPI_EDGE_SENSITIVE) {
 		shareable = 0;
 		name = "ioapic-edge";
@@ -56,6 +52,25 @@ int xen_register_gsi(u32 gsi, int triggering, int polarity)
 		return -1;
 	}
 
+	return irq;
+}
+
+int xen_register_gsi(u32 gsi, int triggering, int polarity)
+{
+	int rc, irq;
+	struct physdev_setup_gsi setup_gsi;
+	struct physdev_map_pirq map_irq;
+	int shareable = 0;
+	char *name;
+
+	if (!xen_domain())
+		return -1;
+
+	printk(KERN_DEBUG "xen: registering gsi %u triggering %d polarity %d\n",
+			gsi, triggering, polarity);
+
+	irq = xen_register_pirq(gsi, triggering);
+
 	setup_gsi.gsi = gsi;
 	setup_gsi.triggering = (triggering == ACPI_EDGE_SENSITIVE ?
 			0 : 1);
@@ -67,7 +82,6 @@ int xen_register_gsi(u32 gsi, int triggering, int polarity)
 	else if (rc) {
 		printk(KERN_ERR "Failed to setup GSI :%d, err_code:%d\n",
 				gsi, rc);
-		BUG();
 	}
 
 	return irq;
@@ -181,9 +195,8 @@ void __init xen_setup_pirqs(void)
 		if (acpi_get_override_irq(irq, &trigger, &polarity) == -1)
 			continue;
 
-		xen_register_gsi(irq,
-			trigger ? ACPI_LEVEL_SENSITIVE : ACPI_EDGE_SENSITIVE,
-			polarity ? ACPI_ACTIVE_LOW : ACPI_ACTIVE_HIGH);
+		xen_register_pirq(irq,
+			trigger ? ACPI_LEVEL_SENSITIVE : ACPI_EDGE_SENSITIVE);
 	}
 
 	xen_setup_acpi_sci();
-- 
1.7.0


-- 
Sometimes a feeling is all we humans have to go on.
		-- Kirk, "A Taste of Armageddon", stardate 3193.9

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 3/3] xen: Don't register GSI in pre-setup
  2010-03-24 11:54 [PATCH 3/3] xen: Don't register GSI in pre-setup Bastian Blank
@ 2010-03-24 17:54 ` Jeremy Fitzhardinge
  2010-03-24 22:54   ` Bastian Blank
  0 siblings, 1 reply; 3+ messages in thread
From: Jeremy Fitzhardinge @ 2010-03-24 17:54 UTC (permalink / raw)
  To: Bastian Blank; +Cc: xen-devel

On 03/24/2010 04:54 AM, Bastian Blank wrote:
> Xen behaves the same way that native Linux, it only allows any IO-APIC
> pin to be setup once.  Therefor we must not set it up in the initial run
> over all legacy interrupts.
>    

Do you need both this patch and the Xen one to solve your problem, or is 
one or the other sufficient?

Is there any dependency between the Linux and Xen patches?  (Doesn't 
look like it to me, but I just want to be sure.)

Thanks,
     J

> Signed-off-by: Bastian Blank<waldi@debian.org>
> ---
>   arch/x86/include/asm/xen/pci.h |    1 +
>   arch/x86/xen/pci.c             |   31 ++++++++++++++++++++++---------
>   2 files changed, 23 insertions(+), 9 deletions(-)
>
> diff --git a/arch/x86/include/asm/xen/pci.h b/arch/x86/include/asm/xen/pci.h
> index d68637f..6286bbb 100644
> --- a/arch/x86/include/asm/xen/pci.h
> +++ b/arch/x86/include/asm/xen/pci.h
> @@ -64,6 +64,7 @@ static inline int xen_pci_setup_msi_irqs(struct pci_dev *dev, int nvec, int type
>   #endif /* CONFIG_PCI_MSI */
>
>   #ifdef CONFIG_XEN_DOM0_PCI
> +int xen_register_pirq(u32 gsi, int triggering);
>   int xen_register_gsi(u32 gsi, int triggering, int polarity);
>   int xen_find_device_domain_owner(struct pci_dev *dev);
>   int xen_register_device_domain_owner(struct pci_dev *dev, uint16_t domain);
> diff --git a/arch/x86/xen/pci.c b/arch/x86/xen/pci.c
> index eabb512..3e95f76 100644
> --- a/arch/x86/xen/pci.c
> +++ b/arch/x86/xen/pci.c
> @@ -16,10 +16,9 @@
>
>   #include "xen-ops.h"
>
> -int xen_register_gsi(u32 gsi, int triggering, int polarity)
> +int xen_register_pirq(u32 gsi, int triggering)
>   {
>   	int rc, irq;
> -	struct physdev_setup_gsi setup_gsi;
>   	struct physdev_map_pirq map_irq;
>   	int shareable = 0;
>   	char *name;
> @@ -27,9 +26,6 @@ int xen_register_gsi(u32 gsi, int triggering, int polarity)
>   	if (!xen_domain())
>   		return -1;
>
> -	printk(KERN_DEBUG "xen: registering gsi %u triggering %d polarity %d\n",
> -			gsi, triggering, polarity);
> -
>   	if (triggering == ACPI_EDGE_SENSITIVE) {
>   		shareable = 0;
>   		name = "ioapic-edge";
> @@ -56,6 +52,25 @@ int xen_register_gsi(u32 gsi, int triggering, int polarity)
>   		return -1;
>   	}
>
> +	return irq;
> +}
> +
> +int xen_register_gsi(u32 gsi, int triggering, int polarity)
> +{
> +	int rc, irq;
> +	struct physdev_setup_gsi setup_gsi;
> +	struct physdev_map_pirq map_irq;
> +	int shareable = 0;
> +	char *name;
> +
> +	if (!xen_domain())
> +		return -1;
> +
> +	printk(KERN_DEBUG "xen: registering gsi %u triggering %d polarity %d\n",
> +			gsi, triggering, polarity);
> +
> +	irq = xen_register_pirq(gsi, triggering);
> +
>   	setup_gsi.gsi = gsi;
>   	setup_gsi.triggering = (triggering == ACPI_EDGE_SENSITIVE ?
>   			0 : 1);
> @@ -67,7 +82,6 @@ int xen_register_gsi(u32 gsi, int triggering, int polarity)
>   	else if (rc) {
>   		printk(KERN_ERR "Failed to setup GSI :%d, err_code:%d\n",
>   				gsi, rc);
> -		BUG();
>   	}
>
>   	return irq;
> @@ -181,9 +195,8 @@ void __init xen_setup_pirqs(void)
>   		if (acpi_get_override_irq(irq,&trigger,&polarity) == -1)
>   			continue;
>
> -		xen_register_gsi(irq,
> -			trigger ? ACPI_LEVEL_SENSITIVE : ACPI_EDGE_SENSITIVE,
> -			polarity ? ACPI_ACTIVE_LOW : ACPI_ACTIVE_HIGH);
> +		xen_register_pirq(irq,
> +			trigger ? ACPI_LEVEL_SENSITIVE : ACPI_EDGE_SENSITIVE);
>   	}
>
>   	xen_setup_acpi_sci();
>    

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 3/3] xen: Don't register GSI in pre-setup
  2010-03-24 17:54 ` Jeremy Fitzhardinge
@ 2010-03-24 22:54   ` Bastian Blank
  0 siblings, 0 replies; 3+ messages in thread
From: Bastian Blank @ 2010-03-24 22:54 UTC (permalink / raw)
  To: Jeremy Fitzhardinge; +Cc: xen-devel

On Wed, Mar 24, 2010 at 10:54:27AM -0700, Jeremy Fitzhardinge wrote:
> On 03/24/2010 04:54 AM, Bastian Blank wrote:
>> Xen behaves the same way that native Linux, it only allows any IO-APIC
>> pin to be setup once.  Therefor we must not set it up in the initial run
>> over all legacy interrupts.
> Do you need both this patch and the Xen one to solve your problem, or is  
> one or the other sufficient?

Both are needed.

> Is there any dependency between the Linux and Xen patches?  (Doesn't  
> look like it to me, but I just want to be sure.)

Nope. Thats why the hypervisor patch returns EEXISTS instead of EBUSY.
The later causes a BUG in current kernels, which is emited before the
real console is setup and breaks the system.

Bastian

-- 
A Vulcan can no sooner be disloyal than he can exist without breathing.
		-- Kirk, "The Menagerie", stardate 3012.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-24 22:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-24 11:54 [PATCH 3/3] xen: Don't register GSI in pre-setup Bastian Blank
2010-03-24 17:54 ` Jeremy Fitzhardinge
2010-03-24 22:54   ` Bastian Blank

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.