Commit Graph

94 Commits

Author SHA1 Message Date
cegger 5bed9654a4 Finish preparation to new interface.
New interface not yet used by default. It needs some testing first.
2008-11-13 18:44:51 +00:00
cegger 32c1f8c732 Nuke last parameter from mpaci_scan_apics() and mpbios_scan().
It is unused.
2008-11-09 14:24:14 +00:00
cegger 4b9b87ae5b Link cpus in the order they are attaching and not in inverse order. 2008-11-06 19:29:46 +00:00
rmind 8f1873ea3b - Avoid the race with CPU online/offline state changes, when setting the
affinity (cpu_lock protects these operations now).
- Disallow setting of state of CPU to to offline, if there are bound LWPs,
  which have no CPU to migrate.
- Disallow setting of affinity for the LWP(s), if all CPUs in the dynamic
  CPU-set are offline.
- sched_setaffinity: fix invalid check of kcpuset_isset().
- Rename cpu_setonline() to cpu_setstate().

Should fix PR/39349.
2008-10-31 00:36:22 +00:00
cegger c479884027 change nfs boot behaviour to automatically try next boot method if boot information are incomplete to succeed.
That way, it is possible combine static and dhcp boot:
  For example, to boot diskless you can specify the nfs-server and the rootpath statically. All other information will be taken via dhcp.

Patch has been presented on port-xen, tech-kern and tech-net:
http://mail-index.netbsd.org/port-xen/2008/10/24/msg004488.html
http://mail-index.netbsd.org/tech-kern/2008/10/24/msg003255.html
http://mail-index.netbsd.org/tech-net/2008/10/24/msg000864.html

No comments, no objections.
2008-10-27 10:58:22 +00:00
jym 4f26afe701 - rename init_events() to events_init(), to better reflect netbsd semantics
- change unbind_[pv]irq_from_evtch() so that they now return the event
channel the [PV]IRQ was bound to. It reflects the opposite behaviour of the
bind_[pv]irq_to_evtch() functions.

- remove xenbus_suspend() and xenbus_resume() prototypes, as they are not
used anywhere else, and will conflict with the xenbus pmf(9) handlers.

- make start_info aligned on a page boundary, as Xen expects it to be so.

- mask event channel during xbd detach before removing its handler (can
avoid spurious events).

- add the "protocol" entry in xenstore during xbd initialization. Normally
created during domU's boot by xentools, it is under domU's responsibility
in all other cases (save/restore, hot plugging, etc.).

- modifications to xs_init(), so that it can properly return an error.

Reviewed by Christoph (cegger@).
2008-10-24 21:09:24 +00:00
cegger 5cbbf5c20d findroot(): set booted_device also when specifying a network device to bootdev.
Useful for booting with root on nfs.
2008-10-24 16:37:25 +00:00
cegger 7f01a821b9 struct device * -> device_t 2008-10-24 16:26:07 +00:00
cegger 2de31871b9 introduce two macros: xendomain_is_dom0() and xendomain_is_privileged(). Use them. 2008-10-21 15:46:32 +00:00
bouyer 6004aef42d Implement the arch-dependent p2m frame lists list. This adds support for
'xm dump-core' for NetBSD domUs.
From Jean-Yves Migeon (jean-yves dot migeon at espci dot fr)
2008-09-16 19:55:31 +00:00
tron 0f256b9d59 Compile NetBSD/amd64 kernels with "-Wextra". Patches contributed by
Juan RP in PR port-amd64/39266.
2008-09-05 13:37:24 +00:00
bouyer 6523980087 printf()->aprint_debug_dev() to match x86/cpu.c 2008-08-22 10:25:58 +00:00
drochner 54745077e8 Remove "struct device" from "struct pic", where it was only real
for ioapics and faked up for others. Add it to "struct ioapic_softc"
for now, until device/softc get split.
This required all typecasts between "struct pic" and "struct ioapic_softc"
to be replaced, I hope I got them all.
functionally tested on i386, compile-tested on xen, untested on amd64
2008-07-03 14:02:24 +00:00
bouyer 802c7519a2 Raise ci_idepth (and switch to interrupt stack on i386) becore calling
xenevt_event().
2008-07-01 18:49:20 +00:00
bouyer 42f814d7d2 spllower(): return immediatly if ci->ci_ilevel <= nlevel, as the asm
versions do.
2008-07-01 18:44:50 +00:00
ad 06c343ac94 vm_page: put TAILQ_ENTRY into a union with LIST_ENTRY, so we can use both. 2008-06-04 12:41:40 +00:00
ad 2839301d21 Add a 'known_mpsafe' argument to intr_establish(). 2008-05-30 19:03:10 +00:00
ad 788aa3a3b0 Give it a private X86_MAXPROCS def. XXX 2008-05-28 12:48:21 +00:00
bouyer 02ac2b8d02 Add a KASSERT(): Xspllower() will reenable interrupts, so make sure it's
not wrong to do so.
2008-05-25 16:09:30 +00:00
bouyer c8e9dd1af4 G/C dead code: remove now-unused softintr-related code. 2008-05-24 15:10:50 +00:00
bouyer e0180214c9 call x86_cpu_idle_init(), avoid null function pointer call (cpu_idle()) when
scheduling starts.
cleanup printfs of vcpu
2008-05-16 17:20:01 +00:00
ad bfff830416 Fix typo. 2008-05-11 16:25:46 +00:00
ad b698c03c2c Don't reload LDTR unless a new value, which only happens for USER_LDT. 2008-05-11 16:23:05 +00:00
ad 3cd3c8ccbc Stop using APIC IDs to identify CPUs for software purposes. Allows for
APIC IDs beyond 31, which has been possible for some time now.
2008-05-11 15:59:50 +00:00
ad f674d9678b Share cpu.h between the x86 ports. 2008-05-11 15:32:20 +00:00
ad c5fb1571ad Update xen for identcpu changes. 2008-05-11 15:02:34 +00:00
ad 95a272a377 Make xen build after tsc changes. 2008-05-10 16:27:57 +00:00
joerg a790b941e6 Make cpu_idle a macro calling a function pointer on x86.
Select the Xen idle routine for Xen, mwait if supported by the CPU and
it is not AMD and halt otherwise. As reported by Christoph Egger,
AMD Barcelona keeps the CPU in C0 state with MWAIT, contrary to HLT,
which uses C1 and therefore much less power.
2008-05-09 18:11:28 +00:00
cegger c92d850bb3 AMD's APM Volume 2 says 'All control registers are 64bit in long mode'.
Fix the CR0 prototype to match this (the asm implementation is correct though).
OK ad
2008-04-30 00:16:30 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
cegger a9291fce0d keep up with x86/x86/cpu.c, rev. 1.33:
Gracefully handle a condition where apic id >= X86_MAXPROCS rather than panicing.
2008-04-24 20:44:02 +00:00
cegger 20161b7289 Access Xen's vcpu info structure per-CPU.
Tested on i386 and amd64 (both dom0 and domU) by me.
Xen2 tested (both dom0 and domU) by bouyer.
OK bouyer
2008-04-21 15:15:33 +00:00
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 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
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 a9cd17640d Add missing __KERNEL_RCSID() 2008-02-17 14:03:16 +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
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
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
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