From owner-freebsd-xen@FreeBSD.ORG Sat Jan 18 23:41:54 2014 Return-Path: Delivered-To: freebsd-xen@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2CD5EF7 for ; Sat, 18 Jan 2014 23:41:54 +0000 (UTC) Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 825781AA2 for ; Sat, 18 Jan 2014 23:41:54 +0000 (UTC) Received: by mail-wi0-f173.google.com with SMTP id d13so2047703wiw.0 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=TNjrv7LlC3LaIbGDzdGBdxos61wO33OKn2vzSbpgJZ0hkviKCJ05mk6Et5lYKVYzQt 8REh6SKCpZa2ewkGpukwMbOLz5UrFtEeHWRI8qt1vItRnZ+yrP5rlvgl9QGSKBWmbJRE JygTE+Uo8CZ0MW4YSvBifMCez6cEdrFnw5ABcLncE6ELv2/TSWDjntAzRN0fsnamwTV/ mKY7ce6TcW8O+ND/FENi+leEEGwfrL+gdWyCTxWcauZQQWQ+Od3T5iryAd+UQa62h2OT yINyedbhADeplxLyJgpCUUYCnF818JjLUVMRUOx5ZrQbRtUtStjbYdcmy/kO8ydy7IEs I6mw== X-Gm-Message-State: ALoCoQlOx1SfDZs0o5MAiHAh/yET3CnIoSQGmqKlwuwz1oMKn60Tvw5NtqL6hMZIq3EEm61JBKbE 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 X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussion of the freebsd port to xen - implementation and usage List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jan 2014 23:41:55 -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