The NetBSD Project

CVS log for src/sys/arch/xen/xen/evtchn.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / arch / xen / xen

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.100 / (download) - annotate - [select for diffs], Wed Sep 7 00:40:19 2022 UTC (18 months, 1 week ago) by knakahara
Branch: MAIN
CVS Tags: triaxx-drm, thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, netbsd-10-base, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm, HEAD
Changes since 1.99: +5 -5 lines
Diff to previous 1.99 (colored)

NetBSD/x86: Raise the number of interrupt sources per CPU from 32 to 56.

There has been no objection for three years.
    https://mail-index.netbsd.org/port-amd64/2019/09/22/msg003012.html
Implemented by nonaka@n.o, updated by me.

Revision 1.99 / (download) - annotate - [select for diffs], Wed May 25 14:35:15 2022 UTC (21 months, 3 weeks ago) by bouyer
Branch: MAIN
Changes since 1.98: +14 -6 lines
Diff to previous 1.98 (colored)

PVH and HVM guests can easily have more than XEN_LEGACY_MAX_VCPUS (32) cpus.
Support up to HVM_MAX_VCPUS (256). This requires resizing a few arrays in
evtchn.c, and using
VCPUOP_register_vcpu_info for vcpuid >= XEN_LEGACY_MAX_VCPUS
Tested with 96 vCPUs.

Revision 1.98 / (download) - annotate - [select for diffs], Tue May 24 15:55:19 2022 UTC (21 months, 3 weeks ago) by bouyer
Branch: MAIN
Changes since 1.97: +13 -2 lines
Diff to previous 1.97 (colored)

Some devices (e.g. ixg in MSI-X mode) don't to have their handlers called
when no interrupt are pending. So add an extra ih_pending field
to struct intrhand, which is incremeted when the handler is not called because
of IPL level and reset to 0 when called. Check this in Xen's resume
assembly to call only handlers that are really pending.

Revision 1.97 / (download) - annotate - [select for diffs], Thu May 19 09:54:27 2022 UTC (22 months ago) by bouyer
Branch: MAIN
Changes since 1.96: +53 -8 lines
Diff to previous 1.96 (colored)

Restore de EOI mechanism for pirq, using the newer hypervisor interface.
It is needed.
Hopefully fixes kern/56291, kern/56793, kern/55667

Revision 1.96 / (download) - annotate - [select for diffs], Sun Nov 15 14:01:06 2020 UTC (3 years, 4 months ago) by bouyer
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.95: +2 -4 lines
Diff to previous 1.95 (colored)

Don't restrict debug event to XENPV, it's also usefull for PVH/PVHVM

Revision 1.95 / (download) - annotate - [select for diffs], Wed May 13 13:19:38 2020 UTC (3 years, 10 months ago) by jdolecek
Branch: MAIN
Branch point for: thorpej-futex
Changes since 1.94: +11 -11 lines
Diff to previous 1.94 (colored)

don't reinitialize mutexes/cv on resume

part of PR port-xen/55207

Revision 1.94 / (download) - annotate - [select for diffs], Thu May 7 19:48:57 2020 UTC (3 years, 10 months ago) by bouyer
Branch: MAIN
Changes since 1.93: +121 -83 lines
Diff to previous 1.93 (colored)

Change event_set_handler() to take the target CPU parameter. If ci is NULL,
  event_set_handler() will choose the CPU and bind the event.
  If ci is not NULL the caller is responsible for binding the event.
Use a IPI xcall to register the handlers if needed.
pull in a hack from x86 to force pirq handlers to be mpsafe if registered at
a level != IPL_VM. This is for the com at isa interrupt handler, which
registers at IPL_HIGH and has to way to tell it's mpsafe (taking
KERNEL_LOCK at IPL_HIGH causes deadlocks on MP systems).

Revision 1.93 / (download) - annotate - [select for diffs], Wed May 6 13:43:48 2020 UTC (3 years, 10 months ago) by bouyer
Branch: MAIN
Changes since 1.92: +83 -65 lines
Diff to previous 1.92 (colored)

remove the per-channel spin lock and instead make sure that events
add/remove will only be done on the CPU the handler is bound to, with
interrupts disabled.
Should be similar to the native x86 interrupts add/remove.

Revision 1.92 / (download) - annotate - [select for diffs], Mon May 4 15:55:56 2020 UTC (3 years, 10 months ago) by jdolecek
Branch: MAIN
Changes since 1.91: +5 -3 lines
Diff to previous 1.91 (colored)

add support for using MSI for XenPV Dom0

use PHYSDEVOP_map_pirq to get the pirq/gsi for MSI/MSI-X, switch also INTx
to use it instead of PHYSDEVOP_alloc_irq_vector

MSI confirmed working with single-vector MSI for wm(4), ahcisata(4), bge(4)

XXX added some provision for MSI-X, but it doesn't actually work (no interrupts
delivered), needs some further investigation; disable MSI-X for XENPV
via flag in x86/pci/pci_machdep.c

Revision 1.91 / (download) - annotate - [select for diffs], Sat Apr 25 15:26:18 2020 UTC (3 years, 10 months ago) by bouyer
Branch: MAIN
Changes since 1.90: +89 -82 lines
Diff to previous 1.90 (colored)

Merge the bouyer-xenpvh branch, bringing in Xen PV drivers support under HVM
guests in GENERIC.
Xen support can be disabled at runtime with
boot -c
disable hypervisor

Revision 1.90 / (download) - annotate - [select for diffs], Tue Apr 21 20:13:40 2020 UTC (3 years, 10 months ago) by jdolecek
Branch: MAIN
CVS Tags: bouyer-xenpvh-base2
Changes since 1.89: +2 -56 lines
Diff to previous 1.89 (colored)

convert to newer HYPERVISOR_physdev_op() interface, now command and the
arg are separate arguments - this is needed for newer physdev_op commands

remove code for PHYSDEVOP_IRQ_UNMASK_NOTIFY, it is obsolete since
interface version 0x00030202 and is unsupported by newer versions of Xen

confirmed working on amd64 Dom0, i386 compile-tested only

Revision 1.89 / (download) - annotate - [select for diffs], Mon Apr 13 22:54:12 2020 UTC (3 years, 11 months ago) by bouyer
Branch: MAIN
CVS Tags: phil-wifi-20200421, bouyer-xenpvh-base1
Changes since 1.88: +19 -5 lines
Diff to previous 1.88 (colored)

By default, events are bound to CPU 0 (exept for IPIs and VTIMERs which
are bound to a different CPU at creation time).
Recent MI changes caused the scheduler to choose a different CPU when
probing and attaching xennet devices (I guess it's the xenbus thread which
runs on a different CPU). This cause the callback to be called on a different
CPU than the one expected by the kernel, and the event is ignored.
It is handled when the clock causes the callback to be called on the right
CPU, which is why xennet still run, but slowly.

Change event_set_handler() to do a EVTCHNOP_bind_vcpu if requested to,
and make sure we don't do it for IPIs and VIRQs (for theses, the op fails).

