All of lore.kernel.org
 help / color / mirror / Atom feed
* RFC: xen config changes v4
@ 2015-02-26  1:53 Luis R. Rodriguez
  2015-02-26  4:59 ` Juergen Gross
  0 siblings, 1 reply; 37+ messages in thread
From: Luis R. Rodriguez @ 2015-02-26  1:53 UTC (permalink / raw)
  To: David Vrabel, Konrad Rzeszutek Wilk, Boris Ostrovsky,
	Juergen Gross, Jan Beulich, Stefano Stabellini
  Cc: xen-devel

OK here's the state of affairs after some further discussion on some v3 patch
RFC changes and issues I've found after trying to build front end drivers
without CONFIG_XEN.

Option                          Selects                 Depends
----------------------------------------------------------------------
XEN
                                PARAVIRT(x86)
                                PARAVIRT_CLOCK(x86)
  XEN_PV(x86)                   XEN_HAVE_PVMMU(x86)
  XEN_PVH(x86)                  XEN_FRONTEND
  XEN_BACKEND                   SWIOTLB_XEN(arm,arm64)  XEN_PV(x86) ||
                                                        XEN_PVH(x86) ||
                                                        XEN_FRONTEND
   XEN_BLKDEV_BACKEND
   XEN_PCIDEV_BACKEND(x86)
   XEN_SCSI_BACKEND
   XEN_NETDEV_BACKEND
  PCI_XEN(x86)                  SWIOTLB_XEN
  XEN_DOM0                      XEN_BACKEND             XEN_PV(x86) ||
                                PCI_XEN(x86)            XEN_PVH(x86)
    XEN_ACPI_HOTPLUG_MEMORY                             XEN_STUB
    XEN_ACPI_HOTPLUG_CPU                                XEN_STUB
    XEN_MCE_LOG(x86)
    XEN_ACPI_PROCESSOR(x86)				ACPI_PROCESSOR
							CPU_FREQ
  XEN_SAVE_RESTORE(x86)
  XEN_DEBUG_FS
  XEN_WDT
  XEN_MAX_DOMAIN_MEMORY(x86)				XEN_HAVE_PVMMU(x86)
  XEN_BALLOON
    XEN_SELFBALLOONING                                  XEN_TMEM(x86)
    XEN_BALLOON_MEMORY_HOTPLUG
    XEN_SCRUB_PAGES
  XENFS                         XEN_PRIVCMD
    XEN_COMPAT_XENFS
  XEN_TMEM(x86)
  XEN_PRIVCMD
  XEN_SYS_HYPERVISOR
  XEN_DEV_EVTCHN
  XEN_GNTDEV
  XEN_GRANT_DEV_ALLOC
  SWIOTLB_XEN
  XEN_STUB(x86_64)                                      BROKEN
  XEN_ACPI_PROCESSOR(x86)
  XEN_HAVE_PVMMU(x86)					XEN_PV(x86)
  XEN_EFI(x64)
  XEN_XENBUS_FRONTEND
XEN_FRONTEND                    XEN			X86_LOCAL_APIC(x86)
                                XEN_XENBUS_FRONTEND	PCI(x86)
  XEN_FBDEV_FRONTEND            INPUT_XEN_KBDDEV_FRONTEND
  XEN_BLKDEV_FRONTEND
  HVC_XEN_FRONTEND              HVC_XEN
  TCG_XEN
  XEN_PCIDEV_FRONTEND(x86)      PCI_XEN(x86)
  XEN_SCSI_FRONTEND
  INPUT_XEN_KBDDEV_FRONTEND
  XEN_NETDEV_FRONTEND

Additionally I will now note some expected code collateral, none of
this is obviously final but I figure I'll give a heads up as what
I have seen so far or what has helped. Perhaps not all is necessary,
but its best to discuss in case anyone sees anything worth barking
over early.

  * Folding XEN_PVHVM under XEN_FRONTEND should enable good
    integration and building of frontend drivers without requiring
    building the whole xen tamale. That has some obvious code changes
    required in place. As a build collateral since XEN_PVH used to
    depend on XEN_PVHVM we'll now obviously have XEN_PVH select
    XEN_FRONTEND.

  * Although technically we never wanted to build XEN_PVHVM without
    XEN_PVH we obviously want to build XEN_FRONTEND without XEN_PV
    and since we are folding XEN_PVHVM under XEN_FRONTEND we want
    to build XEN_FRONTEND without XEN_PV or XEN_PVH. This means
    we need to build some old XEN_PVHVM code without requiring
    a series of things -- none of this is scary reallyt, its just
    putting code into common files and building them when either
    a PV guest is Xen frontend drivers are desired. The split of
    code also tries to aim to compartamentalize XEN_PV code so
    that in the future a swift git rm would enable removal of
    XEN_PV code should that be desirable. In order to make the
    building of common code and non-common code easier to read
    I've added two Kconfig options:

config XEN_BUILD_PV_GUEST                                                       
        def_bool y if XEN_PV || XEN_PVH                                         
                                                                                
config XEN_BUILD_HYPERVISOR                                                     
        def_bool y if XEN_PV || XEN_FRONTEND  

Naming is perhaps not the best, I welcome other ideas.

Example of where we'd use this:

arch/x86/xen/xen-head.S:#ifdef CONFIG_XEN_BUILD_PV_GUEST

  * arch/x86/xen/setup.c has code which only needs to be
    built under certain conditions for simple memory set up.
    To help with this I've added to arch/x86/xen/Kconfig:

config XEN_BUILD_SIMPLE_MEMORY_SETUP
	def_bool y if !XEN_FRONTEND

    and on it folded in all the xen_extra_mem, xen_released_pages,
    xen_remap_mfn stuff (xen_memory_setup() and friends). As
    collateral that also means:

--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1560,8 +1566,10 @@ asmlinkage __visible void __init xen_start_kernel(void)

        if (xen_feature(XENFEAT_auto_translated_physmap))
                x86_init.resources.memory_setup = xen_auto_xlated_memory_setup;
+#ifdef CONFIG_XEN_BUILD_SIMPLE_MEMORY_SETUP
        else
                x86_init.resources.memory_setup = xen_memory_setup;
+#endif
        x86_init.oem.arch_setup = xen_arch_setup;
        x86_init.oem.banner = xen_banner;

There is some setup.c code which is common, so this helps compartamentalize the
non shared code.

  * In terms of shared code we end up with something that looks like this,
    desired naming preferences are welcomed, I can also just fold this into
    proper xen/ directory but was just lazy for my initial build test:

--- a/arch/x86/Kbuild
+++ b/arch/x86/Kbuild
@@ -1,7 +1,21 @@
 obj-$(CONFIG_KVM) += kvm/

+obj-$(CONFIG_XEN_BUILD_PV_GUEST) += xen/
+
 # Xen paravirtualization support
-obj-$(CONFIG_XEN) += xen/
+obj-$(CONFIG_XEN_BUILD_HYPERVISOR) += xen/common.o
+obj-$(CONFIG_XEN_BUILD_HYPERVISOR) += xen/time-common.o
+obj-$(CONFIG_XEN_BUILD_HYPERVISOR) += xen/mmu-common.o
+obj-$(CONFIG_XEN_BUILD_HYPERVISOR) += xen/p2m-common.o
+obj-$(CONFIG_XEN_BUILD_HYPERVISOR) += xen/setup-common.o
+obj-$(CONFIG_XEN_BUILD_HYPERVISOR) += xen/irq.o
+obj-$(CONFIG_XEN_BUILD_HYPERVISOR) += xen/xen-asm.o
+obj-$(CONFIG_XEN_BUILD_HYPERVISOR) += xen/xen-asm_$(BITS).o
+obj-$(CONFIG_XEN_BUILD_HYPERVISOR) += xen/grant-table.o
+obj-$(CONFIG_XEN_FRONTEND) += xen/hvm.o
+obj-$(CONFIG_XEN_FRONTEND) += xen/hvm-time.o
+obj-$(CONFIG_XEN_FRONTEND) += xen/mmu-hvm.o
+obj-$(CONFIG_XEN_FRONTEND) += xen/platform-pci-unplug.o

If any of this looks fuzzy still you could just wait for a clean
patch series to evaluate better.

  Luis

-- 
Luis Rodriguez, SUSE LINUX GmbH
Maxfeldstrasse 5; D-90409 Nuernberg

^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2015-03-06 18:24 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-26  1:53 RFC: xen config changes v4 Luis R. Rodriguez
2015-02-26  4:59 ` Juergen Gross
2015-02-26 10:08   ` David Vrabel
2015-02-26 11:08     ` Stefano Stabellini
2015-02-26 17:29       ` Luis R. Rodriguez
2015-02-26 17:42         ` Stefano Stabellini
2015-02-26 18:48           ` Luis R. Rodriguez
2015-02-27  6:14             ` Juergen Gross
2015-02-27 21:33               ` Luis R. Rodriguez
2015-02-27 10:04             ` Ian Campbell
2015-02-27  6:09           ` Juergen Gross
2015-02-27  9:41             ` Stefano Stabellini
2015-02-27  9:55               ` Juergen Gross
2015-02-27 10:11                 ` Stefano Stabellini
2015-02-27 10:30                   ` Ian Campbell
2015-02-27 11:27                     ` Stefano Stabellini
2015-02-27 11:30                   ` Juergen Gross
2015-02-27 12:24                     ` Stefano Stabellini
2015-02-27 12:36                       ` Juergen Gross
2015-02-27 13:38                         ` Stefano Stabellini
2015-02-27 14:30                           ` Juergen Gross
2015-02-27 17:53                             ` Luis R. Rodriguez
2015-02-27 18:27                               ` Konrad Rzeszutek Wilk
2015-03-02  9:55                                 ` Stefano Stabellini
2015-03-02 16:07                                   ` Konrad Rzeszutek Wilk
2015-03-02 17:07                                     ` Stefano Stabellini
2015-03-02 17:30                                       ` Konrad Rzeszutek Wilk
2015-03-02 21:15                                         ` Luis R. Rodriguez
2015-03-03  6:59                                       ` Juergen Gross
2015-03-02 21:08                                     ` Luis R. Rodriguez
2015-03-02 20:39                                 ` Luis R. Rodriguez
2015-03-06 17:17                                   ` Luis R. Rodriguez
2015-03-06 18:02                                     ` Konrad Rzeszutek Wilk
2015-03-06 18:08                                       ` Luis R. Rodriguez
2015-03-06 18:24                                         ` Roger Pau Monné
2015-02-27 12:48                       ` Ian Campbell
2015-02-27 18:18                   ` Konrad Rzeszutek Wilk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.