From patchwork Tue Jan 28 00:34:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 23772 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f197.google.com (mail-pd0-f197.google.com [209.85.192.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 19E6A20143 for ; Tue, 28 Jan 2014 00:34:38 +0000 (UTC) Received: by mail-pd0-f197.google.com with SMTP id x10sf15626850pdj.8 for ; Mon, 27 Jan 2014 16:34:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=wy/CLXDKza9MnN7Yer+QO0f4maX12werXdTKAmL7A44=; b=Wbh1hycgGGSZ1WOXXWgVy9yVxa49OkMArOiWlFUWaghSbeLfGPL/0OlRN4hxKwJq2T XvKm+UzwtU1opbYXaP5D0oKDd7zk6rIDm+dsZUeFKAEZCawwGKHgYsDvyZcqSa4Z585J kzeFqWMlITW4/soAt7C8iT3Ky6XRCzUlhTUeZBY7CnshKHdE6pkyJLWyQXzIxsmEGzGN 0Ra/eRE6DH9qdcr7+MXMKYXJRsgr7nBOHBo1k5iEfkbs0CWN8iUz+Ks2i0QJx9Hy3klp lqF14g2uEX/oxZv4lqXKlYlYeOgxydu5KP/uhe3pIc28De6l9ltgiUoEZYvDC8f4CtcR vvvA== X-Gm-Message-State: ALoCoQkqhoQLuTMHLUh0HmCFUhl5rjxvlSdPjiyn4WeOcNb0ZVsIAzMVUVRgXnJUma53wTBP5ke3 X-Received: by 10.66.137.8 with SMTP id qe8mr1712741pab.46.1390869277380; Mon, 27 Jan 2014 16:34:37 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.33.200 with SMTP id j66ls1725552qgj.80.gmail; Mon, 27 Jan 2014 16:34:37 -0800 (PST) X-Received: by 10.220.103.141 with SMTP id k13mr2303143vco.25.1390869277289; Mon, 27 Jan 2014 16:34:37 -0800 (PST) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id x7si5774324vel.76.2014.01.27.16.34.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Jan 2014 16:34:37 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id pa12so4020625veb.30 for ; Mon, 27 Jan 2014 16:34:37 -0800 (PST) X-Received: by 10.220.251.73 with SMTP id mr9mr169493vcb.2.1390869277224; Mon, 27 Jan 2014 16:34:37 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp170922vcz; Mon, 27 Jan 2014 16:34:36 -0800 (PST) X-Received: by 10.14.3.72 with SMTP id 48mr28007341eeg.34.1390869276003; Mon, 27 Jan 2014 16:34:36 -0800 (PST) Received: from mail-ee0-f43.google.com (mail-ee0-f43.google.com [74.125.83.43]) by mx.google.com with ESMTPS id a9si23588341eem.195.2014.01.27.16.34.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Jan 2014 16:34:35 -0800 (PST) Received-SPF: neutral (google.com: 74.125.83.43 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.83.43; Received: by mail-ee0-f43.google.com with SMTP id c41so2570372eek.2 for ; Mon, 27 Jan 2014 16:34:35 -0800 (PST) X-Received: by 10.14.98.129 with SMTP id v1mr27462032eef.5.1390869275332; Mon, 27 Jan 2014 16:34:35 -0800 (PST) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id 46sm48745029ees.4.2014.01.27.16.34.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Jan 2014 16:34:34 -0800 (PST) From: Julien Grall To: linux-kernel@vger.kernel.org, konrad.wilk@oracle.com, boris.ostrovsky@oracle.com, david.vrabel@citrix.com Cc: xen-devel@lists.xenproject.org, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, patches@linaro.org, Julien Grall Subject: [PATCH] xen/events: xen_evtchn_fifo_init can be called very late Date: Tue, 28 Jan 2014 00:34:29 +0000 Message-Id: <1390869269-12502-1-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.171 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 Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On ARM, xen_init_IRQ (which calls xen_evtchn_fifo_init) is called after all CPUs are online. It would mean that the notifier will never be called. Therefore, when a secondary CPU will receive an interrupt, Linux will segfault because the event channel structure for this processor is not initialized. This can be fixed by calling the init function on every online cpu when the event channel fifo driver is initialized. Signed-off-by: Julien Grall --- drivers/xen/events/events_fifo.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/xen/events/events_fifo.c b/drivers/xen/events/events_fifo.c index 1de2a19..15498ab 100644 --- a/drivers/xen/events/events_fifo.c +++ b/drivers/xen/events/events_fifo.c @@ -410,12 +410,14 @@ static struct notifier_block evtchn_fifo_cpu_notifier = { int __init xen_evtchn_fifo_init(void) { - int cpu = get_cpu(); + int cpu; int ret; - ret = evtchn_fifo_init_control_block(cpu); - if (ret < 0) - goto out; + for_each_online_cpu(cpu) { + ret = evtchn_fifo_init_control_block(cpu); + if (ret < 0) + goto out; + } pr_info("Using FIFO-based ABI\n"); @@ -423,6 +425,5 @@ int __init xen_evtchn_fifo_init(void) register_cpu_notifier(&evtchn_fifo_cpu_notifier); out: - put_cpu(); return ret; }