Commit Graph
8613 Commits
Author SHA1 Message Date
kaf24@firebug.cl.cam.ac.uk cbafa2c56b Remove the free_vcpu() interface I added in the preceding
changeset. It makes no sense, since an allocated VCPU
cannot be freed at any arbitrary point because individual
VCPUs are not refcounted.

Instead extend free_domain() slightly so it really does do
the reverse of alloc_vcpu() for every allocated VCPU.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-01-14 23:40:09 +01:00
kaf24@firebug.cl.cam.ac.uk 0ed0e37193 Some refactoring of domain creation/destruction.
Interface name changes:
1. do_createdomain -> domain_create

2. domain_destruct -> domain_destroy

Arch-specific changes:
1. arch_do_createdomain -> arch_domain_create
This function now takes a domain pointer, not a VCPU
pointer! Initialisation of VCPU0 must happen in
alloc_vcpu_struct().

2. free_perdomain_pt -> arch_domain_destroy
This function must undo the work of arch_domain_create

TODO: arch_domain_create() refactoring is not completed
for ia64.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-01-14 23:16:43 +01:00
kaf24@firebug.cl.cam.ac.uk f59958dd82 xc_vcpu_getcontext() can no longer be called before a
VCPU's context has been explicitly initialised. 

Fix all the domain builders to no longer attempt this.
They really don't need to anyhow.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-01-14 22:17:33 +01:00
kaf24@firebug.cl.cam.ac.uk 6294397fba Arch-specific per-vcpu info should be initialised to zero
when allocating a new vcpu structure, not copied from
CPU0's idle VCPU. Especially now that the idle VCPU itself
is dynamically allocated. 

This should fix assertions people have been seeing in
getdomain_info_ctxt() relation to IOPL in eflags.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-01-14 21:26:40 +01:00
kaf24@firebug.cl.cam.ac.uk 7770ed988a Fix 64-bit build with crash_debug enabled.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-01-14 17:05:31 +01:00
kaf24@firebug.cl.cam.ac.uk 360a1871b5 Rename cdb to gdbstub and split it into arch dependent/neutral part.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
2006-01-14 16:58:54 +01:00
kaf24@firebug.cl.cam.ac.uk 843f4eb435 merge 2006-01-14 10:36:40 +01:00
kaf24@firebug.cl.cam.ac.uk b395f5ac6d Fix the issue of system crash in vmx stress test.
There is a path that shadow L2 table is assigned
after it is unshadowed in stress test.

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
2006-01-14 10:35:39 +01:00
kaf24@firebug.cl.cam.ac.uk f2a2bc3248 Merge with xen-ia64-unstable.hg 2006-01-14 01:04:06 +01:00
kaf24@firebug.cl.cam.ac.uk c9a14b06a4 Make all nmi debugkey tracing arch specific.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-01-13 23:41:28 +01:00
djm@kirby.fc.hp.com 180a69c1e2 Work around new nmi code in keyhandler
Signed-off-by: Dan Magenheimer <dan.magenheimer@hp.com>
2006-01-13 14:58:41 -06:00
djm@kirby.fc.hp.com 4b79423778 Leave *_SOFTIRQ definitions to Xen common code
Signed-off-by: Dan Magenheimer <dan.magenheimer@hp.com>
2006-01-13 14:31:00 -06:00
djm@kirby.fc.hp.com 3773da3862 Remove annoying #warning when compiling with CONFIG_XEN_SMP 2006-01-13 14:19:30 -06:00
djm@kirby.fc.hp.com cff39e47eb Fix for !CONFIG_SMP compile
Signed-off-by: Dan Magenheimer <dan.magenheimer@hp.com>
2006-01-13 14:16:44 -06:00
djm@kirby.fc.hp.com 0070cb1f3a Merge 2006-01-13 14:12:24 -06:00
Ian.Campbell@xensource.com 0828aa84f7 Correctly handle dumping a VM86 guest's stack.
If the guest context is VM86 then we need to treat ss:sp as 16 bit
segment:offset rather than 32 bit selector:offset.

