Commit Graph

484 Commits

Author SHA1 Message Date
dogcow
b347627ab1 The recent cpu_attach changes broke the xen build; while this compiles,
I'm far from positive it's the correct fix.
2007-03-05 23:26:40 +00:00
drochner
d880082522 clean up how cpus and ioapics are attached at the mainbus:
Seperate "cpubus" and "ioapicbus" -- while they share a common "address
space" (the apic id), the kernel doesn't use this fact. There are different
data passed to cpus and apics, which caused some ugly polymorphism. This
also saves the special "submatch" functions needed to distingush cpus
and ioapics for autoconf. (And it makes that "apid" locators wired
in the kernel configuration are honored now; this allows one to dumb down
an mp box to singleprocessor by userconfig.)
Print "apid" locators in the buses "print" function "as everyone does",
so the per-port cpu drivers don't need to do it.
Being here, constify "struct cpu_functions" and g/c the unused MP_PICMODE
flag.
2007-03-05 16:50:59 +00:00
dogcow
d2c694ade7 fix more caddr_t -> void * fallout. 2007-03-05 04:03:57 +00:00
dogcow
fc8b4c24ce fix more caddr_t -> void * fallout. 2007-03-05 03:22:06 +00:00
christos
53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
bouyer
dd27ab284c Properly honnor bus_dma bus address range restriction for Xen3 (the Xen2
interface doesn't allow it), so that .e.g bus_dma_subregion() has a chance
to work. Unfortunably a stock Xen hypervisor won't allow a upper bound less
than 2^31 (2GB) so devices like bce(4) will need a hacked hypervisor to
work properly.
2007-02-24 21:19:25 +00:00
bouyer
0f5ec4e70b Catch up with x86: add _bus_dmatag_subregion() and _bus_dmatag_destroy()
to x86_bus_dma_tag
2007-02-22 21:38:23 +00:00
dogcow
31286c4ea7 add _tag_needs_free members to x86_bus_dma_tag structs 2007-02-22 20:26:40 +00:00
thorpej
ae01c745cb TRUE -> true, FALSE -> false 2007-02-22 06:47:16 +00:00
thorpej
712239e366 Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 22:59:35 +00:00
dsl
5c89b1866e Get config(1) to supply the default values for BEEP_ONHALT. 2007-02-18 18:15:41 +00:00
pavel
934634a18c Change the process/lwp flags seen by userland via sysctl back to the
P_*/L_* naming convention, and rename the in-kernel flags to avoid
conflict. (P_ -> PK_, L_ -> LW_ ). Add back the (now unused) LSDEAD
constant.

Restores source compatibility with pre-newlock2 tools like ps or top.

Reviewed by Andrew Doran.
2007-02-17 22:31:36 +00:00
ad
3363855a4a Remove spllowersoftclock() and CLKF_BASEPRI(), and always dispatch callouts
via a soft interrupt. In the near future, softclock will be run from process
context.
2007-02-16 02:53:43 +00:00
ad
b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
hubertf
eda05c6413 Remove more duplicate headers.
Patch by Slava Semushin <slava.semushin@gmail.com>

Again, this was tested by comparing obj files from a pristine and a patched
source tree against an i386/ALL kernel, and also for src/sbin/fsck_ffs,
src/sbin/fsdb and src/usr.sbin/makefs. Only changes in assert() line numbers
were detected in 'objdump -d' output.
2007-01-29 01:52:43 +00:00
bouyer
89b7593e6a Xen3 linux guests seems to loan a lot of pages for some disk transfers,
and eventually run out of XENSHM_NPAGES for a single transfers.
Bump XENSHM_NPAGES by 10 for xen3 to avoid deadlocks in such case.
2007-01-20 22:01:06 +00:00
ad
236a8ab694 Update x86_pause() as per i386. 2007-01-14 17:20:32 +00:00
bouyer
4bd6fc948a Fix still possible race condition where xbd_handler could still try to process
an event before the device is ready.
Reported, and tested by anzi at dnainternet net on port-xen.
2007-01-11 19:51:39 +00:00
bouyer
1073d668ed - Add or change memory barrier to reflect the related operation
- In xencons_handler(), update in_cons inside the loop, otherwise,
  we would trigger the xenconscn_getc() workaround wich reset cons and prod
  to their original values, and this creates an infinite loop

Should fix the console hang reported by several users on port-xen@.
2007-01-07 00:02:36 +00:00
bouyer
3fbcd5f774 Don't try to handle xbd interrupts if the device is not yet connected.
Should fix NULL dereference at boot when more than one xbd device is
configured, reported by Juraj Hercek on port-xen@
2007-01-06 22:07:11 +00:00
pavel
104e8925ea remove some leftover msgbuf manipulation from pmap.c, as done for the i386
and amd64 versions before. Inspired by PR port-i386/34186 from Wolfgang
Stukenbrock.
2007-01-06 17:48:52 +00:00
jmcneill
afcfbdad8b On the Xbox, prevent scanning past the first device on bus 1. 2007-01-05 17:53:53 +00:00
yamt
760e1ad563 xbd_handler: call dk_iodone after updating rsp_cons.
otherwise, xbdstart kicked via dk_iodone still sees RING_FULL condition
and just returns.  it makes xbd stall when all requests are acked by
a single xbd_handler.  PR/34005.
2007-01-01 22:54:14 +00:00
yamt
35374d3155 bring in wedge handling code from arch/x86/x86/x86_autoconf.c.
unlike i386, we can't rely on the bootloader.
2007-01-01 02:59:50 +00:00
ad
e96fca7884 Define ipl_t as uint8_t so that it can be packed into a word with a lock
byte. Ok yamt@.
2006-12-26 15:22:44 +00:00
elad
504c71d9fe Make machdep scope architecture-agnostic by removing all arch-specific
requests and centralizing them all. The result is that some of these
are not used on some architectures, but the documentation was updated
to reflect that.
2006-12-26 10:43:43 +00:00
wiz
3ed1aa9185 Spell "separate" correctly. From Zafer Aydogan. 2006-12-25 18:39:47 +00:00
yamt
8bf7662829 merge yamt-splraiseipl branch.
- finish implementing splraiseipl (and makeiplcookie).
	  http://mail-index.NetBSD.org/tech-kern/2006/07/01/0000.html
	- complete workqueue(9) and fix its ipl problem, which is reported
	  to cause audio skipping.
	- fix netbt (at least compilation problems) for some ports.
	- fix PR/33218.
2006-12-21 15:55:21 +00:00
gdt
38eac16b69 Use agp_machdep.c from the new location (x86, not i386). 2006-12-18 20:07:36 +00:00
bouyer
8f9ec90387 Remove extra ) causing compile failure when CONS_OVERRIDE is defined.
From Hideo Masuda in PR port-xen/35217.
2006-12-09 10:37:52 +00:00
yamt
98cfc473c8 - pass intrframe by-pointer, not by-value.
- make i386 and xen use per-cpu interrupt stack.

