From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: [PATCH] x86: return value of domain_pirq_to_irq() is signed Date: Tue, 15 Jun 2010 13:07:24 +0100 Message-ID: <4C17891C02000078000067B4@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartB39EE5EC.0__=" 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 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. --=__PartB39EE5EC.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline That value can, for forcibly unbound PIRQs, validly be negative, and for the respective check to catch those cases (and prevent using these negative values as array index), the respective variables must be of signed type. Signed-off-by: Jan Beulich --- 2010-06-15.orig/xen/arch/x86/irq.c 2010-06-15 09:21:05.000000000 = +0200 +++ 2010-06-15/xen/arch/x86/irq.c 2010-06-15 13:23:00.000000000 = +0200 @@ -887,7 +887,7 @@ static void __do_IRQ_guest(int irq) struct irq_desc *domain_spin_lock_irq_desc( struct domain *d, int pirq, unsigned long *pflags) { - unsigned int irq; + int irq; unsigned long flags; struct irq_desc *desc; =20 @@ -1054,7 +1054,7 @@ extern int ioapic_ack_new; static int pirq_acktype(struct domain *d, int pirq) { struct irq_desc *desc; - unsigned int irq; + int irq; =20 irq =3D domain_pirq_to_irq(d, pirq); if ( irq <=3D 0 ) --=__PartB39EE5EC.0__= Content-Type: text/plain; name="x86-signed-domain-irq.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-signed-domain-irq.patch" That value can, for forcibly unbound PIRQs, validly be negative, and=0Afor = the respective check to catch those cases (and prevent using these=0Anegati= ve values as array index), the respective variables must be of=0Asigned = type.=0A=0ASigned-off-by: Jan Beulich =0A=0A--- = 2010-06-15.orig/xen/arch/x86/irq.c 2010-06-15 09:21:05.000000000 = +0200=0A+++ 2010-06-15/xen/arch/x86/irq.c 2010-06-15 13:23:00.0000000= 00 +0200=0A@@ -887,7 +887,7 @@ static void __do_IRQ_guest(int irq)=0A = struct irq_desc *domain_spin_lock_irq_desc(=0A struct domain *d, int = pirq, unsigned long *pflags)=0A {=0A- unsigned int irq;=0A+ int = irq;=0A unsigned long flags;=0A struct irq_desc *desc;=0A =0A@@ = -1054,7 +1054,7 @@ extern int ioapic_ack_new;=0A static int pirq_acktype(st= ruct domain *d, int pirq)=0A {=0A struct irq_desc *desc;=0A- = unsigned int irq;=0A+ int irq;=0A =0A irq =3D domain_pirq_to_irq(d, = pirq);=0A if ( irq <=3D 0 )=0A --=__PartB39EE5EC.0__= 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 --=__PartB39EE5EC.0__=--