Signed-off-by: Ian Campbell <Ian.Campbell@XenSource.com>
2006-01-13 16:56:09 +00:00
djm@kirby.fc.hp.com 542362015e Allow asm-offsets to work with vanilla binutils
Necessary because SHARED_ARCHINFO_ADDR is negative
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2006-01-13 10:38:44 -06:00
djm@kirby.fc.hp.com cafde138a1 correct implementation of flush_tlb_mask needed to reenable CONFIG_SMP
Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
2006-01-13 10:36:47 -06:00
djm@kirby.fc.hp.com 64d8a35871 Make xmexaple.vti support network option too and other small modifications for convenient use.
Signed-off-by Zhang xiantao <xiantao.zhang@intel.com>
2006-01-13 10:25:10 -06:00
djm@kirby.fc.hp.com a6be6177a3 Unused page struct fields commented out.
Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
2006-01-13 10:24:19 -06:00
djm@kirby.fc.hp.com 7f762c3f38 add prototype of guest_cpu_user_regs() which is used by ns16550_poll().
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2006-01-13 10:23:01 -06:00
kaf24@firebug.cl.cam.ac.uk fc5423d8cd Introduce a locking protocol for acquiring the 'scheduler
lock' on a particular VCPU. Since this requires acquiring
the approrpiate per-CPU lock, we must re-check the VCPU's
current CPU binding after the lock is acquired.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-01-13 16:44:04 +01:00
kaf24@firebug.cl.cam.ac.uk c62fffdcdc Fix writable pagetables when a flush happens in a different
domain, which is temporarily made to run on the wrong
pagetables.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-01-13 16:27:45 +01:00
kaf24@firebug.cl.cam.ac.uk f9a0cd1238 Fix up the way we initialise and set the NMI heartbeat
timers. Also, compund updates to APIC ICR and ICR2 registers
must be done with interrupts disabled to ensure local
atomicity.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-01-13 16:09:45 +01:00
Ian.Campbell@xensource.com 82f5d7e034 Debug keyhandlers for triggering an NMI and examine current NMI state.
Add 'N' keyhandler to dump the current per CPU NMI counts and the
current NMI mask/pending status.

Add 'n' keyhandler to trigger an NMI by sending an IPI. For some
reason the destination shorthand for self is not valid when used with
the NMI delivery mode so we send the IPI to our own APIC ID
explicitly.

Signed-off-by: Ian Campbell <Ian.Campbell@XenSource.com>
2006-01-13 14:59:40 +00:00
djm@kirby.fc.hp.com a3b63a0ab6 Enable warnings and fix a few one (those which occur in almost every file).
The next step is to fix warnings one by one.

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
# User tristan.gingold@bull.net
2006-01-13 08:52:05 -06:00
kaf24@firebug.cl.cam.ac.uk 723bbd528f Fix xenbus_cleanup_devices() to cleanup proper subdirectories
of the deleted path, not merely paths mwith matching prefixes.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-01-13 15:22:36 +01:00
Ian.Campbell@xensource.com 8ffaf9c238 Ensure watchdog remains disabled unless enabled on the command line.
Bail out of setup_apic_nmi_watchdog() early if watchdog is not
enabled. Is the watchdog is disabled then increment
watchdog_disable_count to prevent it ever becoming enabled.

Unconditionally call setup_apic_nmi_watchdog() from setup_local_APIC()
so that the above is guaranteed to have occurred before the first call
of watchdog_enable().

Signed-off-by: Ian Campbell <Ian.Campbell@XenSource.com>
2006-01-13 14:09:39 +00:00
Ian.Campbell@xensource.com dd38458519 Fix x86/32 do_iret implementation, fixes VM86 mode.
Do not clobber a freshly restored esp when performing an iret.

Signed-off-by: Keir Fraser <keir@xensource.com>
Signed-off-by: Ian Campbell <Ian.Campbell@XenSource.com>
2006-01-13 11:04:04 +00:00
kaf24@firebug.cl.cam.ac.uk 4c1b84163e Fix non-debug build.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-01-13 11:38:33 +01:00
kaf24@firebug.cl.cam.ac.uk cc00657854 Add a new timer operation kill_timer(). Effectively the
'opposite' of init_timer(), it marks the end of a timer's
lifetime. After this call the timer will not be pending,
its callback handler will not be running, and future calls
to set_timer() will silently fail.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-01-13 01:03:44 +01:00
kaf24@firebug.cl.cam.ac.uk c5c75c2926 Add missing renamed files. Oops.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-01-13 00:16:07 +01:00
kaf24@firebug.cl.cam.ac.uk 8a3652cb7e Rename ac_timer_* interfaces -> timer_*. The ac_ is
meaningless and unnecessary.

