1. 23 8月, 2012 1 次提交
  2. 22 8月, 2012 2 次提交
  3. 21 3月, 2012 1 次提交
    • S
      xen: support pirq_eoi_map · 9846ff10
      Stefano Stabellini 提交于
      The pirq_eoi_map is a bitmap offered by Xen to check which pirqs need to
      be EOI'd without having to issue an hypercall every time.
      We use PHYSDEVOP_pirq_eoi_gmfn_v2 to map the bitmap, then if we
      succeed we use pirq_eoi_map to check whether pirqs need eoi.
      
      Changes in v3:
      
      - explicitly use PHYSDEVOP_pirq_eoi_gmfn_v2 rather than
      PHYSDEVOP_pirq_eoi_gmfn;
      
      - introduce pirq_check_eoi_map, a function to check if a pirq needs an
      eoi using the map;
      
      -rename pirq_needs_eoi into pirq_needs_eoi_flag;
      
      - introduce a function pointer called pirq_needs_eoi that is going to be
      set to the right implementation depending on the availability of
      PHYSDEVOP_pirq_eoi_gmfn_v2.
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      9846ff10
  4. 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
  5. 14 3月, 2012 1 次提交
  6. 11 3月, 2012 1 次提交
    • K
      xen/enlighten: Expose MWAIT and MWAIT_LEAF if hypervisor OKs it. · 73c154c6
      Konrad Rzeszutek Wilk 提交于
      For the hypervisor to take advantage of the MWAIT support it needs
      to extract from the ACPI _CST the register address. But the
      hypervisor does not have the support to parse DSDT so it relies on
      the initial domain (dom0) to parse the ACPI Power Management information
      and push it up to the hypervisor. The pushing of the data is done
      by the processor_harveset_xen module which parses the information that
      the ACPI parser has graciously exposed in 'struct acpi_processor'.
      
      For the ACPI parser to also expose the Cx states for MWAIT, we need
      to expose the MWAIT capability (leaf 1). Furthermore we also need to
      expose the MWAIT_LEAF capability (leaf 5) for cstate.c to properly
      function.
      
      The hypervisor could expose these flags when it traps the XEN_EMULATE_PREFIX
      operations, but it can't do it since it needs to be backwards compatible.
      Instead we choose to use the native CPUID to figure out if the MWAIT
      capability exists and use the XEN_SET_PDC query hypercall to figure out
      if the hypervisor wants us to expose the MWAIT_LEAF capability or not.
      
      Note: The XEN_SET_PDC query was implemented in c/s 23783:
      "ACPI: add _PDC input override mechanism".
      
      With this in place, instead of
       C3 ACPI IOPORT 415
      we get now
       C3:ACPI FFH INTEL MWAIT 0x20
      
      Note: The cpu_idle which would be calling the mwait variants for idling
      never gets set b/c we set the default pm_idle to be the hypercall variant.
      Acked-by: NJan Beulich <JBeulich@suse.com>
      [v2: Fix missing header file include and #ifdef]
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      73c154c6
  7. 13 1月, 2012 1 次提交
  8. 05 1月, 2012 1 次提交
    • I
      xen/xenbus: Reject replies with payload > XENSTORE_PAYLOAD_MAX. · 9e7860ce
      Ian Campbell 提交于
      Haogang Chen found out that:
      
       There is a potential integer overflow in process_msg() that could result
       in cross-domain attack.
      
       	body = kmalloc(msg->hdr.len + 1, GFP_NOIO | __GFP_HIGH);
      
       When a malicious guest passes 0xffffffff in msg->hdr.len, the subsequent
       call to xb_read() would write to a zero-length buffer.
      
       The other end of this connection is always the xenstore backend daemon
       so there is no guest (malicious or otherwise) which can do this. The
       xenstore daemon is a trusted component in the system.
      
       However this seem like a reasonable robustness improvement so we should
       have it.
      
      And Ian when read the API docs found that:
              The payload length (len field of the header) is limited to 4096
              (XENSTORE_PAYLOAD_MAX) in both directions.  If a client exceeds the
              limit, its xenstored connection will be immediately killed by
              xenstored, which is usually catastrophic from the client's point of
              view.  Clients (particularly domains, which cannot just reconnect)
              should avoid this.
      
      so this patch checks against that instead.
      
      This also avoids a potential integer overflow pointed out by Haogang Chen.
      Signed-off-by: NIan Campbell <ian.campbell@citrix.com>
      Cc: Haogang Chen <haogangchen@gmail.com>
      CC: stable@kernel.org
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      9e7860ce
  9. 19 12月, 2011 1 次提交
  10. 22 11月, 2011 1 次提交
  11. 19 11月, 2011 2 次提交
  12. 13 10月, 2011 1 次提交
  13. 27 9月, 2011 1 次提交
  14. 23 9月, 2011 3 次提交
    • O
      xen/pv-on-hvm kexec: add xs_reset_watches to shutdown watches from old kernel · ddacf5ef
      Olaf Hering 提交于
      Add new xs_reset_watches function to shutdown watches from old kernel after
      kexec boot.  The old kernel does not unregister all watches in the
      shutdown path.  They are still active, the double registration can not
      be detected by the new kernel.  When the watches fire, unexpected events
      will arrive and the xenwatch thread will crash (jumps to NULL).  An
      orderly reboot of a hvm guest will destroy the entire guest with all its
      resources (including the watches) before it is rebuilt from scratch, so
      the missing unregister is not an issue in that case.
      
      With this change the xenstored is instructed to wipe all active watches
      for the guest.  However, a patch for xenstored is required so that it
      accepts the XS_RESET_WATCHES request from a client (see changeset
      23839:42a45baf037d in xen-unstable.hg). Without the patch for xenstored
      the registration of watches will fail and some features of a PVonHVM
      guest are not available. The guest is still able to boot, but repeated
      kexec boots will fail.
      
      [v5: use xs_single instead of passing a dummy string to xs_talkv]
      [v4: ignore -EEXIST in xs_reset_watches]
      [v3: use XS_RESET_WATCHES instead of XS_INTRODUCE]
      [v2: move all code which deals with XS_INTRODUCE into xs_introduce()
          (based on feedback from Ian Campbell); remove casts from kvec assignment]
      Signed-off-by: NOlaf Hering <olaf@aepfle.de>
      [v1: Redid the git description a bit]
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      ddacf5ef
    • O
      xen/pv-on-hvm kexec: update xs_wire.h:xsd_sockmsg_type from xen-unstable · 3b082b25
      Olaf Hering 提交于
      Update include/xen/interface/io/xs_wire.h from xen-unstable.
      Now entries in xsd_sockmsg_type were added.
      Signed-off-by: NOlaf Hering <olaf@aepfle.de>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      3b082b25
    • J
      xen/pci: support multi-segment systems · 55e901fc
      Jan Beulich 提交于
      Now that the hypercall interface changes are in -unstable, make the
      kernel side code not ignore the segment (aka domain) number anymore
      (which results in pretty odd behavior on such systems). Rather, if
      only the old interfaces are available, don't call them for devices on
      non-zero segments at all.
      Signed-off-by: NJan Beulich <jbeulich@suse.com>
      [v1: Edited git description]
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      55e901fc
  15. 06 6月, 2011 1 次提交
  16. 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
  17. 12 5月, 2011 1 次提交
  18. 06 5月, 2011 1 次提交
  19. 31 3月, 2011 1 次提交
  20. 16 3月, 2011 2 次提交
    • I
      xen network backend driver · f942dc25
      Ian Campbell 提交于
      netback is the host side counterpart to the frontend driver in
      drivers/net/xen-netfront.c. The PV protocol is also implemented by
      frontend drivers in other OSes too, such as the BSDs and even Windows.
      
      The patch is based on the driver from the xen.git pvops kernel tree but
      has been put through the checkpatch.pl wringer plus several manual
      cleanup passes and review iterations. The driver has been moved from
      drivers/xen/netback to drivers/net/xen-netback.
      
      One major change from xen.git is that the guest transmit path (i.e. what
      looks like receive to netback) has been significantly reworked to remove
      the dependency on the out of tree PageForeign page flag (a core kernel
      patch which enables a per page destructor callback on the final
      put_page). This page flag was used in order to implement a grant map
      based transmit path (where guest pages are mapped directly into SKB
      frags). Instead this version of netback uses grant copy operations into
      regular memory belonging to the backend domain. Reinstating the grant
      map functionality is something which I would like to revisit in the
      future.
      
      Note that this driver depends on 2e820f58 "xen/irq: implement
      bind_interdomain_evtchn_to_irqhandler for backend drivers" which is in
      linux next via the "xen-two" tree and is intended for the 2.6.39 merge
      window:
              git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git stable/backends
      this branch has only that single commit since 2.6.38-rc2 and is safe for
      cross merging into the net branch.
      Signed-off-by: NIan Campbell <ian.campbell@citrix.com>
      Reviewed-by: NBen Hutchings <bhutchings@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f942dc25
    • J
      watchdog: Xen watchdog driver · 066d6c7f
      Jan Beulich 提交于
      While the hypervisor change adding SCHEDOP_watchdog support included a
      daemon to make use of the new functionality, having a kernel driver
      for /dev/watchdog so that user space code doesn't need to distinguish
      non-Xen and Xen seems to be preferable.
      Signed-off-by: NJan Beulich <jbeulich@novell.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Signed-off-by: NWim Van Sebroeck <wim@iguana.be>
      066d6c7f
  21. 09 3月, 2011 1 次提交
  22. 26 2月, 2011 2 次提交
  23. 16 12月, 2010 1 次提交
  24. 02 12月, 2010 1 次提交
  25. 13 11月, 2010 1 次提交
  26. 28 10月, 2010 1 次提交
  27. 23 10月, 2010 5 次提交
  28. 18 10月, 2010 2 次提交
  29. 27 7月, 2010 1 次提交