Remove the spin on VCPUF_running from context_switch().
It doesn't work because we already set VCPUF_running
locally, and the scheduler should not pick another CPU's
VCPUF_running VCPU anyway, since it mustn't modify the
processor field.
Instead just add a simple assertion to the scheduler to
ensure the scheduling algorithm is not picking an
inappropriate VCPU.
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.
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.
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.
Allow asm-offsets to work with vanilla binutils
Necessary because SHARED_ARCHINFO_ADDR is negative Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
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.
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.
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>
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>
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.
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.
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).
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.
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.
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.
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.
Add a per-vcpu lock-free cache of mappings to map_domain_page.
Improve mapping slot search by using a free bitmap.
Removed map_domain_pages (multi-page mapping functionality).
Noone uses it, nor should they use it in future,
Pass NMIs to DOM0 via a dedicated callback, Xen/Linux x86_64 support.
Register our NMI handler with Xen. Do an iret via the hypervisor
whenever the return CS is > RING0.
Add include/asm-xen/asm-x86_64/nmi.h as a Xen modified copy of
include/asm-x86_64/nmi.h in order that we can implement
get_nmi_reason() in a manner suitable for Xen.
Signed-off-by: Ian Campbell <Ian.Campbell@XenSource.com>
Pass NMIs to DOM0 via a dedicated callback, Xen x86_64 support.
Handle NMI interrupts and dispatch to dom0 on x86_64.
Renames the switch_to_user hypercall to iret. Extend the semantics to
include returns to guest/kernel if CS indicates ring 1. Retain the old
semantics of returning to guest/user if CS indicates ring3.
Plumb in nmi_op hypercall to generic code.
Signed-off-by: Ian Campbell <Ian.Campbell@XenSource.com>
Fixed ia64 compilation issues and also change xen/ia64 to use one single,
multi-cpu, idle domain created dynamically correspondingly. Only
difference is vcpu0 of idle domain is still built at compilation phase,
due to some code copied from Linux requiring that.
Update map_domain_page() documentation (mappings may only be
be used within the mapping vcpu). Implement TLB flush
filtering on the per-domain mapcache.
Proactively check for NULL strings passed into xc_linux_build. Either DTRT
or return error if detected. A NULL cmdline, for example, would currently
generate a segfault.
Add VMX guest quick start into Xen 3.0 user manual.
Signed-off-by: Yongkang You <yongkang.you@intel.com> Signed-off-by: Alan C. Oehler <alan@xensource.com> Signed-off-by: John L Villalovos <john.l.villalovos@intel.com> Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Made network-bridge script work on ALL systems missing ifup/down.
This is done by defining ifup/down both to 'false' when they're
missing; then instead of attempting to parse the IP params from
the kernel command line, we get them from 'ip' instead. So this
works even with (for example) ip=dhcp on the kernel command line.
Also made a few minor syntax changes (in particular, replaced "=="
with "=", and ">&foo" with ">foo 2>foo") so this works with more
limited shells.
Proactively check for NULL strings passed into xc_linx_build. Either do
the right thing or return error if detected. A NULL cmdline, for example,
would currently generate a segfault.
Extend the xc_linux_save interface to take a callback function for handling the
suspend, and push the printf("suspend") out of xc_linux_save and into xc_save.
This means that xc_linux_save can be used without the xc_save wrapper if
desired.