* [PATCH] x86: return value of domain_pirq_to_irq() is signed
@ 2010-06-15 12:07 Jan Beulich
0 siblings, 0 replies; only message in thread
From: Jan Beulich @ 2010-06-15 12:07 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 938 bytes --]
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 <jbeulich@novell.com>
--- 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;
@@ -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;
irq = domain_pirq_to_irq(d, pirq);
if ( irq <= 0 )
[-- Attachment #2: x86-signed-domain-irq.patch --]
[-- Type: text/plain, Size: 932 bytes --]
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 <jbeulich@novell.com>
--- 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;
@@ -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;
irq = domain_pirq_to_irq(d, pirq);
if ( irq <= 0 )
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-06-15 12:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-15 12:07 [PATCH] x86: return value of domain_pirq_to_irq() is signed Jan Beulich
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).