Commit Graph
21806 Commits
Author SHA1 Message Date
Ian Jackson 214abecaa3 xl: start numbering vifs from 0
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-07-14 16:46:49 +01:00
Ian Jackson 6a8f8977a1 libxl, xl: support running bootloader (e.g. pygrub) in domain 0
Much of the bootloader interaction (including the Solaris and NetBSD
portability bits) are translated pretty much directly from the python
in tools/python/xen/xend/XendBootloader.py

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-07-14 16:45:38 +01:00
Ian Jackson 2587d9aa4e libxl: add function to attach/detach a disk to/from the local VM
Useful if you need to read a guest filesystem (e.g. pygrub).

I'm not overly thrilled with the implementation WRT tap interfaces,
particularly WRT to detach. I was unable to find a way to get at the
paramters necessary to call tap_ctl_destroy so I assumed for now it
that is OK to assume that the tap device is going to be wanted for the
actual domain at some point in the immediate future and hence there is
no pressing need to destroy it.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-07-14 16:44:18 +01:00
Ian Jackson 108be15853 libxl: support mapping files rather than carrying paths around
This will allow us to map and then unlink the file and therefore
delete the process on process exit or explicit unmap.

Using the mmaped versions of these files required rewriting build_pv
to use the xc_dom builder functionality directly rather than through
the xc_linux_build "compatibility layer". (The status of the
xc_linux_build interface as a compatibility layer seems a bit dubious
since all existing callers use it but if anything is going to replace
it then libxl seems like the likely candidate).

I'm not thrilled with the definition of the maps lifecycle. This could
be solved by adding a helper function to explicitly free the toplevel
structure.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-07-14 16:43:49 +01:00
Ian Jackson adb8dd8440 libxl, xl: exec xenconsole in current process, defer decision to fork to caller
Use this to run xenconsole as the foreground process and move the
connection to the console in the "create -c" case early enough to be
able to view output from the bootloader. This behaviour is consistent
with how both "xm console" and "xm create -c" operate.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-07-14 16:40:33 +01:00
Ian Jackson df9760236b libxl: fix typo in comment
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-07-14 16:40:09 +01:00
Ian Jackson bba3b1da6e libxl: add libxl_strdup convenience function
Use in preference to libxl_sprintf(..., "%s", "...")

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-07-14 16:39:43 +01:00
Ian Jackson 1304d52120 libxl: add printf attribute to libxl_xs_write and fixup resulting warnings
There is an unfortunate warning for the empty format string by default
which I workaround by adding -Wno-format-zero-length.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-07-14 16:38:47 +01:00
Ian Jackson 87f759dea0 xenconsole: do not exit if a pty device is missing
This can just mean we have raced with the bootloader exiting and if we
continue we will likely see the real domain console show up.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-07-14 16:36:47 +01:00
Ian Jackson dc04fe42de pygrub: introduce easier to parse output format
libxl would rather like to parse the output of pygrub. Rather than
implement an SXP parser in libxl add a --output-format option to
pygrub which can select an alternative, simpler to parse,
format. Available formats are:
    sxp:	current SXP output format;
    simple:	simple key+value output with \n separating item ( for
		debugging). key and value are separated by a single
		space (and key therefore cannot contain a space);
    simple0:	as simple but with \0 as a separator;

Also add --output-directory to allow temporary files to be placed
somewhere other than /var/run/xend/boot.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-07-14 16:36:23 +01:00
Ian Jackson c89747d2e9 tools/ocaml: add the missing license file that all OCaml libs refer to
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-07-14 16:32:47 +01:00
Ian Jackson 85bd32d908 xl: default timer_mode to 1
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-07-14 16:31:59 +01:00
Ian Jackson c8be2ccfa9 tools/misc/xenpm: provide core/package cstate residencies
According to Intel 64 and IA32 Architectures SDM 3B Appendix B, Intel
Nehalem/Westmere processors provide h/w MSR to report the core/package
cstate residencies.Extend sysctl_get_pmstat interface to pass the
core/package cstate residencies, and modify xenpm to output those
information.

[tools part of the patch]

