Commit Graph

268 Commits

Author SHA1 Message Date
perry
5f1c88d70d Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:06:46 +00:00
yamt
50c06dae27 xennet_softstart: turn "xennet: no mbuf cluster" printf to DPRINTF. 2005-12-15 13:45:32 +00:00
yamt
6b6b3253b2 fix a compilation problem after ktrace-lwp merge. 2005-12-13 08:24:30 +00:00
jld
341dd78856 Make xenevt.c compile after lwp changes; not tested yet. 2005-12-12 22:56:50 +00:00
christos
24ecd917a6 change a_p -> a_l->l_proc [untested] 2005-12-12 20:06:22 +00:00
christos
95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
yamt
30e4cf555e remove xen-specific ddb_trap_hook.
you can use DDB_COMMANDONENTER="tr;sh re" to achive the similar behaviour.
2005-11-26 12:19:53 +00:00
yamt
bc21da4cfb bus_dmamem_map: honour BUS_DMA_NOWAIT. noted by Manuel Bouyer.
bus_space_map: always do NOWAIT allocation as it used to be before yamt-km.

we have too many copies!
2005-11-24 13:08:32 +00:00
yamt
73ad976942 simplify memory layout. 2005-11-22 06:18:01 +00:00
bouyer
c59d1285cc Sync with i386/conf/GENERIC:
- add a buch of PCI storage devices
- add firewire devices
- add some missing PCI network devices
- add serial and parallel PCI adapters
- add lpt0 at isa
- add com1 at isa
  com0 not added for the benefit of serial console users (it will conflicts
  with the Xen kernel).
XXX this means that setups with serial console on com1 will now break with the
default kernel.
Use userconf(4) (add -c to kernel command line) or change your setup to
com0 instead (most bios allows arbitrary mappings of com ports)
2005-11-21 22:15:13 +00:00
jld
55b8d39e63 Correct minor precedence mistakes in updates to pm_stats.wired_count 2005-11-16 22:41:20 +00:00
yamt
4868e1f967 add missing IPL_SOFTXENEVT.
pointed by Hisashi T Fujinaka on current-users@.
2005-11-08 22:57:30 +00:00
yamt
06cf1c7649 copy.S should belong to MD_SFILES, not MD_CFILES. 2005-11-08 01:02:39 +00:00
yamt
443e88c5cf some assym cleanup.
- move copyin and friends from locore.S to their own file, copy.S.
  share it between i386 and xen.
