Commit Graph

121 Commits

Author SHA1 Message Date
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
bouyer
305d094b01 Define x86_mfence(). Use it where appropriate. Seems to fix a hang in
the network interface front-end/back-end for me ...
2006-10-15 13:35:15 +00:00
bouyer
f23d3bb7be 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.
2006-09-28 18:53:15 +00:00
bouyer
f99383d432 The Xen folks says everyone should use hypercall call page now, make it so.
Old hypercall call method still still available with
options XEN_NO_HYPERCALLPAGE
but this is disabled by default (xen-3.0.2-2 supports hypercall call page
just fine).
While there add a VIRT_BASE= string in __xen_guest section; from
Bastian Blank on port-xen@.
2006-09-24 18:14:44 +00:00
bouyer
b6ce42d579 Factor out some hypercall code in macros, so that it's easier to change
the way hypercalls are called.
2006-09-24 15:30:14 +00:00
bjh21
e10108c7f2 Nothing in the kernel now tests __HAVE_NWSCONS, so stop defining it everywhere. 2006-09-03 13:51:23 +00:00
bouyer
aeeb0b33ca Some bus_dma(9) fixes for Xen:
- Attempt to gracefully recover from a failed decrease_reservation or
  increase_reservation, by avoiding physical memory loss.
- always store a machine address in ds_addr; this avoids some mistakes
  where machine address would in some case be freed at physical address, or
  mapped as physical address.
2006-08-28 19:58:56 +00:00
dsl
c8da0759cd Fix build of machdep.c with -Os and -O3 2006-08-19 16:06:39 +00:00
yamt
467e0c9853 "xm shutdown" support for xen3. ok'ed by Manuel Bouyer. 2006-08-11 13:22:43 +00:00
yamt
897bdba2b9 implement a simple NETTXF_csum_blank/NETRXF_csum_blank workaround
so that we can talk with linux guests at least.
just fill checksum field of received packets if the flag is set.
maybe should be revisited later.
2006-07-12 15:02:15 +00:00
bouyer
2613e19eec Add a 'base' argument to xenbus_read_ul, so that we can read number is base
other than 10.
2006-06-25 16:46:59 +00:00
bouyer
b063155744 Allow xen_shm_map() to map multiple grants in a contigous virtual address
space.
While here garbage-collect unused xen_shm_vaddr2ma()
2006-06-25 15:18:53 +00:00
kardel
d377d3f58a no timecounters yet - provide a local types.h 2006-06-07 22:45:21 +00:00
bouyer
d1d1596e1e Convert xen_shm_map() and xen_shm_unmap() to the Xen3 grant table
interface.
2006-05-25 21:26:20 +00:00
bouyer
237137c875 Add needed framework for backend drivers.
As we want some control on the name the backend driver will have we
can't use autoconf(9) here. Instead backend drivers registers to
xenbus, which will call a create callback when a new device is there.
Backend devices won't have a "struct device" in xenbus, use a void pointer
instead.
2006-05-23 21:07:56 +00:00
dogcow
fedf1d0f26 For whatever reason, GCC4 really really wants extern struct decls to be
after the struct is defined.
2006-05-15 20:57:53 +00:00
elad
8ccb6c9341 integrate kauth. 2006-05-14 21:55:09 +00:00
bouyer
c96226e3fa Resolve conflicts from xen-3.0.2-2 import 2006-05-07 10:56:37 +00:00
bouyer
388f0b9508 Import non-DPLd Xen public headers from Xen 3.0.2-2 2006-05-07 10:54:39 +00:00
bouyer
c8a960c560 Add dom0 operation support for Xen3. Probably buggy, but it's enouth to have
xend and xenstored starting; xm info and xm list works.
2006-05-07 10:18:28 +00:00
jld
2aa6d50864 Suspend/resume support for xbd -- keep enough info on live I/O to replay.
The rest of suspend/resume isn't there yet, but the parts that touch
regular usage have been tested.  Discussed on port-xen on 2006-04-25;
approved by bouyer@.
2006-05-05 19:25:26 +00:00
bouyer
aab0004b68 Add support for ACPI in xen-3 dom0 support. We can now boot a xen-3 dom0
kernel with a default xen comamnd line.
2006-04-09 19:28:00 +00:00
bouyer
65b5449cc4 Add NetBSD CVS Id. 2006-04-04 20:30:30 +00:00
bouyer
0c9571be10 Properly handle dynamic attach/detach of device:
- keep a linked list of xenbus_device in the xenbus_infrastructure, and
  keep a pointer to struct device for each xenbus_device
- xenbus_probe_device_type(): check that the device is not already attached
- when we get a frontend_changed callback, call xenbus_probe_device_type()
- When a device changes to state XenbusStateClosed, config_detach() it
  and free the structures.
While there, move xbusd_path[] to the end of struct xenbus_device, and
allocate only the space needed to store the path. Garbage-collect
struct xenbus_driver, it's not needed.
2006-03-26 22:02:57 +00:00
bouyer
2fb45fb442 Get the x86_lfence/x86_sfence right (I hope :) 2006-03-19 00:29:00 +00:00
bouyer
14e4157f2e Add a xenbus_read_ul() which reads a node and convert it to unsigned long.
Make xenbus_switch_state() and xenbus_read_driver_state() do something usefull.
2006-03-16 23:08:08 +00:00
bouyer
aceceafca7 Implement watch of xenstore nodes, and install watches for otherend'state
node.
2006-03-15 22:20:06 +00:00
bouyer
f0dc72de02 Implement granttables operations. 2006-03-06 20:30:40 +00:00
bouyer
636656c40d Xenbus public functions 2006-03-06 20:29:52 +00:00
bouyer
8508673945 Mark ring indexes as volatile. 2006-03-06 20:00:51 +00:00
bouyer
2e57249e9d Use x86_lfence/x86_sfence instead of linux wmb()/mb() 2006-03-06 20:00:06 +00:00
bouyer
9c7083dfa0 Implement MULTI_update_va_mapping() and MULTI_update_va_mapping_otherdomain(),
which fills in multicall arguments for __HYPERVISOR_update_va_mapping
and __HYPERVISOR_update_va_mapping_otherdomain dealing with
differences between i386 and amd64.
2006-03-06 19:57:31 +00:00
bouyer
fa2d4a51e2 Add xen_atomic_cmpxchg16(), which exports the cmpxchgw instruction to C. 2006-03-06 19:55:47 +00:00
bouyer
198cdcf732 Correct arguments for __HYPERVISOR_set_timer_op 2006-03-06 19:54:50 +00:00
bouyer
e4e15333af Add x86_sfence() for symetry, which is just a __insn_barrier() here. 2006-03-06 19:54:14 +00:00
perry
fbae48b901 Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
2006-02-16 20:17:12 +00:00
yamt
3bf197127a merge xen pmap_enter, pmap_enter_ma, pmap_remap_pages.
ok'ed by Manuel Bouyer.
2006-01-23 20:19:08 +00:00
bouyer
87d63b6c1c Remove files not needed in the kernel. 2006-01-20 18:17:59 +00:00
bouyer
8f162b7ed8 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.
2006-01-15 22:09:51 +00:00
bouyer
5e035a6853 Import Xen3 public headers from xen-3.0-testing as of 7 Jan 2006. 2006-01-15 21:42:21 +00:00
bouyer
56b1a39e10 Move if_xennet private functions and structures from if_xennetvar.h
to if_xennet.c
2006-01-08 14:45:41 +00:00
perry
2d542ba1f8 inline -> __inline 2005-12-28 19:09:29 +00:00
perry
50a256a3a0 __asm__ -> __asm
__const__ -> const
__inline__ -> inline
__volatile__ -> volatile
2005-12-24 23:23:59 +00:00
perry
5f1c88d70d Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:06:46 +00:00
christos
95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
yamt
73ad976942 simplify memory layout. 2005-11-22 06:18:01 +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
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