1. 15 3月, 2012 1 次提交
    • K
      xen/acpi-processor: C and P-state driver that uploads said data to hypervisor. · 59a56802
      Konrad Rzeszutek Wilk 提交于
      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
      transitions.
      
      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: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      59a56802
  2. 17 12月, 2011 1 次提交
  3. 29 9月, 2011 1 次提交
  4. 20 7月, 2011 1 次提交
    • K
      xen/pciback: xen pci backend driver. · 30edc14b
      Konrad Rzeszutek Wilk 提交于
      This is the host side counterpart to the frontend driver in
      drivers/pci/xen-pcifront.c. The PV protocol is also implemented by
      frontend drivers in other OSes too, such as the BSDs.
      
      The PV protocol is rather simple. There is page shared with the guest,
      which has the 'struct xen_pci_sharedinfo' embossed in it. The backend
      has a thread that is kicked every-time the structure is changed and
      based on the operation field it performs specific tasks:
      
       XEN_PCI_OP_conf_[read|write]:
         Read/Write 0xCF8/0xCFC filtered data. (conf_space*.c)
         Based on which field is probed, we either enable/disable the PCI
         device, change power state, read VPD, etc. The major goal of this
         call is to provide a Physical IRQ (PIRQ) to the guest.
      
         The PIRQ is Xen hypervisor global IRQ value irrespective of the IRQ
         is tied in to the IO-APIC, or is a vector. For GSI type
         interrupts, the PIRQ==GSI holds. For MSI/MSI-X the
         PIRQ value != Linux IRQ number (thought PIRQ==vector).
      
         Please note, that with Xen, all interrupts (except those level shared ones)
         are injected directly to the guest - there is no host interaction.
      
       XEN_PCI_OP_[enable|disable]_msi[|x] (pciback_ops.c)
         Enables/disables the MSI/MSI-X capability of the device. These operations
         setup the MSI/MSI-X vectors for the guest and pass them to the frontend.
      
         When the device is activated, the interrupts are directly injected in the
         guest without involving the host.
      
       XEN_PCI_OP_aer_[detected|resume|mmio|slotreset]: In case of failure,
        perform the appropriate AER commands on the guest. Right now that is
        a cop-out - we just kill the guest.
      
      Besides implementing those commands, it can also
      
       - hide a PCI device from the host. When booting up, the user can specify
         xen-pciback.hide=(1:0:0)(BDF..) so that host does not try to use the
         device.
      
      The driver was lifted from linux-2.6.18.hg tree and fixed up
      so that it could compile under v3.0. Per suggestion from Jesse Barnes
      moved the driver to drivers/xen/xen-pciback.
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      30edc14b
  5. 09 7月, 2011 1 次提交
    • D
      xen: tmem: self-ballooning and frontswap-selfshrinking · a50777c7
      Dan Magenheimer 提交于
      This patch introduces two in-kernel drivers for Xen transcendent memory
      ("tmem") functionality that complement cleancache and frontswap.  Both
      use control theory to dynamically adjust and optimize memory utilization.
      Selfballooning controls the in-kernel Xen balloon driver, targeting a goal
      value (vm_committed_as), thus pushing less frequently used clean
      page cache pages (through the cleancache code) into Xen tmem where
      Xen can balance needs across all VMs residing on the physical machine.
      Frontswap-selfshrinking controls the number of pages in frontswap,
      driving it towards zero (effectively doing a partial swapoff) when
      in-kernel memory pressure subsides, freeing up RAM for other VMs.
      
      More detail is provided in the header comment of xen-selfballooning.c.
      Signed-off-by: NDan Magenheimer <dan.magenheimer@oracle.com>
      
      [v8: konrad.wilk@oracle.com: set default enablement depending on frontswap]
      [v7: konrad.wilk@oracle.com: fix capitalization and punctuation in comments]
      [v6: fix frontswap-selfshrinking initialization]
      [v6: konrad.wilk@oracle.com: fix init pr_infos; add comments about swap]
      [v5: konrad.wilk@oracle.com: add NULL to attr list; move inits up to decls]
      [v4: dkiper@net-space.pl: use strict_strtoul plus a few syntactic nits]
      [v3: konrad.wilk@oracle.com: fix potential divides-by-zero]
      [v3: konrad.wilk@oracle.com: add many more comments, fix nits]
      [v2: rebased to linux-3.0-rc1]
      [v2: Ian.Campbell@citrix.com: reorganize as new file (xen-selfballoon.c)]
      [v2: dkiper@net-space.pl: proper access to vm_committed_as]
      [v2: dkiper@net-space.pl: accounting fixes]
      Cc: Jan Beulich <JBeulich@novell.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Cc: <xen-devel@lists.xensource.com>
      a50777c7
  6. 18 6月, 2011 1 次提交
  7. 27 5月, 2011 1 次提交
    • D
      xen: cleancache shim to Xen Transcendent Memory · 5bc20fc5
      Dan Magenheimer 提交于
      This patch provides a shim between the kernel-internal cleancache
      API (see Documentation/mm/cleancache.txt) and the Xen Transcendent
      Memory ABI (see http://oss.oracle.com/projects/tmem).
      
      Xen tmem provides "hypervisor RAM" as an ephemeral page-oriented
      pseudo-RAM store for cleancache pages, shared cleancache pages,
      and frontswap pages.  Tmem provides enterprise-quality concurrency,
      full save/restore and live migration support, compression
      and deduplication.
      
      A presentation showing up to 8% faster performance and up to 52%
      reduction in sectors read on a kernel compile workload, despite
      aggressive in-kernel page reclamation ("self-ballooning") can be
      found at:
      
      http://oss.oracle.com/projects/tmem/dist/documentation/presentations/TranscendentMemoryXenSummit2010.pdfSigned-off-by: NDan Magenheimer <dan.magenheimer@oracle.com>
      Reviewed-by: NJeremy Fitzhardinge <jeremy@goop.org>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Matthew Wilcox <matthew@wil.cx>
      Cc: Nick Piggin <npiggin@kernel.dk>
      Cc: Mel Gorman <mel@csn.ul.ie>
      Cc: Rik Van Riel <riel@redhat.com>
      Cc: Jan Beulich <JBeulich@novell.com>
      Cc: Chris Mason <chris.mason@oracle.com>
      Cc: Andreas Dilger <adilger@sun.com>
      Cc: Ted Ts'o <tytso@mit.edu>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <joel.becker@oracle.com>
      Cc: Nitin Gupta <ngupta@vflare.org>
      5bc20fc5
  8. 13 5月, 2011 1 次提交
  9. 19 4月, 2011 1 次提交
  10. 15 4月, 2011 1 次提交
  11. 16 3月, 2011 1 次提交
  12. 15 2月, 2011 1 次提交
  13. 12 1月, 2011 2 次提交
  14. 19 11月, 2010 1 次提交
  15. 28 10月, 2010 1 次提交
  16. 21 10月, 2010 1 次提交
  17. 18 10月, 2010 1 次提交
  18. 27 7月, 2010 1 次提交
    • K
      swiotlb-xen: SWIOTLB library for Xen PV guest with PCI passthrough. · b097186f
      Konrad Rzeszutek Wilk 提交于
      This patchset:
      
      PV guests under Xen are running in an non-contiguous memory architecture.
      
      When PCI pass-through is utilized, this necessitates an IOMMU for
      translating bus (DMA) to virtual and vice-versa and also providing a
      mechanism to have contiguous pages for device drivers operations (say DMA
      operations).
      
      Specifically, under Xen the Linux idea of pages is an illusion. It
      assumes that pages start at zero and go up to the available memory. To
      help with that, the Linux Xen MMU provides a lookup mechanism to
      translate the page frame numbers (PFN) to machine frame numbers (MFN)
      and vice-versa. The MFN are the "real" frame numbers. Furthermore
      memory is not contiguous. Xen hypervisor stitches memory for guests
      from different pools, which means there is no guarantee that PFN==MFN
      and PFN+1==MFN+1. Lastly with Xen 4.0, pages (in debug mode) are
      allocated in descending order (high to low), meaning the guest might
      never get any MFN's under the 4GB mark.
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Acked-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Albert Herranz <albert_herranz@yahoo.es>
      Cc: Ian Campbell <Ian.Campbell@citrix.com>
      b097186f
  19. 23 7月, 2010 1 次提交
    • S
      xen: Xen PCI platform device driver. · 183d03cc
      Stefano Stabellini 提交于
      Add the xen pci platform device driver that is responsible
      for initializing the grant table and xenbus in PV on HVM mode.
      Few changes to xenbus and grant table are necessary to allow the delayed
      initialization in HVM mode.
      Grant table needs few additional modifications to work in HVM mode.
      
      The Xen PCI platform device raises an irq every time an event has been
      delivered to us. However these interrupts are only delivered to vcpu 0.
      The Xen PCI platform interrupt handler calls xen_hvm_evtchn_do_upcall
      that is a little wrapper around __xen_evtchn_do_upcall, the traditional
      Xen upcall handler, the very same used with traditional PV guests.
      
      When running on HVM the event channel upcall is never called while in
      progress because it is a normal Linux irq handler (and we cannot switch
      the irq chip wholesale to the Xen PV ones as we are running QEMU and
      might have passed in PCI devices), therefore we cannot be sure that
      evtchn_upcall_pending is 0 when returning.
      For this reason if evtchn_upcall_pending is set by Xen we need to loop
      again on the event channels set pending otherwise we might loose some
      event channel deliveries.
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NSheng Yang <sheng@linux.intel.com>
      Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      183d03cc
  20. 10 9月, 2009 1 次提交
    • J
      xen: make -fstack-protector work under Xen · 577eebea
      Jeremy Fitzhardinge 提交于
      -fstack-protector uses a special per-cpu "stack canary" value.
      gcc generates special code in each function to test the canary to make
      sure that the function's stack hasn't been overrun.
      
      On x86-64, this is simply an offset of %gs, which is the usual per-cpu
      base segment register, so setting it up simply requires loading %gs's
      base as normal.
      
      On i386, the stack protector segment is %gs (rather than the usual kernel
      percpu %fs segment register).  This requires setting up the full kernel
      GDT and then loading %gs accordingly.  We also need to make sure %gs is
      initialized when bringing up secondary cpus too.
      
      To keep things consistent, we do the full GDT/segment register setup on
      both architectures.
      
      Because we need to avoid -fstack-protected code before setting up the GDT
      and because there's no way to disable it on a per-function basis, several
      files need to have stack-protector inhibited.
      
      [ Impact: allow Xen booting with stack-protector enabled ]
      Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      577eebea
  21. 31 3月, 2009 2 次提交
  22. 09 1月, 2009 1 次提交
  23. 05 9月, 2008 1 次提交
  24. 25 8月, 2008 1 次提交
    • A
      xen: implement CPU hotplugging · d68d82af
      Alex Nixon 提交于
      Note the changes from 2.6.18-xen CPU hotplugging:
      
      A vcpu_down request from the remote admin via Xenbus both hotunplugs the
      CPU, and disables it by removing it from the cpu_present map, and removing
      its entry in /sys.
      
      A vcpu_up request from the remote admin only re-enables the CPU, and does
      not immediately bring the CPU up. A udev event is emitted, which can be
      caught by the user if he wishes to automatically re-up CPUs when available,
      or implement a more complex policy.
      Signed-off-by: NAlex Nixon <alex.nixon@citrix.com>
      Acked-by: NJeremy Fitzhardinge <jeremy@goop.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d68d82af
  25. 27 5月, 2008 1 次提交
  26. 25 4月, 2008 4 次提交
  27. 18 7月, 2007 2 次提交