Commit Graph
15431 Commits
Author SHA1 Message Date
Keir Fraser 9ba645fd7d By default allow differences between Xen and XenLinux public headers.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-27 21:28:19 +01:00
Keir Fraser 4706b975b0 Small sysctl cleanups.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-27 21:27:51 +01:00
Keir Fraser 3f96f21796 xenconsoled: improve robustness of logfile handling
Check the 'log_reload' on every iteration of the select() loop, not just when
select() returns EINTR. This is because the log reload signal may have
iterrupted a syscall other than select & thus without this change  we
might miss the reload signal.  The second change makes us process the
hypervisor logs on every iteration of the loop, not just upon timeouts.
This is because if a guest VM were consistently sending some log message
and < 1 second period, the select() would never hit the 1 second timeout
and thus never process the HV logs.

Thanks to Markus Armbruster for pointing out both these edge cases

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2007-06-27 21:05:54 +01:00
Steven Hand 3bc33badf2 Add new sysctl to return runtime information about physical CPU utilization.
Signed-off-by: Steven Hadn <steven@xensource.com>
2007-06-27 21:01:08 +01:00
Keir Fraser cee3908623 vmx: Exclude VMX_PROCBASED_CTL2 from set of MSRs a VMX guest is allowd
to access.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-27 20:56:25 +01:00
Keir Fraser 8d2566713d vmx: Make use of VMX_INSTRUCTION_INFO field to obtain the segment
register of OUTS

Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-27 20:53:57 +01:00
Keir Fraser 748338bb07 hvm: Sync SVM CR4 handling with VMX.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-27 20:17:54 +01:00
Keir Fraser 78e2e202db Fix VMX guest can't boot after MCE enabled.
Signed-off-by: Xin Li <xin.b.li@intel.com>
2007-06-27 20:08:21 +01:00
Keir Fraser 5ba704e717 x86: remove unused nopaging_gdt_descr
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
2007-06-27 20:00:50 +01:00
Keir Fraser 76d84e88e0 Remove incorrect __init prefixes
Following functions can be __init in Linux, however shouldn't
in Xen. __print_IO_APIC is called by keyhandler, while
setup_ioapic_dest is invoked in one platform hypercall.

Signed-off-by Kevin Tian <kevin.tian@intel.com>
2007-06-27 19:59:21 +01:00
Tim Deegan 774dab5320 [VMX] Set up GUEST_CR0 as well as CR0_READ_SHADOW when restoring saved
vcpus.  Also simplify the CR3 reload path.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
2007-06-26 17:54:10 +01:00
Steven Hand b1b322eb8b Deinitialize timers before destroying the local apic; this protects us
against a late firing timer callback function (e.g. hpet_timer_fn) which
tries to access local APIC state.

Signed-off-by: Steven Hand <steven@xensource.com>
2007-06-26 12:40:37 +01:00
kfraser@localhost.localdomain 837eceb667 ioemu: Fix ifdef __x86_64__
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-25 16:52:39 +01:00
kfraser@localhost.localdomain e5417ae6f9 i386: Simplify failsafe callback handling.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-21 21:36:26 +01:00
kfraser@localhost.localdomain d127010888 Fix x86/64 failsafe callback handling.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-21 18:02:50 +01:00
kfraser@localhost.localdomain 5408361cc6 hvm svm: No guest access to SVM MSRs.
Signed-off-by: Mats Petersson <mats.petersson@amd.com>
2007-06-21 15:17:31 +01:00
kfraser@localhost.localdomain 8146857104 x86: machine check exception handling
Properly handle MCE (connecting the exisiting, but so far unused
vendor specific handlers). HVM guests don't own CR4.MCE (and hence
can't suppress the exception) anymore, preventing silent machine
shutdown.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-21 15:10:04 +01:00
kfraser@localhost.localdomain d8b6ccfe2d x86: clear guest's EFLAGS.RF after emulating instructions
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2007-06-21 14:03:57 +01:00
kfraser@localhost.localdomain 0b3c29f7fd i386: remove NMI deferral by instead making sure selector registers
are always stored/restored correctly despite the potential for an NMI
(and also MCE, with a subsequent patch) to kick in.

