From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Fedin Subject: [RFC 0/2] Propagate virtual timer interrupts to userspace Date: Fri, 24 Jul 2015 18:23:33 +0300 Message-ID: Cc: Marc Zyngier To: kvm@vger.kernel.org Return-path: Received: from mailout1.w1.samsung.com ([210.118.77.11]:48189 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752173AbbGXPXm (ORCPT ); Fri, 24 Jul 2015 11:23:42 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NS0002BP03GE550@mailout1.w1.samsung.com> for kvm@vger.kernel.org; Fri, 24 Jul 2015 16:23:40 +0100 (BST) Sender: kvm-owner@vger.kernel.org List-ID: This patchset allows virtual timer to function without vGIC. In this case the interrupt should be handled by userspace GIC emulation. In order to signal an interrupt a VM exit is performed with KVM_EXIT_IRQ return code. Together with the code, IRQ number and level is returned. 'level' is actually reserved for possible future level-sensitive interrupts. For them KVM_EXIT_IRQ code would be generated upon line state transition to the specified level. For edge-sensitive interrupts actually only 'irq' number is meaningful, signalling trigger condition on the specified IRQ. However, 'level' still denotes active state (1 for low-to-high edge or 0 for high-to-low edge). Currently there's no additional API to specify how to treate particular IRQs in the userspace. The userspace is assumed just to know it. On ARM architecture all interrupts are processed by KVM as if they were edge-sensitive, therefore timer interrupt as signalled as edge-sensitive, active high. This patch set is to be applied on top of "Allow to use KVM without in-kernel irqchip" one. Pavel Fedin (2): Introduce KVM_EXIT_IRQ Send KVM_EXIT_IRQ from timer if irqchip is not used arch/arm/kvm/arm.c | 18 +++++++++++------- include/linux/kvm_host.h | 7 +++++++ include/uapi/linux/kvm.h | 3 +++ virt/kvm/arm/arch_timer.c | 6 ++++++ 4 files changed, 27 insertions(+), 7 deletions(-) -- 2.4.4