Revision 1.88 / (download) - annotate - [select for diffs], Mon Apr 6 19:26:00 2020 UTC (3 years, 11 months ago) by jdolecek
Branch: MAIN
CVS Tags: phil-wifi-20200411, bouyer-xenpvh-base
Branch point for: bouyer-xenpvh
Changes since 1.87: +4 -4 lines
Diff to previous 1.87 (colored)

add known_mpsafe parameter also to pirq_establish(), and pass the parameter
to underlying event_set_handler()

Revision 1.87 / (download) - annotate - [select for diffs], Mon Apr 6 18:02:33 2020 UTC (3 years, 11 months ago) by jdolecek
Branch: MAIN
CVS Tags: phil-wifi-20200406
Changes since 1.86: +3 -6 lines
Diff to previous 1.86 (colored)

remove restriction on interrupt level for MP-safe interrupt handlers

Revision 1.86 / (download) - annotate - [select for diffs], Thu May 9 17:09:51 2019 UTC (4 years, 10 months ago) by bouyer
Branch: MAIN
CVS Tags: phil-wifi-20191119, phil-wifi-20190609, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, is-mlppp-base, is-mlppp, ad-namecache-base3, ad-namecache-base2, ad-namecache-base1, ad-namecache-base, ad-namecache
Changes since 1.85: +7 -7 lines
Diff to previous 1.85 (colored)