Signed-off-by: Wei Gang <gang.wei@intel.com>
2010-07-14 16:30:42 +01:00
Ian Jackson 8929f81d2c tools/misc/xenpm: fix get-cpu-topology
fix get-cpu-topology

Signed-off-by: Wei Gang <gang.wei@intel.com>
2010-07-13 19:34:48 +01:00
Ian Jackson d524f866ca tools/ocaml: Properly adjust fields in ocaml structure to match the C layer.
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-07-13 19:28:13 +01:00
Ian Jackson e94b5fc097 tools/ocaml: add a simple logger to the ocaml bindings
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-07-13 19:27:50 +01:00
Ian Jackson e4f42ed7ec tools/ocaml: register the ocaml exception so it can be used at the C level.
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-07-13 19:27:33 +01:00
Ian Jackson 59135ebd28 tools/debugger/gdbsx: enabled by only x86
The changeset 21752:29e545151078 breaks ia64, since gdbsx supports
only x86.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
2010-07-13 19:08:48 +01:00
Keir Fraser ddf3a0035f x86: optimize this_cpu()
Besides the .text space savings of over 2.5k on x86-64 (1.5k for
x86-32) this removes a load (plus a lea on x86-64) from various
frequently executed code paths, and finally provides a reason (other
than legibility) to prefer this_cpu() over per_cpu() in all places
where smp_processor_id() isn't being called anyway.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-07-13 18:17:28 +01:00
Keir Fraser d0a3c6c7a1 [IOMMU] Debug info for AMD IOMMU event log
Print out the event log entry content for debug purposes.
Additionally, when IOMMU reset event log (due to event log overflow),
we should print out the event log content for debugging.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
Signed-off-by: Wei Wang <wei.wang2@amd.com>
2010-07-13 18:13:33 +01:00
Keir Fraser 917335d8b3 x86: Avoid assumptions about C struct layouts from asm code.
Largely this involves avoiding assumptions about 'struct cpu_info'.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-07-13 18:12:15 +01:00
Keir Fraser f65bd343b0 sysctl: Another clarification re. max_cpu_index.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-07-12 18:39:18 +01:00
Keir Fraser 2bdeb12ffb sysctl: Make meaning of max_cpu_index field clearer.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-07-12 18:33:30 +01:00
Keir Fraser 4471167789 x86, pm: provide core/package cstate residencies
According to Intel 64 and IA32 Architectures SDM 3B Appendix B, Intel
Nehalem/Westmere processors provide h/w MSR to report the core/package
cstate residencies. Extend sysctl_get_pmstat interface to pass the
core/package cstate residencies.

