From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charls D. Chap" Subject: (unknown) Date: Tue, 30 Aug 2016 13:42:15 +0300 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 To: kvm@vger.kernel.org Return-path: Received: from mail-ua0-f177.google.com ([209.85.217.177]:33301 "EHLO mail-ua0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755400AbcH3KmQ (ORCPT ); Tue, 30 Aug 2016 06:42:16 -0400 Received: by mail-ua0-f177.google.com with SMTP id l94so25266964ual.0 for ; Tue, 30 Aug 2016 03:42:16 -0700 (PDT) Subject: Sender: kvm-owner@vger.kernel.org List-ID: Hello, It's not clear to me, how is the virtual interrupt injection occurs. For block I/O cases, virtio and full virtualization I know the call graph for both cases MSI, pci legacy. My question is: How QEMU notifies the guest? How the worker thread(iothread or mainloop thread) is going to inject the interrupt to vcpu. vcpu at this time is executing, so it's is in running state. It needs to change context and jump to interrupt handler. How is this change from non-root process context to non-root interrupt context happens? 1) In full-virtualization block io 2) in virtio-blk io For example the issue path in the second case, is clearer, it's a write to a register in pci configuration space (kick). Maybe it's implemented in the following calls(?) msix_notify or pci_set_irq or in the implementation of the ioctls that these two calls invokes in the end. Thanks in advance!