From owner-freebsd-current@FreeBSD.ORG Sun Jan 5 22:19:47 2014 Return-Path: Delivered-To: freebsd-current@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 5FE79B03 for ; Sun, 5 Jan 2014 22:19:47 +0000 (UTC) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com [209.85.217.173]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D47F41924 for ; Sun, 5 Jan 2014 22:19:46 +0000 (UTC) Received: by mail-lb0-f173.google.com with SMTP id z5so9337413lbh.4 for ; Sun, 05 Jan 2014 14:19:44 -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 :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=Hd7a+G9AczFGRnmFEywXhhbfOAzBN+U2XkAWW/PPKlE=; b=I6VmtWVKMNWpv3sHOAC63wAs4tUiw6rU8sq6u2vkv4lEmA5/u5chfDTaD/k02pPHxX ckrvqN8xHNIiHPrHoAqIrZc6GdWlvbJKqop3nsQ0uON4CsARsanqUrShkmm/l9RSrza2 VQAJDwlI3HbsUSibcJ2u4+OplIjgWhztVz+b9paPTRfgnq8BKpFAr9K4fHopleuO1ynT b7B2Wb2cD0XKNxiV8ZP5FDerbm5rAq8SCGpri7WuEYXxEC8aYiz6iiPn2Z+3uaO09mCA k5XtZpMjQtM7pHzOHlvnviskeFN9gcaCC27573B5T33GvqNGEHJh1CX5HpQFy4/UanxA Kh7Q== X-Gm-Message-State: ALoCoQlqm7ooNNWhqY2cy8S+TnzyUwXQGMQV1p6a0pQRTURPoLmCL0kVjWHV/3y2Igba9Y/f8rtK X-Received: by 10.152.19.65 with SMTP id c1mr452980lae.49.1388958773550; Sun, 05 Jan 2014 13:52:53 -0800 (PST) Received: from [10.0.0.94] (ti0273a400-0979.bb.online.no. [85.165.250.215]) by mx.google.com with ESMTPSA id mq10sm41404148lbb.12.2014.01.05.13.52.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 05 Jan 2014 13:52:52 -0800 (PST) Message-ID: <52C9D432.3040409@linaro.org> Date: Sun, 05 Jan 2014 21:52:50 +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: Roger Pau Monne , freebsd-xen@freebsd.org, freebsd-current@freebsd.org, xen-devel@lists.xen.org, gibbs@freebsd.org, jhb@freebsd.org, kib@freebsd.org, julien.grall@citrix.com Subject: Re: [Xen-devel] [PATCH v9 14/19] xen: introduce xenpv bus and a dummy pvcpu device References: <1388677433-49525-1-git-send-email-roger.pau@citrix.com> <1388677433-49525-15-git-send-email-roger.pau@citrix.com> In-Reply-To: <1388677433-49525-15-git-send-email-roger.pau@citrix.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Mon, 06 Jan 2014 01:56:22 +0000 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: Sun, 05 Jan 2014 22:19:47 -0000 On 01/02/2014 03:43 PM, Roger Pau Monne wrote: > Since Xen PVH guests doesn't have ACPI, we need to create a dummy > bus so top level Xen devices can attach to it (instead of > attaching directly to the nexus) and a pvcpu device that will be used > to fill the pcpu->pc_device field. > --- > sys/conf/files.amd64 | 1 + > sys/conf/files.i386 | 1 + > sys/x86/xen/xenpv.c | 155 ++++++++++++++++++++++++++++++++++++++++++++++++++ I think it makes more sense to have 2 files: one for xenpv bus and one for a dummy pvcpu device. It would allow us to move xenpv bus to common code (sys/xen or sys/dev/xen). [..] > + > +static int > +xenpv_probe(device_t dev) > +{ > + > + device_set_desc(dev, "Xen PV bus"); > + device_quiet(dev); > + return (0); As I understand, 0 means I can "handle" the current device, in this case if a device is probing, because it doesn't have yet a driver, we will use xenpv and end up with 2 (or even more) xenpv buses. As we only want to probe xenpv bus once, when the bus was added manually, returning BUS_PROBE_NO_WILDCARD would suit better. [..] > +static int > +xenpvcpu_probe(device_t dev) > +{ > + > + device_set_desc(dev, "Xen PV CPU"); > + return (0); Same here: BUS_PROBE_NOWILDCARD. -- Julien Grall