Signed-off-by: Wei Gang <gang.wei@intel.com>
2010-07-12 18:30:26 +01:00
Keir Fraser 7d343d0e53 Consolidate MSI-X related definitions
Eliminate redundant ones, fix names (where so far inappropriately
referring to capability structure fields the don't really relate to),
use symbolic names instead of raw numbers, and remove an unusable one.

No functional change intended.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-07-12 10:48:34 +01:00
Keir Fraser b298f3d27f x86 cpufreq: Fix debug=y build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-07-12 10:48:04 +01:00
Keir Fraser f94b08c2f6 x86: allow the MSI-X table to reside beyond 4G even on 32-bit systems
Underlying interfaces allow this, and unduly (and silently) truncating
addresses doesn't seem nice.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-07-12 10:43:57 +01:00
Keir Fraser c507b36485 x86: prevent simultaneous use of MSI and MSI-X
This matches similar checks done in Linux, since no good can come from
a domain trying to enable both MSI and MSI-X on the same device at the
same time.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-07-12 10:43:34 +01:00
Keir Fraser 355938432e x86: fix a benign typo
Just to avoid confusing readers - no functional change.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-07-12 10:43:10 +01:00
Keir Fraser 049723c0de x86/cpufreq: pass pointers to cpu masks where possible
This includes replacing the bogus definition of cpumask_test_cpu()
(introduced by c/s 20073) with a Linux compatible one and replacing
the bad uses with cpu_isset().

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-07-12 10:41:48 +01:00
Ian Jackson 827f7fe627 update QEMU_TAG to 833e7e9a4c95739429dc0c803bbbf2346f9897fd 2010-07-09 18:49:12 +01:00
Ian Jackson ec9afc69fe tools/hotplug: xencommons: xenconsoled tracing
cut and paste error lead to using the xenstored command line syntax
for xenconsoled.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-07-09 18:46:07 +01:00
Keir Fraser c415ceb08e x86 hvm: Add a hypercall to allow HVM PV drivers to insert xentrace records
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-09 17:16:41 +01:00
Keir Fraser b91391491c x86 hvm: Add a new HVMOP to get the current Xen system time
Xen absolute system time, so that it can use SCHEDOP_poll in a
sensible fashion.  HVM PV drivers can't use the normal PV clock
because they might have TSC offsets that hey don't know about.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-09 17:16:03 +01:00
Keir Fraser ecac002b16 iommu: New options iommu=dom-strict and iommu=dom0-passthrough
The former strips dom0 of its usual 1:1 mapping of all memory, and
only provides it with mappings of its own memory, like any other
domain. The latter is a new consistent name for iommu=passthrough.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-07-09 16:45:42 +01:00
Keir Fraser 52b8c95eae iommu: Remove pointless iommu=pv boot option.
Allow devices to always be passed through to PV domains, just as they
can be to HVM domains.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-07-09 15:39:35 +01:00
Keir Fraser fa1c92c8ce Merge 2010-07-09 12:35:58 +01:00
Keir Fraser 0e0a3eacbc hvmloader: customize the SMBIOS strings based on xenstore keys
...written at domain creation time by xapi.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-09 12:34:40 +01:00
Keir Fraser dc6c53ebb6 hvmloader: Add a xenbus frontend so it can read values from xenstore
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-09 12:33:57 +01:00
Keir Fraser d0b9080ba0 trace: Trace emulated RDTSC values
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-07-09 12:28:03 +01:00
Keir Fraser a4151a1aec trace: Reinstate tracing for emulated MSR reads and writes
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-07-09 12:27:45 +01:00
Keir Fraser 9627efc9a8 Eliminate unnecessary NR_CPUS-sized arrays from 't' key handler
Replace them with per-CPU data.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-07-09 12:25:07 +01:00
Keir Fraser 156433ce26 cpufreq: eliminate unnecessary NR_CPUS-sized arrays
Replace them with per-CPU data.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-07-09 12:24:41 +01:00
Keir Fraser 378405e3a8 x86/svm: eliminate unnecessary NR_CPUS-sized arrays
Replace them with per-CPU data.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-07-09 12:24:15 +01:00
Keir Fraser cbc585158f x86/mce: eliminate unnecessary NR_CPUS-sized arrays
Replace them with per-CPU data.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-07-09 12:23:52 +01:00
Keir Fraser 4d0cb9ebfd Makefile: Serialise stubdom build after tools
Currently "make stubdom" on its own fails because it depends on files
being installed by the results of "make tools".  This also means that
in some circumstances a parallel "make tools stubdom" (or "make all")
can fail due to races.  So make "make stubdom" depend on "make tools"
having completed first.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-07-09 12:22:52 +01:00
Keir Fraser 3130f964ba xen: allow HVM save/restore from different cpus
The hardware CPUID-levelling features level the feature flags but
don't change the CPU family/model/stepping.  Relax the HVM restore
check on family/model/stepping to printk but not veto the load, so
that VMs can be migrated between machines that have been
CPUID-levelled.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-09 12:22:35 +01:00
Keir Fraser c13cd8786d xen: allow HVM save/restore from different changesets
Allow HVM save/restore from different changesets of Xen.  The HVM save
records are supposed to be backwards compatible; XenServer
live-migrates between versions of Xen during upgrades.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-09 12:22:00 +01:00
Keir Fraser 3803ac6609 mce: Replace BUG() with a console warning in the MCE handler.
If the hardware reports corrected errors that we didn't see through
the status MSRs, complain on the console but don't BUG() the machine.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-09 12:21:31 +01:00
Ian Jackson 772aebeab9 tools/libxl: implement support for nomigrate option in VM profiles
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-07-08 17:54:42 +01:00