Rename rem_timer -> stop_timer.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-01-12 23:39:14 +01:00
kaf24@firebug.cl.cam.ac.uk 4207635014 Simplify vcpu_sleep_sync() and sched_adjdom(). Their
interaction with the scheduler locks was unnecessarily
complicated.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-01-12 23:25:02 +01:00
kaf24@firebug.cl.cam.ac.uk 9b7916cc5e Fix compile warning about uninitialised vars.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-01-12 21:48:51 +01:00
kaf24@firebug.cl.cam.ac.uk 9baabcabfe Update copyright on domain_page implementation. It's been
rewritten from scratch a couple of times now and it's safe
to assert that the original Linux heritage was deleted
long ago.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-01-12 16:10:12 +01:00
kaf24@firebug.cl.cam.ac.uk b1f0161822 More debug print cleanups.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-01-12 15:59:45 +01:00
kaf24@firebug.cl.cam.ac.uk 8a0da1c334 Quieten debug printing on memory_op hypercall. Don't warn
about disallowed multipage allocation attempts.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-01-12 15:44:44 +01:00
kaf24@firebug.cl.cam.ac.uk 6f7a043a6a Re-enable per-cpu cache on map_domain_page(). Fix the
offending caller that broke the vcpu cache (writable
pagetable code kept a mapping outstanding until flush,
which could occur on a different vcpu).

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-01-12 15:43:22 +01:00
kaf24@firebug.cl.cam.ac.uk 6889a045da fixes some compiler warnings due to new types used in
the xenbus.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-01-12 14:27:55 +01:00
kaf24@firebug.cl.cam.ac.uk 71e8ec899a Adds a check to vtpm_manager and vtpm Makefiles to verify openssl and
gmp dev files are installed. If files are missing, Makefile exits with a
message indicating that these tools will not be built, rather than an
error, which prevents Xen from building.

Signed-off-by: Vinnie Scarlata <vincent.r.scarlata@intel.com>
2006-01-12 14:27:20 +01:00
emellor@leeni.uk.xensource.com b85612442b Merged. 2006-01-12 13:20:04 +01:00
emellor@leeni.uk.xensource.com c6aed7c358 8604:a51fcb5de470 introduced a discrepancy between the declaration
and definition of xc_linux_save(). In particular the argument for
the suspend pointer to function was null in one and int in the other.
On inspection, int seemed to be correct, so I went with this.
I also fixed up a few other cosmetic discrepancies.

Signed-Off-By: Horms <horms@verge.net.au>
2006-01-12 13:13:34 +01:00
kaf24@firebug.cl.cam.ac.uk 8f2651280a Fix cpu_affinity memcpy() (bytes not longs!) add add a better
affinity map sanity check to avoid blowing up Xen if no
online cpu is included in the map.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-01-12 12:45:49 +01:00
Ian.Campbell@xensource.com 2c5ceaba04 Fix x86_64 domU build by conditionalizing NMI support on CONFIG_X86_LOCAL_APIC
The NMI handler is not built unless CONFIG_X86_LOCAL_APIC is defined, and 
CONFIG_X86_LOCAL_APIC requires a dom0 build.

Signed-off-by: Ian Campbell <Ian.Campbell@XenSource.com>
2006-01-12 10:37:10 +00:00
kaf24@firebug.cl.cam.ac.uk 8a790edb70 More do_iret() fixes. We need to take care in restoring
EFLAGS that we do not pull in non-zero IOPL, then crash
the domain, and then bug out when dom0 gets vcpu context.
This could otherwise be triggered by a malicious guest.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-01-11 20:14:27 +01:00
kaf24@firebug.cl.cam.ac.uk 5ccd14f4cc map_domain_page per-vcpu cache still seems broken. Disable
while I fix it.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-01-11 20:03:53 +01:00
kaf24@firebug.cl.cam.ac.uk ab8eb5a3ef More code cleanups, mainly to do_iret() implementations.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-01-11 19:44:54 +01:00
kaf24@firebug.cl.cam.ac.uk a5f2116f79 merge 2006-01-11 19:26:03 +01:00
kaf24@firebug.cl.cam.ac.uk a7813c4bba Reassert nmi pending when a nmi handler is registered
if we lost a previous nmi.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-01-11 19:24:43 +01:00