]> xenbits.xensource.com Git - xen.git/log
xen.git
14 years agotools: hvmloader: refactor Makefile to move ROM filenames into variables.
Ian Campbell [Tue, 12 Apr 2011 12:39:56 +0000 (13:39 +0100)]
tools: hvmloader: refactor Makefile to move ROM filenames into variables.

Add an option to use debug Cirrus video BIOS, simply as a convenience.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agotools: hvmloader: split scratch and hypercall addressing from ROMBIOS low heap.
Ian Campbell [Tue, 12 Apr 2011 12:39:22 +0000 (13:39 +0100)]
tools: hvmloader: split scratch and hypercall addressing from ROMBIOS low heap.

Although happen to live at the same physical address their lifespans
do not overlap. The scratch and hypercall spaces are used only within
hvmloader and the same area is reused as a heap within ROMBIOS. But
each is free to make its own decisions about where to place things.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agotools: hvmloader: pass option ROM end address around as a parameter.
Ian Campbell [Tue, 12 Apr 2011 12:38:38 +0000 (13:38 +0100)]
tools: hvmloader: pass option ROM end address around as a parameter.

Reduces the cross talk between ROMBIOS and hvmloader.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agotools: hvmloader: pass SMBIOS location as a runtime parameter.
Ian Campbell [Tue, 12 Apr 2011 12:38:01 +0000 (13:38 +0100)]
tools: hvmloader: pass SMBIOS location as a runtime parameter.

Instead of hardcoding in a header.

Reduces the cross talk between ROMBIOS and hvmloader.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agotools: hvmloader: pass ACPI_PHYSICAL_ADDRESS as a runtime parameter.
Ian Campbell [Tue, 12 Apr 2011 12:37:03 +0000 (13:37 +0100)]
tools: hvmloader: pass ACPI_PHYSICAL_ADDRESS as a runtime parameter.

Instead of hardcoding in a header.

Reduces the cross talk between ROMBIOS and hvmloader.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agotools: hvmloader: split e820 support into its own code module.
Ian Campbell [Tue, 12 Apr 2011 12:36:17 +0000 (13:36 +0100)]
tools: hvmloader: split e820 support into its own code module.

Pass the table address as a paramter to the build function and cause
it to return the number of entries. Pass both base and offset as
parameters to the dump function.

This adds a duplicated e820.h header to ROMBIOS. Since the e820 data
structure is well defined by existing BIOS implementations I think
this is OK and simplifies the cross talk between hvmloader and
ROMBIOS.

Reduces the cross talk between ROMBIOS and hvmloader.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agotools: hvmloader: move ROMBIOS configuration into tools/firmware/rombios/
Ian Campbell [Tue, 12 Apr 2011 12:34:30 +0000 (13:34 +0100)]
tools: hvmloader: move ROMBIOS configuration into tools/firmware/rombios/

Currently rombios and hvmloader are rather intertwined. Separate the
ROMBIOS configuration options out into a ROMBIOS provided file so that
the dependency can become strictly from hvmloader to rombios.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agoremus: fix incorrect error handling for switch_qemu_logdirty in checkpoint code
Shriram Rajagopalan [Tue, 12 Apr 2011 12:28:51 +0000 (13:28 +0100)]
remus: fix incorrect error handling for switch_qemu_logdirty in checkpoint code

c/s 22275: "tools: cleanup domain save switch_qemu_logdirty callback"
introduced a whole bunch of error code fixups. In the process, it also
ended up treating the success return code (0) from
switch_qemu_logdirty as an error and vice versa.

Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
14 years agopassthrough: prevent non-HVM access to HVM-only data
Jan Beulich [Tue, 12 Apr 2011 12:27:27 +0000 (13:27 +0100)]
passthrough: prevent non-HVM access to HVM-only data

Spotted this oversight in c/s 23144:37c4f7d492a4.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoAMD IOMMU: Fix an interrupt remapping issue
Wei Wang [Tue, 12 Apr 2011 12:26:19 +0000 (13:26 +0100)]
AMD IOMMU: Fix an interrupt remapping issue

Some device could generate bogus interrupts if an IO-APIC RTE and an
iommu interrupt remapping entry are not consistent during 2 adjacent
64bits IO-APIC RTE updates. For example, if the 2nd operation updates
destination bits in RTE for SATA device and unmask it, in some case,
SATA device will assert ioapic pin to generate interrupt immediately
using new destination but iommu could still translate it into the old
destination, then dom0 would be confused. To fix that, we sync up
interrupt remapping entry with IO-APIC IRE on every 32 bits operation
and forward IOAPIC RTE updates after interrupt.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Acked-by: Jan Beulich <jbeulich@novell.com>
14 years agoamd iommu: Unmapped interrupt should generate IO page faults.
Wei Wang [Tue, 12 Apr 2011 12:20:57 +0000 (13:20 +0100)]
amd iommu: Unmapped interrupt should generate IO page faults.

This helps us to debug interrupt issues.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
14 years agonestedhvm: Remove nhvm_{initialise,destroy,reset}.
Keir Fraser [Sat, 9 Apr 2011 11:42:24 +0000 (12:42 +0100)]
nestedhvm: Remove nhvm_{initialise,destroy,reset}.

