From owner-freebsd-current@FreeBSD.ORG Mon Jan 6 11:36:53 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 622AC1CA for ; Mon, 6 Jan 2014 11:36:53 +0000 (UTC) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com [209.85.217.171]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D539C16F5 for ; Mon, 6 Jan 2014 11:36:52 +0000 (UTC) Received: by mail-lb0-f171.google.com with SMTP id w7so9675027lbi.2 for ; Mon, 06 Jan 2014 03:36:50 -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=wAmz0/AnkdSWtFxyqTbBWmZeac9Tq38a7Gv+UnPnKo0=; b=ZGT13IlhdXvRyVBw2bBPdxdlZzm68sRnAzyU5uWfSSOa+mTyIbJB/sHiC9H0pQR/n9 RfmMYPKwMBsvVa1PfBXFliu/Ax93JomlXF7WlxcWfntyCrorANP2SiDugCnqS6i65Mxe HMcF80FgBRf/CQMQCcep0fg7wOMc2qik4Mix4mlT7R7SBFqpAJ0fw77ObEkv3wjXblLl yWYTuqqVmn/tkQvZhru8W8kuiA1OEUI8Mu6g2wJ+qoUPHiaa89L8RK3JnaSCkXTxyTvN OFrtGaPUz8K3Wy8Gv+2phunTNW0y+0foEPGQ0eBEzZ5b2KZW4qjL5MQIeGHJ//sfidmL QiTQ== X-Gm-Message-State: ALoCoQk+iCQY0JuleJf3f+3++JgOlJqP2Mfd8sQlVe48NwF3lavb9TAdCCqOg1geIAe3LFH9OxyQ X-Received: by 10.152.44.225 with SMTP id h1mr44576319lam.22.1389007730321; Mon, 06 Jan 2014 03:28:50 -0800 (PST) Received: from [192.168.42.157] ([195.69.14.50]) by mx.google.com with ESMTPSA id mv9sm42580544lbc.0.2014.01.06.03.28.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 06 Jan 2014 03:28:49 -0800 (PST) Message-ID: <52CA9347.8040901@linaro.org> Date: Mon, 06 Jan 2014 11:28:07 +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: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= , 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> <52C9D432.3040409@linaro.org> <52CA7B8F.9060402@citrix.com> In-Reply-To: <52CA7B8F.9060402@citrix.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Mon, 06 Jan 2014 12:33:10 +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: Mon, 06 Jan 2014 11:36:53 -0000 On 01/06/2014 09:46 AM, Roger Pau Monné wrote: > On 05/01/14 22:52, Julien Grall wrote: >> >> >> 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). > > Ack. I wasn't thinking other arches will probably use the xenpv bus but > not the dummy cpu device. Would you agree to leave xenpv bus inside > x86/xen for now and move the dummy PV cpu device to dev/xen/pvcpu/? As we will attach every xen device to xenpv, it makes more sense to have xenpv bus used on ARM. It will avoid duplication code and keep it nicer. I'm fine with this solution for now. I will update/move the code when I will send the patch series to support FreeBSD on Xen on ARM. >> >> [..] >> >>> + >>> +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. > > Ack for both, will change it to BUS_PROBE_NOWILDCARD. While at it, we > should also change xenstore probe function to return BUS_PROBE_NOWILDCARD. > Right, I have a patch for xenstore. Do you want me to send it? -- Julien Grall