Commit Graph
9189 Commits
Author SHA1 Message Date
Juergen Gross 2411017e28 libxc: Enable cpuid performance counter leaf for HVM
In HVM domains the usable performance counters can be checked
automatically only, if cpuid leaf 0x0000000a is accessible.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-09-15 15:26:07 +01:00
Olaf Hering 1f9d04fb02 xenstored: allow guest to shutdown all its watches/transactions
During kexec all old watches have to be removed, otherwise the new
kernel will receive unexpected events. Allow a guest to reset itself
and cleanup all of its watches and transactions.

Add a new XS_RESET_WATCHES command to do the reset on behalf of the
guest.

(Changes by iwj: specify the argument to be a single nul byte.  Permit
read-only clients to use the new command.)

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-09-15 11:08:05 +01:00
Ian Jackson dcbc297aea tools: Revert seabios and upstream qemu build changes
These have broken the build and it seems to be difficult to fix.  So
we will revert the whole lot for now, and await corrected patch(es).

Revert "fix the build when CONFIG_QEMU is specified by the user"
Revert "tools: fix permissions of git-checkout.sh"
Revert "scripts/git-checkout.sh: Is not bash specific. Invoke with /bin/sh."
Revert "Clone and build Seabios by default"
Revert "Clone and build upstream Qemu by default"
Revert "Rename ioemu-dir as qemu-xen-traditional-dir"
Revert "Move the ioemu-dir-find shell script to an external file"

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-09-14 11:38:13 +01:00
Stefano Stabellini cee3fd7bb8 Clone and build Seabios by default
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-09-13 10:30:09 +01:00
Stefano Stabellini 9233be8d2c Clone and build upstream Qemu by default
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-09-13 10:29:14 +01:00
Stefano Stabellini 145854fa0d Rename ioemu-dir as qemu-xen-traditional-dir
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-09-13 10:27:53 +01:00
Stefano Stabellini 088276d615 Move the ioemu-dir-find shell script to an external file
Add support for configuring upstream qemu and rename ioemu-remote
ioemu-dir-remote.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-09-13 10:27:20 +01:00
Olaf Hering 5b6fdcc0d8 xenpaging: use batch of pages during final page-in
Map up to RING_SIZE pages in exit path to fill the ring instead of
populating one page at a time.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
2011-09-13 10:25:32 +01:00
Ian Campbell d7d2447395 hvmloader: don't clear acpi_info after filling in some fields
In particular the madt_lapic0_addr and madt_csum_addr fields are
filled in while building the tables.

This fixes a bluescreen on shutdown with certain versions of Windows.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reported-by: Christoph Egger <Christoph.Egger@amd.com>
Tested-and-acked-by: Christoph Egger <Christoph.Egger@amd.com>
2011-09-13 10:22:03 +01:00
Kaushik Kumar Ram eab869a86a Add missing 'break' statement.
Without the 'break', assigning a pci device to a PV guest results in an abort,
since the code always falls through to the default abort case in the switch
statement.

Signed-off-by: Kaushik Kumar Ram <kaushik@rice.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-08-26 14:58:41 +01:00
Ian Campbell 027f58b0ac hvmloader: relicense hvmloader xenbus implementation under more
liberal terms.

This code is a great example of a simple xenbus implementation and we
would like to reuse it in projects with non-GPLv2 license
(specifically in this case SeaBIOS which is GPLv3).

I picked the license from extras/mini-os/COPYING (A two clause BSD
style license) since mini-os exists for much the same purpose.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Keir Fraser <keir@xen.org>
2011-08-10 14:43:34 +01:00
Ian Jackson b406d93c61 Revert 23757:f5176c177b99 "xenstored: allow guests to reintroduce themselves"
This patch seems to have been applied by mistake, despite adverse
comments on the list and a lack of an appropriate ack.

Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-08-09 17:48:16 +01:00
Keir Fraser ab6e985fae hvmloader: Move init_vm86_tss() back into common code.
It is not BIOS specific.

Signed-off-by: Keir Fraser <keir@xen.org>
2011-08-09 11:33:40 +01:00
Olaf Hering 2346303a42 xenstored: allow guests to reintroduce themselves
During kexec all old watches have to be removed, otherwise the new
kernel will receive unexpected events. Allow a guest to introduce
itself
and cleanup all of its watches.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
2011-08-09 08:53:40 +01:00
Keir Fraser 9f16877252 hvmloader: Enable SCI in QEMU has it disabled.
When booting a Windows guest, the OS report an issue with the ACPI (in
a BSOD). The exact issue is "SCI_EN never becomes set in PM1 Control
Register." (quoted from WinDbg help).

So this patch enables the flags SCI_EN if it is not yet enabled.

Reported-by: Tobias Geiger <tobias.geiger@vido.info>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
2011-07-28 15:40:54 +01:00
Keir Fraser 487f749f0f hvmloader: Allow default response to be specified to xenstore_read().
Signed-off-by: Keir Fraser <keir@xen.org>
2011-07-25 14:21:13 +01:00
Keir Fraser d31b9a4e40 hvmloader: Formatting cleanups.
Signed-off-by: Keir Fraser <keir@xen.org>
2011-07-25 14:09:41 +01:00
Keir Fraser 62d1e95e70 hvmloader: Replace bios_relocate hook with bios_load hook
Used by OVMF BIOS handler.