sti/cli are not allowed on Xen, we have to clear/set a bit in the
shared page. Revert x86_disable_intr/x86_enable_intr to plain function
calls on XENPV.
While there, clean up unused functions and macros, and change cli()/sti()
macros to x86_disable_intr/x86_enable_intr.
Makes Xen domU boot again
(http://www-soc.lip6.fr/~bouyer/NetBSD-tests/xen/HEAD/)

Revision 1.85 / (download) - annotate - [select for diffs], Wed Feb 13 06:52:43 2019 UTC (5 years, 1 month ago) by cherry
Branch: MAIN
CVS Tags: isaki-audio2-base, isaki-audio2
Changes since 1.84: +6 -2 lines
Diff to previous 1.84 (colored)

Further restrict the scope of XENPV to relevant parts.

Revision 1.84 / (download) - annotate - [select for diffs], Wed Feb 13 05:01:58 2019 UTC (5 years, 1 month ago) by cherry
Branch: MAIN
Changes since 1.83: +3 -2 lines
Diff to previous 1.83 (colored)

In preparation for debut-ing PVHVM mode:

 - Make the struct intrstub uniform across native and XEN.
 - Introduce vector callback entrypoints for PVHVM mode.

Revision 1.83 / (download) - annotate - [select for diffs], Tue Dec 25 06:50:12 2018 UTC (5 years, 2 months ago) by cherry
Branch: MAIN
CVS Tags: pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226
Changes since 1.82: +15 -15 lines
Diff to previous 1.82 (colored)

Excise XEN specific code out of x86/x86/intr.c into xen/x86/xen_intr.c

While at it, separate the source function tracking so that the interrupt
paths are truly independant.

Use weak symbol exporting to provision for future PVHVM co-existence
of both files, but with independant paths. Introduce assembler code
such that in a unified scenario, native interrupts get first priority
in spllower(), followed by XEN event callbacks. IPL management and
semantics are unchanged - native handlers and xen callbacks are
expected to maintain their ipl related semantics.

In summary, after this commit, native and XEN now have completely
unrelated interrupt handling mechanisms, including
intr_establish_xname() and assembler stubs and intr handler
management.

Happy Christmas!

Revision 1.82 / (download) - annotate - [select for diffs], Fri Oct 26 05:33:21 2018 UTC (5 years, 4 months ago) by cherry
Branch: MAIN
CVS Tags: pgoyette-compat-1126
Changes since 1.81: +21 -14 lines
Diff to previous 1.81 (colored)

Decompose hypervisor_enable_event() into functional steps.

The hypervisor_unmask_event() step is relevant for any event.

The pirq related step is only relevant for pirq bound events.

Prune blanket usage of this, so that usage is semantically appropriate.

Revision 1.81 / (download) - annotate - [select for diffs], Sun Sep 23 02:27:24 2018 UTC (5 years, 5 months ago) by cherry
Branch: MAIN
CVS Tags: pgoyette-compat-1020, pgoyette-compat-0930
Changes since 1.80: +22 -14 lines
Diff to previous 1.80 (colored)

Encapsulate pre-processing of registered (pirq,evtchn) pair in
preparation for API reorg.

Revision 1.80 / (download) - annotate - [select for diffs], Sun Jun 24 13:35:33 2018 UTC (5 years, 8 months ago) by jdolecek
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625
Branch point for: phil-wifi
Changes since 1.79: +145 -13 lines
Diff to previous 1.79 (colored)

add support for kern.intr.list aka intrctl(8) 'list' for xen

event_set_handler() and pirq_establish() now have extra intrname
parameter; shared intr_create_intrid() is used to provide the value

xen drivers were changed to pass the specific driver instance
name as the xname, e.g.  'vcpu0 clock' instead just 'clock', or
'xencons0' instead of 'xencons'

associated evcnt is now changed to use intrname - this matches native x86

Revision 1.79 / (download) - annotate - [select for diffs], Wed Dec 13 16:30:18 2017 UTC (6 years, 3 months ago) by bouyer
Branch: MAIN
CVS Tags: pgoyette-compat-base, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: pgoyette-compat
Changes since 1.78: +4 -2 lines
Diff to previous 1.78 (colored)

Fixes for physical interrupts on Xen:
- do not cast int * to intr_handle_t *, they're not the same size
- legacy_irq is not always -1 for ioapic interrupts, test pic_type instead
- change irq2port[] to hold (port + 1) so that 0 is an invalid value
- add KASSERTs to make sure vect, port or irq values extracted from arrays are
  valid (or that they are invalid before write)
- for the !ioapic case, we still need to do PHYSDEVOP_ASSIGN_VECTOR and
  bind_pirq_to_evtch().

now XEN3_DOM0 boots again

Revision 1.78 / (download) - annotate - [select for diffs], Sat Nov 11 17:02:53 2017 UTC (6 years, 4 months ago) by riastradh
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202
Changes since 1.77: +2 -14 lines
Diff to previous 1.77 (colored)

Back out previous KASSERTMSG for now.

The immediate problem appears to have been elsewhere, in the wrong
interrupt level passed by the Xen-specific intr_establish to
event_set_handler.

We should maybe restore these assertions later, but at least one was
violated before cherry's interrupt rototill anyway.

Revision 1.77 / (download) - annotate - [select for diffs], Sat Nov 11 08:23:50 2017 UTC (6 years, 4 months ago) by riastradh
Branch: MAIN
Changes since 1.76: +14 -2 lines
Diff to previous 1.76 (colored)

Add kasserts to help diagnose xen interrupt level bug.

https://mail-index.netbsd.org/tech-kern/2017/11/09/msg022571.html

Revision 1.76 / (download) - annotate - [select for diffs], Sat Nov 11 08:22:08 2017 UTC (6 years, 4 months ago) by riastradh
Branch: MAIN
Changes since 1.75: +9 -19 lines
Diff to previous 1.75 (colored)

#if DIAGNOSTIC panic ---> KASSERTMSG

Revision 1.75 / (download) - annotate - [select for diffs], Fri Nov 10 19:24:17 2017 UTC (6 years, 4 months ago) by riastradh
Branch: MAIN
Changes since 1.74: +29 -12 lines
Diff to previous 1.74 (colored)

Fix theoretical race in xen_evtchn_trymask.

This now matches ioapic_trymask:

- Caller masks CPU interrupts while the PIC's interrupts are unmasked.
- Trymask masks the PIC's interrupts, and tests whether any were
  pending that we missed because the CPU interrupts are masked.

  ==> If there were any pending, trymask unmasks PIC's interrupts and
      returns false.

  ==> If not, interrupts are masked on the PIC and CPU and there were
      none pending and trymask returns true.

No functional change right now because cpu_intr_redistribute is
currently disabled on Xen.

ok cherry

Revision 1.74 / (download) - annotate - [select for diffs], Sat Nov 4 10:26:14 2017 UTC (6 years, 4 months ago) by cherry
Branch: MAIN
Changes since 1.73: +167 -2 lines
Diff to previous 1.73 (colored)

Add a PIC_XEN abstraction to evtchn.c

This allows us to get XEN interrupt code closer to unification to x86/intr.c

Revision 1.73 / (download) - annotate - [select for diffs], Sun Jul 16 14:02:48 2017 UTC (6 years, 8 months ago) by cherry
Branch: MAIN
CVS Tags: perseant-stdc-iso10646-base, nick-nhusb-base-20170825
Branch point for: perseant-stdc-iso10646
Changes since 1.72: +18 -18 lines
Diff to previous 1.72 (colored)

Unify the xen and native x86/ interrupt setup functions and
spl traversal data structures.

This is towards PVHVM.

Revision 1.72 / (download) - annotate - [select for diffs], Sun Jul 16 05:03:36 2017 UTC (6 years, 8 months ago) by cherry
Branch: MAIN
Changes since 1.71: +22 -2 lines
Diff to previous 1.71 (colored)

Add a glue function to inspect event channel<->legacy IRQ mappings.
This is towards getting xen to use more x86/ "native" code.

Revision 1.71 / (download) - annotate - [select for diffs], Sat Mar 14 10:49:36 2015 UTC (9 years ago) by bouyer
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, nick-nhusb-base-20170204, nick-nhusb-base-20161204, nick-nhusb-base-20161004, nick-nhusb-base-20160907, nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226, nick-nhusb-base-20150921, nick-nhusb-base-20150606, nick-nhusb-base-20150406, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Changes since 1.70: +19 -8 lines
Diff to previous 1.70 (colored)

Properly implemement pci_intr_disestablish(9), so that interrupt
handlers stop being called when the device has been detached.
Should fix PR port-xen/47720 (which turns out to not be related to raidframe).
While there fix possible races in event_remove_handler() and pirq_establish().

Revision 1.70 / (download) - annotate - [select for diffs], Tue Dec 3 20:51:00 2013 UTC (10 years, 3 months ago) by bouyer
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, nick-nhusb-base, netbsd-7-base
Branch point for: nick-nhusb, netbsd-7
Changes since 1.69: +2 -9 lines
Diff to previous 1.69 (colored)

Remove the "evtchn_do_event: handler %p didn't lower ipl %d %d\n" printf.
With help from Robert Elz we've finally figured out what's going on, and
it actually isn't a bug in the handler, but related to spin mutexes.
When a spin mutex is released, the IPL isn't lowered back if the
curcpu is holding other spin mutexes. This is because mutexes may not
be released in order (and, in this case, the CPU in interrupted while
it holds a spin mutex at IPL < IPL_SCHED).
Also remove the test and resetting the IPL, it will be reset anyway
inside the loop, or at the end of the loop.

Revision 1.69 / (download) - annotate - [select for diffs], Sun Jan 13 21:01:05 2013 UTC (11 years, 2 months ago) by bouyer
Branch: MAIN
CVS Tags: yamt-pagecache-base8, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, khorben-n900, agc-symver-base, agc-symver
Branch point for: rmind-smpnet
Changes since 1.68: +5 -9 lines
Diff to previous 1.68 (colored)

Re-apply
http://mail-index.netbsd.org/source-changes/2012/11/25/msg039125.html
http://mail-index.netbsd.org/source-changes/2012/11/25/msg039126.html
they're not involved in i386 domU hang shown by ATF.

Revision 1.68 / (download) - annotate - [select for diffs], Sat Jan 12 21:09:10 2013 UTC (11 years, 2 months ago) by bouyer
Branch: MAIN
Changes since 1.67: +10 -6 lines
Diff to previous 1.67 (colored)

Revert these commits from november 2012:
http://mail-index.netbsd.org/source-changes/2012/11/25/msg039125.html
http://mail-index.netbsd.org/source-changes/2012/11/25/msg039126.html
http://mail-index.netbsd.org/source-changes/2012/11/25/msg039142.html

they cause a i386PAE domU to hang while running ATF tests, as shown in
http://www-soc.lip6.fr/~bouyer/NetBSD-tests/xen/HEAD/

(we should pay more attention to test results, myself first).

Revision 1.67 / (download) - annotate - [select for diffs], Sat Jan 12 17:39:46 2013 UTC (11 years, 2 months ago) by bouyer
Branch: MAIN
Changes since 1.66: +47 -76 lines
Diff to previous 1.66 (colored)

Back out this commit:
http://mail-index.netbsd.org/source-changes/2012/12/28/msg039950.html
which cause a panic when running tests on amd64, as shown on:
http://www-soc.lip6.fr/~bouyer/NetBSD-tests/xen/HEAD/
(i386 hangs for unrelated reasons).

Revision 1.66 / (download) - annotate - [select for diffs], Fri Dec 28 06:29:56 2012 UTC (11 years, 2 months ago) by cherry
Branch: MAIN
Changes since 1.65: +78 -49 lines
Diff to previous 1.65 (colored)

Simplify the xen event handler callback by:
 - moving the interrupt handler callback traversal into a separate
   function.
 - using evt_iterate_bits() to scan through the pending bitfield
 - removing cross-cpu pending actions - events recieved on the wrong
   vcpu are re-routed via hypervisor_send_event().
 - simplifying nested while() loops by encapsulating them in
   equivalent functions.

Many thanks for multiple reviews by bouyer@ and jym@

Revision 1.65 / (download) - annotate - [select for diffs], Sun Nov 25 20:56:33 2012 UTC (11 years, 3 months ago) by cherry
Branch: MAIN
CVS Tags: yamt-pagecache-base7
Changes since 1.64: +3 -3 lines
Diff to previous 1.64 (colored)

Do not escalate the local spl while taking the interrupt handler list
lock. Re-entrance is protected against within the events handler
framework by toggling interrupts/events, so we don't need (and cannot
use) the spl framework in that path. The other consumers (interrupt
registration/removal code) are not spl sensitive wrt this lock.