The idea is to always check values read from %ds and %es against
__HYPERVISOR_DS, and only store into the current frame (all normal
handlers) or the outer-most one (NMI and MCE) if the value read is
different. That way, any NMI or MCE occurring during frame setup will
store selectors not saved so far on behalf of the interrupted handler,
with that interrupted handler either having managed to read the guest
selector (in which case it can store it regardless of whether NMI/MCE
kicked in between the read and the store) or finding __HYPERVISOR_DS
already in the register, in which case it'll know not to store (as the
nested handler would have done the store).

For the restore portion this makes use of the fact that there's
exactly one such code sequence, and by moving the selector restore
part past all other restores (including all stack pointer adjustments)
the NMI/MCE handlers can safely detect whether any selector would have
been restored already (by range checking EIP) and move EIP back to the
beginning of the selector restore sequence without having to play with
the stack pointer itself or any other gpr.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-21 12:13:06 +01:00
kfraser@localhost.localdomain 5a07d757fb libxenguest: Add another range check to dom restore.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-21 12:10:01 +01:00
kfraser@localhost.localdomain 284d8c4881 libxenguest: Add missing range-check on count field read from a domain
save/restore file.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-21 09:47:39 +01:00
kfraser@localhost.localdomain f09e6f8062 Rename ddc_info -> vbeddc_info in interface header.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-20 19:31:37 +01:00
kfraser@localhost.localdomain cc324a58e1 Add hypercall function for retrieving EDID info
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-20 19:24:08 +01:00
kfraser@localhost.localdomain 50e71c0768 Remove stray semi-colon in macro.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-20 19:08:45 +01:00
kfraser@localhost.localdomain a45afa4a5d x86: Add hypercall function for retrieving EDD info.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-20 18:43:04 +01:00
kfraser@localhost.localdomain d40dbdf39f tools: Adjust tools' path calculation.
I'm suggesting this change to make another tiny step towards the
ability to run the tools e.g. out of the build tree (so that multiple
different Xen versions can co-exist without the requirement to
re-install the respective version with each boot).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2007-06-20 17:07:15 +01:00
kfraser@localhost.localdomain a1f868f2a3 x86: early exception enhancement
In order to at least have some minimal debuging capabilities when Xen
crashes really early, dump out registers and stack contents in a raw
form.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-20 17:05:48 +01:00
kfraser@localhost.localdomain 7000b6bdac tools: Create directory /var/lib/xen at install target.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-20 16:58:21 +01:00
kfraser@localhost.localdomain 084df3b9f7 kernel command line extension
In order to allow appending to the dom0 command line even with boot
loaders that only allow editing the kernel (i.e. Xen in our case)
command line, support a '--' separator option.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-20 16:52:01 +01:00
kfraser@localhost.localdomain 1f698f3f9f x86: introduce specialized clear_page()
More than doubles performance of page clearing on not too old
processors (SSE2 supported).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-20 16:18:03 +01:00
kfraser@localhost.localdomain 340643863b Use clear_page() wherever possible/reasonable instead of open coded
memset() calls (likewise a few replacements memcpy -> copy_page).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2007-06-20 15:33:14 +01:00
kfraser@localhost.localdomain b7954cc598 Enhance guest memory accessor macros so that source operands can be
pointers to const or arrays.

Only build-tested on ia64, and untested for powerpc (which, however,
is almost identical to ia64, except for an apparent bug in the original
version of __copy_field_{from,to}_guest in that the field offset was
multiplied by the field size).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2007-06-20 15:29:53 +01:00
kfraser@localhost.localdomain 6f23c61e5d x86: Use 64-bit arithmetic in reserve_in_boot_e820().
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-20 15:08:32 +01:00
kfraser@localhost.localdomain 8ac9e21c6a hvm/x86: vendor-specific code can call vendor-specific routines directly
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2007-06-20 15:06:17 +01:00
kfraser@localhost.localdomain 5c3222e9a8 x86/hvm: determine shared info format earlier.
Latch guest shared info format when hypercall page is being set up
rather than during an arbitrarily selected hypercall.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-20 15:03:39 +01:00
kfraser@localhost.localdomain dcc2d386c5 x86: fix early option scanning
Make sure command lines like
... vgaxyz vga=
... console=vga vga=
do not mistakenly ignore the vga= option due to finding 'vga' earlier
on the line.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-20 14:57:49 +01:00
kfraser@localhost.localdomain 7d698de822 Fix xm vcpu-set command for managed domains, to take effect immediately.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-06-20 14:43:41 +01:00
kfraser@localhost.localdomain a705b24a9d hvm: Ensure ioemu sees media-change events even when media filename
remains constant my writing a dummy blank string first.
Signed-off-by: Takanori Kasai <kasai.takanori@jp.fujitsu.com>
2007-06-20 14:41:27 +01:00
kfraser@localhost.localdomain d5efa0e4b7 hvm: Fix ioemu Qcow support.
Normally by default, SIGUSR2 is not blocked, so the signal masks of
SIGUSR2 in all threads is unblocked.

