Commit Graph

645 Commits

Author SHA1 Message Date
cegger
e1f7ded34b g/c unused ioapic_bsp_id.
Per discussion with bouyer.
2008-04-18 15:32:46 +00:00
bouyer
ad2fcdc36d Do not set ioapic_bsp_id in cpu_attach_common(). It's already initialized
in cpu_attach(), and doing it here will overwrite the cpu_number of the
physical CPU with the one from the virtual CPU (which is always 0).
XXX is ioapic_bsp_id read somewhere ?
2008-04-17 21:25:00 +00:00
yamt
dc985aec9b cpu_debug_dump: s/curproc/curlwp/ in a message. 2008-04-17 14:01:03 +00:00
cegger
7d2699a931 reduce diff to x86/x86/cpu.c 2008-04-17 12:24:44 +00:00
cegger
19a5965092 Use device_xname(). From Manuel Bouyer. 2008-04-16 20:50:27 +00:00
cegger
af33bdeef3 device_t / softc split
reviewed, tested and approved by bouyer
2008-04-16 18:41:48 +00:00
cegger
7f5c40b741 - use POSIX integer types
- ansify functions
2008-04-14 13:38:03 +00:00
cegger
78ad08323e reduce diff to x86/x86/cpu.c 2008-04-13 22:29:38 +00:00
cegger
f578477b0b - device_t/softc split
- ansify
2008-04-13 21:59:15 +00:00
cegger
f5bd7c2196 use aprint_*_dev and device_xname 2008-04-06 07:23:57 +00:00
cegger
e34ebae1b0 remove unused file
OK bouyer
2008-04-04 20:15:07 +00:00
ad
69c15cf00b Make it compile. 2008-03-22 14:28:10 +00:00
ad
3685a3103f vn_close no longer takes a 'struct lwp' argument. 2008-03-22 14:21:56 +00:00
ichiro
f742db2180 make compile
- add xenbus_read_ull prototype into include/xenbus.h
2008-03-14 02:17:15 +00:00
bouyer
9cde455f5c Add swedge support to xbd backed, and make the virtual block device handle
sizes larger than 4TB. Tested by Jukka Marin.
Should fix kern/37370.
2008-03-13 22:19:39 +00:00
bouyer
b097a67b1d 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).
2008-03-13 22:04:57 +00:00
cube
ade3d15dc2 Don't forget to set sc_dev. 2008-03-05 04:58:29 +00:00
cube
521d00a805 Convert the Xen attachment for npx(4), too. 2008-03-04 15:02:52 +00:00
rmind
85fcf08240 Fix my previous confuse of the code: use selinit/seldestroy in correct
places, and fix missed selnotify call.
2008-03-01 18:32:48 +00:00
rmind
c6186face4 Welcome to 4.99.55:
- Add a lot of missing selinit() and seldestroy() calls.

- Merge selwakeup() and selnotify() calls into a single selnotify().

- Add an additional 'events' argument to selnotify() call.  It will
  indicate which event (POLL_IN, POLL_OUT, etc) happen.  If unknown,
  zero may be used.

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
2008-03-01 14:16:49 +00:00
dogcow
9b1ad79147 fix longrun build borkage on i386 2008-02-27 04:19:24 +00:00
drochner
bb33f35f20 Since files.wscons et al. are included by ~all ports anyway, include
them in the mi "files" file, and remove include statements from md files.
These shouldn't pull in additional kernel code when not in use, so it
shouldn't do any harm except a risk of namespace collisions which
should be easy to fix.
2008-02-20 21:43:33 +00:00
bouyer
af1d7cb986 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.
2008-02-19 19:50:53 +00:00
bouyer
e3e720d87d 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.
2008-02-19 13:25:53 +00:00
bouyer
532742d958 The informations about console and store page number are long, so avoid
overflow on i386PAE when converting to machine address. Fix booting
XEN3PAE kernels when xen maps it above 4Gb.
2008-02-17 17:39:42 +00:00
bouyer
2720c9d6a3 Install xenio.h and xenio3.h in /usr/include/xen, for the benefit
of xentools3.

