From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Rutherford Subject: Re: [RFC PATCH 4/4] KVM: x86: Add support for local interrupt requests from userspace Date: Wed, 13 May 2015 16:13:39 -0700 Message-ID: <20150513231339.GC24121@google.com> References: <1431481652-27268-1-git-send-email-srutherford@google.com> <1431481652-27268-4-git-send-email-srutherford@google.com> <5552FBAD.9050805@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, ahonig@google.com To: Paolo Bonzini Return-path: Received: from mail-ig0-f170.google.com ([209.85.213.170]:37712 "EHLO mail-ig0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934251AbbEMXNn (ORCPT ); Wed, 13 May 2015 19:13:43 -0400 Received: by igbsb11 with SMTP id sb11so58973089igb.0 for ; Wed, 13 May 2015 16:13:42 -0700 (PDT) Content-Disposition: inline In-Reply-To: <5552FBAD.9050805@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, May 13, 2015 at 09:22:21AM +0200, Paolo Bonzini wrote: > > > 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? Uhhh. It's not. Something's wrong here. Looks like I dropped some lines in porting these patches. Somehow this still passes the KVM unit tests o.O I'll track down the error. Steve > > 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