From patchwork Thu Sep 11 08:36:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 37230 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f198.google.com (mail-ie0-f198.google.com [209.85.223.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ABB6320454 for ; Thu, 11 Sep 2014 08:38:27 +0000 (UTC) Received: by mail-ie0-f198.google.com with SMTP id tp5sf25972025ieb.5 for ; Thu, 11 Sep 2014 01:38:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:from:to:date:in-reply-to :references:organization:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=byJmCKdVvg07ovToFHOfrwec+a59jY+wusHZHBnvWfQ=; b=S38nCAadhz+PuH5LoR/p0Fd7yJLiuQ3XdnJeNJIR+wzJl31uxwv9EV92Mmb9GjjNsd d5pC3j8ClamR69fnyPr/cmjX8SpBuQljgX8qwcs0x7J6OzssZImWoajaQPNuFVtXk5WG +14ztoP01ANVjE6jYZbLoFX/4/h8UfVXwmiEIXqm6N41eqwwNDXgbibkoGGMyiAhgLaa z5l0QIakXMOdiabWS0tttZC6xHUeuYJKmi/l27NIB9lSS28XDZb8UiG4HHv5LLQohJVt AADsxZTBDIic57k0USYdjY4pcz4iW8AJUG0iQrApfundlhbOwK9RES2Y6gtOVX1szngr WTLw== X-Gm-Message-State: ALoCoQlDt48Z7lv6d4kR/EDQk1Y1DbRVCmOI/Iqmi5WDAyJp4vw/4eGJze1MH8IraYVtpQ4D76Rd X-Received: by 10.50.80.111 with SMTP id q15mr237015igx.0.1410424707397; Thu, 11 Sep 2014 01:38:27 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.28.196 with SMTP id 62ls65566qgz.12.gmail; Thu, 11 Sep 2014 01:38:27 -0700 (PDT) X-Received: by 10.52.138.210 with SMTP id qs18mr34031913vdb.18.1410424707250; Thu, 11 Sep 2014 01:38:27 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id da2si59605vdc.89.2014.09.11.01.38.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Sep 2014 01:38:27 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.169 as permitted sender) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id ij19so391661vcb.28 for ; Thu, 11 Sep 2014 01:38:27 -0700 (PDT) X-Received: by 10.220.88.76 with SMTP id z12mr7801399vcl.14.1410424707158; Thu, 11 Sep 2014 01:38:27 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp556103vcb; Thu, 11 Sep 2014 01:38:26 -0700 (PDT) X-Received: by 10.220.77.65 with SMTP id f1mr79706vck.48.1410424706212; Thu, 11 Sep 2014 01:38:26 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id yr8si64657vcb.70.2014.09.11.01.38.25 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 11 Sep 2014 01:38:26 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XRzrh-0000v5-Rb; Thu, 11 Sep 2014 08:36:29 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XRzrg-0000v0-KE for xen-devel@lists.xen.org; Thu, 11 Sep 2014 08:36:28 +0000 Received: from [85.158.143.35:15711] by server-3.bemta-4.messagelabs.com id 44/FD-06192-C0F51145; Thu, 11 Sep 2014 08:36:28 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-7.tower-21.messagelabs.com!1410424586!12360806!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 20554 invoked from network); 11 Sep 2014 08:36:27 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 11 Sep 2014 08:36:27 -0000 X-IronPort-AV: E=Sophos;i="5.04,504,1406592000"; d="scan'208";a="170483486" Message-ID: <1410424583.6166.24.camel@kazak.uk.xensource.com> From: Ian Campbell To: Stefano Stabellini Date: Thu, 11 Sep 2014 09:36:23 +0100 In-Reply-To: References: <1409839463-4437-1-git-send-email-vijay.kilari@gmail.com> Organization: Citrix Systems, Inc. X-Mailer: Evolution 3.12.2-1+b1 MIME-Version: 1.0 X-DLP: MIA1 Cc: Vijay Kilari , Prasun Kapoor , Vijaya Kumar K , Julien Grall , Tim Deegan , "xen-devel@lists.xen.org" , Stefano Stabellini , manish.jaggi@caviumnetworks.com Subject: Re: [Xen-devel] [RFC PATCH] xen/arm: Deliver interrupts to vcpu specified in IROUTER X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: On Wed, 2014-09-10 at 19:54 +0100, Stefano Stabellini wrote: > The only additional info that Xen provides is via the CTRL-AAA menu. > Some details on the GIC are printed but nothing as well organized as > /proc/interrupts. I've got the following sat in a local branch somewhere. It's not at all what you would want here but it might give a hint as to the sort of approach for adding this stuff. I also posted some perfc stuff back in http://lists.xen.org/archives/html/xen-devel/2014-05/msg01984.html which included various IRQ (rather than GIC) level stats IIRC. Ian. 8<---------------------- commit 2c71c40ef723b90faf14bc513bd71e532beffa08 Author: Ian Campbell Date: Wed Nov 20 11:54:20 2013 +0000 xen: arm: Add debug keyhandler to dump the physical GIC state. Rename the existing gic_dump_info to gic_dump_info_guest reduce confusion. Signed-off-by: Ian Campbell --- v2: s/gic_dump_info/gic_dump_info_guest/ diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index 256d9cf..d4ddf41 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -161,6 +162,77 @@ int gic_irq_xlate(const u32 *intspec, unsigned int intsize, return 0; } + +static void do_dump_gic(unsigned char key) +{ + int irq; + printk("'%c' pressed -> dumping GIC state\n", key); + + for ( irq = 0; irq < gic.lines; irq++ ) + { + const char *type; + int type_nr, enable, pend, active, priority, target; + struct irq_desc *desc = irq_to_desc(irq); + uint8_t *bytereg; + uint32_t wordreg; + + bytereg = (uint8_t *) (GICD + GICD_ITARGETSR); + target = bytereg[irq]; + + bytereg = (uint8_t *) (GICD + GICD_IPRIORITYR); + priority = bytereg[irq]; + + switch ( irq ) + { + case 0 ... 15: + type = "SGI"; + type_nr = irq; + target = 0x00; /* these are per-CPU */ + break; + case 16 ... 31: + type = "PPI"; + type_nr = irq - 16; + break; + default: + type = "SPI"; + type_nr = irq - 32; + break; + } + + wordreg = GICD[GICD_ISENABLER + irq / 32]; + enable = !!(wordreg & (1u << (irq % 32))); + wordreg = GICD[GICD_ISPENDR + irq / 32]; + pend = !!(wordreg & (1u << (irq % 32))); + wordreg = GICD[GICD_ISACTIVER + irq / 32]; + active = !!(wordreg & (1u << (irq % 32))); + + printk("IRQ%d %s%d: %c%c%c pri:%02x tgt:%02x ", + irq, type, type_nr, + enable ? 'e' : '-', + pend ? 'p' : '-', + active ? 'a' : '-', + priority, target); + + if ( desc->status & IRQ_GUEST ) + { + struct domain *d = desc->action->dev_id; + printk("dom%d %s", d->domain_id, desc->action->name); + } + else + { + printk("Xen"); + } + printk("\n"); + } + +} + +static struct keyhandler dump_gic_keyhandler = { + .irq_callback = 0, + .u.fn = do_dump_gic, + .desc = "dump GIC state" +}; + /* Set up the GIC */ void __init gic_init(void) { @@ -189,6 +261,8 @@ void __init gic_init(void) /* Clear LR mask for cpu0 */ clear_cpu_lr_mask(); + + register_keyhandler('G', &dump_gic_keyhandler); } void send_SGI_mask(const cpumask_t *cpumask, enum gic_sgi sgi) @@ -592,7 +666,7 @@ static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *r */ } -void gic_dump_info(struct vcpu *v) +void gic_dump_info_guest(struct vcpu *v) { struct pending_irq *p; diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h index a0c07bf..f10ad39 100644 --- a/xen/include/asm-arm/gic.h +++ b/xen/include/asm-arm/gic.h @@ -245,7 +245,7 @@ extern void send_SGI_self(enum gic_sgi sgi); extern void send_SGI_allbutself(enum gic_sgi sgi); /* print useful debug info */ -extern void gic_dump_info(struct vcpu *v); +extern void gic_dump_info_guest(struct vcpu *v); /* Number of interrupt lines */ extern unsigned int gic_number_lines(void);