Commit Graph

365 Commits

Author SHA1 Message Date
yamt
5923204be0 fix a race by re-checking req_prod when exiting main loop. 2005-07-19 12:20:29 +00:00
yamt
01fa457bff xen_shm_unmap:
- don't try to remove a request twice.
- fix spl/splx mismatch.
2005-07-19 11:09:52 +00:00
yamt
4ff72cab3e xbdback_co_main_loop: don't forget to set xbdi->cont in the case of error. 2005-07-19 09:45:12 +00:00
tls
0ac3367f2a Improvements to xbdback (the domain 0 driver that provides "xbd" virtual
disks to other domains) from Jed Davis, <jld@panix.com>:

	* Issue multiple requests when necessary rather than
	  assuming that arbitrary requests can be mapped into single
	  contiguous virtual address ranges.

	* Don't assume that all data for a request is consecutive
	  in memory.  With some client OSes, it's not.

	The above two changes fix data corruption issues with Linux
	clients with certain filesystem block sizes.

	* Gracefully handle memory or pool allocation failures after
	  beginning to handle a request from the ring.

	* Merge contiguous requests to avoid the "64K turns into 44K + 20K
	  and doubles the transactions per second at the disk" problem
	  caused by the 11-page limit caused by the structure of Xen
	  ring entries.  This causes a very slight performance decrease
	  for sequential 64K I/O if the disk is not already saturated with
	  requests (about 1%) but halves the transactions per second we
	  hit the disk with -- or better.  It even compensates for bizarre
	  Linux behaviour like breaking long requests up into 5.5K pieces.

	* Probably some stuff I forgot to mention.

Disk throughput (though not latency) is now much, much closer to the
"raw hardware" case than it was before.
2005-07-17 08:23:43 +00:00
yamt
1eb847c433 evtchn_do_event: enable interrupts while calling interrupt handlers. 2005-07-15 09:16:23 +00:00
yamt
cdc5b954fc include cardbus/pcmcia.
XXX 32bit cards don't work due to the way how xen handles
pci configuration space.
2005-07-15 07:56:22 +00:00
yamt
300f70f6e0 handle tx buffer exhaustion. 2005-07-07 12:01:25 +00:00
yamt
73a032cf90 create opt_pcifixup.h to match with the recent i386 change. 2005-06-28 12:01:11 +00:00
dyoung
7a7b273b60 Don't include files.ath any more, it's disappeared. 2005-06-25 23:09:54 +00:00
bouyer
acd358ae3d Use the time provided by the hypervisor instead of our global time variable
for xen_microtime(). This match more closely what is done on a real i386
(where we read the RTC), and seems to fix gettimeofday() sometime going
backward by several seconds for me.
2005-06-25 18:44:59 +00:00
dyoung
9063402978 Resolve conflicts in importation of 18-May-2005 ath(4) / net80211(9)
from FreeBSD.  Introduce compatibility shims (sys/dev/ic/ath_netbsd.[ch],
sys/net80211/ieee80211_netbsd.[ch]).  Update drivers (an, atu, atw,
awi, ipw, iwi, rtw, wi) for the new net80211(9) API.
2005-06-22 06:14:51 +00:00
chs
b36d2dee68 copy the athhal glue from Makefile.i386. 2005-06-19 20:28:14 +00:00
chs
187b985918 add ath stuff. 2005-06-19 20:22:26 +00:00
bouyer
15ce68ccd1 Allow compiling a domain0 kernel with vga but without pckbc, and add
console support for USB keyboard. Problem pointed out by Karl Janmar on
port-xen.
2005-06-16 10:58:52 +00:00
bouyer
6b930c6d27 Add support for x86 boot flags:
-s boot single user
-a ask root device
XXX -d is ifdef'd out for now, it cause early panic (no console message).
2005-06-15 22:08:08 +00:00
bouyer
48c16dfe5f xen_shm_size isn't patchable because _xen_shm_vaddr2ma[] is static, so
remove comment saying it is. Pointed out by Jed Davis.
2005-06-12 14:59:48 +00:00
sjg
aa7b975acd Sometimes .BEGIN target is not wanted - eg in sub-make's. 2005-06-07 18:11:34 +00:00
yamt
84ebe3241f - xen_network_handler: fix transmit stall. (re)start transmit
after collecting tx buffers.
- some assertions.
2005-06-06 11:51:41 +00:00
yamt
6976dba3a6 fix a typo (NETIF_TX_RING_SIZE <-> NETIF_RX_RING_SIZE) 2005-06-06 11:51:02 +00:00
yamt
5c8133c87b privcmd_ioctl: remove unnecessary variable shadowing. 2005-06-01 12:56:02 +00:00
yamt
e76114f7e0 appease -Wcast-qual. 2005-06-01 12:05:28 +00:00
yamt
24ca3e95ec sync with i386. (avoid shadowing) 2005-05-31 13:53:15 +00:00
yamt
80d547c255 remove local prototypes of printk. 2005-05-31 12:44:29 +00:00
yamt
457b7ee79b always provide prototype of printk for now. because:
- currently its implementation is always compiled in.
	- there're users which don't honor XENDEBUG.
