Skip to content

Commit

Permalink
fix(ipc): inject non-hw interupt
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Martins <[email protected]>
  • Loading branch information
josecm authored and DavidMCerdeira committed Sep 27, 2024
1 parent 02790d7 commit dde8a88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static void ipc_notify(size_t shmem_id, size_t event_id)
struct ipc* ipc_obj = ipc_find_by_shmemid(cpu()->vcpu->vm, shmem_id);
if (ipc_obj != NULL && event_id < ipc_obj->interrupt_num) {
irqid_t irq_id = ipc_obj->interrupts[event_id];
vcpu_inject_hw_irq(cpu()->vcpu, irq_id);
vcpu_inject_irq(cpu()->vcpu, irq_id);
}
}

Expand Down

2 comments on commit dde8a88

@gaojunhao
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For ipc sharemem device, when it is initialize, the device interrupt->hw set true, so here use vcpu_inject_irq to replace vcpu_inject_hw_irq, but vcpu_inject_irq function still will use vgic_inject_hw to inject interrupt because vgic_int_is_hw(interrupt) will be true.

@josecm
Copy link
Member Author

@josecm josecm commented on dde8a88 Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For ipc sharemem device, when it is initialize, the device interrupt->hw set true, so here use vcpu_inject_irq to replace vcpu_inject_hw_irq, but vcpu_inject_irq function still will use vgic_inject_hw to inject interrupt because vgic_int_is_hw(interrupt) will be true.

@gaojunhao Thanks for taking a look at the code. I am trying to find the place where you say the ipc interrupt->hw is set to true for ipc interrupts but can't. Can you please point it out in the code? From what I see, the interrupt->hw is only set to true via the interrupts_vm_assign function, and that function is only called for physical devices in the vm initialization ,not for the ipc objects. But maybe I am missing something.

Please sign in to comment.