Commit Graph

999 Commits

Author SHA1 Message Date
jym cb1f14140c VIRQ_TIMER virqs are allocated and tracked in a array
(virq_timer_to_evtch, indexed by cpuid) different from the
VIRQ <> event channel one (virq_to_evtch, indexed by event channel ID).

This is fine: fix a "harmless" bug that resulted in the event
channel of VIRQ_TIMER getting lost during bind as it was not stored
in the proper array.

"Harmless" because it is not critical for -current, however in the Xen
save/restore branch this completely cripples restore. Xen clock gets
suspended, but never comes back (fetched channel ID being invalid). Oops.

Add a small comment so we can better see the "get => allocate? => set"
chain of actions when binding/unbinding event channels.
2011-08-28 22:55:52 +00:00
jym 4128291e47 KNF, white spaces and comment typo fixes. 2011-08-28 22:36:17 +00:00
christos 93e326680f use c99 struct initializers 2011-08-27 09:32:11 +00:00
jym b1c4de01e1 Protect xbdback(4) ring indexes from overflowing; leave the continuation
prematurely in case they do, to avoid looping "endlessly" (or at least
a very long time) at IPL_BIO while trying to handle requests.

This should not happen in a nominal scenario, but the ring can get
corrupted for whatever reason (memory errors, domU failures or
exploitation).
2011-08-24 20:49:34 +00:00
jym e298d4d6a8 Merge err printf with the panic(9) message.
Also fix the if () {...} statement with braces, to avoid calling panic()
every time. Hi cherry!
2011-08-21 10:00:13 +00:00
joerg a99d375170 Works with clang's integrated assembler now. 2011-08-17 21:42:16 +00:00
dholland 595e2ecd73 Fix broken build. 2011-08-16 02:59:16 +00:00
cherry ce14cd73f0 invert buggy ci_flag test 2011-08-15 20:17:12 +00:00
cherry c04a001592 Do not panic() on xen_send_ipi() sent to a cpu not yet running.
x86 MP boot depends on this strange behaviour.
2011-08-15 20:14:52 +00:00
cherry a6365cd724 Call the right function
(fix for an egregious error)
2011-08-13 20:24:19 +00:00
cherry ac71905311 Use spin mutices correctly.
- Prune redundant splxx()/splx() pairs.
 - Do not "leak" a mutex_spin_enter() via conditional return.

Thanks rmind@
2011-08-13 17:23:42 +00:00
cherry e37867bdb5 Remove spurious header.
Thanks rmind@
2011-08-13 16:22:15 +00:00
cherry 7bd1f7e3fe MP probing and startup code 2011-08-13 12:37:30 +00:00
cherry 92ccc4ea78 Add locking around ops to the hypervisor MMU "queue". 2011-08-13 12:09:38 +00:00
cherry 787e5fb097 remove unnecessary locking overhead for UP 2011-08-13 11:41:57 +00:00
cherry 3c3a6a3a8e Hide the MD details of specific IPIs behind semantically pleasing functions. This cleans up a couple of #ifdef XEN/#endif pairs 2011-08-11 18:11:17 +00:00
cherry 3ccb0add41 Make event/interrupt handling MP aware 2011-08-11 17:58:59 +00:00
cherry 155048478e refactor the bitstring/mask operations to be behind an API. Make pending interrupt marking cpu aware. 2011-08-10 21:46:02 +00:00
cherry 941e03e900 KNF police (rmind@ :-) 2011-08-10 20:38:45 +00:00
cherry d7b11fa417 xen ipi infrastructure 2011-08-10 11:39:44 +00:00
cherry 1f0a8a809d Introduce locking primitives for Xen pte operations, and xen helper calls for MP related MMU ops 2011-08-10 09:50:37 +00:00
cherry 8d4cb7a73d Add Xen specific ipi bitmasks 2011-08-10 06:29:23 +00:00
bouyer 0eab8d73aa Guard against spurious xbdback_backend_changed() calls which would result
in the block device being opened twice. Fixes port-xen/45158,
although the underlying cause (multiple open of the same device not
properly handled any more) is not fixed.
2011-08-07 17:39:34 +00:00
bouyer d6cda51db2 Add a comment explaing why a flush workqueue is handled differently from
read/write workqueue requests.
2011-08-07 17:15:40 +00:00
bouyer 48ed379bb7 Several fixes to the continuation engine:
- make sure to enter the continuation loop at splbio(), and add some
  KASSERT() for this.
- When a flush operation is enqueued to the workqueue, make sure the
  continuation loop can't be restarted by a previous workqueue
  completion or an event. We can't restart it at this point because
  the flush even is still recorded as the current I/O.
  For this add a xbdback_co_cache_doflush_wait() which acts as a noop;
  the workqueue callback will restart the loop once the flush is complete.