Revision 1.64 / (download) - annotate - [select for diffs], Sun Nov 25 08:39:36 2012 UTC (11 years, 3 months ago) by cherry
Branch: MAIN
Changes since 1.63: +4 -5 lines
Diff to previous 1.63 (colored)

Make hypervisor_set_ipending() and its consumers cpu unaware. This syncs syntax with semantics

Revision 1.63 / (download) - annotate - [select for diffs], Sun Nov 25 07:48:46 2012 UTC (11 years, 3 months ago) by cherry
Branch: MAIN
Changes since 1.62: +3 -6 lines
Diff to previous 1.62 (colored)

hypervisor_set_ipending() should not set the pending flag across cpus. The reason for this is that the pending flag update is not atomic, or protected by a lock. Since its current (mis)use in evtchn_do_event() across cpus is to notify the remote cpu of an interrupt, we use hypervisor_send_event() instead, to trigger an event on the remote cpu, which in turn invokes evtchn_do_event() on that cpu and DTRT on it.

On the local cpu, we protect hypervisor_set_ipending() from re-entry via cli(). Remove a redundant and unprotected call to hypervisor_set_ipending().

Thanks to jym@ for spotting this discrepancy while reviewing a related patch.

See: http://mail-index.netbsd.org/tech-kern/2012/11/12/msg014374.html

Revision 1.62 / (download) - annotate - [select for diffs], Sun Feb 12 14:24:08 2012 UTC (12 years, 1 month ago) by jym
Branch: MAIN
CVS Tags: yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base10
Branch point for: tls-maxphys, netbsd-6-1, netbsd-6-0, netbsd-6
Changes since 1.61: +4 -4 lines
Diff to previous 1.61 (colored)

Xen MP merge introduced MP safety around ipl handlers. When removing an
event handler, check handler's function and arguments against the real
ones, not the ones from wrappers.

This fixes a bug where !mpsafe events could not be removed from the handler
chain, thereby blocking suspension of a domU.

ok releng@.

Revision 1.61 / (download) - annotate - [select for diffs], Thu Dec 8 03:34:44 2011 UTC (12 years, 3 months ago) by cherry
Branch: MAIN
Changes since 1.60: +3 -3 lines
Diff to previous 1.60 (colored)

kmem_free() the appropriate size.

Thanks cegger@

Revision 1.60 / (download) - annotate - [select for diffs], Wed Dec 7 16:26:23 2011 UTC (12 years, 3 months ago) by cegger
Branch: MAIN
Changes since 1.59: +6 -6 lines
Diff to previous 1.59 (colored)

replace malloc() with kmem_zalloc() per request from cherry.
While here fix error path.

XXX: The size allocated and freed for interrupt handlers looks
inconsistent to me.

Revision 1.59 / (download) - annotate - [select for diffs], Wed Dec 7 15:47:43 2011 UTC (12 years, 3 months ago) by cegger
Branch: MAIN
Changes since 1.58: +6 -6 lines
Diff to previous 1.58 (colored)

switch from xen3-public to xen-public.

Revision 1.58 / (download) - annotate - [select for diffs], Wed Dec 7 13:49:04 2011 UTC (12 years, 3 months ago) by cegger
Branch: MAIN
Changes since 1.57: +3 -2 lines
Diff to previous 1.57 (colored)

build fix: add back <sys/malloc.h>. malloc(9) is still in use.

Revision 1.57 / (download) - annotate - [select for diffs], Wed Dec 7 12:31:51 2011 UTC (12 years, 3 months ago) by cherry
Branch: MAIN
Changes since 1.56: +11 -12 lines
Diff to previous 1.56 (colored)

Move to kmem_zalloc() instead of malloc().

Revision 1.56 / (download) - annotate - [select for diffs], Sat Nov 19 17:13:39 2011 UTC (12 years, 4 months ago) by cherry
Branch: MAIN
CVS Tags: jmcneill-usbmp-pre-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: jmcneill-usbmp
Changes since 1.55: +44 -21 lines
Diff to previous 1.55 (colored)

[merging from cherry-xenmp] bring in bouyer@'s changes via:
http://mail-index.netbsd.org/source-changes/2011/10/22/msg028271.html
From the Log:
Log Message:
Various interrupt fixes, mainly:
keep a per-cpu mask of enabled events, and use it to get pending events.
A cpu-specific event (all of them at this time) should not be ever masked
by another CPU, because it may prevent the target CPU from seeing it
(the clock events all fires at once for example).

Revision 1.55 / (download) - annotate - [select for diffs], Wed Sep 21 15:26:47 2011 UTC (12 years, 6 months ago) by cegger
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base
Branch point for: yamt-pagecache
Changes since 1.54: +3 -2 lines
Diff to previous 1.54 (colored)

Initialize mutex before use. Lets me boot a dom0 kernel again
without a lockdebug panic.

Revision 1.54 / (download) - annotate - [select for diffs], Tue Sep 20 00:12:24 2011 UTC (12 years, 6 months ago) by jym
Branch: MAIN
Changes since 1.53: +37 -7 lines
Diff to previous 1.53 (colored)

Merge jym-xensuspend branch in -current. ok bouyer@.

Goal: save/restore support in NetBSD domUs, for i386, i386 PAE and amd64.

Executive summary:
- split all Xen drivers (xenbus(4), grant tables, xbd(4), xennet(4))
in two parts: suspend and resume, and hook them to pmf(9).
- modify pmap so that Xen hypervisor does not cry out loud in case
it finds "unexpected" recursive memory mappings
- provide a sysctl(7), machdep.xen.suspend, to command suspend from
userland via powerd(8). Note: a suspend can only be handled correctly
when dom0 requested it, so provide a mechanism that will prevent
kernel to blindly validate user's commands

The code is still in experimental state, use at your own risk: restore
can corrupt backend communications rings; this can completely thrash
dom0 as it will loop at a high interrupt level trying to honor
all domU requests.

XXX PAE suspend does not work in amd64 currently, due to (yet again!)
page validation issues with hypervisor. Will fix.

XXX secondary CPUs are not suspended, I will write the handlers
in sync with cherry's Xen MP work.

Tested under i386 and amd64, bear in mind ring corruption though.

No build break expected, GENERICs and XEN* kernels should be fine.
./build.sh distribution still running. In any case: sorry if it does
break for you, contact me directly for reports.

Revision 1.53 / (download) - annotate - [select for diffs], Sun Aug 28 22:55:52 2011 UTC (12 years, 6 months ago) by jym
Branch: MAIN
Changes since 1.52: +8 -2 lines
Diff to previous 1.52 (colored)

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.

Revision 1.52 / (download) - annotate - [select for diffs], Sun Aug 28 22:36:17 2011 UTC (12 years, 6 months ago) by jym
Branch: MAIN
Changes since 1.51: +15 -14 lines
Diff to previous 1.51 (colored)

KNF, white spaces and comment typo fixes.

