From owner-freebsd-arm@FreeBSD.ORG Fri Jan 17 13:49:44 2014 Return-Path: Delivered-To: freebsd-arm@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 7420C86D for ; Fri, 17 Jan 2014 13:49:44 +0000 (UTC) Received: from mail-wg0-f42.google.com (mail-wg0-f42.google.com [74.125.82.42]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0318314F2 for ; Fri, 17 Jan 2014 13:49:43 +0000 (UTC) Received: by mail-wg0-f42.google.com with SMTP id l18so1779852wgh.5 for ; Fri, 17 Jan 2014 05:49:42 -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=gptWh6SCeZgU4ox3TMfLGNjiaIT4/FIrU9bsOrmbQ3o=; b=MJcmXHfJkbIDL0viXCZXfJF8CoN2d68l+WmCO1B3CY4qSN3wQZ+o/ux58CYsAGCB29 qtsv0PXxtA8tsp/EFv7v+liNiEUnF28/ee2iO3QosjefKZ8ZlGw2Xd4UpJwlmCoredqf FnuTtOsWuJp2PEO8oMSrgye71Zy2ExXkuK0j9QxKSdny/gtkWAPeectpsl/wgDtFTgEh SeJUz40SCPhCFtDG8umck2cRTAWkLbLDdHW9tlc8c34GN/IHusBwlB8quB9NIS/1kyno zHW27RyZx5x4NafL1mmrslHnZFq5q5RLlX5KuXkOHvYgcfVhKauA6vnwFKPinvv0sVRB DCHg== X-Gm-Message-State: ALoCoQlj9uzptbYT4yk7/1ThhFOIVGrkZ6g2Sqz2rGDNubXuZ/fehmmbzyPGYUpCzx5AiRFp283V X-Received: by 10.194.92.7 with SMTP id ci7mr2157335wjb.58.1389966582419; Fri, 17 Jan 2014 05:49:42 -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 x4sm3327855wif.0.2014.01.17.05.49.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Jan 2014 05:49:41 -0800 (PST) Message-ID: <52D934F4.709@linaro.org> Date: Fri, 17 Jan 2014 13:49:40 +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: Ian Campbell 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> <1389950962.6697.33.camel@kazak.uk.xensource.com> In-Reply-To: <1389950962.6697.33.camel@kazak.uk.xensource.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: 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: Fri, 17 Jan 2014 13:49:44 -0000 On 01/17/2014 09:29 AM, Ian Campbell wrote: > On Fri, 2014-01-17 at 00:36 +0000, Julien Grall wrote: >> >> On 01/16/2014 01:56 AM, Nathan Whitehorn wrote: >>> On the subject of simple-bus, they usually aren't necessary. For >>> example, all hypervisor devices on IBM hardware live under /vdevice, >>> which is attached to the device tree root. They don't use MMIO, so >>> simple-bus doesn't really make sense. How does Xen communicate with the >>> OS in these devices? >>> -Nathan >> >> 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. > > Is the root node not considered to be a "top-level simple-bus" with a > 1:1 mapping of MMIO and interrupts? (Linux seems to treat it this way, > but I haven't trawled the docs for a spec reference to back that > behaviour up). I take it BSD doesn't do this? There is 2 different paths on FreeBSD to decode interrupt/MMIO (depending if you are under the root node or a simple-bus node). Most of the code is duplicated but there are some parts which differs (for instance interrupt decoding, see my answer to Nathan). I will look at closer to the code this week-end and see if I can fix it. -- Julien Grall