1. 24 Oct, 2018 3 commits
  2. 14 Sep, 2018 1 commit
    • Marek Marczykowski-Górecki's avatar
      xen/balloon: add runtime control for scrubbing ballooned out pages · 197ecb38
      Marek Marczykowski-Górecki authored
      Scrubbing pages on initial balloon down can take some time, especially
      in nested virtualization case (nested EPT is slow). When HVM/PVH guest is
      started with memory= significantly lower than maxmem=, all the extra
      pages will be scrubbed before returning to Xen. But since most of them
      weren't used at all at that point, Xen needs to populate them first
      (from populate-on-demand pool). In nested virt case (Xen inside KVM)
      this slows down the guest boot by 15-30s with just 1.5GB needed to be
      returned to Xen.
      Add runtime parameter to enable/disable it, to allow initially disabling
      scrubbing, then enable it back during boot (for example in initramfs).
      Such usage relies on assumption that a) most pages ballooned out during
      initial boot weren't used at all, and b) even if they were, very few
      secrets are in the guest at that time (before any serious userspace
      kicks in).
      enabled by default), controlling default value for the new runtime
      Signed-off-by: Marek Marczykowski-Górecki's avatarMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
      Reviewed-by: Juergen Gross's avatarJuergen Gross <jgross@suse.com>
      Signed-off-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
  3. 27 Jul, 2018 2 commits
  4. 12 Dec, 2017 1 commit
  5. 31 Oct, 2017 1 commit
  6. 31 Aug, 2017 1 commit
  7. 06 Jul, 2016 1 commit
  8. 15 Mar, 2016 1 commit
  9. 20 Aug, 2015 2 commits
  10. 26 Mar, 2015 1 commit
  11. 23 Mar, 2015 1 commit
  12. 16 Mar, 2015 1 commit
  13. 23 Sep, 2014 1 commit
    • Juergen Gross's avatar
      xen-scsiback: Add Xen PV SCSI backend driver · d9d660f6
      Juergen Gross authored
      Introduces the Xen pvSCSI backend. With pvSCSI it is possible for a
      Xen domU to issue SCSI commands to a SCSI LUN assigned to that
      domU. The SCSI commands are passed to the pvSCSI backend in a driver
      domain (usually Dom0) which is owner of the physical device. This
      allows e.g. to use SCSI tape drives in a Xen domU.
      The code is taken from the pvSCSI implementation in Xen done by
      Fujitsu based on Linux kernel 2.6.18.
      Changes from the original version are:
      - port to upstream kernel
      - put all code in just one source file
      - adapt to Linux style guide
      - use target core infrastructure instead doing pure pass-through
      - enable module unloading
      - support SG-list in grant page(s)
      - support task abort
      - remove redundant struct backend
      - allocate resources dynamically
      - correct minor error in scsiback_fast_flush_area
      - free allocated resources in case of error during I/O preparation
      - remove CDB emulation, now handled by target core infrastructure
      Signed-off-by: Juergen Gross's avatarJuergen Gross <jgross@suse.com>
      Reviewed-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
  14. 18 Jul, 2014 1 commit
    • Daniel Kiper's avatar
      xen: Put EFI machinery in place · be81c8a1
      Daniel Kiper authored
      This patch enables EFI usage under Xen dom0. Standard EFI Linux
      Kernel infrastructure cannot be used because it requires direct
      access to EFI data and code. However, in dom0 case it is not possible
      because above mentioned EFI stuff is fully owned and controlled
      by Xen hypervisor. In this case all calls from dom0 to EFI must
      be requested via special hypercall which in turn executes relevant
      EFI code in behalf of dom0.
      When dom0 kernel boots it checks for EFI availability on a machine.
      If it is detected then artificial EFI system table is filled.
      Native EFI callas are replaced by functions which mimics them
      by calling relevant hypercall. Later pointer to EFI system table
      is passed to standard EFI machinery and it continues EFI subsystem
      initialization taking into account that there is no direct access
      to EFI boot services, runtime, tables, structures, etc. After that
      system runs as usual.
      This patch is based on Jan Beulich and Tang Liang work.
      Signed-off-by: Jan Beulich's avatarJan Beulich <jbeulich@suse.com>
      Signed-off-by: default avatarTang Liang <liang.tang@oracle.com>
      Signed-off-by: default avatarDaniel Kiper <daniel.kiper@oracle.com>
      Reviewed-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com
      Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
  15. 06 Jan, 2014 1 commit
    • Ian Campbell's avatar
      xen: balloon: enable for ARM · 72f28071
      Ian Campbell authored
      Since c275a57f "xen/balloon: Set balloon's initial state to number of
      existing RAM pages" the balloon driver appears to work fine on ARM as far as I
      can tell. Prior to that commit it was broken because on ARM RAM doesn't
      typically start at zero, effectively leaving a big MMIO hole at the start.
      This would cause the balloon driver to give away all of RAM at start of day,
      which is rather inconvenient.
      It was already enabled (or rather not excluded) on ARM64. The
      "xen/balloon: Seperate the auto-translate logic properly (v2)"
      added in the proper plumbing to work with ARM and PVH type guests.
      Signed-off-by: default avatarIan Campbell <ian.campbell@citrix.com>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: David Vrabel <david.vrabel@citrix.com>
      Acked-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
      [v2: Added the bit about PVH]
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  16. 02 Dec, 2013 1 commit
  17. 10 Oct, 2013 1 commit
    • Stefano Stabellini's avatar
      xen/arm,arm64: enable SWIOTLB_XEN · 83862ccf
      Stefano Stabellini authored
      Xen on arm and arm64 needs SWIOTLB_XEN: when running on Xen we need to
      program the hardware with mfns rather than pfns for dma addresses.
      Remove SWIOTLB_XEN dependency on X86 and PCI and make XEN select
      SWIOTLB_XEN on arm and arm64.
      At the moment always rely on swiotlb-xen, but when Xen starts supporting
      hardware IOMMUs we'll be able to avoid it conditionally on the presence
      of an IOMMU on the platform.
      Implement xen_create_contiguous_region on arm and arm64: for the moment
      we assume that dom0 has been mapped 1:1 (physical addresses == machine
      addresses) therefore we don't need to call XENMEM_exchange. Simply
      return the physical address as dma address.
      Initialize the xen-swiotlb from xen_early_init (before the native
      dma_ops are initialized), set xen_dma_ops to &xen_swiotlb_dma_ops.
      Signed-off-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Changes in v8:
      - assume dom0 is mapped 1:1, no need to call XENMEM_exchange.
      Changes in v7:
      - call __set_phys_to_machine_multi from xen_create_contiguous_region and
      xen_destroy_contiguous_region to update the P2M;
      - don't call XENMEM_unpin, it has been removed;
      - call XENMEM_exchange instead of XENMEM_exchange_and_pin;
      - set nr_exchanged to 0 before calling the hypercall.
      Changes in v6:
      - introduce and export xen_dma_ops;
      - call xen_mm_init from as arch_initcall.
      Changes in v4:
      - remove redefinition of DMA_ERROR_CODE;
      - update the code to use XENMEM_exchange_and_pin and XENMEM_unpin;
      - add a note about hardware IOMMU in the commit message.
      Changes in v3:
      - code style changes;
      - warn on XENMEM_put_dma_buf failures.
  18. 30 Jul, 2013 1 commit
  19. 15 May, 2013 2 commits
  20. 08 May, 2013 1 commit
  21. 01 May, 2013 1 commit
    • Dan Magenheimer's avatar
      xen: tmem: enable Xen tmem shim to be built/loaded as a module · 10a7a077
      Dan Magenheimer authored
      Allow Xen tmem shim to be built/loaded as a module.  Xen self-ballooning
      and frontswap-selfshrinking are now also "lazily" initialized when the
      Xen tmem shim is loaded as a module, unless explicitly disabled by
      module parameters.
      Note runtime dependency disallows loading if cleancache/frontswap lazy
      initialization patches are not present.
      If built-in (not built as a module), the original mechanism of enabling
      via a kernel boot parameter is retained, but this should be considered
      Note that module unload is explicitly not yet supported.
      [v1: Removed the [CLEANCACHE|FRONTSWAP]_HAS_LAZY_INIT ifdef]
      [v2: Squashed the xen/tmem: Remove the subsys call patch in]
      [akpm@linux-foundation.org: fix build (disable_frontswap_selfshrinking undeclared)]
      Signed-off-by: default avatarDan Magenheimer <dan.magenheimer@oracle.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarBob Liu <lliubbo@gmail.com>
      Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com>
      Cc: Andor Daam <andor.daam@googlemail.com>
      Cc: Florian Schmaus <fschmaus@gmail.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Stefan Hengelein <ilendir@googlemail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  22. 27 Mar, 2013 1 commit
    • Konrad Rzeszutek Wilk's avatar
      xen/acpi-stub: Disable it b/c the acpi_processor_add is no longer called. · 76fc2537
      Konrad Rzeszutek Wilk authored
      With the Xen ACPI stub code (CONFIG_XEN_STUB=y) enabled, the power
      C and P states are no longer uploaded to the hypervisor.
      The reason is that the Xen CPU hotplug code: xen-acpi-cpuhotplug.c
      and the xen-acpi-stub.c register themselves as the "processor" type object.
      That means the generic processor (processor_driver.c) stops
      working and it does not call (acpi_processor_add) which populates the
               per_cpu(processors, pr->id) = pr;
      structure. The 'pr' is gathered from the acpi_processor_get_info function
      which does the job of finding the C-states and figuring out PBLK address.
      The 'processors->pr' is then later used by xen-acpi-processor.c (the one that
      uploads C and P states to the hypervisor). Since it is NULL, we end
      skip the gathering of _PSD, _PSS, _PCT, etc and never upload the power
      management data.
      The end result is that enabling the CONFIG_XEN_STUB in the build means that
      xen-acpi-processor is not working anymore.
      This temporary patch fixes it by marking the XEN_STUB driver as
      BROKEN until this can be properly fixed.
      CC: jinsong.liu@intel.com
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  23. 20 Feb, 2013 3 commits
    • Liu Jinsong's avatar
      xen/acpi: ACPI cpu hotplug · 39adc483
      Liu Jinsong authored
      This patch implement real Xen ACPI cpu hotplug driver as module.
      When loaded, it replaces Xen stub driver.
      For booting existed cpus, the driver enumerates them.
      For hotadded cpus, which added at runtime and notify OS via
      device or container event, the driver is invoked to add them,
      parsing cpu information, hypercalling to Xen hypervisor to add
      them, and finally setting up new /sys interface for them.
      Signed-off-by: default avatarLiu Jinsong <jinsong.liu@intel.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    • Liu Jinsong's avatar
      xen/acpi: ACPI memory hotplug · ef92e7ca
      Liu Jinsong authored
      This patch implements real Xen acpi memory hotplug driver as module.
      When loaded, it replaces Xen stub driver.
      When an acpi memory device hotadd event occurs, it notifies OS and
      invokes notification callback, adding related memory device and parsing
      memory information, finally hypercall to xen hypervisor to add memory.
      Signed-off-by: default avatarLiu Jinsong <jinsong.liu@intel.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    • Liu Jinsong's avatar
      xen/stub: driver for memory hotplug · dcb93b96
      Liu Jinsong authored
      This patch create a file (xen-stub.c) for Xen stub drivers.
      Xen stub drivers are used to reserve space for Xen drivers, i.e.
      memory hotplug and cpu hotplug, and to block native drivers loaded,
      so that real Xen drivers can be modular and loaded on demand.
      This patch is specific for Xen memory hotplug (other Xen logic
      can add stub drivers on their own). The xen stub driver will
      occupied earlier via subsys_initcall (than native memory hotplug
      driver via module_init and so blocking native). Later real Xen
      memory hotplug logic will unregister the stub driver and register
      itself to take effect on demand.
      Signed-off-by: default avatarLiu Jinsong <jinsong.liu@intel.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  24. 29 Nov, 2012 1 commit
  25. 09 Oct, 2012 1 commit
    • Arnd Bergmann's avatar
      ARM: Xen: fix initial build problems · f880b67d
      Arnd Bergmann authored
      * The XEN_BALLOON code requires the balloon infrastructure that is not
        getting built on ARM.
      * The tmem hypercall is not available on ARM
      * ARMv6 does not support cmpxchg on 16-bit words that are used in the
        Xen grant table code, so we must ensure that Xen support is only
        built on ARMv7-only kernels not combined ARMv6/v7 kernels.
      * sys-hypervisor.c needs to include linux/err.h in order to use the
        IS_ERR/PTR_ERR/ERR_PTR family of functions.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarIan Campbell <ian.campbell@citrix.com>
      Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Cc: xen-devel@lists.xensource.com
  26. 19 Jul, 2012 1 commit
  27. 07 May, 2012 1 commit
  28. 16 Apr, 2012 1 commit
  29. 24 Mar, 2012 1 commit
    • Konrad Rzeszutek Wilk's avatar
      xen/acpi: Fix Kconfig dependency on CPU_FREQ · df7a3ee2
      Konrad Rzeszutek Wilk authored
      The functions: "acpi_processor_*" sound like they depend on CONFIG_ACPI_PROCESSOR
      but in reality they are exposed when CONFIG_CPU_FREQ=[y|m]. As such
      update the Kconfig to have this dependency and fix compile issues:
      ERROR: "acpi_processor_unregister_performance" [drivers/xen/xen-acpi-processor.ko] undefined!
      ERROR: "acpi_processor_notify_smm" [drivers/xen/xen-acpi-processor.ko] undefined!
      ERROR: "acpi_processor_register_performance" [drivers/xen/xen-acpi-processor.ko] undefined!
      ERROR: "acpi_processor_preregister_performance" [drivers/xen/xen-acpi-processor.ko] undefined!
      Note: We still need the CONFIG_ACPI
      Reported-by: default avatarRandy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  30. 20 Mar, 2012 1 commit
  31. 14 Mar, 2012 1 commit
    • Konrad Rzeszutek Wilk's avatar
      xen/acpi-processor: C and P-state driver that uploads said data to hypervisor. · 59a56802
      Konrad Rzeszutek Wilk authored
      This driver solves three problems:
       1). Parse and upload ACPI0007 (or PROCESSOR_TYPE) information to the
           hypervisor - aka P-states (cpufreq data).
       2). Upload the the Cx state information (cpuidle data).
       3). Inhibit CPU frequency scaling drivers from loading.
      The reason for wanting to solve 1) and 2) is such that the Xen hypervisor
      is the only one that knows the CPU usage of different guests and can
      make the proper decision of when to put CPUs and packages in proper states.
      Unfortunately the hypervisor has no support to parse ACPI DSDT tables, hence it
      needs help from the initial domain to provide this information. The reason
      for 3) is that we do not want the initial domain to change P-states while the
      hypervisor is doing it as well - it causes rather some funny cases of P-states
      For this to work, the driver parses the Power Management data and uploads said
      information to the Xen hypervisor. It also calls acpi_processor_notify_smm()
      to inhibit the other CPU frequency scaling drivers from being loaded.
      Everything revolves around the 'struct acpi_processor' structure which
      gets updated during the bootup cycle in different stages. At the startup, when
      the ACPI parser starts, the C-state information is processed (processor_idle)
      and saved in said structure as 'power' element. Later on, the CPU frequency
      scaling driver (powernow-k8 or acpi_cpufreq), would call the the
      acpi_processor_* (processor_perflib functions) to parse P-states information
      and populate in the said structure the 'performance' element.
      Since we do not want the CPU frequency scaling drivers from loading
      we have to call the acpi_processor_* functions to parse the P-states and
      call "acpi_processor_notify_smm" to stop them from loading.
      There is also one oddity in this driver which is that under Xen, the
      physical online CPU count can be different from the virtual online CPU count.
      Meaning that the macros 'for_[online|possible]_cpu' would process only
      up to virtual online CPU count. We on the other hand want to process
      the full amount of physical CPUs. For that, the driver checks if the ACPI IDs
      count is different from the APIC ID count - which can happen if the user
      choose to use dom0_max_vcpu argument. In such a case a backup of the PM
      structure is used and uploaded to the hypervisor.
      [v1-v2: Initial RFC implementations that were posted]
      [v3: Changed the name to passthru suggested by Pasi Kärkkäinen <pasik@iki.fi>]
      [v4: Added vCPU != pCPU support - aka dom0_max_vcpus support]
      [v5: Cleaned up the driver, fix bug under Athlon XP]
      [v6: Changed the driver to a CPU frequency governor]
      [v7: Jan Beulich <jbeulich@suse.com> suggestion to make it a cpufreq scaling driver
           made me rework it as driver that inhibits cpufreq scaling driver]
      [v8: Per Jan's review comments, fixed up the driver]
      [v9: Allow to continue even if acpi_processor_preregister_perf.. fails]
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  32. 16 Dec, 2011 1 commit
  33. 29 Sep, 2011 1 commit