xen part is reviewed by Manuel Bouyer.
2006-12-08 15:05:18 +00:00
wiz
6919c6578c s/independant/independent/, from Zafer. 2006-11-24 22:04:21 +00:00
yamt
9777cce8d1 include the i386 frameasm.h rather than inlining it. 2006-11-21 07:35:01 +00:00
oster
d4240170d8 xen_shm_errintvl is only used in the DEBUG case. Fixes build for non-DEBUG. 2006-11-16 22:38:18 +00:00
yamt
730ba489f6 xen_shm: make some variables static. 2006-11-16 05:43:47 +00:00
bouyer
70aa8a0541 vn_lock() the vnode we got from bdevvp(), otherwise if something else uses
this device in userland (e.g. qemu-dm when running a HVM guest), we'll reuse
the existing vnode and we'll panic in VOP_UNLOCK(). We don't have this issue
most of the time because when xbdback is the only user, we get a specfs
vnode for which locking operation are NOPs.

Thanks to Antti Kantee for spotting the missing vn_lock() in sources and
giving details about vnode locking.
2006-11-14 22:14:56 +00:00
jld
bd403112d6 Under Xen2, timestamp updates should happen every 10ms, and a timer
event should be raised every 10ms if we're runnable.  Unfortunately,
there seems to be an intermittent bug in the hypervisor such that,
for about 1<<32 ns (~4.3s) after it manifests, every running domain
continues to run but not get its timer events and new timestamps (nor
is it preempted in favor of other domains on that CPU).  This can cause
strange behavior from our timekeeping; for example, hardclock() is never
called during this interval.

