From owner-freebsd-current@FreeBSD.ORG Tue Jan 14 15:47:33 2014 Return-Path: Delivered-To: freebsd-current@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 07FD698D for ; Tue, 14 Jan 2014 15:47:33 +0000 (UTC) Received: from mail-we0-f175.google.com (mail-we0-f175.google.com [74.125.82.175]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8DAE312C2 for ; Tue, 14 Jan 2014 15:47:32 +0000 (UTC) Received: by mail-we0-f175.google.com with SMTP id p61so564013wes.34 for ; Tue, 14 Jan 2014 07:47:24 -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=eZAf2Jsq8X2YtooXl7ODA3aJHw4fEtu9rY90GKEFVoY=; b=GRZZkCqZCCXAbN88F7ArrHFFwq1sN2BdGOcBEOBbGJrjkhl0oZZFeLiUPnzmCMj2Tz CdCAotTLXm45zSvurLRsRBD1hkiIQrFMvDdOrEw/zHoJFxIqTrQds6PaiRPzvkggf5Ch gN9QYW0p6rPxUr65VHfEHkzlrOeR8koUzS9nMF3uMhcPrqD2J77h9junn6YT9Qr64lih R+ap5UiD9Bnb+Ll7OPB301fcTmMSEh1UGONUzMqbj1n/J0VUKUVRPml80krZ1Xc1VH87 4xjZz/D9nrnwY9eaCfVjUuFl3IIfmKN6nFV88+fSCe0FjjOetqKqIV5vkc/I6w5L6FIg 2sLw== X-Gm-Message-State: ALoCoQkwdfJ9o25lbVttzKofZHSt+Pwjbi83GiONaLQof49Ilcmf8cTeS1Pj0WJuzn9J2NQ+yFNB X-Received: by 10.180.8.194 with SMTP id t2mr3606396wia.41.1389714103256; Tue, 14 Jan 2014 07:41:43 -0800 (PST) Received: from [10.80.2.139] ([185.25.64.249]) by mx.google.com with ESMTPSA id f7sm839362wjb.7.2014.01.14.07.41.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 14 Jan 2014 07:41:42 -0800 (PST) Message-ID: <52D55AB4.4010504@linaro.org> Date: Tue, 14 Jan 2014 15:41:40 +0000 From: Julien Grall User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20131104 Icedove/17.0.10 MIME-Version: 1.0 To: Roger Pau Monne Subject: Re: [PATCH v10 14/20] xen: introduce xenpv bus and a dummy pvcpu device References: <1389711582-66908-1-git-send-email-roger.pau@citrix.com> <1389711582-66908-15-git-send-email-roger.pau@citrix.com> In-Reply-To: <1389711582-66908-15-git-send-email-roger.pau@citrix.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: xen-devel@lists.xen.org, julien.grall@citrix.com, freebsd-xen@freebsd.org, freebsd-current@freebsd.org, kib@freebsd.org, gibbs@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jan 2014 15:47:33 -0000 On 01/14/2014 02:59 PM, Roger Pau Monne wrote: > +static int > +xenpv_attach(device_t dev) > +{ > + device_t child; > + > + if (xen_hvm_domain()) { > + device_t xenpci; > + devclass_t dc; > + > + /* Make sure xenpci has been attached */ > + dc = devclass_find("xenpci"); > + if (dc == NULL) > + panic("unable to find xenpci devclass"); > + > + xenpci = devclass_get_device(dc, 0); > + if (xenpci == NULL) > + panic("unable to find xenpci device"); > + > + if (!device_is_attached(xenpci)) > + panic("trying to attach xenpv before xenpci"); > + } Can you use the identify method to add the xenpci device? As I said earlier, I will reuse this code for ARM guest and this device is not used on this architecture. -- Julien Grall