Signed-off-by: Bei Guan <gbtju85@gmail.com>
Signed-off-by: Keir Fraser <keir@xen.org>
2011-07-25 13:57:49 +01:00
Keir Fraser 2e5a0460d5 hvmloader: Declare get_hvm_info_table/get_shared_info as const funcs.
The compiler can perform CSE on their call sites.

Signed-off-by: Keir Fraser <keir@xen.org>
2011-07-23 09:57:04 +01:00
Keir Fraser 1123bdf3b9 hvmloader: Remove bogus and unused RESERVED_MEMSIZE decl.
Signed-off-by: Keir Fraser <keir@xen.org>
2011-07-23 09:56:13 +01:00
Keir Fraser dc21926aff hvmloader: New functions mem_hole_alloc() and mem_hole_populate_ram().
These can be used by BIOS-specific handlers to set up memory regions
as required by their firmware payload.

Use mem_hole_alloc() to allocate properly reserved space for the
shared-info-page mapping. The old location conflicts with space
required for the OVMF BIOS (support for which is work in progress).

Signed-off-by: Keir Fraser <keir@xen.org>
2011-07-23 09:43:47 +01:00
Roger Pau Monne b74ae3bf63 xend: remove PCI device listing from NetBSD, since it's Linux
specific code.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
2011-07-23 08:58:37 +01:00
Jan Beulich ec029aaa9a add privileged (dom0) kernel feature indication
With our switching away from supporting 32-bit Dom0 operation, users
complained that attempts (perhaps due to lack of knowledge of that
change) to boot the no longer privileged kernel in Dom0 resulted in
apparently silent failure. To make the mismatch explicit and visible,
add dom0 feature flag that the kernel can set to indicate operation as
dom0 is supported.

Due to the way elf_xen_parse_features() worked up to now (getting
fixed here), adding features indications to the old, string based ELF
note would make the respective kernel unusable on older hypervisors.
For that reason, a new ELF Note is being introduced that allows
specifying supported features as a bit array instead (with features
unknown to the hypervisor simply ignored, as now also done by
elf_xen_parse_features(), whereas here unknown kernel-required
features still keep the kernel [and hence VM] from booting).

Introduce and use elf_note_numeric_array() to be forward
compatible (or else an old hypervisor wouldn't be able to parse kernel
specified features occupying more than 64 bits - thanks, Ian!).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-07-23 08:49:15 +01:00
Keir Fraser f2cca23a87 hvmloader: Switch to absolute addressing for calling hypercall stubs.
This is clearer and less fragile than trying to make relative calls
work. In particular, the old approach failed if _start was not
== HVMLOADER_PHYSICAL_ADDRESS. This was the case for some modern
toolchains which reorder functions.

Signed-off-by: Keir Fraser <keir@xen.org>
2011-07-20 15:02:16 +01:00
Keir Fraser 30191ad44f hvmloader: Remove hard tabs from source files.
Signed-off-by: Keir Fraser <keir@xen.org>
2011-07-20 14:52:16 +01:00
Wei Liu 1b86994afe libxl: clean up trailing whitespaces in code.
Commit exactly the results of running
   find \! -iname '*.txt' -type f -print0 | xargs -0 perl -p -i.bak -E 's/\s+\n/\n/'

Signed-off-by: Wei Liu <liuw@liuw.name>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed: Ian Jackson <ian.jackson@eu.citrix.com>
2011-07-19 16:02:36 +01:00
Wei Liu b2c448b55c libxl: enabling upstream qemu as pure pv backend.
This patch makes device_model_{version,override} work for pure pv
guest, so that users can specify upstream qemu as pure pv backend
other than traditional qemu-xen.

This patch also adds device_model_args_{pv,hvm} options for pv and
hvm guest respectively.

Internally, original libxl__create_xenpv_qemu allocates a new empty
dm_info (struct libxl_device_model_info) for every xenpv qemu created.
Now the caller of libxl__create_xenpv_qemu is responsible for
allocating this dm_info.

Signed-off-by: Wei Liu <liuw@liuw.name>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-07-19 15:47:14 +01:00
Ian Campbell 22480b967b libxl: Keyed unions key off an enum instead of an arbitrary expression
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2011-07-18 14:52:30 +01:00
Ian Campbell 9949c1ba69 libxl: use libxl_domain_type enum with libxl__domain_suspend_common
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2011-07-18 14:52:30 +01:00
Ian Campbell c9a87ccb1f libxl: specify HVM vs PV in create_info using libxl_domain_type enum
Since libxl_init_build_info now needs an error return and a ctx (to
log to) switch all libxl_init_*_info to have an int return and a ctx.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2011-07-18 14:52:30 +01:00
Ian Campbell bd3454b651 libxl: specify HVM vs PV in build_info using libxl_domain_type enum
Also caught one place (in libxl__domain_restore_common) which used
info->u.hvm.pae even if !hvm. (fortunately the value was unused in
xc_domain_restore).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2011-07-18 14:52:30 +01:00
Ian Campbell 27ca29fb0a libxl: replace libxl__domain_is_hvm with libxl__domain_type
New function returns a libxl_domain_type enum.

