From patchwork Fri Jan 9 15:58:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 5601451 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BB65AC058D for ; Fri, 9 Jan 2015 15:58:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6638720504 for ; Fri, 9 Jan 2015 15:58:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 82609202FE for ; Fri, 9 Jan 2015 15:58:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757852AbbAIP60 (ORCPT ); Fri, 9 Jan 2015 10:58:26 -0500 Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]:60853 "EHLO cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756564AbbAIP60 (ORCPT ); Fri, 9 Jan 2015 10:58:26 -0500 Received: from e106785-lin.cambridge.arm.com ([10.1.203.153]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id t09FwJwo015046; Fri, 9 Jan 2015 15:58:19 GMT From: Andre Przywara To: penberg@kernel.org, will.deacon@arm.com Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, marc.zyngier@arm.com Subject: [RFC PATCH] kvmtool: remove 8250 IRQ line reset on device_init Date: Fri, 9 Jan 2015 15:58:19 +0000 Message-Id: <1420819099-29690-1-git-send-email-andre.przywara@arm.com> X-Mailer: git-send-email 1.7.9.5 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently we reset the KVM interrupt line on initializing the 8250 serial device emulation. For ARM this creates a problem where we use the in-kernel IRQ chip before having fully initialized it. But with the new kernel interface we cannot finish the GIC initialization before we know the number of used IRQs, so we have to wait until all devices have been created and initialized. Since the in-kernel GIC emulation resets the IRQ line anyway and also QEMU gets away without resetting it, the easiest solution is to drop the IRQ line reset. Signed-off-by: Andre Przywara --- Hi Pekka, this patch is an easy fix for our problems with Marc's kvmtool tree and 3.19-rc (setting number of IRQs after the GIC has been used already). I see that this basically reverts: > commit 2ca9e37193ca5f5df5726e0061dc749829295435 > Author: Pekka Enberg > Date: Sun Jan 23 11:49:39 2011 +0200 > > kvm,8250: Fix device initial state > > This patch fixes 8250 device initial state for registers and IRQ based > on what Qemu does. Do you (or does anyone) know of the issue that this patch fixed? This is four years old and from what I see QEMU does no longer the mentioned IRQ reset(?). Reworking kvmtool to avoid this issue sound rather painful. Cheers, Andre. tools/kvm/hw/serial.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/kvm/hw/serial.c b/tools/kvm/hw/serial.c index 270e6182..2f19ba8 100644 --- a/tools/kvm/hw/serial.c +++ b/tools/kvm/hw/serial.c @@ -406,7 +406,6 @@ static int serial8250__device_init(struct kvm *kvm, struct serial8250_device *de ioport__map_irq(&dev->irq); r = ioport__register(kvm, dev->iobase, &serial8250_ops, 8, dev); - kvm__irq_line(kvm, dev->irq, 0); return r; }