Should fix "kernel diagnostic assertion xbd_io->xio_mapped == 0" panics
reported by Jeff Rizzo on port-xen@.
2011-08-07 17:10:35 +00:00
bouyer 0ef67b2899 Make sure to call xbdback_trampoline() at splbio() 2011-08-04 18:01:49 +00:00
jym 5b7c93647d Fix typo in comment. 2011-07-31 18:00:54 +00:00
jym a1508a4756 Move xen.balloon to machdep in the sysctl(7) tree. It does not really
belong to either kern or hw.

Rename machdep.xen_timepush_ticks to xen.timepush_ticks, so it can live
under the same tree as the balloon node, machdep.xen.

ok bouyer@.
2011-07-29 22:16:05 +00:00
matt 6ed2595d7e Change a cast to appease gcc4.5 2011-07-27 23:11:23 +00:00
matt 1df400bdea Make this use offsetof and __typeof__ to appease gcc4.5 2011-07-27 23:10:40 +00:00
jym 7e80d41a91 And... explain xbd(4). 2011-07-25 00:06:49 +00:00
jym 6214043369 KNF. No functional change. 2011-07-25 00:02:38 +00:00
jym 77822551fa Add more comments to xbdback(4) code. These make the continuations a bit
easier to follow (and understand). Helped tracking down a regression
between save/restore xbdback(4) states.

A few minor fixes, which are merely cosmetic:
- call graph is (somewhat) more readable
- rework the xbdback_do_io routine with a switch statement, so as to
trigger a panic() in case an invalid operation passed through the sanity
checks. panic might be overkill here, but I am sure to catch errrors in
case it happens.
2011-07-24 23:56:34 +00:00
joerg 3eb244d801 Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
2011-07-17 20:54:30 +00:00
rmind 3127d2afb9 Initialise cpus_running to 1 on Xen, as it was done on x86.
Problem analysed by hannken@.  Fixes PR/45062.
2011-07-16 14:46:18 +00:00
jym 6d90e19e1d Remove all return error checks for event_set_handler(...). It either
succeeds or end in panic.
2011-07-02 19:07:56 +00:00
dyoung e265f67bc1 #include <sys/bus.h> instead of <machine/bus.h>. 2011-07-01 18:31:32 +00:00
wiz 4cbd24b23f dependant -> dependent 2011-06-30 20:09:15 +00:00
rmind 06b5aba5f8 Few XEN fixes:
- cpu_load_pmap: perform tlbflush() after xen_set_user_pgd().
- xen_pmap_bootstrap: perform xpq_queue_tlb_flush() in the end.
- pmap_tlb_shootdown: do not check PG_G for Xen.
2011-06-15 20:50:02 +00:00
rmind 57f2d9bddc - cpu_hatch: call tlbflushg(), just to make sure that TLB is clean.
- xen_bootstrap_tables: call xpq_queue_tlb_flush() for safety.
- Initialise cpus_attached and ci_cpumask for primary CPU.
2011-06-15 19:54:16 +00:00
rmind 155f2284da - privpgop_fault: call pmap_update() before uvmfault_unlockall().
- privcmd_ioctl, xengnt_more_entries: add missing pmap_update().
2011-06-15 19:51:50 +00:00
pgoyette 813683b4ac Include required file for xen acpi 2011-06-13 00:53:15 +00:00
jruoho 4e4705978b Fix build failure for the odd child, as pointed out by pgoyette@. 2011-06-12 16:31:57 +00:00
rmind e225b7bd09 Welcome to 5.99.53! Merge rmind-uvmplock branch:
- Reorganize locking in UVM and provide extra serialisation for pmap(9).
  New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
  the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
  Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
  kernel-lock on some ports).  Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.
2011-06-12 03:35:36 +00:00
jym 422a28e00e Be more consistent for event handler naming with block backend: it is
xbdback(4) rather than xbd(4), and use i for identifier separation
(like xvif(4)).

The name is not used outside from event counters (vmstat -i), so
should be transparent to Xen block scripts.
2011-06-07 16:41:14 +00:00
bouyer 44635a6831 Don't call psignal() without holding proc_lock. This is the cause of
the reboot of PR port-xen/45028
Now that Xen2 is gone, handle FPU context switches the same way as
amd64. This makes all tests in /usr/tests/lib/libc/ieeefp pass.
2011-06-07 14:53:03 +00:00
bouyer 1d34d759fe check that the list is empty before calling cv_wait(). Otherwise
we may sleep waiting for an event which is already in the queue.
2011-06-07 13:52:30 +00:00
joerg f6ced94e3b Disable -Werror for ah_regdomain.c if building with clang as workaround
for http://llvm.org/bugs/show_bug.cgi?id=10030.
2011-05-30 15:06:32 +00:00
joerg 1b1e18e947 Use format string for the device name 2011-05-30 14:34:58 +00:00
joerg 4ef16e9c8a Use proper format string 2011-05-30 13:03:56 +00:00