• Suresh Warrier's avatar
    KVM: PPC: Book3S HV: Enable IRQ bypass · c57875f5
    Suresh Warrier authored
    Add the irq_bypass_add_producer and irq_bypass_del_producer
    functions. These functions get called whenever a GSI is being
    defined for a guest. They create/remove the mapping between
    host real IRQ numbers and the guest GSI.
    
    Add the following helper functions to manage the
    passthrough IRQ map.
    
    kvmppc_set_passthru_irq()
      Creates a mapping in the passthrough IRQ map that maps a host
      IRQ to a guest GSI. It allocates the structure (one per guest VM)
      the first time it is called.
    
    kvmppc_clr_passthru_irq()
      Removes the passthrough IRQ map entry given a guest GSI.
      The passthrough IRQ map structure is not freed even when the
      number of mapped entries goes to zero. It is only freed when
      the VM is destroyed.
    
    [paulus@ozlabs.org - modified to use is_pnv_opal_msi() rather than
     requiring all passed-through interrupts to use the same irq_chip;
     changed deletion so it zeroes out the r_hwirq field rather than
     copying the last entry down and decrementing the number of entries.]
    Signed-off-by: default avatarSuresh Warrier <warrier@linux.vnet.ibm.com>
    Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
    c57875f5
book3s_hv.c 95 KB