From owner-freebsd-arm@FreeBSD.ORG Sat Jan 18 23:41:54 2014 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF1CEEF6 for ; Sat, 18 Jan 2014 23:41:54 +0000 (UTC) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4F26E1AA1 for ; Sat, 18 Jan 2014 23:41:54 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id g10so2042785wiw.7 for ; Sat, 18 Jan 2014 15:41:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=h76klGEasTqnnGciDyydOIaeOjOmyJ0mgLXev17A2ug=; b=I75UFRDjues9/BFXvqt5/fqatDoKs6V8adiTEMgva1k9oJn7jWV8Wsvw3JoZ1ju8M0 UZD0TD+qBpAJs3JyQwJxDsNzt3Co3e/ctEPH5CSBBgLkOeU5QDfLGXqc5shPrOD2p9k7 GsFqGBKpK5M5xDHcP0kOO2wciEKK3Uy/7TsyKLV8/ScRC2AKNUprfFtehJZ1q6EB4pi4 /9IoqaI+bL4ayNpjaOcse28rjhy2s4bhal7qIGzak5tHnVrJLjAXApDRbAfEJiGOT9xo XDvJcrX6TtA6Kko16JZysTngYmW+97TMmO62z0wzKNKotyKHLjWmC5ULV7TA23yrXXxX jInA== X-Gm-Message-State: ALoCoQmCL/WMM7RWxFKDI8yTwq5BVrkFk6kJqgR1TfOJcniL5n8ScjAwPFat3iMG9uCCB+sURqEi X-Received: by 10.194.175.202 with SMTP id cc10mr8113022wjc.48.1390088506777; Sat, 18 Jan 2014 15:41:46 -0800 (PST) Received: from [192.168.0.2] (cpc8-cmbg15-2-0-cust169.5-4.cable.virginm.net. [86.30.140.170]) by mx.google.com with ESMTPSA id w1sm16375423wix.1.2014.01.18.15.41.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 18 Jan 2014 15:41:46 -0800 (PST) Message-ID: <52DB1138.6010804@linaro.org> Date: Sat, 18 Jan 2014 23:41:44 +0000 From: Julien Grall User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Nathan Whitehorn , Warner Losh Subject: Re: [RFC] Add support for Xen ARM guest on FreeBSD References: <1389733267-20822-1-git-send-email-julien.grall@linaro.org> <24851B79-7EC7-4E3A-94DB-4B9B86FDFFFC@bsdimp.com> <52D6B62A.9000208@linaro.org> <52D73C4E.2080306@freebsd.org> <52D87B15.5090208@linaro.org> <52D89DC9.7050303@freebsd.org> In-Reply-To: <52D89DC9.7050303@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, xen-devel@lists.xen.org, freebsd-xen@freebsd.org, freebsd-arm@FreeBSD.org, gibbs@freebsd.org, roger.pau@citrix.com X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jan 2014 23:41:54 -0000 Hello Nathan, On 01/17/2014 03:04 AM, Nathan Whitehorn wrote: > On 01/16/14 18:36, Julien Grall wrote: >> >> >> On 01/16/2014 01:56 AM, Nathan Whitehorn wrote: >> As I understand, only the simple bus code (see simplebus_attach) is >> translating the interrupts in the device on a resource. >> So if you have a node directly attached to the root node with >> interrupts and MMIO, the driver won't be able to retrieve and >> translate the interrupts via bus_alloc_resources. > Why not? nexus on ARM, MIPS, PowerPC, and sparc64 can do this. I have digged into the code to find the reason of my issue. FreeBSD is receiving a VM fault when the driver (xen-dt) is trying to setup the IRQ. This is because the GIC is not yet initialized but FreeBSD asks to unmask the IRQ (sys/arm/arm/gic.c:306). With this problem, all device nodes that are before the GIC in the device tree can't have interrupts. For instance this simple device will segfault on FreeBSD: / { mybus { compatible = "simple-bus"; mynode { interrupt-parent = &gic; interrupts = <...>; }; gic: gic@xxxx { interrupt-controller; } }; }; The node "mynode" will have to move after the GIC to be able to work correctly. -- Julien Grall