Add LIBXL__DOMAIN_IS_TYPE helper macro.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2011-07-18 14:52:30 +01:00
Ian Campbell 7831601070 libxl: Give the HVM domain type the name "HVM"
This is generally used in the Xen universe, rather than "FV" which is
not used elsewhere.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2011-07-18 14:52:29 +01:00
Roger Pau Monne 259fa32558 xend NetBSD init script: fixed problem when restarting xend
When restarting xend, the rc.d script was unable to find the pid of
the running xend, so no process was restarted.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-07-18 14:38:31 +01:00
Christoph Egger fd14a1943c nestedsvm: Support TSC Rate MSR
Support TSC Rate MSR and enable TSC scaling for
nested virtualization.

With it, guest VMs don't need take #VMEXIT to calculate a translated
TSC value when it is running under TSC emulation mode.

I measured native performance of the rdtsc instruction
in the l2 guest with xen-on-xen and both host and
and l1 guest run under TSC emulation mode.

TSC scaling just needs MSR emulation and correct tsc offset
calculation to be done and thus can be emulated also on older
hardware. In this case rdtsc instruction is intercepted and
handled by the host directly and safes the cost of a full
VMRUN/VMEXIT emulation cycle.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2011-07-16 09:23:22 +01:00
Ian Campbell 68b5b85595 libxc: remove obsolete comment.
Seems to predate Xen 3.0...

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2011-07-16 09:18:45 +01:00
Keir Fraser 3f3d4fd3b5 xen/libxc: Clean up pv_cpuid switch statements.
Signed-off-by: Keir Fraser <keir@xen.org>
2011-07-16 09:09:46 +01:00
David Vrabel 508424df09 xen/libxc: set CPUID topology leaf as unsupported for PV guests
The result of a CPUID Extended Topology Enumeration leaf for PV guests
is invalid as the level in ECX is ignored.  This can cause some guests
to loop endlessly when trying to enumerate the topology.

Since the physical topology isn't useful to PV guests set the topology
leaf as unsupported.

Guests affected include Linux kernels prior 2.6.32 where a workaround
was applied ("xen: mask extended topology info in cpu",
82d6469916c6fcfa345636a49004c9d1753905d1).

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
2011-07-16 09:05:45 +01:00
Roger Pau Monne 2e8644e1d9 tools: xencommons NetBSD init script: Multiple bugfixes and improvements
Added a cleanup of the xenstore database, to purge old entries,
prevented the restart of xenstore and set Domain-0 name.  Also
replaced the sleep 5 (wait for xenstore to come up) with the method
used in the linux init script.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-07-15 18:22:03 +01:00
Ian Campbell c57de7d5ae xl: log domain suspension.
Other shutdown reasons all end up saying something useful while
suspend does not. With this patch the log looks like:
  Domain 670 is dead
  Domain has suspended.
  Done. Exiting now

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-07-15 18:13:28 +01:00
Ian Campbell cf5cc0aa31 pygrub: prefer Grub2 to Grub1
If a VM image has grub2 installed it is likely the one we need to be using.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-07-15 18:12:55 +01:00
Roger Pau Monne 22771413fb xenbackendd: fix mistaken treatment of unknown backend (eg console) as VIF/VBD
Fixed a cleanup of a variable used in a loop and added a debug message.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-07-15 18:09:49 +01:00
Ian Campbell 72be5b5baf libxl: add LIBXL_MAC_{FMT,FMTLEN,BYTES}
Modelled after LIBXL_UUID_... (where I also add FMTLEN).

signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2011-07-14 13:24:19 +01:00
Ian Campbell 30c794d5c5 libxl: rename testenum->testidl
I plan to add some non-Enumeration tests.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2011-07-14 13:24:11 +01:00
Ian Campbell 2763c22eba libxl: IDL: bring command line handling in genwrap.py into one place.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2011-07-14 13:22:36 +01:00
Ian Campbell 12073e5a69 libxl: IDL: add helper to generate references to Aggregate type members.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2011-07-14 13:22:36 +01:00
Ian Campbell f5f648c462 libxl: IDL: remove libxl_C_type_of
It's not really adding much...

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2011-07-14 13:22:36 +01:00
Ian Campbell bd7f7849f2 libxl: IDL: refactor code to massage a type into a function argument
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2011-07-14 13:22:36 +01:00
Ian Campbell 48db030b86 libxl: IDL: handle generation of pass-by-reference arguments.
Up until now everything with a destructor function happened to be
pass-by-reference so the current code worked but this will not be the case for
*_to_string and *_to_json. Put some infrastructure in place and use it.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2011-07-14 13:22:36 +01:00
Ian Campbell 2cbaaf0d42 libxl: IDL: s/anonynous/anonymous/
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2011-07-14 13:22:36 +01:00