Revision 1.51 / (download) - annotate - [select for diffs], Sat Aug 13 17:23:42 2011 UTC (12 years, 7 months ago) by cherry
Branch: MAIN
CVS Tags: jym-xensuspend-nbase, jym-xensuspend-base
Changes since 1.50: +6 -17 lines
Diff to previous 1.50 (colored)

Use spin mutices correctly.
 - Prune redundant splxx()/splx() pairs.
 - Do not "leak" a mutex_spin_enter() via conditional return.

Thanks rmind@

Revision 1.50 / (download) - annotate - [select for diffs], Thu Aug 11 17:59:00 2011 UTC (12 years, 7 months ago) by cherry
Branch: MAIN
Changes since 1.49: +178 -35 lines
Diff to previous 1.49 (colored)

Make event/interrupt handling MP aware

Revision 1.49 / (download) - annotate - [select for diffs], Wed Aug 10 21:46:02 2011 UTC (12 years, 7 months ago) by cherry
Branch: MAIN
Changes since 1.48: +4 -4 lines
Diff to previous 1.48 (colored)

refactor the bitstring/mask operations to be behind an API. Make pending interrupt marking cpu aware.

Revision 1.48 / (download) - annotate - [select for diffs], Sat Jul 2 19:07:56 2011 UTC (12 years, 8 months ago) by jym
Branch: MAIN
Changes since 1.47: +4 -6 lines
Diff to previous 1.47 (colored)

Remove all return error checks for event_set_handler(...). It either
succeeds or end in panic.

Revision 1.47 / (download) - annotate - [select for diffs], Mon Dec 20 00:25:46 2010 UTC (13 years, 3 months ago) by matt
Branch: MAIN
CVS Tags: uebayasi-xip-base7, rmind-uvmplock-nbase, rmind-uvmplock-base, matt-mips64-premerge-20101231, jruoho-x86intr-base, jruoho-x86intr, cherry-xenmp-base, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: cherry-xenmp
Changes since 1.46: +3 -4 lines
Diff to previous 1.46 (colored)

Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits.  Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.

Revision 1.46 / (download) - annotate - [select for diffs], Fri Oct 23 05:10:48 2009 UTC (14 years, 4 months ago) by snj
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9, yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base6, uebayasi-xip-base5, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, uebayasi-xip-base1, uebayasi-xip-base, uebayasi-xip, matt-premerge-20091211
Branch point for: rmind-uvmplock
Changes since 1.45: +2 -7 lines
Diff to previous 1.45 (colored)

Drop 3rd and 4th clauses.  Approved by cl@ and Keir Fraser (copyright
holders).

Revision 1.45 / (download) - annotate - [select for diffs], Mon Oct 19 18:41:11 2009 UTC (14 years, 5 months ago) by bouyer
Branch: MAIN
Changes since 1.44: +2 -7 lines
Diff to previous 1.44 (colored)

Remove closes 3 & 4 from my licence. Lots of thanks to Soren Jacobsen
for the booring work !

Revision 1.44 / (download) - annotate - [select for diffs], Wed Jul 29 12:02:09 2009 UTC (14 years, 7 months ago) by cegger
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7
Changes since 1.43: +2 -46 lines
Diff to previous 1.43 (colored)

remove Xen2 support.
ok bouyer@

