# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1258463236 0
# Node ID c6c51f99768a0b53a35b8ccc8f617ce68b28a4b6
# Parent aac490021bb8d328d0f1a00a50a7c02cbc1eba1d
Revert 20437:64599a2d310d
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
xen/arch/x86/irq.c | 18 +-----------------
xen/arch/x86/physdev.c | 36 ++++++++++++++++--------------------
xen/include/asm-x86/irq.h | 2 --
3 files changed, 17 insertions(+), 39 deletions(-)
diff -r aac490021bb8 -r c6c51f99768a xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c Tue Nov 17 08:05:52 2009 +0000
+++ b/xen/arch/x86/irq.c Tue Nov 17 13:07:16 2009 +0000
@@ -63,11 +63,6 @@ static struct timer irq_ratelimit_timer;
/* irq_ratelimit: the max irq rate allowed in every 10ms, set 0 to disable */
static unsigned int __read_mostly irq_ratelimit_threshold = 10000;
integer_param("irq_ratelimit", irq_ratelimit_threshold);
-
-int check_irq_status(int irq)
-{
- return irq_status[irq] != IRQ_UNUSED ? 1 : 0;
-}
/* Must be called when irq disabled */
void lock_vector_lock(void)
@@ -721,9 +716,6 @@ int setup_irq(unsigned int irq, struct i
desc->status &= ~IRQ_DISABLED;
desc->handler->startup(irq);
- if ( !check_irq_status(irq) )
- irq_status[irq] = IRQ_USED;
-
spin_unlock_irqrestore(&desc->lock,flags);
return 0;
@@ -1412,8 +1404,6 @@ int map_domain_pirq(
ASSERT(spin_is_locked(&pcidevs_lock));
ASSERT(spin_is_locked(&d->event_lock));
-
- desc = irq_to_desc(irq);
if ( !IS_PRIV(current->domain) &&
!(IS_PRIV_FOR(current->domain, d) &&
@@ -1427,13 +1417,6 @@ int map_domain_pirq(
return -EINVAL;
}
- if ( desc->action )
- {
- dprintk(XENLOG_G_WARNING, "Attempt to map in-use IRQ by Xen,"
- " irq:%d!\n", irq);
- return 0;
- }
-
old_irq = domain_pirq_to_irq(d, pirq);
old_pirq = domain_irq_to_pirq(d, irq);
@@ -1453,6 +1436,7 @@ int map_domain_pirq(
return ret;
}
+ desc = irq_to_desc(irq);
if ( type == MAP_PIRQ_TYPE_MSI )
{
diff -r aac490021bb8 -r c6c51f99768a xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c Tue Nov 17 08:05:52 2009 +0000
+++ b/xen/arch/x86/physdev.c Tue Nov 17 13:07:16 2009 +0000
@@ -30,7 +30,7 @@ static int physdev_map_pirq(struct physd
static int physdev_map_pirq(struct physdev_map_pirq *map)
{
struct domain *d;
- int pirq = 0, irq, ret = 0;
+ int pirq, irq, ret = 0;
struct msi_info _msi;
void *map_data = NULL;
@@ -55,28 +55,23 @@ static int physdev_map_pirq(struct physd
switch ( map->type )
{
case MAP_PIRQ_TYPE_GSI:
- {
- int gsi, triggering, polarity;
-
- gsi = map->index & 0xffff;
- triggering = !!(map->index & (1 << 16));
- polarity = !!(map->index & (1 << 24));
- irq = pirq = map->pirq;
-
- if ( gsi < 0 || gsi >= nr_irqs_gsi )
- {
- dprintk(XENLOG_G_ERR, "dom%d: map invalid gsi %d\n",
- d->domain_id, gsi);
+ if ( map->index < 0 || map->index >= nr_irqs_gsi )
+ {
+ dprintk(XENLOG_G_ERR, "dom%d: map invalid irq %d\n",
+ d->domain_id, map->index);
ret = -EINVAL;
goto free_domain;
}
- if ( !check_irq_status(irq) ) {
- mp_register_gsi(gsi, triggering, polarity);
- printk("Register gsi:%d for dom:%d, irq:%d\n", gsi,
- d->domain_id, irq);
- }
- break;
- }
+ irq = domain_pirq_to_irq(current->domain, map->index);
+ if ( !irq )
+ {
+ dprintk(XENLOG_G_ERR, "dom%d: map pirq with incorrect irq!\n",
+ d->domain_id);
+ ret = -EINVAL;
+ goto free_domain;
+ }
+ break;
+
case MAP_PIRQ_TYPE_MSI:
irq = map->index;
if ( irq == -1 )
@@ -108,6 +103,7 @@ static int physdev_map_pirq(struct physd
spin_lock(&pcidevs_lock);
/* Verify or get pirq. */
spin_lock(&d->event_lock);
+ pirq = domain_irq_to_pirq(d, irq);
if ( map->pirq < 0 )
{
if ( pirq )
diff -r aac490021bb8 -r c6c51f99768a xen/include/asm-x86/irq.h
--- a/xen/include/asm-x86/irq.h Tue Nov 17 08:05:52 2009 +0000
+++ b/xen/include/asm-x86/irq.h Tue Nov 17 13:07:16 2009 +0000
@@ -143,8 +143,6 @@ void move_masked_irq(int irq);
void irq_set_affinity(int irq, cpumask_t mask);
-int check_irq_status(int irq);
-
#define domain_pirq_to_irq(d, pirq) ((d)->arch.pirq_irq[pirq])
#define domain_irq_to_pirq(d, irq) ((d)->arch.irq_pirq[irq])
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|