1. 23 9月, 2014 2 次提交
  2. 04 9月, 2014 2 次提交
  3. 02 9月, 2014 2 次提交
  4. 13 8月, 2014 1 次提交
  5. 01 8月, 2014 5 次提交
  6. 30 7月, 2014 1 次提交
    • D
      x86/xen: safely map and unmap grant frames when in atomic context · b7dd0e35
      David Vrabel 提交于
      arch_gnttab_map_frames() and arch_gnttab_unmap_frames() are called in
      atomic context but were calling alloc_vm_area() which might sleep.
      
      Also, if a driver attempts to allocate a grant ref from an interrupt
      and the table needs expanding, then the CPU may already by in lazy MMU
      mode and apply_to_page_range() will BUG when it tries to re-enable
      lazy MMU mode.
      
      These two functions are only used in PV guests.
      
      Introduce arch_gnttab_init() to allocates the virtual address space in
      advance.
      
      Avoid the use of apply_to_page_range() by using saving and using the
      array of PTE addresses from the alloc_vm_area() call (which ensures
      that the required page tables are pre-allocated).
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      b7dd0e35
  7. 19 7月, 2014 1 次提交
    • D
      xen: Put EFI machinery in place · be81c8a1
      Daniel Kiper 提交于
      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: NJan Beulich <jbeulich@suse.com>
      Signed-off-by: NTang Liang <liang.tang@oracle.com>
      Signed-off-by: NDaniel Kiper <daniel.kiper@oracle.com>
      Reviewed-by: NDavid Vrabel <david.vrabel@citrix.com>
      Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      be81c8a1
  8. 15 7月, 2014 2 次提交
  9. 04 7月, 2014 1 次提交
  10. 03 7月, 2014 1 次提交
  11. 18 6月, 2014 1 次提交
  12. 24 5月, 2014 6 次提交
  13. 16 5月, 2014 1 次提交
  14. 13 5月, 2014 1 次提交
  15. 28 4月, 2014 1 次提交
  16. 18 4月, 2014 1 次提交
  17. 16 4月, 2014 4 次提交
  18. 07 4月, 2014 1 次提交
    • A
      Xen: do hv callback accounting only on x86 · d06eb3ee
      Arnd Bergmann 提交于
      Patch 99c8b79d "xen: Add proper irq accounting for HYPERCALL vector"
      added a call to inc_irq_stat(irq_hv_callback_count) in common Xen code,
      however both the inc_irq_stat function and the irq_hv_callback_count
      counter are architecture specific.
      
      This makes the code build again on ARM by moving the call into the
      existing #ifdef CONFIG_X86. We may want to later do the same implementation
      on ARM that x86 has though.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Xen <xen-devel@lists.xenproject.org>
      d06eb3ee
  19. 25 3月, 2014 1 次提交
    • W
      xen/balloon: flush persistent kmaps in correct position · 09ed3d5b
      Wei Liu 提交于
      Xen balloon driver will update ballooned out pages' P2M entries to point
      to scratch page for PV guests. In 24f69373 ("xen/balloon: don't alloc
      page while non-preemptible", kmap_flush_unused was moved after updating
      P2M table. In that case for 32 bit PV guest we might end up with
      
        P2M    X -----> S  (S is mfn of balloon scratch page)
        M2P    Y -----> X  (Y is mfn in persistent kmap entry)
      
      kmap_flush_unused() iterates through all the PTEs in the kmap address
      space, using pte_to_page() to obtain the page. If the p2m and the m2p
      are inconsistent the incorrect page is returned.  This will clear
      page->address on the wrong page which may cause subsequent oopses if
      that page is currently kmap'ed.
      
      Move the flush back between get_page and __set_phys_to_machine to fix
      this.
      Signed-off-by: NWei Liu <wei.liu2@citrix.com>
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Cc: stable@vger.kernel.org # 3.12+
      09ed3d5b
  20. 20 3月, 2014 1 次提交
    • S
      xen, balloon: Fix CPU hotplug callback registration · 43ea9536
      Srivatsa S. Bhat 提交于
      Subsystems that want to register CPU hotplug callbacks, as well as perform
      initialization for the CPUs that are already online, often do it as shown
      below:
      
      	get_online_cpus();
      
      	for_each_online_cpu(cpu)
      		init_cpu(cpu);
      
      	register_cpu_notifier(&foobar_cpu_notifier);
      
      	put_online_cpus();
      
      This is wrong, since it is prone to ABBA deadlocks involving the
      cpu_add_remove_lock and the cpu_hotplug.lock (when running concurrently
      with CPU hotplug operations).
      
      The xen balloon driver doesn't take get/put_online_cpus() around this code,
      but that is also buggy, since it can miss CPU hotplug events in between the
      initialization and callback registration:
      
      	for_each_online_cpu(cpu)
      		init_cpu(cpu);
      		   ^
      		   |  Race window; Can miss CPU hotplug events here.
      		   v
      	register_cpu_notifier(&foobar_cpu_notifier);
      
      Interestingly, the balloon code in xen can simply be reorganized as shown
      below, to have a race-free method to register hotplug callbacks, without even
      taking get/put_online_cpus(). This is because the initialization performed for
      already online CPUs is exactly the same as that performed for CPUs that come
      online later. Moreover, the code has checks in place to avoid double
      initialization.
      
      	register_cpu_notifier(&foobar_cpu_notifier);
      
      	get_online_cpus();
      
      	for_each_online_cpu(cpu)
      		init_cpu(cpu);
      
      	put_online_cpus();
      
      A hotplug operation that occurs between registering the notifier and calling
      get_online_cpus(), won't disrupt anything, because the code takes care to
      perform the memory allocations only once.
      
      So reorganize the balloon code in xen this way to fix the issues with CPU
      hotplug callback registration.
      
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: David Vrabel <david.vrabel@citrix.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Reviewed-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Signed-off-by: NSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      43ea9536
  21. 18 3月, 2014 3 次提交
    • S
      xen/acpi-processor: fix enabling interrupts on syscore_resume · cd979883
      Stanislaw Gruszka 提交于
      syscore->resume() callback is expected to do not enable interrupts,
      it generates warning like below otherwise:
      
      [ 9386.365390] WARNING: CPU: 0 PID: 6733 at drivers/base/syscore.c:104 syscore_resume+0x9a/0xe0()
      [ 9386.365403] Interrupts enabled after xen_acpi_processor_resume+0x0/0x34 [xen_acpi_processor]
      ...
      [ 9386.365429] Call Trace:
      [ 9386.365434]  [<ffffffff81667a8b>] dump_stack+0x45/0x56
      [ 9386.365437]  [<ffffffff8106921d>] warn_slowpath_common+0x7d/0xa0
      [ 9386.365439]  [<ffffffff8106928c>] warn_slowpath_fmt+0x4c/0x50
      [ 9386.365442]  [<ffffffffa0261bb0>] ? xen_upload_processor_pm_data+0x300/0x300 [xen_acpi_processor]
      [ 9386.365443]  [<ffffffff814055fa>] syscore_resume+0x9a/0xe0
      [ 9386.365445]  [<ffffffff810aef42>] suspend_devices_and_enter+0x402/0x470
      [ 9386.365447]  [<ffffffff810af128>] pm_suspend+0x178/0x260
      
      On xen_acpi_processor_resume() we call various procedures, which are
      non atomic and can enable interrupts. To prevent the issue introduce
      separate resume notify called after we enable interrupts on resume
      and before we call other drivers resume callbacks.
      Signed-off-by: NStanislaw Gruszka <sgruszka@redhat.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      cd979883
    • Z
      xen/grant-table: Refactor gnttab_[un]map_refs to avoid m2p_override · 1429d46d
      Zoltan Kiss 提交于
      The grant mapping API does m2p_override unnecessarily: only gntdev needs it,
      for blkback and future netback patches it just cause a lock contention, as
      those pages never go to userspace. Therefore this series does the following:
      - the bulk of the original function (everything after the mapping hypercall)
        is moved to arch-dependent set/clear_foreign_p2m_mapping
      - the "if (xen_feature(XENFEAT_auto_translated_physmap))" branch goes to ARM
      - therefore the ARM function could be much smaller, the m2p_override stubs
        could be also removed
      - on x86 the set_phys_to_machine calls were moved up to this new funcion
        from m2p_override functions
      - and m2p_override functions are only called when there is a kmap_ops param
      
      It also removes a stray space from arch/x86/include/asm/xen/page.h.
      Signed-off-by: NZoltan Kiss <zoltan.kiss@citrix.com>
      Suggested-by: NAnthony Liguori <aliguori@amazon.com>
      Suggested-by: NDavid Vrabel <david.vrabel@citrix.com>
      Suggested-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      1429d46d
    • R
      xen: add support for MSI message groups · 4892c9b4
      Roger Pau Monne 提交于
      Add support for MSI message groups for Xen Dom0 using the
      MAP_PIRQ_TYPE_MULTI_MSI pirq map type.
      
      In order to keep track of which pirq is the first one in the group all
      pirqs in the MSI group except for the first one have the newly
      introduced PIRQ_MSI_GROUP flag set. This prevents calling
      PHYSDEVOP_unmap_pirq on them, since the unmap must be done with the
      first pirq in the group.
      Signed-off-by: NRoger Pau Monné <roger.pau@citrix.com>
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      4892c9b4
  22. 12 3月, 2014 1 次提交