They are a pointless level of abstraction beneath nestedhvm_* variants
of the same operations, which all callers should be using.

At the same time, nestedhvm_vcpu_initialise() does not need to call
destroy if initialisation fails. That is the vendor-specific init
function's job (clearing up its own state on failure).

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agolibxl: Add libvirt-xml to userdata userid registry
Jim Fehlig [Fri, 8 Apr 2011 15:56:08 +0000 (16:56 +0100)]
libxl: Add libvirt-xml to userdata userid registry

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoremus: blackhole replication target
Shriram Rajagopalan [Fri, 8 Apr 2011 15:49:25 +0000 (16:49 +0100)]
remus: blackhole replication target

The new --null option allows one to test and play with just the
memory checkpointing and network buffering aspect of remus, without
the need for a second host. The disk is not replicated. All replication
data is sent to /dev/null. This option is pretty handy when a user
wants to see the page churn for his workload or observe the latency hit
though the latter will not be accurate.

Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoremus: proper cleanup on checkpoint failure.
Shriram Rajagopalan [Fri, 8 Apr 2011 15:49:04 +0000 (16:49 +0100)]
remus: proper cleanup on checkpoint failure.

While running remus, when an error occurs during checkpointing
(e.g., timeouts on primary, failing to checkpoint network buffer
or disk or even communication failure) the domU is sometimes
left in suspended state on primary. Instead of blindly closing
the checkpoint file handle, attempt to resume the domain before
the close.

Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: Drop internal DEVICE_TAP backend type
Ian Campbell [Fri, 8 Apr 2011 15:40:58 +0000 (16:40 +0100)]
libxl: Drop internal DEVICE_TAP backend type

There is no such thing with blktap2, the backend in that case is PHY.

libxl_device_disk_del was just plain wrong in this regard, fix it to
select the appropriate backend_kind.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: handle the tail end of a tap device using the phy backend handling code
Ian Campbell [Fri, 8 Apr 2011 15:40:19 +0000 (16:40 +0100)]
libxl: handle the tail end of a tap device using the phy backend handling code

We are literally creating a phy backend on top of a blktap2 created
device anyway so we might as well reuse the code and make this
explicit.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: refactor DISK_BACKEND_PHY handling in libxl_device_disk_add
Ian Campbell [Fri, 8 Apr 2011 15:39:53 +0000 (16:39 +0100)]
libxl: refactor DISK_BACKEND_PHY handling in libxl_device_disk_add

A step on the path to sharing this code with the tail-end of the
DISK_BACKEND_TAP case.

I made the result of libxl__blktap_devpath non-const to achieve
this. The existing caller calls libxl__strdup on the result but since
the function is an internal one and the result is already garbage
collected I think this is unnecessary and we can just use the
non-const result directly.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: only a CDROM type disk can be empty.
Ian Campbell [Fri, 8 Apr 2011 15:39:19 +0000 (16:39 +0100)]
libxl: only a CDROM type disk can be empty.

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>
14 years agolibxl: convert an empty tap disk into a qdisk
Ian Campbell [Fri, 8 Apr 2011 15:38:59 +0000 (16:38 +0100)]
libxl: convert an empty tap disk into a qdisk

