From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [RFC PATCH 4/4] KVM: x86: Add support for local interrupt requests from userspace Date: Wed, 13 May 2015 09:22:21 +0200 Message-ID: <5552FBAD.9050805@redhat.com> References: <1431481652-27268-1-git-send-email-srutherford@google.com> <1431481652-27268-4-git-send-email-srutherford@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: ahonig@google.com To: Steve Rutherford , kvm@vger.kernel.org Return-path: Received: from mail-wg0-f49.google.com ([74.125.82.49]:36292 "EHLO mail-wg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753839AbbEMHW1 (ORCPT ); Wed, 13 May 2015 03:22:27 -0400 Received: by wgbhc8 with SMTP id hc8so221245wgb.3 for ; Wed, 13 May 2015 00:22:26 -0700 (PDT) In-Reply-To: <1431481652-27268-4-git-send-email-srutherford@google.com> Sender: kvm-owner@vger.kernel.org List-ID: On 13/05/2015 03:47, Steve Rutherford wrote: > In order to enable userspace PIC support, the userspace PIC needs to > be able to inject local interrupt requests. > > This adds the ioctl KVM_REQUEST_LOCAL_INTERRUPT and kvm exit > KVM_EXIT_GET_EXTINT. > > The vm ioctl KVM_REQUEST_LOCAL_INTERRUPT makes a KVM_REQ_EVENT request > on the BSP, which causes the BSP to exit to userspace to fetch the > vector of the underlying external interrupt, which the BSP then > injects into the guest. This matches the PIC spec, and is necessary to > boot Windows. > > Boots and passes the KVM unit tests on intel x86 with the > PIC/PIT/IOAPIC in userspace (under a non-QEMU VMM). Boots and passes > the KVM unit tests under normal conditions as well. > > SVM support and device assignment are untested with this feature > enabled, but testing for both is in the works. > > Compiles for ARM/x86/PPC. This may be ENOCOFFEE, but where is extint.vector read? Could you use KVM_INTERRUPT to set KVM_REQUEST_LOCAL_INTERRUPT _and_ the interrupt vector at the same time? This is exactly the logic that is used for !irqchip, and it should work for the EXTINT case as well. Paolo