1. 06 1月, 2014 11 次提交
  2. 20 8月, 2013 4 次提交
    • S
      xen: fix ARM build after 6efa20e4 · 072b2064
      Stefano Stabellini 提交于
      The following commit:
      
      commit 6efa20e4
      Author: Konrad Rzeszutek Wilk <konrad@kernel.org>
      Date:   Fri Jul 19 11:51:31 2013 -0400
      
          xen: Support 64-bit PV guest receiving NMIs
      
      breaks the Xen ARM build:
      
      CC      drivers/xen/events.o
      drivers/xen/events.c: In function 'xen_send_IPI_one':
      drivers/xen/events.c:1218:6: error: 'XEN_NMI_VECTOR' undeclared (first use in this function)
      
      Simply ifdef the undeclared symbol in the code.
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      072b2064
    • D
      xen/events: document behaviour when scanning the start word for events · 3ef0296a
      David Vrabel 提交于
      The original comment on the scanning of the start word on the 2nd pass
      did not reflect the actual behaviour (the code was incorrectly masking
      bit_idx instead of the pending word itself).
      
      The documented behaviour is not actually required since if event were
      pending in the MSBs, they would be immediately scanned anyway as we go
      through the loop again.
      
      Update the documentation to reflect this (instead of trying to change
      the behaviour).
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Reviewed-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
      3ef0296a
    • D
      xen/events: mask events when changing their VCPU binding · 4704fe4f
      David Vrabel 提交于
      When a event is being bound to a VCPU there is a window between the
      EVTCHNOP_bind_vpcu call and the adjustment of the local per-cpu masks
      where an event may be lost.  The hypervisor upcalls the new VCPU but
      the kernel thinks that event is still bound to the old VCPU and
      ignores it.
      
      There is even a problem when the event is being bound to the same VCPU
      as there is a small window beween the clear_bit() and set_bit() calls
      in bind_evtchn_to_cpu().  When scanning for pending events, the kernel
      may read the bit when it is momentarily clear and ignore the event.
      
      Avoid this by masking the event during the whole bind operation.
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Reviewed-by: NJan Beulich <jbeulich@suse.com>
      CC: stable@vger.kernel.org
      4704fe4f
    • D
      xen/events: initialize local per-cpu mask for all possible events · 84ca7a8e
      David Vrabel 提交于
      The sizeof() argument in init_evtchn_cpu_bindings() is incorrect
      resulting in only the first 64 (or 32 in 32-bit guests) ports having
      their bindings being initialized to VCPU 0.
      
      In most cases this does not cause a problem as request_irq() will set
      the irq affinity which will set the correct local per-cpu mask.
      However, if the request_irq() is called on a VCPU other than 0, there
      is a window between the unmasking of the event and the affinity being
      set were an event may be lost because it is not locally unmasked on
      any VCPU. If request_irq() is called on VCPU 0 then local irqs are
      disabled during the window and the race does not occur.
      
      Fix this by initializing all NR_EVENT_CHANNEL bits in the local
      per-cpu masks.
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      CC: stable@vger.kernel.org
      84ca7a8e
  3. 09 8月, 2013 1 次提交
    • K
      xen: Support 64-bit PV guest receiving NMIs · 6efa20e4
      Konrad Rzeszutek Wilk 提交于
      This is based on a patch that Zhenzhong Duan had sent - which
      was missing some of the remaining pieces. The kernel has the
      logic to handle Xen-type-exceptions using the paravirt interface
      in the assembler code (see PARAVIRT_ADJUST_EXCEPTION_FRAME -
      pv_irq_ops.adjust_exception_frame and and INTERRUPT_RETURN -
      pv_cpu_ops.iret).
      
      That means the nmi handler (and other exception handlers) use
      the hypervisor iret.
      
      The other changes that would be neccessary for this would
      be to translate the NMI_VECTOR to one of the entries on the
      ipi_vector and make xen_send_IPI_mask_allbutself use different
      events.
      
      Fortunately for us commit 1db01b49
      (xen: Clean up apic ipi interface) implemented this and we piggyback
      on the cleanup such that the apic IPI interface will pass the right
      vector value for NMI.
      
      With this patch we can trigger NMIs within a PV guest (only tested
      x86_64).
      
      For this to work with normal PV guests (not initial domain)
      we need the domain to be able to use the APIC ops - they are
      already implemented to use the Xen event channels. For that
      to be turned on in a PV domU we need to remove the masking
      of X86_FEATURE_APIC.
      
      Incidentally that means kgdb will also now work within
      a PV guest without using the 'nokgdbroundup' workaround.
      
      Note that the 32-bit version is different and this patch
      does not enable that.
      
      CC: Lisa Nguyen <lisa@xenapiadmin.com>
      CC: Ben Guthro <benjamin.guthro@citrix.com>
      CC: Zhenzhong Duan <zhenzhong.duan@oracle.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      [v1: Fixed up per David Vrabel comments]
      Reviewed-by: NBen Guthro <benjamin.guthro@citrix.com>
      Reviewed-by: NDavid Vrabel <david.vrabel@citrix.com>
      6efa20e4
  4. 28 6月, 2013 1 次提交
    • J
      xen: Convert printks to pr_<level> · 283c0972
      Joe Perches 提交于
      Convert printks to pr_<level> (excludes printk(KERN_DEBUG...)
      to be more consistent throughout the xen subsystem.
      
      Add pr_fmt with KBUILD_MODNAME or "xen:" KBUILD_MODNAME
      Coalesce formats and add missing word spaces
      Add missing newlines
      Align arguments and reflow to 80 columns
      Remove DRV_NAME from formats as pr_fmt adds the same content
      
      This does change some of the prefixes of these messages
      but it also does make them more consistent.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      283c0972
  5. 08 5月, 2013 1 次提交
  6. 17 4月, 2013 2 次提交
  7. 03 4月, 2013 1 次提交
  8. 28 3月, 2013 1 次提交
  9. 20 2月, 2013 1 次提交
  10. 13 2月, 2013 1 次提交
  11. 06 2月, 2013 1 次提交
  12. 07 11月, 2012 1 次提交
    • M
      xen/events: fix RCU warning, or Call idle notifier after irq_enter() · 772aebce
      Mojiong Qiu 提交于
      exit_idle() should be called after irq_enter(), otherwise it throws:
      
      [ INFO: suspicious RCU usage. ]
      3.6.5 #1 Not tainted
      -------------------------------
      include/linux/rcupdate.h:725 rcu_read_lock() used illegally while idle!
      
      other info that might help us debug this:
      
      RCU used illegally from idle CPU!
      rcu_scheduler_active = 1, debug_locks = 1
      RCU used illegally from extended quiescent state!
      1 lock held by swapper/0/0:
       #0:  (rcu_read_lock){......}, at: [<ffffffff810e9fe0>] __atomic_notifier_call_chain+0x0/0x140
      
      stack backtrace:
      Pid: 0, comm: swapper/0 Not tainted 3.6.5 #1
      Call Trace:
       <IRQ>  [<ffffffff811259a2>] lockdep_rcu_suspicious+0xe2/0x130
       [<ffffffff810ea10c>] __atomic_notifier_call_chain+0x12c/0x140
       [<ffffffff810e9fe0>] ? atomic_notifier_chain_unregister+0x90/0x90
       [<ffffffff811216cd>] ? trace_hardirqs_off+0xd/0x10
       [<ffffffff810ea136>] atomic_notifier_call_chain+0x16/0x20
       [<ffffffff810777c3>] exit_idle+0x43/0x50
       [<ffffffff81568865>] xen_evtchn_do_upcall+0x25/0x50
       [<ffffffff81aa690e>] xen_do_hypervisor_callback+0x1e/0x30
       <EOI>  [<ffffffff810013aa>] ? hypercall_page+0x3aa/0x1000
       [<ffffffff810013aa>] ? hypercall_page+0x3aa/0x1000
       [<ffffffff81061540>] ? xen_safe_halt+0x10/0x20
       [<ffffffff81075cfa>] ? default_idle+0xba/0x570
       [<ffffffff810778af>] ? cpu_idle+0xdf/0x140
       [<ffffffff81a4d881>] ? rest_init+0x135/0x144
       [<ffffffff81a4d74c>] ? csum_partial_copy_generic+0x16c/0x16c
       [<ffffffff82520c45>] ? start_kernel+0x3db/0x3e8
       [<ffffffff8252066a>] ? repair_env_string+0x5a/0x5a
       [<ffffffff82520356>] ? x86_64_start_reservations+0x131/0x135
       [<ffffffff82524aca>] ? xen_start_kernel+0x465/0x46
      
      Git commit 98ad1cc1
      Author: Frederic Weisbecker <fweisbec@gmail.com>
      Date:   Fri Oct 7 18:22:09 2011 +0200
      
          x86: Call idle notifier after irq_enter()
      
      did this, but it missed the Xen code.
      Signed-off-by: NMojiong Qiu <mjqiu@tencent.com>
      Cc: stable@vger.kernel.org # from 3.3 and newer.
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      772aebce
  13. 20 10月, 2012 1 次提交
  14. 03 10月, 2012 1 次提交
  15. 23 8月, 2012 2 次提交
  16. 14 9月, 2012 1 次提交
  17. 30 5月, 2012 1 次提交
  18. 22 5月, 2012 1 次提交
  19. 27 4月, 2012 1 次提交
  20. 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
  21. 17 12月, 2011 1 次提交
  22. 22 11月, 2011 1 次提交
    • D
      xen/event: Add reference counting to event channels · 420eb554
      Daniel De Graaf 提交于
      Event channels exposed to userspace by the evtchn module may be used by
      other modules in an asynchronous manner, which requires that reference
      counting be used to prevent the event channel from being closed before
      the signals are delivered.
      
      The reference count on new event channels defaults to -1 which indicates
      the event channel is not referenced outside the kernel; evtchn_get fails
      if called on such an event channel. The event channels made visible to
      userspace by evtchn have a normal reference count.
      Signed-off-by: NDaniel De Graaf <dgdegra@tycho.nsa.gov>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      420eb554
  23. 20 10月, 2011 3 次提交