Revision 1.43 / (download) - annotate - [select for diffs], Fri Mar 27 15:47:33 2009 UTC (14 years, 11 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-nfs-mp-base6, yamt-nfs-mp-base5, yamt-nfs-mp-base4, yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base, jymxensuspend-base
Changes since 1.42: +3 -2 lines
Diff to previous 1.42 (colored)

Explicitly #include <sys/device.h> and <sys/evcnt.h>.  These files only
got the definitions they needed by chance, before.

Revision 1.42 / (download) - annotate - [select for diffs], Wed Dec 17 20:51:33 2008 UTC (15 years, 3 months ago) by cegger
Branch: MAIN
CVS Tags: nick-hppapmap-base2, mjf-devfs2-base
Branch point for: jym-xensuspend
Changes since 1.41: +7 -7 lines
Diff to previous 1.41 (colored)

kill MALLOC and FREE macros.

Revision 1.41 / (download) - annotate - [select for diffs], Thu Nov 13 21:39:29 2008 UTC (15 years, 4 months ago) by bouyer
Branch: MAIN
CVS Tags: haad-nbase2, haad-dm-base2, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Changes since 1.40: +2 -6 lines
Diff to previous 1.40 (colored)

Remove a debug printf(). It will call splx(), which may panic in spllowwer()
on KASSERT(psl == 0);

Revision 1.40 / (download) - annotate - [select for diffs], Wed Nov 5 21:04:05 2008 UTC (15 years, 4 months ago) by bouyer
Branch: MAIN
Changes since 1.39: +32 -21 lines
Diff to previous 1.39 (colored)

evtchn_do_event(): in our C implementation of spllower(), if a handler fails
to restore the spl (shouldn't happen, but ...), we could end up with a
higther pending ipl set and never cleared because iplbit already
handled this level. while (iplmask != 0) {} would then never be true,
and we'd end up triggering KASSERT(iplbit != 0).
Now print the faultly handler and reset the IPL, and start the whole
pending IPL handling again if needed.

Revision 1.39 / (download) - annotate - [select for diffs], Fri Oct 24 21:09:24 2008 UTC (15 years, 4 months ago) by jym
Branch: MAIN
CVS Tags: netbsd-5-base, matt-mips64-base2
Branch point for: nick-hppapmap, netbsd-5
Changes since 1.38: +9 -5 lines
Diff to previous 1.38 (colored)

- rename init_events() to events_init(), to better reflect netbsd semantics

- change unbind_[pv]irq_from_evtch() so that they now return the event
channel the [PV]IRQ was bound to. It reflects the opposite behaviour of the
bind_[pv]irq_to_evtch() functions.

- remove xenbus_suspend() and xenbus_resume() prototypes, as they are not
used anywhere else, and will conflict with the xenbus pmf(9) handlers.

- make start_info aligned on a page boundary, as Xen expects it to be so.

- mask event channel during xbd detach before removing its handler (can
avoid spurious events).

- add the "protocol" entry in xenstore during xbd initialization. Normally
created during domU's boot by xentools, it is under domU's responsibility
in all other cases (save/restore, hot plugging, etc.).

- modifications to xs_init(), so that it can properly return an error.

Reviewed by Christoph (cegger@).

Revision 1.38 / (download) - annotate - [select for diffs], Sat May 24 15:09:34 2008 UTC (15 years, 9 months ago) by bouyer
Branch: MAIN
CVS Tags: yamt-pf42-base4, yamt-pf42-base3, wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, simonb-wapbl-nbase, simonb-wapbl-base, simonb-wapbl, haad-dm-base1
Branch point for: haad-dm
Changes since 1.37: +9 -9 lines
Diff to previous 1.37 (colored)

Remork the C implementation of spllower() in evtchn_do_event(), so that
callbacks are always called in decreasing IPL order. Although it's not
strictly a bug, it makes the code easier to read, and avoids processing
the whole IPL range several times.

Revision 1.37 / (download) - annotate - [select for diffs], Mon Apr 21 15:15:34 2008 UTC (15 years, 11 months ago) by cegger
Branch: MAIN
CVS Tags: yamt-pf42-base2, yamt-nfs-mp-base2, yamt-nfs-mp-base, hpcarm-cleanup-nbase
Branch point for: yamt-nfs-mp, wrstuden-revivesa
Changes since 1.36: +5 -7 lines
Diff to previous 1.36 (colored)

Access Xen's vcpu info structure per-CPU.
Tested on i386 and amd64 (both dom0 and domU) by me.
Xen2 tested (both dom0 and domU) by bouyer.
OK bouyer

Revision 1.36 / (download) - annotate - [select for diffs], Sat Apr 19 13:46:12 2008 UTC (15 years, 11 months ago) by cegger
Branch: MAIN
Changes since 1.35: +39 -16 lines
Diff to previous 1.35 (colored)

Use interrupt biglock wrapper as in x86/x86/intr.c
This change is based on http://mail-index.netbsd.org/port-amd64/2004/02/22/0000.html
OK bouyer

Revision 1.35 / (download) - annotate - [select for diffs], Mon Apr 14 13:38:03 2008 UTC (15 years, 11 months ago) by cegger
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base
Branch point for: yamt-pf42
Changes since 1.34: +6 -6 lines
Diff to previous 1.34 (colored)

- use POSIX integer types
- ansify functions

Revision 1.34 / (download) - annotate - [select for diffs], Sun Apr 6 07:24:20 2008 UTC (15 years, 11 months ago) by cegger
Branch: MAIN
Changes since 1.33: +3 -3 lines
Diff to previous 1.33 (colored)

use aprint_*_dev and device_xname

Revision 1.33 / (download) - annotate - [select for diffs], Thu Mar 13 22:04:57 2008 UTC (16 years ago) by bouyer
Branch: MAIN
CVS Tags: yamt-lazymbuf-base15, yamt-lazymbuf-base14, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, ad-socklock-base1
Changes since 1.32: +35 -6 lines
Diff to previous 1.32 (colored)

Implement a C version of splx() in evtchn_do_event(). using plain splx()
here will reenable interrupts as a side effect, and we don't want it here.

It could cause some event handlers to run twice (which should be harmless),
and trap() to be called on the wrong LWP in doreti_checkast (which can
probably cause some damage).

Revision 1.32 / (download) - annotate - [select for diffs], Tue Feb 19 19:50:53 2008 UTC (16 years, 1 month ago) by bouyer
Branch: MAIN
CVS Tags: nick-net80211-sync-base, nick-net80211-sync, hpcarm-cleanup-base
Branch point for: mjf-devfs2, keiichi-mipv6
Changes since 1.31: +6 -6 lines
Diff to previous 1.31 (colored)

The event bitmasks provided by the hypervisor are unsigned long (so 64bits
on amd64). Make sure to use the right type to store and manipulate them.
This fixes amd64, where basically any event channel > 31 was not working
(and you get there after starting/stopping a domU a few times). Things
would occasionally unwedge though the spllower() callbacks.

Revision 1.31 / (download) - annotate - [select for diffs], Tue Feb 19 13:25:53 2008 UTC (16 years, 1 month ago) by bouyer
Branch: MAIN
Changes since 1.30: +30 -19 lines
Diff to previous 1.30 (colored)

Fix xenevt to not call softint_schedule() above IPL_HIGH:
Register a ipl callback for IPL_HIGH.
if the current ipl level is too high, just record the event in a bitmap,
and record IPL_HIGH as pending. The callback will process the pending events.

Revision 1.30 / (download) - annotate - [select for diffs], Fri Jan 11 20:00:53 2008 UTC (16 years, 2 months ago) by bouyer
Branch: MAIN
CVS Tags: mjf-devfs-base, bouyer-xeni386-nbase, bouyer-xeni386-base
Changes since 1.29: +3 -2 lines
Diff to previous 1.29 (colored)

Merge the bouyer-xeni386 branch to head, at tag bouyer-xeni386-merge1 (the
branch is still active and will see i386PAE support developement).
Sumary of changes:
- switch xeni386 to the x86/x86/pmap.c, and the xen/x86/x86_xpmap.c
  pmap bootstrap.
- merge back most of xen/i386/ to i386/i386
- change the build to reduce diffs between i386 and amd64 in file locations
- remove include files that were identical to the i386/amd64 counterparts,
  the build will find them via the xen-ma/machine link.

Revision 1.29 / (download) - annotate - [select for diffs], Sat Jan 5 19:29:26 2008 UTC (16 years, 2 months ago) by bouyer
Branch: MAIN
CVS Tags: matt-armv6-base
Changes since 1.28: +3 -3 lines
Diff to previous 1.28 (colored)

Wrap test for debug_port in __predict_false()

Revision 1.28 / (download) - annotate - [select for diffs], Sat Jan 5 19:16:07 2008 UTC (16 years, 2 months ago) by bouyer
Branch: MAIN
Changes since 1.27: +3 -3 lines
Diff to previous 1.27 (colored)

Make sure debug_port isn't used before initialized by setting it to -1.

Revision 1.27 / (download) - annotate - [select for diffs], Thu Dec 13 21:42:06 2007 UTC (16 years, 3 months ago) by bouyer
Branch: MAIN
CVS Tags: vmlocking2-base3
Changes since 1.26: +2 -5 lines
Diff to previous 1.26 (colored)

Remove obsolete code and comment.

Revision 1.26 / (download) - annotate - [select for diffs], Wed Dec 12 22:16:32 2007 UTC (16 years, 3 months ago) by bouyer
Branch: MAIN
CVS Tags: yamt-kmem-base3
Changes since 1.25: +16 -13 lines
Diff to previous 1.25 (colored)

cleanup the debug event handler to not use the IPL system at all. Fix
debug event storm on XEN2.

Revision 1.25 / (download) - annotate - [select for diffs], Mon Dec 3 15:34:29 2007 UTC (16 years, 3 months ago) by ad
Branch: MAIN
CVS Tags: yamt-kmem-base2, yamt-kmem-base, vmlocking2-base2, vmlocking2-base1, vmlocking-nbase, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, jmcneill-pm-base, cube-autoconf-base, cube-autoconf
Branch point for: yamt-kmem, vmlocking2, bouyer-xeni386
Changes since 1.24: +4 -4 lines
Diff to previous 1.24 (colored)

Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.

Revision 1.24 / (download) - annotate - [select for diffs], Thu Nov 22 16:17:07 2007 UTC (16 years, 3 months ago) by bouyer
Branch: MAIN
Changes since 1.23: +11 -12 lines
Diff to previous 1.23 (colored)

Pull up the bouyer-xenamd64 branch to HEAD. This brings in amd64 support
to NetBSD/Xen, both Dom0 and DomU.

Revision 1.23 / (download) - annotate - [select for diffs], Wed Oct 17 19:58:32 2007 UTC (16 years, 5 months ago) by garbled
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, jmcneill-base, bouyer-xenamd64-base2, bouyer-xenamd64-base
Branch point for: mjf-devfs
Changes since 1.22: +2 -2 lines
Diff to previous 1.22 (colored)

Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree.  Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches.  The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.

Revision 1.22 / (download) - annotate - [select for diffs], Wed Sep 26 19:48:45 2007 UTC (16 years, 5 months ago) by ad
Branch: MAIN
CVS Tags: yamt-x86pmap-base3, yamt-x86pmap-base2, vmlocking-base, ppcoea-renovation-base
Branch point for: bouyer-xenamd64
Changes since 1.21: +3 -3 lines
Diff to previous 1.21 (colored)

x86 changes for pcc and LKMs.

- Replace most inline assembly with proper functions. As a side effect
  this reduces the size of amd64 GENERIC by about 120kB, and i386 by a
  smaller amount. Nearly all of the inlines did something slow, or something
  that does not need to be fast.
- Make curcpu() and curlwp functions proper, unless __GNUC__ && _KERNEL.
  In that case make them inlines. Makes curlwp LKM and preemption safe.
- Make bus_space and bus_dma more LKM friendly.
- Share a few more files between the ports.
- Other minor changes.

Revision 1.21 / (download) - annotate - [select for diffs], Sun Sep 23 16:54:09 2007 UTC (16 years, 5 months ago) by bouyer
Branch: MAIN
CVS Tags: yamt-x86pmap-base
Branch point for: yamt-x86pmap
Changes since 1.20: +8 -4 lines
Diff to previous 1.20 (colored)

Ajust for Xen 3.1.0 public headers. From Christoph Egger in private mail.

Revision 1.20 / (download) - annotate - [select for diffs], Fri Dec 8 15:05:18 2006 UTC (17 years, 3 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3, yamt-idlelwp-base8, yamt-idlelwp, thorpej-atomic-base, thorpej-atomic, reinoud-bufcleanup, post-newlock2-merge, nick-csl-alignment-base5, nick-csl-alignment-base, nick-csl-alignment, newlock2-nbase, newlock2-base, mjf-ufs-trans-base, mjf-ufs-trans, matt-mips64-base, matt-mips64, hpcarm-cleanup, ad-audiomp-base, ad-audiomp
Branch point for: vmlocking, ppcoea-renovation, matt-armv6, jmcneill-pm
Changes since 1.19: +2 -5 lines
Diff to previous 1.19 (colored)

- pass intrframe by-pointer, not by-value.
- make i386 and xen use per-cpu interrupt stack.

xen part is reviewed by Manuel Bouyer.

Revision 1.19 / (download) - annotate - [select for diffs], Thu Sep 28 18:53:16 2006 UTC (17 years, 5 months ago) by bouyer
Branch: MAIN
CVS Tags: yamt-splraiseipl-base2, wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4, matt-nb4-arm-base, matt-nb4-arm
Changes since 1.18: +4 -5 lines
Diff to previous 1.18 (colored)

Add Xen3 support for ACPI and/or MPBIOS + IOAPIC. To help with this, physical
CPUs are now configured on mainbus only in dom0, and only to know about
their APIC id. virtual CPUs are attached to hypervisor as:
vcpu* at hypervisor?
and this is what's used as curcpu(). The kernel config files needs to be
updated for this, see XEN3_DOM0 or XEN3_DOMU for examples.
XEN3_DOM0 now has acpi, MPBIOS and ioapic by default.
Note that a Xen dom0 kernel doens't have access to the lapic.

Revision 1.18 / (download) - annotate - [select for diffs], Sun Jan 15 22:09:52 2006 UTC (18 years, 2 months ago) by bouyer
Branch: MAIN
CVS Tags: yamt-uio_vmspace-base5, yamt-splraiseipl-base, yamt-pdpolicy-base9, yamt-pdpolicy-base8, yamt-pdpolicy-base7, yamt-pdpolicy-base6, yamt-pdpolicy-base5, yamt-pdpolicy-base4, yamt-pdpolicy-base3, yamt-pdpolicy-base2, yamt-pdpolicy-base, yamt-pdpolicy, simonb-timecounters-base, simonb-timecounters, simonb-timcounters-final, rpaulo-netinet-merge-pcb-base, rpaulo-netinet-merge-pcb, peter-altq-base, peter-altq, gdamore-uart-base, gdamore-uart, elad-kernelauth-base, elad-kernelauth, chap-midi-nbase, chap-midi-base, chap-midi, abandoned-netbsd-4-base, abandoned-netbsd-4
Branch point for: yamt-splraiseipl, newlock2
Changes since 1.17: +79 -17 lines
Diff to previous 1.17 (colored)

Snapshot of work in progress on NetBSD port to Xen3:
- kernel (both dom0 and domU) boot, console is functionnal and it can starts
  software from a ramdisk
- there is no driver front-end expect console for domU yet.
- dom0 can probe devices and ex(4) work when Xen3 is booted without acpi
  and apic support. But the on-board IDE doens't get interrupts.
  The PCI code still needs work (it's hardcoded to mode 1). Some of this
  code should be shared with ../x86
  The physical insterrupt code needs to get MPBIOS and ACPI support, and
  do interrupt routing to properly interract with Xen.
To enable Xen-3.0 support, add
options XEN3
to your kernel config file (this will disable Xen2 support)
Changes affecting Xen-2.0 support (no functionnal changes intended):
- get more constants from genassym for assembly code
- remove some unneeded registers move from start()
- map the shared info page from start(), and remove the pte = 0xffffffff hack
- vector.S: in hypervisor_callback() make sure %esi points to
  HYPERVISOR_shared_info before accessing the info page. Remplace some
  hand-written assembly with the equivalent macro defined in frameasm.h
- more debug code, dissabled by default.

while here added my copyright on some files I worked on in 2005.

Revision 1.17 / (download) - annotate - [select for diffs], Sun Dec 11 12:19:50 2005 UTC (18 years, 3 months ago) by christos
Branch: MAIN
Branch point for: yamt-uio_vmspace
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (colored)

merge ktrace-lwp.

Revision 1.16 / (download) - annotate - [select for diffs], Fri Aug 19 16:06:12 2005 UTC (18 years, 7 months ago) by bouyer
Branch: MAIN
CVS Tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base3, yamt-readahead-base2, yamt-readahead-base, yamt-readahead, thorpej-vnode-attr-base, thorpej-vnode-attr, ktrace-lwp-base
Changes since 1.15: +10 -8 lines
Diff to previous 1.15 (colored)

Make PCI devices usable for non-domain0 kernels. Based on patches sent by
Ceri Storey to port-xen, with some additionnal changes by me:
- include bus_dma.c, bus_space.c and pci_machdep.c if pci is defined
  instead of dom0ops
- Make various initialisations, and probe/attach pci busses based on NPCI
  instead of DOM0OPS
- in conf/files.xen, move xen-specific devices before non-xen specific devices
  so that the xen-specific match function is called first, to avoid false
  attachement from too liberal match function in non-xen code.

Revision 1.15 / (download) - annotate - [select for diffs], Fri Jul 15 09:16:23 2005 UTC (18 years, 8 months ago) by yamt
Branch: MAIN
Changes since 1.14: +5 -3 lines
Diff to previous 1.14 (colored)

evtchn_do_event: enable interrupts while calling interrupt handlers.

Revision 1.14 / (download) - annotate - [select for diffs], Thu Apr 28 18:26:26 2005 UTC (18 years, 10 months ago) by yamt
Branch: MAIN
CVS Tags: kent-audio2-base
Branch point for: yamt-lazymbuf
Changes since 1.13: +6 -6 lines
Diff to previous 1.13 (colored)

rename do_event to evtchan_do_event.
the former is too generic name and it actually hides a bug in xennetback.

Revision 1.13 / (download) - annotate - [select for diffs], Wed Apr 20 14:48:29 2005 UTC (18 years, 11 months ago) by bouyer
Branch: MAIN
Changes since 1.12: +23 -8 lines
Diff to previous 1.12 (colored)

Event handling optimisations:
- sort the ih_evt_handler list by IPL, higher first. Otherwise some handlers
  would have been delayed, event if they could run at the current IPL.
- As ih_evt_handler is sorted, remove IPLs that have been processed for
  an event when calling hypervisor_set_ipending()
- In hypervisor_set_ipending(), enter the event in ipl_evt_mask only
  for the lowest IPL. As deffered IPLs are processed high to low,
  this ensure that hypervisor_enable_event() will be called only when all
  callbacks have been called for an event. We don't need the evtch_maskcount[]
  counters any more.

Thanks to YAMAMOTO Takashi for ideas and feedback.

Revision 1.12 / (download) - annotate - [select for diffs], Wed Apr 20 07:59:21 2005 UTC (18 years, 11 months ago) by xtraeme
Branch: MAIN
Changes since 1.11: +4 -4 lines
Diff to previous 1.11 (colored)

Fix typo (vitual -> virtual)

Revision 1.11 / (download) - annotate - [select for diffs], Tue Apr 19 22:14:30 2005 UTC (18 years, 11 months ago) by bouyer
Branch: MAIN
Changes since 1.10: +2 -5 lines
Diff to previous 1.10 (colored)

Avoid a race between do_hypervisor_event() and stipending() that could
cause an event to be both handled and marked as pending, or being
marked as pending twice (triggering the diagnostic check
evtch_maskcount[port] == 0 in hypervisor_set_ipending):
mask and clear event by word of 32bit in do_hypervisor_event() or stipending(),
instead of by indiviual bits in do_event() or xenevt_event().
In addition this is marginally more efficient.

Revision 1.10 / (download) - annotate - [select for diffs], Mon Apr 18 21:31:03 2005 UTC (18 years, 11 months ago) by bouyer
Branch: MAIN
Changes since 1.9: +2 -16 lines
Diff to previous 1.9 (colored)

Remove unused code.

Revision 1.9 / (download) - annotate - [select for diffs], Mon Apr 18 20:23:56 2005 UTC (18 years, 11 months ago) by yamt
Branch: MAIN
Changes since 1.8: +1 -0 lines
Diff to previous 1.8 (colored)

don't unmask an event channel until all interrupts for it are served.
fix problems with shared (physical) interrupts.

Revision 1.8 / (download) - annotate - [select for diffs], Mon Apr 18 20:22:22 2005 UTC (18 years, 11 months ago) by yamt
Branch: MAIN
Changes since 1.7: +8 -8 lines
Diff to previous 1.7 (colored)

make this compilable with IRQ_DEBUG defined.

Revision 1.7 / (download) - annotate - [select for diffs], Sun Apr 17 14:50:11 2005 UTC (18 years, 11 months ago) by bouyer
Branch: MAIN
Changes since 1.6: +17 -8 lines
Diff to previous 1.6 (colored)

Allow to pass a more descriptive name to event_set_handler() (e.g. IRQ number
for physical IRQ, or device name for xen device drivers). This makes
systat and vmstat output more usable, especially as the channel numbers
change each time a guest reboots.

Revision 1.6 / (download) - annotate - [select for diffs], Sat Apr 16 23:33:18 2005 UTC (18 years, 11 months ago) by bouyer
Branch: MAIN
Changes since 1.5: +11 -40 lines
Diff to previous 1.5 (colored)

Remove functions that just call another one.
Inline a function used at only one place.

Revision 1.5 / (download) - annotate - [select for diffs], Sat Apr 16 22:49:38 2005 UTC (18 years, 11 months ago) by bouyer
Branch: MAIN
Changes since 1.4: +199 -239 lines
Diff to previous 1.4 (colored)

Get rid of the event to pseudo-irq mapping. We are limited to 32 pseudo-irq,
including soft interrupt, and this is way too low in some use (lots of domains,
or domains with lots of xennet, or even hardware with lots of devices at
different interrupts).
Based on idea from YAMAMOTO Takashi, keep one list of handler per-event and
one per-IPL (so the same handler is now in 2 lists). In the common case were
an event is received at low IPL, we can call the handlers quickly (there
is usually only one handler per event, unless the event is mapped to a
physical interrupt and this interrupt is shared by different devices).
Deffered events and software interrupts are handled by a bitmask (as before)
with one bit per IPL. When one IPL has an event pending all handlers for
this IPL will be called.
With this change, it is now possible to have all the 1024 events active.

While here, handle debug event in a special way: the handler is always called,
regardless of the current IPL. Make the handler print usefull informations
about events and IPL states.
Also remove code not used on Xen in files inherited from the x86 port.

Revision 1.4 / (download) - annotate - [select for diffs], Thu Mar 17 15:32:38 2005 UTC (19 years ago) by bouyer
Branch: MAIN
CVS Tags: yamt-km-base4, yamt-km-base3
Branch point for: ktrace-lwp
Changes since 1.3: +24 -6 lines
Diff to previous 1.3 (colored)

Protect various IRQ and event allocation/deallocations with splhigh().
Print the IRQ used for debug and misdirect events.

Revision 1.3 / (download) - annotate - [select for diffs], Fri Mar 11 15:48:40 2005 UTC (19 years ago) by bouyer
Branch: MAIN
CVS Tags: netbsd-3-base
Branch point for: netbsd-3
Changes since 1.2: +4 -4 lines
Diff to previous 1.2 (colored)

increment couters at the right place, so that deffered interrupts are
accounted too.

Revision 1.2 / (download) - annotate - [select for diffs], Wed Mar 9 22:39:21 2005 UTC (19 years ago) by bouyer
Branch: MAIN
Changes since 1.1: +635 -0 lines
Diff to previous 1.1 (colored)

Merge the bouyer-xen2 branch. This add supports for the Xen 2.0 virtual
machine kernel (both privileged and non-privileged domains), and remove support
for the old xen 1.2.

Revision 1.1, Mon Dec 13 17:52:21 2004 UTC (19 years, 3 months ago) by bouyer
Branch: MAIN
CVS Tags: yamt-km-base2, yamt-km-base
Branch point for: yamt-km, kent-audio2, bouyer-xen2
FILE REMOVED

file evtchn.c was initially added on branch bouyer-xen2.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>