1. 02 May, 2017 1 commit
  2. 24 Aug, 2016 1 commit
  3. 26 Jul, 2016 1 commit
  4. 25 Jul, 2016 1 commit
    • Vitaly Kuznetsov's avatar
      xen: introduce xen_vcpu_id mapping · 88e957d6
      Vitaly Kuznetsov authored
      
      
      It may happen that Xen's and Linux's ideas of vCPU id diverge. In
      particular, when we crash on a secondary vCPU we may want to do kdump
      and unlike plain kexec where we do migrate_to_reboot_cpu() we try
      booting on the vCPU which crashed. This doesn't work very well for
      PVHVM guests as we have a number of hypercalls where we pass vCPU id
      as a parameter. These hypercalls either fail or do something
      unexpected.
      
      To solve the issue introduce percpu xen_vcpu_id mapping. ARM and PV
      guests get direct mapping for now. Boot CPU for PVHVM guest gets its
      id from CPUID. With secondary CPUs it is a bit more
      trickier. Currently, we initialize IPI vectors before these CPUs boot
      so we can't use CPUID. Use ACPI ids from MADT instead.
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      88e957d6
  5. 06 Jul, 2016 3 commits
  6. 21 Dec, 2015 1 commit
  7. 08 Sep, 2015 1 commit
  8. 29 Apr, 2015 1 commit
    • Boris Ostrovsky's avatar
      xen: Suspend ticks on all CPUs during suspend · 2b953a5e
      Boris Ostrovsky authored
      Commit 77e32c89
      
       ("clockevents: Manage device's state separately for
      the core") decouples clockevent device's modes from states. With this
      change when a Xen guest tries to resume, it won't be calling its
      set_mode op which needs to be done on each VCPU in order to make the
      hypervisor aware that we are in oneshot mode.
      
      This happens because clockevents_tick_resume() (which is an intermediate
      step of resuming ticks on a processor) doesn't call clockevents_set_state()
      anymore and because during suspend clockevent devices on all VCPUs (except
      for the one doing the suspend) are left in ONESHOT state. As result, during
      resume the clockevents state machine will assume that device is already
      where it should be and doesn't need to be updated.
      
      To avoid this problem we should suspend ticks on all VCPUs during
      suspend.
      Signed-off-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      2b953a5e
  9. 16 Mar, 2015 2 commits
    • David Vrabel's avatar
      xen/privcmd: improve performance of MMAPBATCH_V2 · 4e8c0c8c
      David Vrabel authored
      
      
      Make the IOCTL_PRIVCMD_MMAPBATCH_V2 (and older V1 version) map
      multiple frames at a time rather than one at a time, despite the pages
      being non-consecutive GFNs.
      
      xen_remap_foreign_mfn_array() is added which maps an array of GFNs
      (instead of a consecutive range of GFNs).
      
      Since per-frame errors are returned in an array, privcmd must set the
      MMAPBATCH_V1 error bits as part of the "report errors" phase, after
      all the frames are mapped.
      
      Migrate times are significantly improved (when using a PV toolstack
      domain).  For example, for an idle 12 GiB PV guest:
      
              Before     After
        real  0m38.179s  0m26.868s
        user  0m15.096s  0m13.652s
        sys   0m28.988s  0m18.732s
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Reviewed-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
      4e8c0c8c
    • David Vrabel's avatar
      xen: unify foreign GFN map/unmap for auto-xlated physmap guests · 628c28ee
      David Vrabel authored
      
      
      Auto-translated physmap guests (arm, arm64 and x86 PVHVM/PVH) map and
      unmap foreign GFNs using the same method (updating the physmap).
      Unify the two arm and x86 implementations into one commont one.
      
      Note that on arm and arm64, the correct error code will be returned
      (instead of always -EFAULT) and map/unmap failure warnings are no
      longer printed.  These changes are required if the foreign domain is
      paging (-ENOENT failures are expected and must be propagated up to the
      caller).
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Reviewed-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
      628c28ee
  10. 23 Feb, 2015 1 commit
    • David Vrabel's avatar
      x86/xen: allow privcmd hypercalls to be preempted · fdfd811d
      David Vrabel authored
      
      
      Hypercalls submitted by user space tools via the privcmd driver can
      take a long time (potentially many 10s of seconds) if the hypercall
      has many sub-operations.
      
      A fully preemptible kernel may deschedule such as task in any upcall
      called from a hypercall continuation.
      
      However, in a kernel with voluntary or no preemption, hypercall
      continuations in Xen allow event handlers to be run but the task
      issuing the hypercall will not be descheduled until the hypercall is
      complete and the ioctl returns to user space.  These long running
      tasks may also trigger the kernel's soft lockup detection.
      
      Add xen_preemptible_hcall_begin() and xen_preemptible_hcall_end() to
      bracket hypercalls that may be preempted.  Use these in the privcmd
      driver.
      
      When returning from an upcall, call xen_maybe_preempt_hcall() which
      adds a schedule point if if the current task was within a preemptible
      hypercall.
      
      Since _cond_resched() can move the task to a different CPU, clear and
      set xen_in_preemptible_hcall around the call.
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Reviewed-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
      fdfd811d
  11. 18 Jul, 2014 2 commits
    • Daniel Kiper's avatar
      xen: Silence compiler warnings · 57f7138d
      Daniel Kiper authored
      
      
      Add inline keyword to silence the following compiler
      warnings if xen_efi_probe() is not used:
      
        CC      arch/x86/xen/setup.o
      In file included from arch/x86/xen/xen-ops.h:7:0,
                       from arch/x86/xen/setup.c:31:
      include/xen/xen-ops.h:43:35: warning: ‘xen_efi_probe’ defined but not used [-Wunused-function]
      Signed-off-by: default avatarDaniel Kiper <daniel.kiper@oracle.com>
      Reviewed-by: default avatarKonrad Rzeszutek Wilk <Konrad.wilk@oracle.com>
      Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
      57f7138d
    • 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: default 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>
      be81c8a1
  12. 12 May, 2014 1 commit
  13. 18 Mar, 2014 1 commit
    • Stanislaw Gruszka's avatar
      xen/acpi-processor: fix enabling interrupts on syscore_resume · cd979883
      Stanislaw Gruszka authored
      
      
      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: default avatarStanislaw Gruszka <sgruszka@redhat.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      cd979883
  14. 10 Oct, 2013 1 commit
    • Stefano Stabellini's avatar
      swiotlb-xen: use xen_alloc/free_coherent_pages · 1b65c4e5
      Stefano Stabellini authored
      
      
      Use xen_alloc_coherent_pages and xen_free_coherent_pages to allocate or
      free coherent pages.
      
      We need to be careful handling the pointer returned by
      xen_alloc_coherent_pages, because on ARM the pointer is not equal to
      phys_to_virt(*dma_handle). In fact virt_to_phys only works for kernel
      direct mapped RAM memory.
      In ARM case the pointer could be an ioremap address, therefore passing
      it to virt_to_phys would give you another physical address that doesn't
      correspond to it.
      
      Make xen_create_contiguous_region take a phys_addr_t as start parameter to
      avoid the virt_to_phys calls which would be incorrect.
      
      Changes in v6:
      - remove extra spaces.
      Signed-off-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Reviewed-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      1b65c4e5
  15. 09 Oct, 2013 1 commit
  16. 29 Nov, 2012 2 commits
  17. 28 Nov, 2012 1 commit
  18. 28 Mar, 2012 1 commit
  19. 25 Feb, 2011 1 commit
  20. 20 Oct, 2010 1 commit
  21. 22 Jul, 2010 1 commit
  22. 07 Jun, 2010 1 commit
  23. 16 Jul, 2008 1 commit
    • Isaku Yamahata's avatar
      xen: add xen_arch_resume()/xen_timer_resume hook for ia64 support · ad55db9f
      Isaku Yamahata authored
      
      
      add xen_timer_resume() hook.
      
      Timer resume should be done after event channel is resumed.
      add xen_arch_resume() hook when ipi becomes usable after resume.
      After resume, some cpu specific resource must be reinitialized
      on ia64 that can't be set by another cpu.
      
      However available hooks is run once on only one cpu so that ipi has
      to be used.
      
      During stop_machine_run() ipi can't be used because interrupt is masked.
      So add another hook after stop_machine_run().
      Another approach might be use resume hook which is run by
      device_resume(). However device_resume() may be executed on
      suspend error recovery path.
      
      So it is necessary to determine whether it is executed on real resume path
      or error recovery path.
      Signed-off-by: default avatarIsaku Yamahata <yamahata@valinux.co.jp>
      Cc: Stephen Tweedie <sct@redhat.com>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Mark McLoughlin <markmc@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      ad55db9f
  24. 27 May, 2008 2 commits
    • Jeremy Fitzhardinge's avatar
      xen: maintain clock offset over save/restore · 359cdd3f
      Jeremy Fitzhardinge authored
      
      
      Hook into the device model to make sure that timekeeping's resume handler
      is called.  This deals with our clocksource's non-monotonicity over the
      save/restore.  Explicitly call clock_has_changed() to make sure that
      all the timers get retriggered properly.
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      359cdd3f
    • Jeremy Fitzhardinge's avatar
      xen: implement save/restore · 0e91398f
      Jeremy Fitzhardinge authored
      
      
      This patch implements Xen save/restore and migration.
      
      Saving is triggered via xenbus, which is polled in
      drivers/xen/manage.c.  When a suspend request comes in, the kernel
      prepares itself for saving by:
      
      1 - Freeze all processes.  This is primarily to prevent any
          partially-completed pagetable updates from confusing the suspend
          process.  If CONFIG_PREEMPT isn't defined, then this isn't necessary.
      
      2 - Suspend xenbus and other devices
      
      3 - Stop_machine, to make sure all the other vcpus are quiescent.  The
          Xen tools require the domain to run its save off vcpu0.
      
      4 - Within the stop_machine state, it pins any unpinned pgds (under
          construction or destruction), performs canonicalizes various other
          pieces of state (mostly converting mfns to pfns), and finally
      
      5 - Suspend the domain
      
      Restore reverses the steps used to save the domain, ending when all
      the frozen processes are thawed.
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      0e91398f
  25. 24 Apr, 2008 1 commit