From patchwork Tue Jan 28 16:51:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 23804 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f199.google.com (mail-yk0-f199.google.com [209.85.160.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 84466202B2 for ; Tue, 28 Jan 2014 16:53:46 +0000 (UTC) Received: by mail-yk0-f199.google.com with SMTP id 142sf3010842ykq.2 for ; Tue, 28 Jan 2014 08:53:45 -0800 (PST) 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=lA4VEs0fC0n/3tuv2tFI5FiOkgi2urlkHfdiYtYe96k=; b=bYUjtwsP1DdOEJAIwVsG9wQSNt6x/2RkYjXb3hIPwXAEv0GGQUEqgfyShqjYO4JFJz Z25wC9cT4taH187/gqbgH44hr0v2siNjL7nuxDDZpce3mim6bk+nkHuNyG+DwxNyc8j2 sKwndmrhBHGLI7GnwXDRchht4uaT7b0/cwbM4pfWM7RFZDuuGlYx+EzGFY/7hKQp+RLi iU54UAXAcDZ0wft9dpFFmNvPAuiEA+VgmyinSs/GXyBbt4yG33Vl3OKxRxVx15TknAex 9i396pMsj3BUXYulYD/8hNDrghsq6rS+iWk1X3Q+ylJ/j6tn8Kt90NFYSaUlAZvnneks ZrmQ== X-Gm-Message-State: ALoCoQk79j2KAjhi6K6uRo/H/r4r+GKiNqmIh+LSg90kbf3xz7fbJxHQXY1dY/PwSEL2ou37HOJx X-Received: by 10.58.242.70 with SMTP id wo6mr906720vec.16.1390928025448; Tue, 28 Jan 2014 08:53:45 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.92.240 with SMTP id b103ls2177623qge.57.gmail; Tue, 28 Jan 2014 08:53:45 -0800 (PST) X-Received: by 10.52.50.177 with SMTP id d17mr1504142vdo.23.1390928025378; Tue, 28 Jan 2014 08:53:45 -0800 (PST) Received: from mail-vb0-f47.google.com (mail-vb0-f47.google.com [209.85.212.47]) by mx.google.com with ESMTPS id x5si6514516veb.149.2014.01.28.08.53.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 28 Jan 2014 08:53:45 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.47 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.47; Received: by mail-vb0-f47.google.com with SMTP id p6so400140vbe.34 for ; Tue, 28 Jan 2014 08:53:45 -0800 (PST) X-Received: by 10.58.37.67 with SMTP id w3mr1799052vej.22.1390928025271; Tue, 28 Jan 2014 08:53:45 -0800 (PST) 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.220.174.196 with SMTP id u4csp45495vcz; Tue, 28 Jan 2014 08:53:44 -0800 (PST) X-Received: by 10.220.159.4 with SMTP id h4mr1838854vcx.1.1390928024147; Tue, 28 Jan 2014 08:53:44 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id dr8si6524767vcb.88.2014.01.28.08.53.43 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 28 Jan 2014 08:53:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) 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 1W8BtL-0003QH-Fa; Tue, 28 Jan 2014 16:52:03 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1W8BtK-0003Q7-Qd for xen-devel@lists.xen.org; Tue, 28 Jan 2014 16:52:03 +0000 Received: from [193.109.254.147:44492] by server-4.bemta-14.messagelabs.com id D1/70-03916-230E7E25; Tue, 28 Jan 2014 16:52:02 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-3.tower-27.messagelabs.com!1390927918!410229!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n X-StarScan-Received: X-StarScan-Version: 6.9.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 23122 invoked from network); 28 Jan 2014 16:52:00 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 28 Jan 2014 16:52:00 -0000 X-IronPort-AV: E=Sophos;i="4.95,736,1384300800"; d="scan'208";a="95329558" Received: from accessns.citrite.net (HELO FTLPEX01CL03.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 28 Jan 2014 16:51:57 +0000 Received: from [10.80.2.80] (10.80.2.80) by FTLPEX01CL03.citrite.net (10.13.107.80) with Microsoft SMTP Server id 14.2.342.4; Tue, 28 Jan 2014 11:51:56 -0500 Message-ID: <1390927915.31814.9.camel@kazak.uk.xensource.com> From: Ian Campbell To: Date: Tue, 28 Jan 2014 16:51:55 +0000 In-Reply-To: <1390927878-7048-1-git-send-email-ian.campbell@citrix.com> References: <1390927878-7048-1-git-send-email-ian.campbell@citrix.com> Organization: Citrix Systems, Inc. X-Mailer: Evolution 3.4.4-3 MIME-Version: 1.0 X-Originating-IP: [10.80.2.80] X-DLP: MIA1 Cc: Oleksandr Tyshchenko , julien.grall@linaro.org, tim@xen.org, george.dunlap@citrix.com, stefano.stabellini@eu.citrix.com Subject: Re: [Xen-devel] [PATCH] xen: arm: increase priority of SGIs used as IPIs 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=neutral (google.com: 209.85.212.47 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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 Tue, 2014-01-28 at 16:51 +0000, Ian Campbell wrote: > Tested with "HACK: dump pcpu state keyhandler" which I'll post for > completeness. >From 7975fb2a9a27e738d3b551fa2258d65a8c4b0d9a Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Tue, 28 Jan 2014 15:57:33 +0000 Subject: [PATCH] HACK: dump pcpu state keyhandler --- xen/arch/arm/gic.c | 3 +++ xen/common/keyhandler.c | 20 ++++++++++++++++++++ xen/include/asm-arm/gic.h | 1 + 3 files changed, 24 insertions(+) diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index e6257a7..dcf9cd4 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -811,6 +811,9 @@ static void do_sgi(struct cpu_user_regs *regs, int othercpu, enum gic_sgi sgi) case GIC_SGI_CALL_FUNCTION: smp_call_function_interrupt(); break; + case GIC_SGI_DUMP_HOST_STATE: + show_execution_state(regs); + break; default: panic("Unhandled SGI %d on CPU%d", sgi, smp_processor_id()); break; diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c index 8e4b3f8..52f0916 100644 --- a/xen/common/keyhandler.c +++ b/xen/common/keyhandler.c @@ -20,6 +20,7 @@ #include #include #include +#include static struct keyhandler *key_table[256]; static unsigned char keypress_key; @@ -149,6 +150,24 @@ static struct keyhandler dump_registers_keyhandler = { .desc = "dump registers" }; +static void dump_pcpus(unsigned char key, struct cpu_user_regs *regs) +{ + printk("'%c' pressed -> dumping PCPU state\n\n", key); + + send_SGI_self(GIC_SGI_DUMP_HOST_STATE); + + dsb(); /* Wait for SGI write to occur, or else it might be delayed + * until later, meaning we don't make a point of having an + * IPI interrupting an interrupt. */ +} + +static struct keyhandler dump_pcpus_keyhandler = { + .irq_callback = 1, + .diagnostic = 1, + .u.irq_fn = dump_pcpus, + .desc = "dump pcpus" +}; + static DECLARE_TASKLET(dump_dom0_tasklet, NULL, 0); static void dump_dom0_action(unsigned long arg) @@ -539,6 +558,7 @@ void __init initialize_keytable(void) } register_keyhandler('A', &toggle_alt_keyhandler); register_keyhandler('d', &dump_registers_keyhandler); + register_keyhandler('P', &dump_pcpus_keyhandler); register_keyhandler('h', &show_handlers_keyhandler); register_keyhandler('q', &dump_domains_keyhandler); register_keyhandler('r', &dump_runq_keyhandler); diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h index 87f4298..9c6f9bb 100644 --- a/xen/include/asm-arm/gic.h +++ b/xen/include/asm-arm/gic.h @@ -183,6 +183,7 @@ enum gic_sgi { GIC_SGI_EVENT_CHECK = 0, GIC_SGI_DUMP_STATE = 1, GIC_SGI_CALL_FUNCTION = 2, + GIC_SGI_DUMP_HOST_STATE = 3, }; extern void send_SGI_mask(const cpumask_t *cpumask, enum gic_sgi sgi); extern void send_SGI_one(unsigned int cpu, enum gic_sgi sgi);