Re: [Xen-devel] [PATCH v2 2/2] x86, arm, platform, xen, kconfig: add xen defconfig helper

Luis R. Rodriguez
2015-01-14T18:36:42Z

On Wed, Jan 14, 2015 at 11:29:41AM +0000, Stefano Stabellini wrote:
> On Tue, 13 Jan 2015, Luis R. Rodriguez wrote:
> > On Mon, Dec 15, 2014 at 02:58:26PM +0000, Stefano Stabellini wrote:
> > > On Tue, 9 Dec 2014, Luis R. Rodriguez wrote:
> > > > From: "Luis R. Rodriguez" <mcgrof@suse.com>
> > > >
> > > > This lets you build a kernel which can support xen dom0
> > > > or xen guests by just using:
> > > >
> > > > make xenconfig
> > > >
> > > > on both x86 and arm64 kernels. This also splits out the
> > > > options which are available currently to be built with x86
> > > > and 'make ARCH=arm64' under a shared config.
> > > >
> > > > Technically xen supports a dom0 kernel and also a guest
> > > > kernel configuration but upon review with the xen team
> > > > since we don't have many dom0 options its best to just
> > > > combine these two into one.
> > > >
> > > > Cc: Josh Triplett <josh@joshtriplett.org>
> > > > Cc: Borislav Petkov <bp@suse.de>
> > > > Cc: Pekka Enberg <penberg@kernel.org>
> > > > Cc: David Rientjes <rientjes@google.com>
> > > > Cc: Michal Marek <mmarek@suse.cz>
> > > > Cc: Randy Dunlap <rdunlap@infradead.org>
> > > > Cc: penberg@kernel.org
> > > > Cc: levinsasha928@gmail.com
> > > > Cc: mtosatti@redhat.com
> > > > Cc: fengguang.wu@intel.com
> > > > Cc: David Vrabel <david.vrabel@citrix.com>
> > > > Cc: Ian Campbell <Ian.Campbell@citrix.com>
> > > > Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > > > Cc: xen-devel@lists.xenproject.org
> > > > Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> > > > Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
> > > > ---
> > > > arch/x86/configs/xen.config | 7 +++++++
> > > > kernel/configs/xen.config | 30 ++++++++++++++++++++++++++++++
> > > > scripts/kconfig/Makefile | 5 +++++
> > > > 3 files changed, 42 insertions(+)
> > > > create mode 100644 arch/x86/configs/xen.config
> > > > create mode 100644 kernel/configs/xen.config
> > > >
> > > > diff --git a/arch/x86/configs/xen.config b/arch/x86/configs/xen.config
> > > > new file mode 100644
> > > > index 0000000..92b8587f
> > > > --- /dev/null
> > > > +++ b/arch/x86/configs/xen.config
> > > > @@ -0,0 +1,7 @@
> > > > +# x86 xen specific config options
> > > > +CONFIG_XEN_PVHVM=y
> > > > +CONFIG_XEN_MAX_DOMAIN_MEMORY=500
> > > > +CONFIG_XEN_SAVE_RESTORE=y
> > > > +# CONFIG_XEN_DEBUG_FS is not set
> > > > +CONFIG_XEN_PVH=y
> > > > +CONFIG_XEN_MCE_LOG=y
> > > > diff --git a/kernel/configs/xen.config b/kernel/configs/xen.config
> > > > new file mode 100644
> > > > index 0000000..d2ec010
> > > > --- /dev/null
> > > > +++ b/kernel/configs/xen.config
> > > > @@ -0,0 +1,30 @@
> > > > +# generic config
> > > > +CONFIG_XEN=y
> > > > +CONFIG_XEN_DOM0=y
> > > > +CONFIG_PCI_XEN=y
> > >
> > > This shouldn't be here
> >
> > If PCI is not supported on the arch this won't be selected as kconfig would not
> > allow for it, what would be the issue of keeping it here?
>
> It looks wrong to me to have an arch specific option here. Moreover many
> ARM boards don't even have PCI, so it looks even worse.
> CONFIG_PCI_XEN is certainly not a generic config option for Xen.

OK fair enough.

> > What xen instances
> > would we not want to have this enabled for and can we instead manage that
> > through Kconfig magic by negating PCI_XEN for it?
>
> Everything can be fixed via Kconfig magic, the point of this exercise is
> to try to avoid it.
>
> Are there any cases on x86 where you don't actually want CONFIG_PCI_XEN?

Not that I can think of.

> If not, then why don't just enable it automatically and silently if
> CONFIG_PCI is selected? If we did that, we could avoid specifying it
> here.

CONFIG_PCI_XEN already depends depends on PCI && XEN so I think its safe
to just put it in blindly for x86.

> In any case, given that CONFIG_PCI_XEN is only defined on x86, I think
> it should be in arch/x86/configs/xen.config.

OK!

Will respin.

Luis