XXX ignore those in Makefile.ioctl-c, they don't compile properly outside
of the Xen context and the ioctls from xenio.h conflicts with
soundcard.h
2008-02-17 16:23:12 +00:00
bouyer
895da00e0d Fix IOCTL_PRIVCMD_HYPERCALL issue which shows up with xen-3.1.3:
some hypercalls results are returned though the error path (depending on
sign, it's an error code or a result), and some results are interpreted in
a special way by the NetBSD kernel (e.g. -1).
Add a 'retval' member to the privcmd_hypercall_t argument, which holds
the hypercall result if it completed without error. The error code
is returned via the usual error path.
Handle the old IOCTL_PRIVCMD_HYPERCALL under COMPAT_40.

While there, make the double-inclusion protection #define match the
convention in xenio3.h and xenio.h.
2008-02-17 16:21:19 +00:00
bouyer
a9cd17640d Add missing __KERNEL_RCSID() 2008-02-17 14:03:16 +00:00
jmmv
af05f05499 Let Xen kernels build with "options MODULAR" enabled by pulling in the
appropriate kobj_machdep.c file.
2008-01-31 13:46:33 +00:00
joerg
6e869e402d Refactor in_cksum/in4_cksum/in6_cksum implementations:
- All three functions are included in the kernel by default.
  They call a backend function cpu_in_cksum after possibly
  computing the checksum of the pseudo header.
- cpu_in_cksum is the core to implement the one-complement sum.
  The default implementation is moderate fast on most platforms
  and provides a 32bit accumulator with 16bit addends for L32 platforms
  and a 64bit accumulator with 32bit addends for L64 platforms.
  It handles edge cases like very large mbuf chains (could happen with
  native IPv6 in the future) and provides a good base for new native
  implementations.
- Modify i386 and amd64 assembly to use the new interface.

This disables the MD implementations on !x86 until the conversion is
done. For Alpha, the portable version is faster.
2008-01-25 21:12:10 +00:00
bouyer
98a8e8b486 Merge the bouyer-xeni386 branch. This brings in PAE support to NetBSD xeni386
(domU only). PAE support is enabled by 'options PAE', see the new XEN3PAE_DOMU
and INSTALL_XEN3PAE_DOMU kernel config files.

See the comments in arch/i386/include/{pte.h,pmap.h} to see how it works.
In short, we still handle it as a 2-level MMU, with the second level page
directory being 4 pages in size. pmap switching is done by switching the
L2 pages in the L3 entries, instead of loading %cr3. This is almost required
by Xen, which handle the last L2 page (the one mapping 0xc0000000 - 0xffffffff)
in a very special way. But this approach should also work for native PAE
support if ever supported (in fact, the pmap should almost suport native
PAE, what's missing is bootstrap code in locore.S).
2008-01-23 19:46:43 +00:00
lukem
14c9fc8ffa Remove unnecessary references to config_time.h. 2008-01-17 01:56:02 +00:00
ad
dfe83e08ca Remove options MATH_EMULATE. 2008-01-16 09:37:04 +00:00
dogcow
5058ecbe4e cargo-cult copy cpu_offline_md; fixes compile on i386/x86_64 2008-01-16 02:08:49 +00:00
bouyer
3fcec0e820 Allocate one more L2 slot in xen_pmap_bootstrap() for i386.
pmap_bootstrap()/init386() wants to map a few additionnal things after
first_avail that we didn't account for, before pmap_growkernel() is
used/functionnal, and if the loaded kernel is close to the end of
the last L2 slot we loose. Should fix port-xen/37761 by YAMAMOTO Takashi.

Fix a XENPRINTF() so that low debug builds again.
2008-01-15 19:55:53 +00:00
ad
ee652e42b1 - Split crashdump code out into its own file.
- Remove NO_SPARSE_DUMP.
- Minor KNF, sprinkle static.
2008-01-12 20:03:41 +00:00
bouyer
26315d042c 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.
2008-01-11 20:00:13 +00:00
ad
e8532b7138 - Fix a memory order problem with non-interlocked mutex release.
- Give kernel_lock its own cache line.
2008-01-10 20:14:10 +00:00
bouyer
0b075efe67 Move a CLI() after .Lspllower_resume; because on Xen .Lspllower_resume
may be called from Xdoreti via iret, so with interrupts enabled.
2008-01-09 23:45:34 +00:00
joerg
34dc4c6501 Switch Xen to generic TODR. Tested by Manuel Bouyer. 2008-01-08 20:37:34 +00:00
bouyer
98b295d02d uobj->vmobjlock is a mutex these days. 2008-01-08 19:26:44 +00:00
bouyer
1ad062e684 Allocating up to 8k on stack isn't a good idea ... 2008-01-08 19:26:10 +00:00
bouyer
4507f75dd0 Fix fallout from vmlocking2: in xbdback_co_io_loop(), return the right object. 2008-01-06 12:43:42 +00:00
yamt
a0958af97a g/c ci_idle_pcb_paddr 2008-01-05 21:37:25 +00:00
bouyer
f8a26c5d3c Wrap test for debug_port in __predict_false() 2008-01-05 19:29:26 +00:00
bouyer
81873269e4 Make sure debug_port isn't used before initialized by setting it to -1. 2008-01-05 19:16:07 +00:00
ad
c29520cb1a Fix includes. 2008-01-05 00:31:50 +00:00
yamt
1c6ebd43e5 fix a bug in the previous. (per-cpu tss change)
keep iopl in pcb so that it won't lost.
2008-01-04 16:38:46 +00:00
yamt
35d91ae479 i386:
- make tss per-cpu.  this considerably speeds up context switch for,
	  at least, pentium4, where ltr instruction seems very slow.
i386, xen:
	- kill cpu_maxproc.
kvm86:
	- adapt to per-cpu tss.
	- cleanup and simplify.
	- move kvm86_mp_lock to more meaningful place.
	- disable preemption during a call.
2008-01-04 15:55:28 +00:00
joerg
02af50dd40 Add assym.h dependency. 2008-01-03 21:17:44 +00:00