Commit Graph
21832 Commits
Author SHA1 Message Date
Keir Fraser 8bced86016 hvmloader: clear the xenbus event-channel when we're done with it.
Otherwise a later xenbus client that naively waits for the rising edge
could get stuck.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-20 13:42:17 +01:00
Keir Fraser f181642944 gdbsx: Implement missing Makefile rules.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-07-20 11:26:20 +01:00
Keir Fraser bfb32dde4f tools: Update distclean target to remove auto-gen'ed tarballs.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-07-20 11:18:39 +01:00
Keir Fraser e3c0ad6c82 hvmloader: Download gpxe bits via HTTP rather than GIT protocol.
Latter is faster but won't work through all firewall setups.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-07-20 11:09:21 +01:00
Keir Fraser 762599eddf hvmloader: Build GPXE from upstream git repo, latest release tag.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-07-20 10:58:04 +01:00
Keir Fraser deed1aad66 Merge 2010-07-19 18:56:02 +01:00
Stefano Stabellini 965936bc90 More consistent error handling in libxl
Lots of places in libxl return -1 as an error which is inconsistent with
libxl error codes since that is ERROR_VERSION. Also in other places the
xc_* function to implement a command is called but the return value is
either never checked or not passed on.

This patch introduces a new internal function libxl_xc_error() which
maps xc error codes to xl error codes. Callers of libxc functions are
converted to use this when returning error codes back to libxl callers.

Also a bug is fixed where a caller depends on errno being set but is
cleared by cleanup code which calls in to library functions which modify
errno as a side-effect.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
2010-07-19 18:40:09 +01:00
Stefano Stabellini a9c189d680 Implement xl dump-core
Implements dump-core command which is similar to xm dump-core except
that it requires an additional argument which is the target filename.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
2010-07-19 15:33:38 +01:00
Stefano Stabellini 9fc200ae85 make libxl build since 21811
First hunk, I assume is getting the arguments in wrong order on memset.

Second hunk is to kill a compiler warning about mis-use of printf-style
format strings which kills the build on -Werror.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
2010-07-19 15:15:32 +01:00
Stefano Stabellini 1ea482edf8 Actually it's an interrupt descriptor table register :)
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
2010-07-19 15:11:07 +01:00
Keir Fraser ba01489a10 tools: gpxe build fix for NetBSD
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2010-07-19 15:10:20 +01:00
Stefano Stabellini 402ddf4b39 This patch introduces libxl_primary_console_exec: a new libxl function
that finds the domid and console number corresponding to the primary
console of a given vm. The domid might be different from the domid of
the VM and the console number might not be 0 when using stubdoms.
The caller (xl_cmdimpl.c in this case) has to make sure that the stubdom
is already created before calling libxl_primary_console_exec in the hvm
case. In the PV case libxl_primary_console_exec has to be called before
libxl_run_bootloader.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-07-19 12:47:53 +01:00
Stefano Stabellini 6b331584fb execute command by execvp() so can search command in PATH.
Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
2010-07-19 12:22:25 +01:00
Stefano Stabellini 19ea926cbc Improve balloon support for NetBSD.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2010-07-19 12:22:04 +01:00
Stefano Stabellini 1f7a33f7c7 Without this we leak an fd on each domain shutdown and eventually run
out of file descriptors meaning new the console of new domains are not
logged.

Seems to have been accidentally removed in 16638:28921e83000b.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-07-19 12:21:24 +01:00
Stefano Stabellini 870648146f Implement "xl tmem-freeable" to match "xm tmem-freeable".
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2010-07-19 12:20:41 +01:00
Keir Fraser be0ec5b617 Merge 2010-07-16 17:44:04 +01:00
Keir Fraser 41ea432fe0 vtd: Do not update-and-flush an IOMMU PTE if it does not change.
There are cases of identical repeated calls to
iommu_map_page(). Flushing is slow, so it's worth detecting these and
bailing early.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-07-16 17:41:53 +01:00
Keir Fraser 338666b9df iommu: Map dom0 initial allocation in 'dom0-strict' iommu mode.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-07-16 16:19:51 +01:00
Keir Fraser 6518d6c62b x86: use cpuid vector 0xb when available for detecting cpu topology
cpuid leaf 0xb provides extended topology enumeration. This interface
provides the 32-bit x2APIC id of the logical processor and it also
provides a new mechanism to detect SMT and core siblings (which
provides increased addressability).


Signed-off-by: Weidong Han <weidong.han@intel.com>
2010-07-16 13:54:44 +01:00
Keir Fraser b3625d1e2c ACPI: add support for x2APIC ACPI extensions
All logical processors with APIC ID values of 255 and greater will
have their APIC reported through Processor X2APIC structure (type-9
entry type) and all logical processors with APIC ID less than 255 will
have their APIC reported through legacy Processor Local APIC (type-0
entry type) only. This is the same case even for NMI structure
reporting.

The Processor X2APIC Affinity structure provides the association
between the X2APIC ID of a logical processor and the proximity domain
to which the logical processor belongs.

This patch adds 2 new subtables to MADT and one new subtable to SRAT.

This patch also changes x86_acpiid_to_apicid from u8 to u32 for x2APIC
ID, and changes mp_register_lapic to accept 32-bit id. But there are
still some 8-bit apic id hardcode and assumptions in Xen code, it
needs to be fixed in future.

Signed-off-by: Weidong Han <weidong.han@intel.com>
2010-07-16 13:52:18 +01:00
Keir Fraser 1652d36bbe xen: Send the debug VIRQ to guests after the rest of the domain dump is done.
Send the debug VIRQ to guests after the rest of the domain dump is
done. This stops all the 'q' debug-key output getting interleaved with
the debug-virq output from a pv-ops dom0 kernel.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-16 13:51:27 +01:00
Stefano Stabellini 7255b375df Before this patch only log messages with precisely priority
LOG_WARNING (or precisely LOG_DEBUG if -v) would be logged.

xenconsoled only actually logs using LOG_ERR and LOG_DEBUG so for the
most part we would have been logging absolutely nothing up until now.

Linux provides a LOG_UPTO macro but I'm not sure how portable that is
so I have opencoded the list of levels.

Do I get some sort of prize for fixing a bug introduced in 2005?

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-07-16 12:10:56 +01:00
Ian Jackson 8dda1f560d pygrub: look in every partition for something to boot
pygrub: look in every partition for something to boot, in case
the OS installer (SLES 10 sp1 in particular) forgets to mark the
boot partition as active.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: David Markey <admin@dmarkey.com>
2010-07-15 18:18:16 +01:00
Ian Jackson 8582d429a1 xm: Do not check path of kernel if bootloader is specified
When create DomU, if bootloader is specified, 'kernel/ramdisk' will be
used by bootloader when boots DomU. So it is needless to check the
path is existent or not.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2010-07-15 16:32:50 +01:00
Ian Jackson fb1d9a4ad1 gdbsx: update README and remove space in q packet
Newer version of gdb, version 7*, seems to have bug where it is not
parsing thread list from gdbsx properly. Getting rid of the space in
thread list works around it. It's ok with older gdb also.

Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
2010-07-15 16:30:24 +01:00
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