1. 21 5月, 2012 1 次提交
  2. 08 5月, 2012 1 次提交
  3. 29 3月, 2012 1 次提交
  4. 28 3月, 2012 1 次提交
  5. 24 3月, 2012 1 次提交
  6. 21 3月, 2012 2 次提交
  7. 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
  8. 14 3月, 2012 1 次提交
  9. 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
  10. 13 1月, 2012 1 次提交
  11. 05 1月, 2012 2 次提交
    • 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
    • J
      Xen: consolidate and simplify struct xenbus_driver instantiation · 73db144b
      Jan Beulich 提交于
      The 'name', 'owner', and 'mod_name' members are redundant with the
      identically named fields in the 'driver' sub-structure. Rather than
      switching each instance to specify these fields explicitly, introduce
      a macro to simplify this.
      
      Eliminate further redundancy by allowing the drvname argument to
      DEFINE_XENBUS_DRIVER() to be blank (in which case the first entry from
      the ID table will be used for .driver.name).
      
      Also eliminate the questionable xenbus_register_{back,front}end()
      wrappers - their sole remaining purpose was the checking of the
      'owner' field, proper setting of which shouldn't be an issue anymore
      when the macro gets used.
      
      v2: Restore DRV_NAME for the driver name in xen-pciback.
      Signed-off-by: NJan Beulich <jbeulich@suse.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: Ian Campbell <ian.campbell@citrix.com>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      73db144b
  12. 21 12月, 2011 1 次提交
  13. 19 12月, 2011 1 次提交
  14. 17 12月, 2011 3 次提交
  15. 15 12月, 2011 1 次提交
  16. 22 11月, 2011 4 次提交
  17. 19 11月, 2011 2 次提交
  18. 17 11月, 2011 1 次提交
  19. 01 11月, 2011 2 次提交
  20. 13 10月, 2011 1 次提交
  21. 30 9月, 2011 1 次提交
  22. 29 9月, 2011 4 次提交
    • D
      xen: allow balloon driver to use more than one memory region · 8b5d44a5
      David Vrabel 提交于
      Allow the xen balloon driver to populate its list of extra pages from
      more than one region of memory.  This will allow platforms to provide
      (for example) a region of low memory and a region of high memory.
      
      The maximum possible number of extra regions is 128 (== E820MAX) which
      is quite large so xen_extra_mem is placed in __initdata.  This is safe
      as both xen_memory_setup() and balloon_init() are in __init.
      
      The balloon regions themselves are not altered (i.e., there is still
      only the one region).
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      8b5d44a5
    • D
      xen/balloon: account for pages released during memory setup · aa24411b
      David Vrabel 提交于
      In xen_memory_setup() pages that occur in gaps in the memory map are
      released back to Xen.  This reduces the domain's current page count in
      the hypervisor.  The Xen balloon driver does not correctly decrease
      its initial current_pages count to reflect this.  If 'delta' pages are
      released and the target is adjusted the resulting reservation is
      always 'delta' less than the requested target.
      
      This affects dom0 if the initial allocation of pages overlaps the PCI
      memory region but won't affect most domU guests that have been setup
      with pseudo-physical memory maps that don't have gaps.
      
      Fix this by accouting for the released pages when starting the balloon
      driver.
      
      If the domain's targets are managed by xapi, the domain may eventually
      run out of memory and die because xapi currently gets its target
      calculations wrong and whenever it is restarted it always reduces the
      target by 'delta'.
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      aa24411b
    • S
      xen: modify kernel mappings corresponding to granted pages · 0930bba6
      Stefano Stabellini 提交于
      If we want to use granted pages for AIO, changing the mappings of a user
      vma and the corresponding p2m is not enough, we also need to update the
      kernel mappings accordingly.
      Currently this is only needed for pages that are created for user usages
      through /dev/xen/gntdev. As in, pages that have been in use by the
      kernel and use the P2M will not need this special mapping.
      However there are no guarantees that in the future the kernel won't
      start accessing pages through the 1:1 even for internal usage.
      
      In order to avoid the complexity of dealing with highmem, we allocated
      the pages lowmem.
      We issue a HYPERVISOR_grant_table_op right away in
      m2p_add_override and we remove the mappings using another
      HYPERVISOR_grant_table_op in m2p_remove_override.
      Considering that m2p_add_override and m2p_remove_override are called
      once per page we use multicalls and hypercall batching.
      
      Use the kmap_op pointer directly as argument to do the mapping as it is
      guaranteed to be present up until the unmapping is done.
      Before issuing any unmapping multicalls, we need to make sure that the
      mapping has already being done, because we need the kmap->handle to be
      set correctly.
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      [v1: Removed GRANT_FRAME_BIT usage]
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      0930bba6
    • S
      xen: add an "highmem" parameter to alloc_xenballooned_pages · 693394b8
      Stefano Stabellini 提交于
      Add an highmem parameter to alloc_xenballooned_pages, to allow callers to
      request lowmem or highmem pages.
      
      Fix the code style of free_xenballooned_pages' prototype.
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      693394b8
  23. 27 9月, 2011 1 次提交
  24. 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
  25. 26 7月, 2011 1 次提交
    • D
      xen/balloon: memory hotplug support for Xen balloon driver · 080e2be7
      Daniel Kiper 提交于
      Memory hotplug support for Xen balloon driver.  It should be mentioned
      that hotplugged memory is not onlined automatically.  It should be onlined
      by user through standard sysfs interface.
      
      Memory could be hotplugged in following steps:
      
        1) dom0: xl mem-max <domU> <maxmem>
           where <maxmem> is >= requested memory size,
      
        2) dom0: xl mem-set <domU> <memory>
           where <memory> is requested memory size; alternatively memory
           could be added by writing proper value to
           /sys/devices/system/xen_memory/xen_memory0/target or
           /sys/devices/system/xen_memory/xen_memory0/target_kb on dumU,
      
        3) domU: for i in /sys/devices/system/memory/memory*/state; do \
                   [ "`cat "$i"`" = offline ] && echo online > "$i"; done
      
      Memory could be onlined automatically on domU by adding following line to
      udev rules:
      
        SUBSYSTEM=="memory", ACTION=="add", RUN+="/bin/sh -c '[ -f /sys$devpath/state ] && echo online > /sys$devpath/state'"
      
      In that case step 3 should be omitted.
      Signed-off-by: NDaniel Kiper <dkiper@net-space.pl>
      Acked-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Ian Campbell <ian.campbell@citrix.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      080e2be7
  26. 12 7月, 2011 1 次提交
    • K
      xen/pci: Remove 'xen_allocate_pirq_gsi'. · 78316ada
      Konrad Rzeszutek Wilk 提交于
      In the past (2.6.38) the 'xen_allocate_pirq_gsi' would allocate
      an entry in a Linux IRQ -> {XEN_IRQ, type, event, ..} array. All
      of that has been removed in 2.6.39 and the Xen IRQ subsystem uses
      an linked list that is populated when the call to
      'xen_allocate_irq_gsi' (universally done from any of the xen_bind_*
      calls) is done. The 'xen_allocate_pirq_gsi' is a NOP and there is
      no need for it anymore so lets remove it.
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      78316ada