From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v9 14/19] xen: introduce xenpv bus and a dummy pvcpu device Date: Sun, 05 Jan 2014 21:52:50 +0000 Message-ID: <52C9D432.3040409@linaro.org> References: <1388677433-49525-1-git-send-email-roger.pau@citrix.com> <1388677433-49525-15-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1388677433-49525-15-git-send-email-roger.pau@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org 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 List-Id: xen-devel@lists.xenproject.org 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