- defparam KERNBASE and kill KERNBASE_LOCORE hack.
- add more symbols to assym.h and use it where appropriate.
2005-11-07 11:42:34 +00:00
yamt
83c44381ee Xsoftnet: remove an unnecessary assignment. 2005-11-07 08:52:07 +00:00
yamt
06085e8f52 - use sys/spl.h.
- add some IPL_ definitions.
2005-11-03 13:06:06 +00:00
yamt
0416d5be24 add splraiseipl(). 2005-10-29 11:07:45 +00:00
yamt
54007a40c0 remove duplicated spllpt(). 2005-10-28 10:34:18 +00:00
yamt
464cf44f6c dksubr: do b_blkno -> b_rawblkno translation earlier so that bufq can uses it. 2005-10-18 00:14:43 +00:00
yamt
aec75b1cc6 - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
  have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
  from sys/bufq.h to sys/bufq_impl.h.
  (is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c.  (not tested)
2005-10-15 17:29:10 +00:00
bouyer
65679198a8 Also remove pkt_next now that packets are not recorded in a per-page list. 2005-10-08 20:23:59 +00:00
bouyer
0e12d49f1c If a domain has more than one interface, a page can hold packets for different
xennetback instances. To support this, more fields from xni_page to xni_pkt.
This would also have the effect to move more code into the
while (!SLIST_EMPTY(&pkt_page->xni_pkt_head)) loop in xennetback_tx_free().
By passing xni_pkt instead of xni_page to xennetback_tx_free we can
avoid the loop, and the xni_pkt_head list completely. There is even a sligh
performance increase if the domU deals with xni_txring->event properly.

Based on comments from YAMAMOTO Takashi.
2005-10-08 20:22:05 +00:00
bouyer
181bca1deb Fix problem pointed out by YAMAMOTO Takashi:
In theory mbufs can have an infinite life time and could block the transmit
ring (as slots are released when the mbuf external storage is freed). To
avoid this, when we're processing the last slot of the ring copy the buffer
and release the slot immediatly.
2005-10-03 22:15:44 +00:00
bouyer
213d74cfef Major improvements to the network backend, leading to a 0-copy transmit and
receive system:
- on the receive side, attach the mapped buffer as external storage
  instead of copying it. As a mapped buffer may not live much longer, we
  have to deal with the fact that one page of buffer may containt several
  packets, and it's not possible to map them several times. Use a hashed list
  to keep track of mapped pages, and use reference counters.
- on the transmit side, when MCLBYTES == PAGE_SIZE, give away the mbuf
  cluster page when possible instead of copying it. Keep a pool of physical
  pages to map in place of the page we give away. When copying, use a
  pool_cache(9) to manage copy buffers (use mclpool_cache when
  MCLBYTES == PAGE_SIZE, otherwise use a private pool/pool_cache) instead
  of a local list. This should reduce the number of hypercalls and MMU
  operations in the copy case as well.
2005-10-02 21:49:23 +00:00
bouyer
8b47a87eb6 Have xennet_start() schedule a software interrupt to defer processing of the
send queue. This give upper layer an opportunity to queue up all available
packets before starting to process them. This reduce the number of interrupt
generated on the backend, and the time spent doing hypercalls in a significant
way.
2005-10-02 21:39:41 +00:00
bouyer
8519a64973 inline 2 trivial functions that are called often (according to profiling
data).
2005-09-20 20:33:53 +00:00
bouyer
0b1f7e4a8c When disconnecting a device, we have to wait for pending I/O before releasing
the ressources (this can lead to a dom0 kernel crash when destroying a domain
with active I/O going). For this, add a refcount to struct xbdback_instance,
and defer CMSG_BLKIF_BE_DISCONNECT reply until refcount is back to 0 (which
means all queued buffers have completed).
Based on patch sent by Jed Davis on port-xen.
2005-09-20 20:29:18 +00:00
yamt
7e71f567e4 include "conf/std". 2005-09-17 09:44:05 +00:00
bouyer
241368ab96 Check that m_copyback() didn't fail. Pointed out by YAMAMOTO Takashi. 2005-09-12 16:30:46 +00:00
yamt
55dd3a28d4 remove no longer used macros. 2005-09-12 12:41:06 +00:00
yamt
8dcf8ba6e2 xennet_start: don't allocate cluster mbufs unless needed. 2005-09-12 12:40:43 +00:00
chs
c36910e9cd remove the part of rev. 1.168 that skips TLB invalidations in pmap_enter().
it's wrong for wired mappings.  fixes PR 29804.
2005-09-11 14:30:31 +00:00
bouyer
4f6680c241 Use MCLGET() instead of local list of buffers. Garbage-collect
struct xennet_txbuf usage.
2005-09-11 13:20:00 +00:00
bouyer
acad751169 Remplace MEXTMALLOC/memcpy with m_copyback. 2005-09-11 11:44:52 +00:00
bouyer
b069bb656c The line number in the PCI interrupt register can be larger than 31 on
some hardware, depending on how Xen set things up. So bump NR_PIRQ from 32
to 256.
2005-09-10 18:24:35 +00:00
bouyer
b75ba03dd4 Add a vm_prot_t parameter to pmap_remap_pages(), and use it for the new PTE
instead to always trying PG_RW and falling back to PG_RO if this fails.
Use uvm_map_checkprot() in IOCTL_PRIVCMD_MMAP and IOCTL_PRIVCMD_MMAP_BATCH
to compute the appropriate vm_prot_t for pmap_remap_pages().
Thanks to Jed Davis for pointing out uvm_map_checkprot().
2005-09-10 18:00:49 +00:00
bouyer
ba9c8cd0c3 Apply patch from Jed Davis, posted to port-xen:
Implement IOCTL_PRIVCMD_MMAPBATCH, as a loop calling pmap_remap_pages().
XXX this should do the MMU operations in batch.
2005-09-10 15:48:10 +00:00
bouyer
8dfe5bc813 Apply patch from Jed Davis, posted to port-xen:
In pmap_remap_pages() new mappings are created (PG_RW|PG_M). When saving
a domain, the hypervisor will refuse to map the foreing pages RW.
As a temporary measure, retry the mapping read-only if PG_RW fails, so that
domain save will work. Also fix the PTP's wire_count if the MMU update
fails (prevent a kernel panic).
2005-09-10 15:46:04 +00:00
bouyer
7558bd0a7c Fix typo reported by Jed Davis on port-xen:
IOCTL_PRIVCMD_GET_MACH2PHYS_START_MFN is a read, not a write.
2005-09-10 15:41:54 +00:00
kleink
aece7a90fd Change the driver open function's conditional for overriding exclusive tty
use from checking the proc's uid to suser(9), and account for the use of
privileges.  Noted by David Holland in PR kern/31126.
2005-09-06 21:40:37 +00:00
bouyer
f60ca60293 Rename _PRIVATE_BUS_DMAMEM_ALLOC_RANGE to _BUS_DMAMEM_ALLOC_RANGE for
consistency with other macros defined in bus_private.h. Pointed out by
YAMAMOTO Takashi.
2005-08-22 11:09:39 +00:00
bouyer
e6a6daf84f Fix a memory leak. Thanks to YAMAMOTO Takashi for the notice. 2005-08-22 11:04:10 +00:00
bouyer
d342a7617e Define a xendevbus atttibute and add it to hypervisor. Use it for xen devices
which attach to hypervisor. This allows to use config_found_ia() instead of
config_found(), instead of relying on the order of which device are
written in ioconf.c.
From Quentin Garnier.
2005-08-21 22:20:28 +00:00
yamt
6788570f66 xen_parse_cmdline:
- use BOOT_FLAG macro.
- allow RB_KDB because it works fine, depending on type of console.
2005-08-21 13:15:43 +00:00
yamt
1a3bee2634 - count if_opackets correctly.
- reflect tx errors to if_oerrors.
2005-08-21 13:12:59 +00:00
bouyer
cd1cc7810a Also properly check the alignement and boundary constraints. 2005-08-20 20:06:24 +00:00
bouyer
0944c0fa9d Deal with the machine address space being non-contigous in bus_dmamem_alloc():
- Define _BUS_AVAIL_END to 0xffffffff, as we don't have an easy way to
  find the upper bound for our machine address space (and this can change
  when we swap pages with the hypervisor).
- implement _xen_bus_dmamem_alloc_range(), which will request a contigous
  set of pages to the hypervisor if the pages returned by uvm_pglistalloc()
  don't fit the constraints.
We can't deal with the low/high constraints yet, because Xen doesn't offer a
way to get pages in a specific ranges of addresses.

Based on patches from Dave Thompson (in private mail), with heavy hacking
by me.
2005-08-20 19:30:37 +00:00
bouyer
54ecd3d8a1 Implement xpq_queue_machphys_update(), which queues a request to
update the machine to physical table (to be used after a
MEMOP_increase_reservation).
2005-08-20 19:20:54 +00:00
yamt
5cb036f6e3 add wedge support to xbd and cgd. 2005-08-20 12:03:52 +00:00
bouyer
41b1abf49b Provide a PCI_MACHDEP_ENUMERATE_BUS to the MI pci system. We can't use
the generic pci_enumerate_bus() in Xen because the hypervisor may
hide the function 0, but give access to other functions of the same device
and pci_enumerate_bus() will stop if function 0 isn't available.
2005-08-19 17:17:53 +00:00