2005-05-31 12:42:58 +00:00
yamt
bcc5a2379e avoid variable shadowing. 2005-05-31 12:36:56 +00:00
yamt
9a13650e12 constify. 2005-05-31 11:57:13 +00:00
yamt
3a00578853 x86_variable_test_bit: don't remove const qualifier unnecessarily. 2005-05-31 04:34:53 +00:00
christos
f6b4c20f18 s/GENASSYM/GENASSYM_CONF/ so we can use "GENASSYM" as the program name. 2005-05-31 04:03:08 +00:00
chs
b0a8a83e7b remove vestigal {,e}intr{names,cnt} symbols now that vmstat doesn't need them. 2005-05-31 00:45:02 +00:00
chs
94622623d8 in pmap_enter(), preset the mod/ref bits based on the flags argument.
fixes 25640.
2005-05-29 15:56:59 +00:00
bouyer
45d876eaeb Reset the microtime state in inittodr(), so that the next clock tick will
initialise the microtime state again. it was initialised at the first
clock tick before time of day was set. Should fix port-xen/29846.
Also, try harder to call microset() once a second; the clock interrupt handler
can be called more often than HZ in some case.
2005-05-27 22:02:25 +00:00
bouyer
7a5d07454c Always call the xpq_queue*() functions at splvm(), so that it's safe to call
them from interrupt context.
xpq_flush_queue() is called from IPL_NET in if_xennet.c, and
other xpq_queue* functions may be called from interrupt context via
pmap_kenter*(). Should fix port-xen/30153.
Thanks to Jason Thorpe and YAMAMOTO Takashi for enlightments on this issue.
2005-05-26 13:54:43 +00:00
yamt
b0bd23fffb privcmd_ioctl: don't abuse errno for IOCTL_PRIVCMD_INITDOMAIN_EVTCHN.
renumber the ioctl and keep the old one for compatibility.
PR/30027.
2005-05-24 12:07:12 +00:00
bouyer
1e58e4ef41 - There is a possible race condition with the rx->event stuff, causing
event not to be sent when one is needed. Fixing this would require
  one hypercall per packet, instead of one per NB_XMIT_PAGES_BATCH pages.
  It's not worth it, so always send an event at the end of xennetback_ifstart()
- there is no callback mechanism to notify us when a guest has handled
  packets we sent. If we stop transmitting because the ring is full or we're
  out of pages when the ifq is also full, nothing will call
  xennetback_ifstart() again and transmit is stalled. Abuse the watchdog
  to kick the transmit queue once second after an out of ressources
  condition.
