mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
s390x/pci: enable adapter event notification for interpreted devices
Use the associated kvm ioctl operation to enable adapter event notification and forwarding for devices when requested. This feature will be set up with or without firmware assist based upon the 'forwarding_assist' setting. Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com> Message-Id: <20220902172737.170349-6-mjrosato@linux.ibm.com> [thuth: Rename "forwarding_assist" property to "forwarding-assist"] Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
15d0e7942d
commit
d0bc7091c2
5 changed files with 100 additions and 5 deletions
|
@ -1066,6 +1066,32 @@ static void fmb_update(void *opaque)
|
|||
timer_mod(pbdev->fmb_timer, t + pbdev->pci_group->zpci_group.mui);
|
||||
}
|
||||
|
||||
static int mpcifc_reg_int_interp(S390PCIBusDevice *pbdev, ZpciFib *fib)
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = s390_pci_kvm_aif_enable(pbdev, fib, pbdev->forwarding_assist);
|
||||
if (rc) {
|
||||
DPRINTF("Failed to enable interrupt forwarding\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mpcifc_dereg_int_interp(S390PCIBusDevice *pbdev, ZpciFib *fib)
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = s390_pci_kvm_aif_disable(pbdev);
|
||||
if (rc) {
|
||||
DPRINTF("Failed to disable interrupt forwarding\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar,
|
||||
uintptr_t ra)
|
||||
{
|
||||
|
@ -1120,7 +1146,12 @@ int mpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar,
|
|||
|
||||
switch (oc) {
|
||||
case ZPCI_MOD_FC_REG_INT:
|
||||
if (pbdev->summary_ind) {
|
||||
if (pbdev->interp) {
|
||||
if (mpcifc_reg_int_interp(pbdev, &fib)) {
|
||||
cc = ZPCI_PCI_LS_ERR;
|
||||
s390_set_status_code(env, r1, ZPCI_MOD_ST_SEQUENCE);
|
||||
}
|
||||
} else if (pbdev->summary_ind) {
|
||||
cc = ZPCI_PCI_LS_ERR;
|
||||
s390_set_status_code(env, r1, ZPCI_MOD_ST_SEQUENCE);
|
||||
} else if (reg_irqs(env, pbdev, fib)) {
|
||||
|
@ -1129,7 +1160,12 @@ int mpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar,
|
|||
}
|
||||
break;
|
||||
case ZPCI_MOD_FC_DEREG_INT:
|
||||
if (!pbdev->summary_ind) {
|
||||
if (pbdev->interp) {
|
||||
if (mpcifc_dereg_int_interp(pbdev, &fib)) {
|
||||
cc = ZPCI_PCI_LS_ERR;
|
||||
s390_set_status_code(env, r1, ZPCI_MOD_ST_SEQUENCE);
|
||||
}
|
||||
} else if (!pbdev->summary_ind) {
|
||||
cc = ZPCI_PCI_LS_ERR;
|
||||
s390_set_status_code(env, r1, ZPCI_MOD_ST_SEQUENCE);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue