From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: tlb flush after each vm_exit, also virtual interrupts injection Date: Mon, 29 Aug 2016 11:55:43 +0200 Message-ID: References: <346384966.13112634.1470159219285.JavaMail.zimbra@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: "Charls D. Chap" , kvm To: Wanpeng Li Return-path: Received: from mx1.redhat.com ([209.132.183.28]:36748 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932584AbcH2Jzr (ORCPT ); Mon, 29 Aug 2016 05:55:47 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 25/08/2016 11:12, Wanpeng Li wrote: >> > >> > ioctl when? interrupt kind >> > ------------------------------------------------------------------------ >> > KVM_INTERRUPT i8259 in userspace EXTINT >> > KVM_SET_GSI_ROUTING (always) IOAPIC >> > KVM_SIGNAL_MSI (always) MSI >> > KVM_SET_GSI_ROUTING (always) MSI >> > KVM_IRQFD any that can use KVM_SET_GSI_ROUTING >> > >> > After KVM_SET_GSI_ROUTING, the host invokes another ioctl on the VM > MSI routing is also set by KVM_SET_GSI_ROUTING,though MSI/MSI-X > doesn't associated with GSI, this is intended to save a KVM API, > right? In addition, kvm_send_userspace_msi() which is called in > KVM_SIGNAL_MSI path set MSI routing entry again, No, kvm_send_userspace_msi simply converts the struct used by userspace (struct kvm_msi) into the one used by the kernel (struct kvm_kernel_irq_routing_entry). I saw there are > patches which will update gsi routing after changed MSI-X > configuration(https://patchwork.kernel.org/patch/6827431/) > , so why set MSI routing entry again during send MSI? KVM_SIGNAL_MSI does not need a previous KVM_SET_GSI_ROUTING, but if userspace wants it can use both. Note that you've linked a patch for lkvm, not Linux or QEMU. Paolo