So here's a workaround: if timestamp is allegedly up to date but is more
than 40ms old (this is semi-arbitrary), the domain sets its timer to a
time in the past, which causes it to become immediately pending, and also
results in the publication of a new timestamp.
2006-11-11 23:33:12 +00:00
yamt
641f2cc444 xennet_checksum_fill: remove a debug printf. 2006-11-10 11:52:49 +00:00
jld
e973fa550e If the timestamp is/becomes stale when computing the current system_time,
obviously shadow_system_time will need to be reread as well.
2006-11-05 10:11:55 +00:00
jld
9253e28032 Ensure that the timestamp we use in get_tsc_offset_ns remains valid
until after we do the rdtsc; since Xen3 dynamically adjusts its idea of
the clock frequency, this is important.  (Linux and FreeBSD both do this.)
2006-11-03 12:09:46 +00:00
jld
f566d2017b "static volatile", not "volatile static". 2006-11-03 09:16:13 +00:00
jld
2d61afc3e7 Recycle old buffers into new rx requests when their number reaches half of
those not tied up in active mbufs, rather than half of the total number.

(Or, to more literally translate the C, when there are at least as
many buffers waiting to be reused as outstanding rx requests.)

This prevents us from dropping off the network for a while when more
than 128 of the 256 buffers are in use by mbufs, which might not be
freed for an arbitrarily long time; the remaining buffers would stack up
on the free list but not be reclaimed until enough mbufs were eventually
freed, leaving the interface unable to receive packets until then.
2006-11-03 03:03:32 +00:00
gson
3b3814b873 const correctness 2006-10-23 18:10:44 +00:00
yamt
6a98028817 use vmem for xen_shm. 2006-10-22 09:44:55 +00:00
mrg
065b4dbdca fix errors in the previous changes. 2006-10-21 08:09:58 +00:00
mrg
648bbec934 in cpu_dumpconf(), don't panic() if we can't bdevsw_lookup() the
dumpdev.  this occurs when we try to set the dumpdev to a device
with no driver loaded.  this fixes PR#34872.

in sys_swapctl, if bdevsw_lookup() fails, set dumpdev = NODEV
before calling cpu_dumpconf().  (this also fixes PR#34872.)

XXX: cpu_dumpconf() should probably be changed to take a dumpdev
XXX: and return an error in such cases, but that is a much more
XXX: intrusive change.

XXX2: this is only run-tested on sparc64 and compile tested on a
XXX2: couple of platforms.
2006-10-21 05:54:31 +00:00
drochner
06e33f371b remove relicts of COMPAT_AOUT, fixes compilation problems with old
kernel config files reported by Patrick Welche on current-users
2006-10-19 16:55:37 +00:00
bouyer
f3366866dc Change BSD_SYMTAB to BSD_SYMTAB=yes. Xen-3.0.2 wants it, and xen-3.0.3
doesn't care.
2006-10-17 22:16:20 +00:00
bouyer
abd9ea51ce XEN_NO_HYPERCALLPAGE is redundant with XEN_COMPAT_030001; make
XEN_COMPAT_030001 disable the hypercall page too and remove
XEN_NO_HYPERCALLPAGE
2006-10-17 19:57:24 +00:00
bouyer
754514a443 Add ELF_PADDR_OFFSET and VIRT_ENTRY strings to __xen_guest ELF section,
so that our kernels works with newer xen-3 hypervisors; and correct the value
of VIRT_BASE for dom0.
Now that we can embed the values of KERNBASE and KERNTEXTOFF in the binary
for Xen, make the domU memory layout the same as dom0 for Xen3 (making
it the other way round doens't work; probably because of alignement
constraints in the hypervisor). The old domU layout is used if options
XEN_COMPAT_030001 is present in the kernel config file. Enable this the
domU kernel config files for now, in case someone wants to run a NetBSD
domU on an older Xen3 installation.
2006-10-17 18:53:03 +00:00