pseries pci: removed dt_irq from PCI host bus
PATCH 1/1 pseries pci: removed dt_irq from PCI host bus
As it is a very quick operation to resolve qirq from IRQ number, it makes no sense to cache it anywhere but its original source i.e. XICS.
Signed-off-by Alexey Kardashevskiy <[email protected]>
--- hw/spapr_pci.c | 14 +++++--------- hw/spapr_pci.h | 1 - 2 files changed, 5 insertions(+), 10 deletions(-)
hw/spapr_pci.c +5 -9
@@ -162,7 +162,9 @@ static void pci_spapr_set_irq(void *opaque, int irq_num, int level)*/ sPAPRPHBState *phb = opaque; -qemu_set_irq (phb->lsi_table[irq_num].qirq, level); +qemu_set_irq (xics_assign_irq (spapr->icp, + phb->lsi_table[irq_num].dt_irq,XICS_LSI ), + level); } static uint64_t spapr_io_read(void *opaque, target_phys_addr_t addr,
@@ -268,16 +270,10 @@ static int spapr_phb_init(SysBusDevice *s)/* Initialize the LSI table */ for (i =0 ; i <PCI_NUM_PINS ; i++) { -qemu_irq qirq; -uint32_t num; - - qirq =spapr_allocate_lsi (0 , &num); -if (!qirq) { +if (!spapr_allocate_lsi (0 , &phb->lsi_table[i].dt_irq)) { +fprintf (stderr,"Failed to allocate LSI IRQ pin %u\n" , i);return -1 ; } - - phb->lsi_table[i].dt_irq = num; - phb->lsi_table[i].qirq = qirq; }return 0 ;
hw/spapr_pci.h +0 -1
@@ -41,7 +41,6 @@ typedef struct sPAPRPHBState {struct {uint32_t dt_irq; -qemu_irq qirq; } lsi_table[PCI_NUM_PINS ];QLIST_ENTRY (sPAPRPHBState) list;
Signature · 1 line
1.7.7.3
Quoted 4 lines · Alexey Kardashevskiy
As it is a very quick operation to resolve qirq from IRQ number, it makes no sense to cache it anywhere but its original source i.e. XICS.
Signed-off-by Alexey Kardashevskiy<[email protected]>
Ben, please ack/nack.
Alex
Quoted 51 lines
--- hw/spapr_pci.c | 14 +++++--------- hw/spapr_pci.h | 1 - 2 files changed, 5 insertions(+), 10 deletions(-)hw/spapr_pci.c +5
-9@@ -162,7 +162,9 @@ static void pci_spapr_set_irq(void *opaque, int irq_num, int level)*/ sPAPRPHBState *phb = opaque; -qemu_set_irq (phb->lsi_table[irq_num].qirq, level); +qemu_set_irq (xics_assign_irq (spapr->icp, + phb->lsi_table[irq_num].dt_irq,XICS_LSI ), + level); } static uint64_t spapr_io_read(void *opaque, target_phys_addr_t addr,@@ -268,16 +270,10 @@ static int spapr_phb_init(SysBusDevice *s)/* Initialize the LSI table */ for (i =0 ; i<PCI_NUM_PINS ; i++) { -qemu_irq qirq; -uint32_t num; - - qirq =spapr_allocate_lsi (0 ,&num); -if (!qirq) { +if (!spapr_allocate_lsi (0 ,&phb->lsi_table[i].dt_irq)) { +fprintf (stderr,"Failed to allocate LSI IRQ pin %u\n" , i);return -1 ; } - - phb->lsi_table[i].dt_irq = num; - phb->lsi_table[i].qirq = qirq; }return 0 ;hw/spapr_pci.h +0
-1@@ -41,7 +41,6 @@ typedef struct sPAPRPHBState {struct {uint32_t dt_irq; -qemu_irq qirq; } lsi_table[PCI_NUM_PINS ];QLIST_ENTRY (sPAPRPHBState) list;