xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: suppress warning messages on IO-APIC-less systems
@ 2012-04-17 12:58 Jan Beulich
  2012-04-17 13:09 ` Keir Fraser
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2012-04-17 12:58 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 1406 bytes --]

Each call to mp_register_gsi() so far produced two warnings (about not
being able to find the corresponding IO-APIC pin).

However, we should use the provided information for setting the ELCR
correctly (we might want to even do this when there is an IO-APIC, if
was absolutely certain that all machines really have this register
[and specifically not some other device at the two I/O ports in
question]). It is in any case questionable that we allow Dom0 to set
this register - it could particularly be the interrupt of a plug-in
serial port card that might not work due to this. The problem is that
all Dom0 kernels to date do so, hence we can't simply #GP on such an
access (which would be the result if we disallowed access to the port
as we should have done from the beginning).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/mpparse.c
+++ b/xen/arch/x86/mpparse.c
@@ -1034,6 +1034,21 @@ int mp_register_gsi (u32 gsi, int trigge
 		return gsi;
 #endif
 
+	if (!nr_ioapics) {
+		unsigned int port = 0x4d0 + (gsi >> 3);
+		u8 val;
+
+		if (!platform_legacy_irq(gsi))
+			return -EINVAL;
+		val = inb(port);
+		if (triggering)
+			val |= 1 << (gsi & 7);
+		else
+			val &= ~(1 << (gsi & 7));
+		outb(val, port);
+		return 0;
+	}
+
 	ioapic = mp_find_ioapic(gsi);
 	if (ioapic < 0) {
 		printk(KERN_WARNING "No IOAPIC for GSI %u\n", gsi);




[-- Attachment #2: x86-no-ioapic.patch --]
[-- Type: text/plain, Size: 1458 bytes --]

x86: suppress warning messages on IO-APIC-less systems

Each call to mp_register_gsi() so far produced two warnings (about not
being able to find the corresponding IO-APIC pin).

However, we should use the provided information for setting the ELCR
correctly (we might want to even do this when there is an IO-APIC, if
was absolutely certain that all machines really have this register
[and specifically not some other device at the two I/O ports in
question]). It is in any case questionable that we allow Dom0 to set
this register - it could particularly be the interrupt of a plug-in
serial port card that might not work due to this. The problem is that
all Dom0 kernels to date do so, hence we can't simply #GP on such an
access (which would be the result if we disallowed access to the port
as we should have done from the beginning).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/mpparse.c
+++ b/xen/arch/x86/mpparse.c
@@ -1034,6 +1034,21 @@ int mp_register_gsi (u32 gsi, int trigge
 		return gsi;
 #endif
 
+	if (!nr_ioapics) {
+		unsigned int port = 0x4d0 + (gsi >> 3);
+		u8 val;
+
+		if (!platform_legacy_irq(gsi))
+			return -EINVAL;
+		val = inb(port);
+		if (triggering)
+			val |= 1 << (gsi & 7);
+		else
+			val &= ~(1 << (gsi & 7));
+		outb(val, port);
+		return 0;
+	}
+
 	ioapic = mp_find_ioapic(gsi);
 	if (ioapic < 0) {
 		printk(KERN_WARNING "No IOAPIC for GSI %u\n", gsi);

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH] x86: suppress warning messages on IO-APIC-less systems
  2012-04-17 12:58 [PATCH] x86: suppress warning messages on IO-APIC-less systems Jan Beulich
@ 2012-04-17 13:09 ` Keir Fraser
  0 siblings, 0 replies; 2+ messages in thread
From: Keir Fraser @ 2012-04-17 13:09 UTC (permalink / raw)
  To: Jan Beulich, xen-devel

On 17/04/2012 13:58, "Jan Beulich" <JBeulich@suse.com> wrote:

> Each call to mp_register_gsi() so far produced two warnings (about not
> being able to find the corresponding IO-APIC pin).
> 
> However, we should use the provided information for setting the ELCR
> correctly (we might want to even do this when there is an IO-APIC, if
> was absolutely certain that all machines really have this register
> [and specifically not some other device at the two I/O ports in
> question]). It is in any case questionable that we allow Dom0 to set
> this register - it could particularly be the interrupt of a plug-in
> serial port card that might not work due to this. The problem is that
> all Dom0 kernels to date do so, hence we can't simply #GP on such an
> access (which would be the result if we disallowed access to the port
> as we should have done from the beginning).
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/arch/x86/mpparse.c
> +++ b/xen/arch/x86/mpparse.c
> @@ -1034,6 +1034,21 @@ int mp_register_gsi (u32 gsi, int trigge
> return gsi;
>  #endif
>  
> + if (!nr_ioapics) {
> +  unsigned int port = 0x4d0 + (gsi >> 3);
> +  u8 val;
> +
> +  if (!platform_legacy_irq(gsi))
> +   return -EINVAL;
> +  val = inb(port);
> +  if (triggering)
> +   val |= 1 << (gsi & 7);
> +  else
> +   val &= ~(1 << (gsi & 7));
> +  outb(val, port);
> +  return 0;
> + }
> +
> ioapic = mp_find_ioapic(gsi);
> if (ioapic < 0) {
> printk(KERN_WARNING "No IOAPIC for GSI %u\n", gsi);
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

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

end of thread, other threads:[~2012-04-17 13:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-17 12:58 [PATCH] x86: suppress warning messages on IO-APIC-less systems Jan Beulich
2012-04-17 13:09 ` Keir Fraser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).