I'm not sure that empty disks which are is_cdrom are especially valid,
or that a cdrom can ever be handled by tapdisk anyway but try to do
something sane since it seems that xl's parse_disk_config() routine
could potentially generate such a configuration (although whether from
a valid input string or not I'm not sure).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: make fallback from blktap2 to qdisk more explicit.
Ian Campbell [Fri, 8 Apr 2011 15:38:36 +0000 (16:38 +0100)]
libxl: make fallback from blktap2 to qdisk more explicit.

When blktap2 is not present we fallback to qdisk, instead of falling
through a switch statement instead make this explicit, with a comment,
prior to the switch statement.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: remove impossible check for backend != DISK_BACKEND_QDISK
Ian Campbell [Fri, 8 Apr 2011 15:38:06 +0000 (16:38 +0100)]
libxl: remove impossible check for backend != DISK_BACKEND_QDISK

In this case we are already in the DISK_BACKEND_QDISK case of a switch
statement on the same variable.

It is possible that we fell through from the DISK_BACKEND_TAP case
(although I'm about to remove that in a subsequent patch), however in
that case we are explicitly falling back from blktap2 to qdisk so
DEVICE_QDISK is still the right answer.

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>
14 years agolibxl: drop domid field from libxl_device_*
Ian Campbell [Fri, 8 Apr 2011 15:36:20 +0000 (16:36 +0100)]
libxl: drop domid field from libxl_device_*

All functions which add a device to a domain already take a domid
argument and the callers typically write the same value to the
structure right before making the call.

Functions which delete a device typically do not but adding this field
makes the interface more consistent anyway and all callers have the
domid to hand.

All functions which return a libxl device structure are given a domid
as a paramter and the caller therefore already knows which domain it
is dealing with.

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>
14 years agoxend: drop XenAPI error message translation
Ian Campbell [Fri, 8 Apr 2011 15:22:51 +0000 (16:22 +0100)]
xend: drop XenAPI error message translation

The only "translation" is to the C locale (e.g. the NUL
translation). I think it very unlikely we are going to see any new
translations of the XenAPI error messages at this point so the only
purpose of this code appears to be to periodically regenerate
xen-xm.pot with a new embedded timestamp, to the detriment of those of
us who use a version control system.

After much beating with sticks I mananged to enable XenAPI support in
xend and configure xm such that it returns "Permission denied." (AKA
the SESSION_AUTHENTICATION_FAILED message) which I take to be a sign
I've not broken things too badly.

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>
14 years agolibxl/xl: drop support for netchannel2
Ian Campbell [Fri, 8 Apr 2011 15:21:12 +0000 (16:21 +0100)]
libxl/xl: drop support for netchannel2

netchannel2 was never widely deployed and no supported kernel includes
either the front- or back-ends. The last known kernel with this
support was the xen.git 2.6.31 branch which has been unsupported for
ages.

xl will warn the user if it spots a "vif2" configration item but
otherwise support is completely removed.

Work is ongoing to add the interesting features of netchannel2 as
protocol extensions to netchannel1.

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>
14 years agolibxl: bump SONAME after binary incompatible change.
Ian Campbell [Fri, 8 Apr 2011 15:17:18 +0000 (16:17 +0100)]
libxl: bump SONAME after binary incompatible change.

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>
14 years agoxen/lto: if the makefile asks for binary, always build binary
Tim Deegan [Thu, 7 Apr 2011 14:08:32 +0000 (15:08 +0100)]
xen/lto: if the makefile asks for binary, always build binary

even if the source is a C file.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agoxen/x86: explicitly mark start-of-file asm()s as .text
Tim Deegan [Thu, 7 Apr 2011 14:08:05 +0000 (15:08 +0100)]
xen/x86: explicitly mark start-of-file asm()s as .text

LLVM and gold between them get confused when asm align commands
are emitted before a section marker.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agoxen/acpi: disentangle ACPI enumerations.
Tim Deegan [Thu, 7 Apr 2011 14:06:47 +0000 (15:06 +0100)]
xen/acpi: disentangle ACPI enumerations.

There are two sets of ACPI table enums and structs, and clang
complains about implicit casts between them.  It would be much better
to remove one entire set of ACPI definitions but for now just use the
right enum for each interface.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agoxen: another unsigned comparison < 0
Tim Deegan [Thu, 7 Apr 2011 14:06:06 +0000 (15:06 +0100)]
xen: another unsigned comparison < 0

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agolibxc: set all VCPU's online by default in HVM info table
Gianni Tedesco [Thu, 7 Apr 2011 11:13:58 +0000 (12:13 +0100)]
libxc: set all VCPU's online by default in HVM info table

This sets a saner default for the cpu-online-map by setting all bits
to 1. The default assumption ought to be that nr-vcpus ==
nr-vcpus-at-start. If that is not true, then the toolstack must modify
the bitmap, but if it is true, the toolstack oughtn't need to do
anything further.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
14 years agoX86: offline/broken page handler for pod cache
Liu, Jinsong [Thu, 7 Apr 2011 11:12:38 +0000 (12:12 +0100)]
X86: offline/broken page handler for pod cache

When offline a page, or, when a broken page occur, the page maybe
populated, or, may at pod cache.  This patch is to handle the
offline/broken page at pod cache.  It scan pod cache, if hit, remove
and replace it, and then put the offline/broken page to
page_offlined_list/page_broken_list

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
14 years agoX86: Fix mce offline page bug
Liu, Jinsong [Thu, 7 Apr 2011 11:12:01 +0000 (12:12 +0100)]
X86: Fix mce offline page bug

c/s 19913 break mce offline page logic:
For page_state_is(pg, free), it's impossible to trigger the case;
For page_state_is(pg, offlined), it in fact didn't offline related
page;

This patch fix the bug, and remove an ambiguous comment.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
14 years agox86/hvm: do actually init nested HVM state for VCPUs
Tim Deegan [Thu, 7 Apr 2011 10:39:35 +0000 (11:39 +0100)]
x86/hvm: do actually init nested HVM state for VCPUs
when nested HVM is enabled after VCPus are allocated.
The previous patch would fail because the call to
nestedhvm_vcpu_initialise() in the HVM param set code
happens before nestedhvm_enabled(v->domain) is true.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agox86/hvm: Don't unconditionally set up nested HVM state
Tim Deegan [Thu, 7 Apr 2011 10:12:55 +0000 (11:12 +0100)]
x86/hvm: Don't unconditionally set up nested HVM state
for domains that aren't going to use it.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agolibxl: do not expose libxenctrl/libxenstore headers via libxl.h
Ian Campbell [Wed, 6 Apr 2011 15:50:16 +0000 (16:50 +0100)]
libxl: do not expose libxenctrl/libxenstore headers via libxl.h

This completely removes libxenstore from libxl users' view.

xl still needs libxenctrl directly due to the direct use of the
xentoollog functionality but it is not exposed to the indirect linkage
anymore.

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>
14 years agoxentrace: Move register_cpu_notifier() call into boot-time init.
Keir Fraser [Wed, 6 Apr 2011 14:52:50 +0000 (15:52 +0100)]
xentrace: Move register_cpu_notifier() call into boot-time init.

We can't do it lazily from alloc_trace_bufs() as that gets called
later if tracing is enabled later by dom0.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agox86/hvm: load CPU structures from xen versions <=3.4
George Dunlap [Wed, 6 Apr 2011 10:40:54 +0000 (11:40 +0100)]
x86/hvm: load CPU structures from xen versions <=3.4

Xen 4.0 added "msr_tsc_aux" in the middle of the hvm_hw_cpu structure, making
it incompatible with pre-3.4 savefiles.  This patch uses the recently introduced
backwards-compatibility infrastructure to convert the old to the new.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agohvm: infrastructure for backwards-compatible loading
George Dunlap [Wed, 6 Apr 2011 10:40:51 +0000 (11:40 +0100)]
hvm: infrastructure for backwards-compatible loading

The hvm_save code is used to save and restore hypervisor-related
hvm state, either for classic save/restore, or for migration
(including remus).  This is meant to be backwards-compatible across
some hypervisor versions; but if it does change, there is no way to
handle the old format as well as the new.

This patch introduces the infrastructure to allow a single older
version ("compat") of any given "save type" to be defined, along with
a function to turn the "old" version into the "new" version.  If the
size check fails for the "normal" version, it will check the "compat"
version, and if it matches, will read the old entry and call the
conversion function.

This patch involves some preprocessor hackery, but I'm only extending the
hackery that's already there.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agoNested SVM: fix race in remote shootdown.
Tim Deegan [Wed, 6 Apr 2011 10:22:39 +0000 (11:22 +0100)]
Nested SVM: fix race in remote shootdown.

nestedhvm_flushtlb_ipi() can run between nsvm_vcpu_switch() and CLGI,
which would leave the VMCB pointing at the wrong p2m table.
Check for this after CLGI.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agoxen: fix non-debug and 32-bit builds after nested HVM series
Tim Deegan [Wed, 6 Apr 2011 10:22:39 +0000 (11:22 +0100)]
xen: fix non-debug and 32-bit builds after nested HVM series

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agoImplement Nested-on-Nested.
cegger [Tue, 5 Apr 2011 13:44:09 +0000 (15:44 +0200)]
Implement Nested-on-Nested.
This allows the guest to run nested guest with hap enabled.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agoImplement generic piece to finally enable nested virtualization
cegger [Wed, 9 Mar 2011 11:36:23 +0000 (12:36 +0100)]
Implement generic piece to finally enable nested virtualization

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agoImplement SVM specific interrupt handling
cegger [Wed, 9 Mar 2011 11:36:17 +0000 (12:36 +0100)]
Implement SVM specific interrupt handling

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agoImplement SVM specific part for Nested Virtualization
cegger [Wed, 9 Mar 2011 11:36:05 +0000 (12:36 +0100)]
Implement SVM specific part for Nested Virtualization

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agoHandle interrupts (generic part)
cegger [Mon, 28 Feb 2011 11:21:57 +0000 (12:21 +0100)]
Handle interrupts (generic part)

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agoAllow guest to enable SVM in EFER
cegger [Mon, 28 Feb 2011 11:21:54 +0000 (12:21 +0100)]
Allow guest to enable SVM in EFER

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agoWhen injecting an exception into L2 guest,
cegger [Mon, 28 Feb 2011 11:21:52 +0000 (12:21 +0100)]
When injecting an exception into L2 guest,
inject a #VMEXIT if L1 guest intercepts the exception

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agoAllow paged real mode during vmrun emulation.
cegger [Mon, 28 Feb 2011 11:21:49 +0000 (12:21 +0100)]
Allow paged real mode during vmrun emulation.
Emulate cr0 and cr4 when guest does not intercept them.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agoNested Virtualization core implementation
cegger [Mon, 28 Feb 2011 11:21:46 +0000 (12:21 +0100)]
Nested Virtualization core implementation

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agoadd nestedhvm function hooks for svm/vmx specific code
cegger [Mon, 28 Feb 2011 11:21:44 +0000 (12:21 +0100)]
add nestedhvm function hooks for svm/vmx specific code

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agoData structures for Nested Virtualization
cegger [Mon, 28 Feb 2011 11:21:41 +0000 (12:21 +0100)]
Data structures for Nested Virtualization

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agotools: Add nestedhvm guest config option
cegger [Mon, 28 Feb 2011 11:21:38 +0000 (12:21 +0100)]
tools: Add nestedhvm guest config option

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agoRemove __init specifier from function declarations in header files.
Keir Fraser [Wed, 6 Apr 2011 08:20:40 +0000 (09:20 +0100)]
Remove __init specifier from function declarations in header files.

The specifier only needs to be added to the function's definition.

At the same time, fix init_cpu_to_node() to be __init rather than
__devinit (it is only called at boot time).

Signed-off-by: Keir Fraser <keir@xen.org>
14 years ago[VTD] Fixes to ACPI DMAR flag checks.
Allen Kay [Wed, 6 Apr 2011 08:11:02 +0000 (09:11 +0100)]
[VTD] Fixes to ACPI DMAR flag checks.

 * platform_supports_{intremap,x2apic} should not be marked __init as
   they are used during S3 resume.
 * DMAR flags should be taken from the table passed to
   acpi_parse_dmar() -- this is the trusted copy of the DMAR, when
   running in TXT mode.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
14 years agox86, amd, MTRR: remove k8_enable_fixed_iorrs()
Wei Huang [Wed, 6 Apr 2011 08:02:13 +0000 (09:02 +0100)]
x86, amd, MTRR: remove k8_enable_fixed_iorrs()

AMD64 defines two special bits (bit 3 and 4) RdMem and WrMem in fixed
MTRR type. Their values are supposed to be 0 after BIOS hands the
control to OS according to AMD BKDG. Unless OS specificially turn them
on, they are kept 0 all the time. As a result, k8_enable_fixed_iorrs()
is unnecessary and removed from upstream kernel (see
https://patchwork.kernel.org/patch/11425/). This patch does the same
thing.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
14 years agox86, amd, MTRR: correct DramModEn bit of SYS_CFG MSR
Wei Huang [Wed, 6 Apr 2011 08:01:31 +0000 (09:01 +0100)]
x86, amd, MTRR: correct DramModEn bit of SYS_CFG MSR

Some buggy BIOS might set SYS_CFG DramModEn bit to 1, which can cause
unexpected behavior on AMD platforms. This patch clears DramModEn bit
if it is 1.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
14 years agolibxl: Drop unnecessary \n from log message
Ian Campbell [Tue, 5 Apr 2011 17:23:54 +0000 (18:23 +0100)]
libxl: Drop unnecessary \n from log message

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>
14 years agolibxl: specific explicit disk image format to new qemu
Ian Campbell [Tue, 5 Apr 2011 17:17:55 +0000 (18:17 +0100)]
libxl: specific explicit disk image format to new qemu

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: specify disks using supported command line syntax for new qemu
Ian Campbell [Tue, 5 Apr 2011 16:34:48 +0000 (17:34 +0100)]
libxl: specify disks using supported command line syntax for new qemu

The -hdX syntax is only retained for compatibility reasons and the
-sdX syntax doesn't even exist.

Additionally convert the first four non-SCSI disks to hd[a-d] and
ignore any further non-SCSI disks (since qemu only supports 4 IDE
devices).

SCSI disks are passed through as is. qemu-xen was limited to 7 SCSI
devices but upstream qemu supports 256, therefore do not limit the
number of disks on the libxl side.

qemu-xen did all this itself internally.

Fixes "qemu: -xvda: invalid option" and allows PVHVM to work with
upstream qemu.

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>
14 years agolibxl: pass list of disks to libxl__build_device_model_args
Ian Campbell [Tue, 5 Apr 2011 16:27:49 +0000 (17:27 +0100)]
libxl: pass list of disks to libxl__build_device_model_args

Given that we have the information available this is preferable to
picking it out of xenstore instead. We already do this for VIFs.

Only the qemu upstream version makes use of it since old qemu-xen
actually parses xenstore itself.

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>
14 years agolibxl: return raw disk and partition number from libxl__device_disk_dev_number
Ian Campbell [Tue, 5 Apr 2011 16:23:51 +0000 (17:23 +0100)]
libxl: return raw disk and partition number from libxl__device_disk_dev_number

Optional parameters, caller to follow.

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>
14 years agolibxl: explicitly set disk format in libxl__append_disk_list_of_type
Ian Campbell [Tue, 5 Apr 2011 16:21:36 +0000 (17:21 +0100)]
libxl: explicitly set disk format in libxl__append_disk_list_of_type

Ideally we should be able to infer the format from something stashed
in xenstore but this is better than letting users see garbage values.

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>
14 years agopassthrough: use domain pirq as index of struct hvm_irq_dpci's hvm_timer array
Jan Beulich [Tue, 5 Apr 2011 12:05:05 +0000 (13:05 +0100)]
passthrough: use domain pirq as index of struct hvm_irq_dpci's hvm_timer array

Since d->nr_pirqs is guaranteed to be not larger than nr_irqs,
indexing arrays by the former ought to be preferred. In the case
given, the indices so far had to be computed specially in a number of
cases, whereas the indexes use now are all readily available.

This opens the possibility to fold the ->mirq[] and ->hvm_timer[]
members of struct hvm_irq_dpci into a single array, possibly with some
members overlayed in a union to reduce size (see
http://lists.xensource.com/archives/html/xen-devel/2011-03/msg02006.html).
Such space saving wouldn't, however, suffice to generally get the
respective allocation sizes here to below PAGE_SIZE, not even when
converting the array of structures into an array of pointers to
structures. Whether a multi-level lookup mechanism would make sense
here is questionable, as it can be expected that for other than Dom0
(which isn't hvm, and hence shouldn't use these data structures - see
http://lists.xensource.com/archives/html/xen-devel/2011-03/msg02004.html)
only very few entries would commonly be used here. An obvious
alternative would be to use rb or radix trees (both currently only
used in tmem).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agox86: introduce alloc_vcpu_guest_context()
Jan Beulich [Tue, 5 Apr 2011 12:03:29 +0000 (13:03 +0100)]
x86: introduce alloc_vcpu_guest_context()

This is necessary because on x86-64 struct vcpu_guest_context is
larger than PAGE_SIZE, and hence not suitable for a general purpose
runtime allocation. On x86-32, FIX_PAE_HIGHMEM_* fixmap entries are
being re-used, whiule on x86-64 new per-CPU fixmap entries get
introduced.  The implication of using per-CPU fixmaps is that these
allocations have to happen from non-preemptable hypercall context
(which they all do).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agox86: split struct domain
Jan Beulich [Tue, 5 Apr 2011 12:02:57 +0000 (13:02 +0100)]
x86: split struct domain

This is accomplished by converting a couple of embedded arrays (in one
case a structure containing an array) into separately allocated
pointers, and (just as for struct arch_vcpu in a prior patch)
overlaying some PV-only fields with HVM-only ones.

One particularly noteworthy change in the opposite direction is that
of PITState - this field so far lived in the HVM-only portion, but is
being used by PV guests too, and hence needed to be moved out of
struct hvm_domain.

The change to XENMEM_set_memory_map (and hence libxl__build_pre() and
the movement of the E820 related pieces to struct pv_domain) are
subject to a positive response to a query sent to xen-devel regarding
the need for this to happen for HVM guests (see
http://lists.xensource.com/archives/html/xen-devel/2011-03/msg01848.html).

The protection of arch.hvm_domain.irq.dpci accesses by is_hvm_domain()
is subject to confirmation that the field is used for HVM guests only
(see
http://lists.xensource.com/archives/html/xen-devel/2011-03/msg02004.html).

In the absence of any reply to these queries, and given the early
state of 4.2 development, I think it should be acceptable to take the
risk of having to later undo/redo some of this.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agox86: move pv-only members of struct vcpu to struct pv_vcpu
Jan Beulich [Tue, 5 Apr 2011 12:02:00 +0000 (13:02 +0100)]
x86: move pv-only members of struct vcpu to struct pv_vcpu

... thus further shrinking overall size of struct arch_vcpu.

This has a minor effect on XEN_DOMCTL_{get,set}_ext_vcpucontext - for
HVM guests, some meaningless fields will no longer get stored or
retrieved: reads will now return zero, and writes are required to be
(mostly) zero (the same as was already done on x86-32).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agox86: split struct vcpu
Jan Beulich [Tue, 5 Apr 2011 12:01:25 +0000 (13:01 +0100)]
x86: split struct vcpu

This is accomplished by splitting the guest_context member, which by
itself is larger than a page on x86-64. Quite a number of fields of
this structure is completely meaningless for HVM guests, and thus a
new struct pv_vcpu gets introduced, which is being overlaid with
struct hvm_vcpu in struct arch_vcpu. The one member that is mostly
responsible for the large size is trap_ctxt, which now gets allocated
separately (unless fitting on the same page as struct arch_vcpu, as is
currently the case for x86-32), and only for non-hvm, non-idle
domains.

This change pointed out a latent problem in arch_set_info_guest(),
which is permitted to be called on already initialized vCPU-s, but
so far copied the new state into struct arch_vcpu without (in this
case) actually going through all the necessary accounting/validation
steps. The logic gets changed so that the pieces that bypass
accounting
will at least be verified to be no different from the currently active
bits, and the whole change will fail in case they are. The logic does
*not* get adjusted here to do full error recovery, that is, partially
modified state continues to not get unrolled in case of failure.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoRemove direct cpumask_t members from struct vcpu and struct domain
Jan Beulich [Tue, 5 Apr 2011 12:00:54 +0000 (13:00 +0100)]
Remove direct cpumask_t members from struct vcpu and struct domain

The CPU masks embedded in these structures prevent NR_CPUS-independent
sizing of these structures.

Basic concept (in xen/include/cpumask.h) taken from recent Linux.

For scalability purposes, many other uses of cpumask_t should be
replaced by cpumask_var_t, particularly local variables of functions.
This implies that no functions should have by-value cpumask_t
parameters, and that the whole old cpumask interface (cpus_...())
should go away in favor of the new (cpumask_...()) one.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxsm: Error code consistency
Machon Gregory [Mon, 4 Apr 2011 14:54:45 +0000 (15:54 +0100)]
xsm: Error code consistency

Signed-off-by: Machon Gregory <mbgrego@tycho.ncsc.mil>
14 years agolibxl: add CODING_STYLE
Ian Jackson [Mon, 4 Apr 2011 13:54:46 +0000 (14:54 +0100)]
libxl: add CODING_STYLE

libxenlight and xl grew enough to need a CODING_STYLE, that I blatantly
copied from qemu and linux, just adding few specific modifications.
The result should be as less controversial as possible, mostly
documenting what we are already doing.

[ Message and document originally posted to xen-devel on 2010-09-01 ]

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agox86/mm: fix PSE alignment checks in pagetable walker.
Tim Deegan [Mon, 4 Apr 2011 09:38:27 +0000 (10:38 +0100)]
x86/mm: fix PSE alignment checks in pagetable walker.

The PSE handling doesn't check bits 1...8 (or 1...9 for non-PAE guests)
being zero, thus allowing bad (not 2Mb/4Mb aligned) large pages to be
handled.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agox86: cleanup bogus CONFIG_ACPI_PCI uses
Jan Beulich [Sat, 2 Apr 2011 14:58:54 +0000 (15:58 +0100)]
x86: cleanup bogus CONFIG_ACPI_PCI uses

We're building for one case (CONFIG_ACPI_PCI defined) only, yet still
had the other case's code in there. Additionally there was quite a bit
of pseudo-duplication between disabled(!) DMI scan and ACPI boot code.

acpi_pci_disabled had only a single reader, which is off by default
(i.e. must be enable on the command line), so it seems pointless to
keep it.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agox86/ACPI: __init-annotate
Jan Beulich [Sat, 2 Apr 2011 14:58:22 +0000 (15:58 +0100)]
x86/ACPI: __init-annotate

xen/arch/x86/acpi/boot.c consists of almost only code/data in .init.*,
so move the few bits that aren't into a new file and then use the
recently introduced .init.o mechanism to move all the literal strings
into .init.rodata.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoamd-iommu: __init-annotate
Jan Beulich [Sat, 2 Apr 2011 14:57:35 +0000 (15:57 +0100)]
amd-iommu: __init-annotate

Besides marking a few more items __init/__initdata, use the recently
introduced .init.o mechanism to move all the literal strings into
.init.rodata in those files that consist of only contributions to
.init.*.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agomove register_cpu_notifier() into .init.text
Jan Beulich [Sat, 2 Apr 2011 14:57:03 +0000 (15:57 +0100)]
move register_cpu_notifier() into .init.text

With no modular drivers, all CPU notifier setup is supposed to happen
during boot. There also is a respective comment in the function.=20

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agomove setup_irq() into .init.text
Jan Beulich [Sat, 2 Apr 2011 14:56:32 +0000 (15:56 +0100)]
move setup_irq() into .init.text

With no modular drivers, all interrupt setup is supposed to happen
during boot.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agomove request_irq() into .init.text
Jan Beulich [Sat, 2 Apr 2011 14:56:07 +0000 (15:56 +0100)]
move request_irq() into .init.text

With no modular drivers, all interrupt setup is supposed to happen
during boot.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agox86: eliminate old-CPU support bits
Jan Beulich [Sat, 2 Apr 2011 14:55:36 +0000 (15:55 +0100)]
x86: eliminate old-CPU support bits

Some pieces can be removed altogether, others are only of possible use
in 32-bit builds.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxen: fix reloc.S generation for non-gnu toolchain
Christoph Egger [Sat, 2 Apr 2011 14:53:35 +0000 (15:53 +0100)]
xen: fix reloc.S generation for non-gnu toolchain

The output of AT&T UNIX and GNU od(1) are different.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
14 years agoxentrace: remove unneeded debug printk
Olaf Hering [Sat, 2 Apr 2011 14:50:47 +0000 (15:50 +0100)]
xentrace: remove unneeded debug printk

The pointer value in case of an allocation failure is rather
uninteresting.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
14 years agoxentrace: correct formula to calculate t_info_pages
Olaf Hering [Sat, 2 Apr 2011 14:50:19 +0000 (15:50 +0100)]
xentrace: correct formula to calculate t_info_pages

The current formula to calculate t_info_pages, based on the initial
code, is slightly incorrect. It may allocate more than needed.
Each cpu has some pages/mfns stored as uint32_t.
That list is stored with an offset at tinfo.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
14 years ago[VTD] check BIOS settings before enabling interrupt remapping or x2apic
Allen Kay [Sat, 2 Apr 2011 14:49:25 +0000 (15:49 +0100)]
[VTD] check BIOS settings before enabling interrupt remapping or x2apic

Check flags field in ACPI DMAR structure before enabling interrupt
remapping or x2apic.  This allows platform vendors to disable
interrupt remapping or x2apic features if on board BIOS does not
support them.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
14 years agolibxl: typedef libxl_action_on_shutdown
Ian Campbell [Thu, 31 Mar 2011 18:39:30 +0000 (19:39 +0100)]
libxl: typedef libxl_action_on_shutdown

This is the libxl convention. By using the "typedef enum foo { } foo;"
syntax we can retain backwards compatibility with existing users.

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>
14 years agotools: remove some .o and binary files on clean
Ian Campbell [Thu, 31 Mar 2011 18:35:27 +0000 (19:35 +0100)]
tools: remove some .o and binary files on clean

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>
14 years agotools: remove pattern matched linking rules
Ian Campbell [Thu, 31 Mar 2011 18:34:56 +0000 (19:34 +0100)]
tools: remove pattern matched linking rules

Most subdirs only build a single tool to start with and those which
build multiple tools often have different linkage requirements.

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>
14 years agotools: Remove $(CFLAGS) from links lines.
Ian Campbell [Thu, 31 Mar 2011 18:32:18 +0000 (19:32 +0100)]
tools: Remove $(CFLAGS) from links lines.

The relevant variable in these circumstances is called $(LDFLAGS).

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>
14 years agotools: ocaml: drop redefinition of xen_mb
Ian Campbell [Thu, 31 Mar 2011 18:31:06 +0000 (19:31 +0100)]
tools: ocaml: drop redefinition of xen_mb

This is always available to the in-tree build.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agotools: ocaml: drop some commented out build rules.
Ian Campbell [Thu, 31 Mar 2011 18:30:42 +0000 (19:30 +0100)]
tools: ocaml: drop some commented out build rules.

These are covered by tools/ocaml/Makefile.rules now

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agotools: ocaml: push CFLAGS usage down into the specific bindings
Ian Campbell [Thu, 31 Mar 2011 18:30:15 +0000 (19:30 +0100)]
tools: ocaml: push CFLAGS usage down into the specific bindings

So each binding only builds against what it requires.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agotools: xenstored: make usage info of xenstored accurate
Juergen Gross [Thu, 31 Mar 2011 18:27:40 +0000 (19:27 +0100)]
tools: xenstored: make usage info of xenstored accurate

The usage printed for xenstored was not in sync with the parameters
defined in the code.

Signed-off-by: juergen.gross@ts.fujitsu.com
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: fix memory management in "xl network-attach"
David Scott [Thu, 31 Mar 2011 18:19:16 +0000 (19:19 +0100)]
libxl: fix memory management in "xl network-attach"

The libxl_device_nic struct has strings which are initially strdup()ed
and then free()ed in libxl_device_nic_destroy(). In the
"network-attach" parser we need to free() the existing string and
strdup((*argv) + N), rather than just copying the pointer.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agotools: ocaml: do not try to link dynamic objects into .a libraries
Ian Campbell [Thu, 31 Mar 2011 18:07:06 +0000 (19:07 +0100)]
tools: ocaml: do not try to link dynamic objects into .a libraries

lib<foo>_stubs.a was linking against $(LIBS_<foo>) which only includes
dynamic linkage information which is not useful for a static library.

$(LIBS_<foo>) is still used when linking <foo>.cmxa

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>
14 years agolibxl: use system include for libxl_uuid.h
Ian Campbell [Thu, 31 Mar 2011 18:04:19 +0000 (19:04 +0100)]
libxl: use system include for libxl_uuid.h

We install libxl_uuid.h into the system include directory and refer to
it from libxl.h, hence we should include with <> not "".

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>
14 years agotools: ocaml: Add an ocaml binding for libxl_get_topologyinfo
David Scott [Thu, 31 Mar 2011 18:02:55 +0000 (19:02 +0100)]
tools: ocaml: Add an ocaml binding for libxl_get_topologyinfo

Add an ocaml binding for libxl_get_topologyinfo in the style of
libxl_get_physinfo.

The function returns an array of optional records, one per possible pCPU.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agotools: blktap2: copy xenstore/hashtable.h into blktap2 (really)
Ian Jackson [Thu, 31 Mar 2011 17:16:34 +0000 (18:16 +0100)]
tools: blktap2: copy xenstore/hashtable.h into blktap2 (really)

hg add the missing files from 23112:e15ca5c3effc

14 years agolibxl: export libxl_utils.h
Ian Jackson [Thu, 31 Mar 2011 17:15:35 +0000 (18:15 +0100)]
libxl: export libxl_utils.h

libxl_utils.h is the header for libxlu.{so,a} and should have been
exported for the benefit of libxl callers.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Jim Fehlig <jfehlig@novell.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agotools: blktap2: copy xenstore/hashtable.h into blktap2
Ian Campbell [Thu, 31 Mar 2011 17:13:50 +0000 (18:13 +0100)]
tools: blktap2: copy xenstore/hashtable.h into blktap2

hashtable.c has already been copied, forked and modified, there
doesn't seem much point in avoiding the same for the header until
someone feels motivated to properly refactor.

Add comments to the various duplicated files cross-referencing each
other for future reference and as a barrier to forking again...

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>
14 years agotools: ocaml: xl: propagate simplfied libxl interface to PCI BDFs to bindings.
Ian Campbell [Thu, 31 Mar 2011 17:12:07 +0000 (18:12 +0100)]
tools: ocaml: xl: propagate simplfied libxl interface to PCI BDFs to bindings.

22166:251694a87f1d changed the libxl interface to remove the need for
users to understand BDF encoding but did not propagate the change to
the ocaml bindings. Do that now.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: remove "reg" and "enable" fields from PCI device.
Ian Campbell [Thu, 31 Mar 2011 17:11:25 +0000 (18:11 +0100)]
libxl: remove "reg" and "enable" fields from PCI device.

The structure of the BDF argument used with PCI passthrough related
hypercalls was taken from the structure of the PCI config_address
register (I/O port 0xCF8) which allows I/O mapped access to PCI
configuration space but these fields have no meaning in the context of
PCI passthrough configuration and hence do not need to be exposed via
libxl.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>