When creating HVM guest, if we use the Qcow format image file, in the
main thread, Qcow uses SIGUSR2 to be notified of the completion of the
request after it issues an AIO request; in tools/ioemu/block.c:
bdrv_read_em(), in some point between bdrv_aio_read() and
qemu_aio_wait(), Dom0 may send a SIGUSR2 to Qemu immediately to
indicate the completion of an AIO request -- since at the moment
SIGUSR2 in main thread is blocked by qemu_aio_wait_start(), the signal
may be delivered to one non-main thread, causing the signal handler of
SIGUSR2 is invoked, then the main thread hangs in
qemu_aio_wait()->syswait()...

This patch blocks SIGUSR2 at the beginning of Qemu's main(), so it
ensures SIGUSR2 is blocked by default when a new thread is created,
then only the threads that use the signal unblock it.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2007-06-20 14:36:11 +01:00
kfraser@localhost.localdomain 9b6d355987 32-on-64: First slot of hidden L4 page directory must start life as zero.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-20 13:39:54 +01:00
kfraser@localhost.localdomain d151a52e74 32-on-64: Fix error path where we fail to successfully switch a guest
into compat mode.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-20 13:38:48 +01:00
kfraser@localhost.localdomain f423003436 32-on-64: Fix error path from memory_op() hypercall.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-20 13:38:22 +01:00
kfraser@localhost.localdomain 19636447b8 hvm: Support injection of virtual NMIs and clean up ExtInt handling in general.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-20 11:50:16 +01:00
Tim Deegan eed63189da [HVM][SVM] flush all entries from guest ASIDs when xen writes CR3.
This makes the assumptions about TLB flush behaviour in the page-type
system and the shadow code safe again, and fixes a corner case of NPT
log-dirty.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
2007-06-20 10:55:37 +01:00
kfraser@localhost.localdomain 2677d3c3f3 x86: retrieve VBE EDID/DDC info independent of used video mode
The code to retrieve this information was protected by a check of a
variable (vbe_version) that would get initialized only when a VESA
mode was selected on the command line.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

At the same time I cleaned up use of 'scratch space' at address
modelist and beyond.

Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-19 18:07:53 +01:00
kfraser@localhost.localdomain bdb957f876 blktap: Add fallback code to blktap for missing poll-on-aio support.
blktap requires a xen specific kernel AIO ABI which has been vetoed by
upstream in favour of another approach. Rather than include this ABI,
Fedora has been carrying a patch which makes tap:aio use a thread to
poll for aio events and notify the main thread via a pipe.

The upstream approach of allowing io_getevents() poll normal file
descriptors via epoll is still progressing:
 http://lkml.org/lkml/2007/1/3/16

but when that does make it upstream, blktap will require significant
re-working to use that approach.

In the meantime, here's a patch which uses the poll-in-a-thread
approach only if AIO poll support isn't available. It also hides the
details behind a simple abstraction and makes both tap:aio and
tap:qcow use it.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2007-06-19 16:32:28 +01:00
kfraser@localhost.localdomain 477ac069bc tools: Allow xendomains to handle domain names >16 characters
The xendomains init script parses the output of "xm list", and
since xm list restricts the length of domains to 16 characters the
xendomain script cannot handle long domain names.

This patch makesit parse the output of "xm list -l" instead.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2007-06-19 16:29:22 +01:00
kfraser@localhost.localdomain 0edf82adb3 ioemu: Assembler memcpy() for x86, and lowest-common-denominator
memcpy() function for all others, avoiding noisy longword copies on
ia64.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-19 16:08:15 +01:00
kfraser@localhost.localdomain 310da2e989 tools: Fix compiler warning.
From: Charles Coffing <ccoffing@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-19 15:55:13 +01:00
kfraser@localhost.localdomain 2e56ad1686 hvm svm: Log into 'xm dmesg' that SVM NPT is enabled.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-06-19 15:39:08 +01:00