2005-05-18 16:19:23 +00:00
bouyer
2d6b318a94 Reorder the receive code to avoid a possible race with the sc_rx->event
stuff, and fix a possible infinite loop in case of ressource shortage.
2005-05-18 16:11:32 +00:00
christos
362a4a0bd5 Yes, it was a cool trick >20 years ago to use "0123456789abcdef"[a] to
implement, xtoa(), but I think defining the samestring 50 times is a bit
too much. Defined HEXDIGITS and hexdigits in subr_prf.c and use it...
2005-05-17 04:14:57 +00:00
yamt
4657218e21 arch/i386/i386/linux_trap.c -> arch/x86/x86/linux_trap.c 2005-05-16 12:05:50 +00:00
bouyer
89e3f91e8d Remove obsolete file missed from the bouyer-xen2 merge.
Pointed out by YAMAMOTO Takashi.
2005-05-12 22:28:54 +00:00
yamt
8595c9071a add no_instrument_function attribute to hypervisor_force_callback
because it's used from mcount.  kernel profiling now works.
2005-05-11 13:53:41 +00:00
yamt
7c723859bb s/ENTRY/NENTRY/ where appropriate. 2005-05-11 13:52:32 +00:00
bouyer
2af19a98f8 Remove some debug printf(), and #ifdef DEBUG some others. 2005-05-10 20:36:01 +00:00
yamt
dfc745b200 include atomic.h for x86_atomic_setbits/clearbits_l. 2005-04-30 08:37:16 +00:00
yamt
0a93637210 xennetback_ifstart: test a correct variable, rather than a function. 2005-04-28 18:28:00 +00:00
yamt
d9e14a772f rename do_event to evtchan_do_event.
the former is too generic name and it actually hides a bug in xennetback.
2005-04-28 18:26:26 +00:00
lukem
3fd1802e62 Move the MI printing of `copyright' to the MD cpu_startup() code
where the printing of `version' is already performed.
This has the benefit of allowing the copyright to be available
via dmesg(8) on platforms which need the `msgbuf' to be setup
in cpu_startup() before printed output is remembered.
2005-04-25 15:02:02 +00:00
yamt
1ceedf04a2 don't use block scope static function decl. found by gcc4. 2005-04-22 14:47:39 +00:00
bouyer
4fe12d1c70 Add polling support to the domain controller. Use this in xencons instead
of relying on the fact that the domain controller is still getting interrupts
when xenconscn_getc()/xenconscn_putc() is called.
Now that polling is fixed, move IPL_CTRL down between IPL_SOFTSERIAL and
IPL_TTY, fixing port-xen/29999 by YAMAMOTO Takashi.
Now that IPL_CTRL is low enouth, remove the softintr stuff from the
domain controller, and call wakeup() directly.

Thanks to YAMAMOTO Takashi and Christian Limpach for feedback and suggestions.
2005-04-20 22:01:24 +00:00
bouyer
6970747e8e 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.
2005-04-20 14:48:29 +00:00
xtraeme
480fde49a6 Fix typo (vitual -> virtual) 2005-04-20 07:59:21 +00:00
bouyer
fe7cc0abe1 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.
2005-04-19 22:14:30 +00:00
bouyer
367b093823 Add sysmon_power attribute to hypervisor, and an handler for CMSG_SHUTDOWN
messages.
Now a NetBSD guest will reboot or shutdown on 'xm shutdown' commands in
domain0.
2005-04-18 21:33:21 +00:00
bouyer
3ffaa46bf7 Remove unused code. 2005-04-18 21:31:03 +00:00
yamt
769b9c4b84 don't unmask an event channel until all interrupts for it are served.
fix problems with shared (physical) interrupts.
2005-04-18 20:23:56 +00:00
yamt
7939b0f6ff make this compilable with IRQ_DEBUG defined. 2005-04-18 20:22:22 +00:00
bouyer
9e2767d248 If VOP_IOCTL fails on the device we're trying to export, return an error
instead of dereferencing a NULL pointer later.
Problem reported by Martti Kuparinen in private email.
2005-04-18 11:41:11 +00:00
bouyer
c6a8468bd3 Remove unused code.
Add support for dynamic attach/detach. Should fix port-xen/29856 by Juan RP.
2005-04-17 22:59:37 +00:00
bouyer
381c7beadd Add a kernel thread to the control interface, to handle deferred callacks
(which may sleep). Fix port-xen/29851 by YAMAMOTO Takashi.
Use config_pending_incr()/config_pending_decr() in if_xennet instead of
busy-looping (which doesn't work any more).
Remove the kernel thread from xbd, which isn't needed any more.
2005-04-17 21:11:30 +00:00
bouyer
c7520961bf 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.
2005-04-17 14:50:11 +00:00
bouyer
b8171ad79a Remove
xenkbc at hypervisor
vga at hypervisor
they have been obsoleted by PCI and ISA support, and don't compile any more.
2005-04-17 14:44:14 +00:00
bouyer
4de6ba366b Remove functions that just call another one.
Inline a function used at only one place.
2005-04-16 23:33:17 +00:00
bouyer
c17413ff3e 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.
2005-04-16 22:49:37 +00:00
yamt
1d12c53188 add files which i forgot to add with arch/x86/x86/bus_dma.c rev.1.21. 2005-04-16 08:53:09 +00:00
yamt
1c9ce81d36 s/foreing/foreign/g
ok'ed by Manuel Bouyer.
2005-04-16 08:49:29 +00:00
yamt
fb4a1ff192 tweak x86 bus_dma code so that it can be used by xen port.
- distinguish paddr_t and bus_addr_t.
  for xen, use bus_addr_t in the sense of machine address.
- move _X86_BUS_DMA_PRIVATE part of bus.h into bus_private.h.
- remove special handling of xen_shm.  we can always grab
  machine address from pte.
2005-04-16 07:53:35 +00:00
yamt
f76348ddee if_xennet: m_paddr is not always valid. 2005-04-14 13:15:48 +00:00
yamt
9e56f2c967 if_xennet: handle MEXTREMOVE correctly. fix pool cache corruption. 2005-04-14 12:37:43 +00:00
yamt
f12efb9990 fix a bug which corrupts runqueue.
when dealing with events, which are handed to xenevt pseudo device,
don't call wakeup(9)/selnotify(9) at too high IPL.  PR/29792.
2005-04-11 12:10:31 +00:00
yamt
108d62f302 xencons_start: retry when queue is full. 2005-04-11 10:48:14 +00:00
yamt
e73431068c don't stamp soft interrupts. 2005-04-11 09:24:04 +00:00
yamt
6b2d8b66a4 merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
  save some resources like pv_entry.  also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
2005-04-01 11:59:21 +00:00
bouyer
f5abf7cc11 Use DEV_STRATEGY() instead of VOP_STRATEGY(). YAMAMOTO Takashi says it's not
safe to use VOP_STRATEGY() from interrupt context.
2005-03-31 13:35:02 +00:00
bouyer
b50ebb2aa2 Merge 1.1.14.3 from yamt-km branch:
We can't write directly to a gdt slot, we need to go though
xen_update_descriptor().

From YAMAMOTO Takashi: this is not a problem in HEAD, because
as the kva for gdt is pageable, when gdt_put_slot1 attempts to modify gdt,
the fault handler allocates and maps a new page for you.
So the kernel doesn't panic, but could leak some memory.
2005-03-28 16:40:41 +00:00
bouyer
13e1355ec4 Remplace __insn_barrier() with x86_lfence() where appropriate.
While here, replace a panic() with a return of error code in xbdback.c.
2005-03-26 21:22:45 +00:00
bouyer
57d0b7f835 Don't assume we're on a uniprocessor system (the hypervisor may be running SMP)
and add "lock;" barrier to avoid instruction reordering in event handlings.
This fix the last issue with event loss I was getting on SMP systems.
2005-03-26 20:00:49 +00:00
yamt
2e2956423c don't bother to allocate gdt slots for tss
as we don't actually use them.
2005-03-25 10:27:03 +00:00
bouyer
83e1dbf7bb npxintr(): this function does the right thing if we don't try to clear
the interrupt latch (which is probably done by the hypervisor, linux/xen
doesn't do it either). Now the "fputest" configure test from pkgsrc/math/yorick
works as expected.
Thanks to Christian Limpach for the hint.
2005-03-20 13:12:59 +00:00
cube
08498f7926 In xennet_ioctl, we need a declaration for sc when debugging macros are
active.  Reported on current-users by Teemu Rinta-aho.
2005-03-18 11:15:40 +00:00
bouyer
23b38e8659 Convert to ether_ioctl(), and claim IFF_SIMPLEX | IFF_MULTICAST.
This allows IPv6 on NetBSD domU.
2005-03-17 22:30:17 +00:00
bouyer
9af95b6ee2 Protect various IRQ and event allocation/deallocations with splhigh().
Print the IRQ used for debug and misdirect events.
2005-03-17 15:32:38 +00:00
bouyer
b3b63c9707 print the IRQ used by the domain controller. 2005-03-17 15:31:17 +00:00
bouyer
3307398997 When handling a defered event, unmasking it isn't enouth, we also need to check
if the corresponding bit needs to be set in evtchn_pending_sel, and eventually
force an upcall (if we got a second event when this one what being handled).
For now to this by calling hypervisor_enable_irq(), this could be rewritten
in inline assembly by someone knowing enouth about i386 assembly :)
2005-03-17 15:30:45 +00:00
bouyer
02e969d512 Avoid loosing upcalls in stipending() by checking evtchn_upcall_pending
with upcalls unmasked.
2005-03-17 15:26:06 +00:00
bouyer
a982855f7e Sync with i386/locore.S 1.33:
Check the passed in address as well as determining the maximum length
using VM_MAXUSER_ADDRESS in copyinstr and copyoutstr.

Problem originally fixed in OpenBSD/i386.
This fix suggested by Charles Hannum (mycroft at netbsd dot org).
2005-03-16 14:52:29 +00:00
bouyer
c0c525e11b Fix stack offset to account for an extra register pushl compared to the i386
version.
Thanks to fvdl@ for confirming I was right on this.
2005-03-16 11:25:03 +00:00
bouyer
407770d89d Add more DIAGNOSTIC checks
fix test of xbdback_map_shm() return value.
2005-03-15 23:39:18 +00:00
bouyer
c3b1622d19 Add some DIAGNOSTIC checks
Protect more stuff with splvm().
2005-03-15 23:37:58 +00:00
bouyer
d8ac66d8b5 Move Xen kernel config files to arch/i386, so that they can be added to
the i386 release process. Make them include archi/i386/conf/GENERIC.local,
like other i386 GENERIC and INSTALL files.
2005-03-11 20:48:24 +00:00
bouyer
b3de8f0978 Define xen devices in i386/conf/majors.i386. This makes sure there won't
be conflics with regular i386 kernels.
2005-03-11 20:44:37 +00:00
bouyer
153285b0bd Properly define NISA and NPCI; cleanup use of NISA and NPCI. 2005-03-11 20:39:39 +00:00
bouyer
45f2a74300 Print the irq used. 2005-03-11 15:51:25 +00:00
bouyer
9375b9c69f Wrap some ISA stuff in DOM0OPS, so that DOMU kernels build again. 2005-03-11 15:50:25 +00:00
bouyer
111fb1ed01 increment couters at the right place, so that deffered interrupts are
accounted too.
2005-03-11 15:48:40 +00:00
bouyer
a4dee0e2b9 The extent allocation was off by one, causing us to use unallocated
kernel VA, and overflow the _xen_shm_vaddr2ma[] array.
2005-03-11 15:47:27 +00:00
bouyer
5ce7842238 Add missing STI() from i386/i386/vector.S 1.15.
This seems to fix the network hang issues I noticed with NetBSD guests
on heavy network I/O.
2005-03-11 15:45:54 +00:00
bouyer
fb78ac6542 Properly track connected/disconnected state, and set IFF_RUNNING only when
in connected state. Avoid a panic when the interface is configured
before being in connected state (e.g. when configured automatically by xend
when a domain is created).
2005-03-11 11:34:32 +00:00
bouyer
145cc1138c Clean up ISA attachement, and do not try to attach it at hypervisor if
it has already been attached at pcib.
2005-03-10 22:10:11 +00:00
bouyer
f7dcd8b304 Report which IRQ is used. 2005-03-10 21:44:31 +00:00
bouyer
bdb48992d1 Bump blkif_pdev_t from 16 to 32 bits, to fix the dev_t problem on NetBSD.
Remove the padding bits from blkif_extent_t, so that the message size doesn't
change. You'll need xentools20-2.0.3nb1 if you upgrade your kernel
(the old tools didn't zero out the padding bits, and a new kernel will
interpret them as part of the device number).
2005-03-10 19:47:08 +00:00
bouyer
82981f9fda - Don't reallocate transmit pages from xennetback_get_xmit_page(), as the
previously-allocated pages may not have been loaned to the remote domain
  yet. Let the called deal with this.
- clean up the TX and RX loops to use less MASK_NETIF_xX_IDX() calls
- When we're done with the queued TX requests, try again in case some new
  ones are available
- avoid leaking a xmit page if we queued NB_XMIT_PAGES_BATCH requests.
- remove dead code.
2005-03-10 17:12:12 +00:00
bouyer
94d162a5c1 Use the same type as xen in the request descriptor.
Change the logic in the request processing loop so that we don't
think the ring is empty when is has BLKIF_RING_SIZE requests.
2005-03-10 17:05:38 +00:00
bouyer
577e77f21d Add some DIAGNOSTIC cheks
Protect the callback queue with splvm()
XXX some debug printf about the callback stuff is left here. This is because
    I've not been able to trigger this condition yet, so I've left them
    until we sure the code works as intended.
2005-03-10 17:02:20 +00:00
xtraeme
840f589aad Add missing #ifdef DDB for db_max_line() 2005-03-10 00:31:48 +00:00
matt
290234fa8a Update to new bus_dma semantics. 2005-03-10 00:20:54 +00:00
xtraeme
d2088067fe Add missing #ifdef DDB, ok'ed by bouyer@. 2005-03-09 23:40:08 +00:00
xtraeme
3c451cf142 Now that GENERIC* kernels are removed, remove references. 2005-03-09 23:24:50 +00:00
bouyer
e9666f30ad 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.
2005-03-09 22:39:19 +00:00
simonb
ff8f0b23c9 Add COMPAT_20 (and COMPAT_16 in some cases) to kernel config files
that didn't have those options but had other earlier compat options.
2005-02-25 13:46:48 +00:00
dsl
1122e62a52 Add FFS_NO_SNAPSHOT - commented out in XEN 2005-02-18 21:12:36 +00:00
dsl
4822cbaae2 Invert FFS_SNAPSHOT to FFS_NO_SNAPSHOT 2005-02-18 21:05:50 +00:00
dsl
05e2f6ebdb Add 'option FFS_SNAPSHOT' to most of the config files.
Commented out for kernels that appear to hace space constraints.
2005-02-11 08:25:53 +00:00
jmc
89f2c62a84 Add opt_scsipi_debug.h to list since compat_linux pulls in scsipi now for sg
driver
2005-02-04 05:59:51 +00:00
jmc
672ed23467 vfr.c is still needed on the trunk or GENERIC doesn't compile... 2005-02-04 05:59:23 +00:00
bouyer
52a37d39ea vfr.c doesn't exists any more. 2005-02-03 21:38:59 +00:00
hannken
d5fbb6936f Add file system snapshots to kernel configs.
- Ffs internal snapshots get compiled in unconditionally.

- File system snapshot device fss(4) added to all kernel configs that
  have a disk.  Device is commented out on all non-GENERIC kernels.

Reviewed by: Jason Thorpe <thorpej@netbsd.org>
2005-01-31 16:54:32 +00:00
rumble
de81c2c878 Sprinkle options UFS_DIRHASH on GENERIC kernels. It's presently
commented out and labeled experimental pending further review and
testing.
2005-01-28 03:19:49 +00:00
cube
ec53a61e98 Add tap(4) support to a random^Wcarefully chosen set of kernel configs.
All those kernels have a line for both tun and bridge, and if either is
commented out, tap is commented out also.  With the exception of i386's
GENERIC_TINY.

XXX:  we _need_ some way of making this more simple.
2005-01-17 15:28:51 +00:00
yamt
1207308b90 for in-kernel maps,
- allocate kva for vm_map_entry from the map itsself and
  remove the static limit, MAX_KMAPENT.
- keep merged entries for later splitting to fix allocate-to-free problem.
  PR/24039.
2005-01-01 21:00:06 +00:00
tls
c1545077ff Terminate the domain on RB_HALT, not just on reboot. This avoids looping
around a cngetc() that will never return while "halted", which is rude,
and which also requires domain 0 to not just restart us, but kill us
first.  Suggestion from Michael Kukat (though this change is not the
same as the one he suggested).

Will cngetc() actually return something when running in domain 0 with a
VGA console?  I don't think it will; if it actually does, we should make
this behaviour depend on whether we're in domain 0 or some other domain.
2004-12-14 18:07:42 +00:00
tls
2f6318305f Change confusing name HYPERVISOR_yield to HYPERVISOR_sched_op as suggested
by Michael Kukat.
2004-12-14 17:13:56 +00:00
tls
db47b27974 HYPERVISOR_yield is one of the hypervisor calls that's "overloaded"; it
does different things depending what's in %ebx.

We weren't setting %ebx here *at all*; so we did not get SCHEDOP_yield,
which was what was wanted; so unpredictable things happened, notably
immediate return to the NetBSD idle loop, in other words spinning on CPU.
Definitely not cool!

Michael Kukat caught this one and suggested this fix on port-xen.
2004-12-13 19:33:56 +00:00
jmc
d33fb8436c Fix some improper casts now that b_count is an int 2004-12-10 20:05:05 +00:00
christos
142373a47b dkvar.h now needs bufq.h, and now xen compiles again. 2004-12-10 18:54:08 +00:00
christos
78db5aa65d catch up with field name rename. 2004-12-10 18:53:43 +00:00
christos
d0f26be538 Just when I thought it was all working... Unfortunately cpu.h defines
clockframe -> intrframe, but that is included too late, because this
file includes systm.h and it is in the path of including systm.h. Fix
it by not including <systm.h>; it was only needed for the panic() calls
which I have disabled, since they look more like debugging calls to me.
Also add forward struct declaration for trapframe.
2004-12-10 18:51:15 +00:00
christos
d4ea0343bc don't use va_list here; use _BSD_VA_LIST_ because we could be included
before va_list is defined. This is common practice for kernel header
files (syslog.h)
2004-12-10 18:49:02 +00:00
christos
174c6b074b Move the disable_intr and enable_intr functions from xenfunc.h to cpufunc.h,
because the x86/intr.h needs them and does not include xenfunc.h. Including
xenfunc.h in cpufunc.h is a clear lose because xenfunc.h needs a boatload
of include functions in order to compile.
2004-12-10 18:47:52 +00:00
christos
30fc143afa Add COMPAT_BSDPTY to the rest of the config files. 2004-11-10 17:54:02 +00:00
christos
eec07087aa Add COMPAT_BSDPTY on all the kernels that have COMPAT options. 2004-11-10 17:25:21 +00:00
jmc
97b060e9aa This needs u16/u32/u64 defined if it's going to include internals (otherwise
it has to load hypervisor.h which has all sorts of other problems assuming
_KERNEL). Provide the defs before including hypervisor-if.h and then turn
them off afterwards (ala the same as hypervisor.h does
2004-11-10 02:52:11 +00:00
yamt
05f25dcc2a move buffer queue related stuffs from buf.h to their own header, bufq.h. 2004-10-28 07:07:35 +00:00
yamt
c0ebe301d7 don't reference kernel_lock directly. 2004-10-23 21:27:33 +00:00
thorpej
dc2f2fbe74 Centralize the declaration of booted_device and booted_partition. 2004-10-23 17:07:37 +00:00
thorpej
42b8fac3b8 Move boot device detection code from i386 and amd64 ports to x86_autoconf.c.
Rename i386_alldisks and x86_64_alldisks to x86_alldisks, adjust other
references to compensate.
2004-10-20 04:20:05 +00:00
tls
849c42925b Changes from Christian Limpach to improve timekeeping on NetBSD/xen by
actually adjusting the time correctly (calling hardclock as needed, not
just blindly every time Xen schedules us) based on Xen's idea of the
time in the shared page.

Xen source repo change info:
 ChangeSet
   2004/09/22 13:47:22+01:00 cl349@freefall.cl.cam.ac.uk
   Fix time.

 netbsd-2.0-xen-sparse/sys/arch/xen/xen/clock.c
   2004/09/22 13:47:21+01:00 cl349@freefall.cl.cam.ac.uk +28 -3
   Don't call hardclock on spurious timer interrupt and call hardclock
   for missed interrupts.

 netbsd-2.0-xen-sparse/sys/arch/xen/conf/XEN
   2004/09/22 13:47:21+01:00 cl349@freefall.cl.cam.ac.uk +0 -1
   Don't need custom HZ value any longer.

: ----------------------------------------------------------------------
2004-09-23 02:24:22 +00:00
yamt
d2fe4b34bb move some per-cpu data definitions to MI place so that they can be modified
without touching all ports.  discussed on tech-kern@.
2004-09-22 11:32:02 +00:00
skrll
f7155e40f6 There's no need to pass a proc value when using UIO_SYSSPACE with
vn_rdwr(9) and uiomove(9).

OK'd by Jason Thorpe
2004-09-17 14:11:20 +00:00
tls
74ec9a5fcc Actually mix samples into the kernel RNG pool. There's a buglet here: all
disk samples are reported as belonging to the first disk.
2004-09-15 04:55:21 +00:00
jdolecek
3ea04717bf do not include "compat/aout/files.aout", COMPAT_AOUT is soon to be removed 2004-09-14 16:51:57 +00:00
manu
6e3c639957 IPv4 PIM support, based on a submission from Pavlin Radoslavov posted on
tech-net@
2004-09-04 23:29:44 +00:00
drochner
46289e1fef Phase out the use of a string as first "attach args" member to control
which bustype should be attached with a specific call to config_found()
(from a "mainbus" or a bus bridge).
Do it for isa/eisa/mca and pci/agp for now. These buses all attach to
an mi interface attribute "isabus", "eisabus" etc., and the autoconf
framework now allows to specify an interface attribute on config_found()
and config_search(), which limits the search of matching config data
to these which attach to that specific attribute.
So we basically have to call config_found_ia(..., "foobus", ...) where
such a bus is attached.
As a consequence, where a "mainbus" or alike also attaches other
devices (eg CPUs) which do not attach to a specific attribute yet,
we need at least pass an attribute name (different from "foobus") so
that the foo bus is not found at these places. This made some minor
changes necessary which are not obviously related to the mentioned buses.
2004-08-30 15:05:15 +00:00
jdolecek
64969161df use uvm_grow() to update stack segment size on stack page fault instead
of MD code
2004-08-28 17:53:00 +00:00
tls
f2621c88af Set the system clock (via Xen) in resettodr(), if domain 0.
This has a couple of beneficial effects:

1) The TOD time will be preserved across boots, as one would expect.

2) Newly-started VMs will get the correct time according to domain 0.
   Previously, since we never set the time back to Xen, each VM would
   get the uncorrected system clock time, never even seeing any
   changes made since the current startup.

I don't understand how XenoLinux slaves the other domain's clocks to
the Xen "wall clock" time that we're setting here, so I haven't even
tried.  But now we can run ntpd in each domain without a huge offset
at boot caused by never updating the wall clock time at all...
2004-07-16 22:36:33 +00:00
atatat
f68a9f1ff2 Add "options SYSCTL_INCLUDE_DESCR" to a lot of configs, but commented
out in most of them.
2004-07-15 03:53:44 +00:00
abs
bd8eb3b5ed Add (commented out) ALTQ options to all GENERIC-like files 2004-06-26 07:32:05 +00:00
jmc
84fafa3db5 Ignore errors on some rm -rf's for platforms that aren't quite
POSIX compliant
and return errors on r/o source (FreeBSD) for -rf. Fixes PR#25022
2004-06-21 18:20:08 +00:00
christos
c22e4ed8cd ptm is now mandatory, depends on pty, and can be disabled with -DNO_DEV_PTM 2004-06-18 15:02:29 +00:00
christos
0399e839cf Add pseudo-device ptm on all the generic flavored kernels. 2004-06-16 15:07:39 +00:00
cl
0ebd762347 cleanup low-level bit mangling code 2004-06-14 13:55:52 +00:00
thorpej
e33c2bb5d5 Add the %MAKEOPTIONSAPPEND token at the end of the file, after the
common Makefile.kern.inc has been included.
2004-06-04 04:45:49 +00:00
cl
c489489b14 - increase number of receive buffers
- handle case where last receive buffer is used
2004-05-14 14:23:35 +00:00
cl
4dd8e2b2cf use relative links: using $S fails if $S is relative to another dir
than the one where it's used
2004-05-14 14:07:46 +00:00
cl
885c0b6fc9 ``build.sh -m xen-i386 release'' now builds a release for NetBSD/xen
for i386.  The resulting release consists of:
- NetBSD/xen for i386 kernel, loader and docuemntation
- NetBSD/i386 userland sets
2004-05-12 16:56:41 +00:00
cl
ba728d7531 Avoid overrun problems with the indexes of the slots in the
communication rings.
2004-05-10 01:39:39 +00:00
cl
5359887820 Reboot machine when hypervisor signals "die" event. 2004-05-07 23:05:30 +00:00
cl
977bfc3501 Add support for domain0 operations:
- access to all physical memory
- access to hypervisor traps from userland
- setup/config Xen's network routing/firewall rules
2004-05-07 15:51:04 +00:00
cl
d877f23fb5 add support for hot-add/-remove of block devices 2004-05-07 14:15:11 +00:00
cl
8e658015da replace rdr6/ldr6 with the corresponding hypervisor traps 2004-05-07 14:01:33 +00:00
cl
e03778cac9 cleanup debugging code 2004-05-07 13:56:48 +00:00
cl
175b0c3bf7 check for AST on return from event handler to userland 2004-05-07 13:52:37 +00:00
cl
f61d1b4cce fix lazy fpu state saving 2004-05-07 13:48:32 +00:00
cl
2745d2d566 add missing break 2004-05-02 20:38:35 +00:00
cl
79d1a31951 Move struct xen_netinfo into include/xen.h so that xen12load compiles again. 2004-04-26 23:54:42 +00:00
cl
f720882cf0 Rework the physical<->machine memory mapping: offset physical addresses
by 0x100000 (above the I/O Memory "hole") leaving all physical addresses
below unused, don't perform phys<->mach mapping for addresses below 0x100000
or beyond the real hardware's physical memory.

-> /dev/mem works now as expected and X works in domain0.
2004-04-26 22:05:04 +00:00
cl
f184e73cf0 Add mouse support. 2004-04-26 19:44:54 +00:00
cl
b21e228a58 Add support for i386_iopl. 2004-04-25 23:46:07 +00:00
cl
63ccbaf08a Move some of the context switching code into a C function. 2004-04-25 19:01:27 +00:00
cl
b336bf8532 Add memory barriers. 2004-04-25 18:30:55 +00:00
cl
1408a99dbe Select first disk device as boot device if no boot device is selected
from the command line.
2004-04-25 14:40:02 +00:00
cl
a9154d4a78 Don't attach vga and keyboard if the domain is not privileged.
Also cleanup print command if attachment fails.
2004-04-25 00:24:08 +00:00
cl
8d5b657eb1 Add sysctl nodes for Xen disk cookies used by domain creation tools. 2004-04-24 21:55:37 +00:00
cl
f53151522e Enable keyboard and vga display as console when running as domain-0. 2004-04-24 21:45:58 +00:00
cl
5c7586f0e5 Add keyboard support and wscons config options. 2004-04-24 21:33:32 +00:00
cl
428e3dcc56 remove trailing empty lines 2004-04-24 21:01:37 +00:00
cl
44e8720ec9 Add vga display support. 2004-04-24 20:58:59 +00:00
cl
8e6ccbacfb Allow the block device driver to impersonate wd/sd/cd devices. This allows
for most system seamless migration from a NetBSD/i386 setup to a NetBSD/xen
setup without changing /etc/fstab or creating additional device nodes.
2004-04-24 20:05:49 +00:00
cl
122ad5af2a Make bus_space map machine addresses instead of physical addresses. 2004-04-24 19:43:53 +00:00
cl
6d328d297e Let event_set_handler set the void * argument to event handlers. 2004-04-24 19:32:37 +00:00
cl
fb658556ac Make bus_space map machine addresses instead of physical addresses. 2004-04-24 19:18:01 +00:00
cl
4c5f9e53a1 Make kernel command line parsing support additional keywords without
having to change existing code which calls the parser.
2004-04-24 18:55:02 +00:00
cl
fb65e916fb Consistently use xencons for eveything reffering to Xen's virtual console.
rename arch/xen/xen/console.c -> arch/xen/xen/xencons.c
2004-04-24 18:24:14 +00:00
cl
d843f649c6 Add ``hypervisor at mainbus'' and attach all devices provided by the
hypervisor to it instead of mainbus.
2004-04-24 17:45:38 +00:00
cl
ef3c59b551 add __KERNEL_RCSID 2004-04-24 17:41:49 +00:00
cl
edf6d721c7 Add ``hypervisor at mainbus'' and attach all devices provided by the
hypervisor to it instead of mainbus.

rename arch/xen/i386/hypervisor.c -> arch/xen/i386/hypervisor_machdep.c
2004-04-24 17:35:27 +00:00
cl
2b115ed1d8 Catch up with recent src/sys/dev/dksubr.c change (1.11 -> 1.12) which
prevents us from processing multiple bufs during 1 *start call.  We now
rely on dk_start calling us repeatedly as long as there are bufs on the
queue.
2004-04-24 16:47:29 +00:00
cl
a01e0b0219 parse bootdev parameter for partition and set booted_partition accordingly 2004-04-21 18:06:51 +00:00
cl
ff6c26a333 - setup vfr rules when running as domain-0
- patch ethernet address if running as domain-0 so that arp can work

also include bpfilter.h to get NBPFILTER
2004-04-21 17:36:59 +00:00
cl
3ba9d3ae38 don't crash when changing/adding ip addresses 2004-04-21 12:43:43 +00:00
cl
b5acdb9f14 cleanup debugging printf's 2004-04-21 12:14:45 +00:00
cl
c705011fd6 Loader which allows booting NetBSD as domain0 guest OS. 2004-04-17 23:20:37 +00:00
cl
17292d12b3 use nanoseconds since boot counter for delay routine 2004-04-17 21:49:55 +00:00
cl
9a39f88e1e add block device driver 2004-04-17 12:56:26 +00:00
cl
e688fd0596 sync with arch/i386/i386/pmap.c:
1.172/yamt
- keep cr3 register and its copy in TSS synchronized.
- defer LDTR loading as well as cr3.
2004-04-17 12:53:27 +00:00
cl
1cfcb16460 - microtime support
- don't report cpu speed in startrtclock()
2004-04-17 12:50:45 +00:00
cl
e22637e9aa report cpu speed correctly 2004-04-17 12:47:38 +00:00
cl
8bde79bdaa - fix event dispatching for event 0
- use struct trapframe instead of struct pt_regs
2004-04-17 12:46:42 +00:00
cl
9f3568420d call HYPERVISOR_exit on reboot 2004-04-11 00:44:15 +00:00
cl
d145eca4fb catch up with arch/x86/x86/intr.c
1.15/kochi
use designated initializer for struct pic initializers.
just for readability.

update the xenev_pic initializer as well
2004-04-11 00:18:29 +00:00
cl
2bdade5a16 - remove pmap_kenter_ma prototype here
- xennet? is an interface not a driver (boot message)
2004-04-11 00:00:43 +00:00
cl
1eec38f848 get the time from Xen 2004-04-10 23:50:23 +00:00
cl
9ce2a8f441 add prototype for pmap_kenter_ma 2004-04-10 23:47:24 +00:00