Commit Graph
23223 Commits
Author SHA1 Message Date
Christoph Egger d0c9dab138 tools/xentrace: decode 'continue_running' and 'RDTSC' entries.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2011-04-13 14:09:55 +01:00
Tim Deegan 3943f0228d Remove "uninitialized_var" macro, which doesn't work with clang.
Since its only user is in ACPI parsing code, the extra overhead of
initializing to 0 is not worth fighting over.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2011-04-13 09:18:10 +01:00
Stephen Smalley ad17ef1932 xsm: Fix xsm_mmu_* and xsm_update_va_mapping hooks
This is an attempt to properly fix the hypervisor crash previously
described in
http://marc.info/?l=xen-devel&m=128396289707362&w=2

In looking into this issue, I think the proper fix is to move the
xsm_mmu_* and xsm_update_va_mapping hook calls later in the callers,
after more validation has been performed and the page_info struct is
readily available, and pass the page_info to the hooks. This patch
moves the xsm_mmu_normal_update, xsm_mmu_machphys_update and
xsm_update_va_mapping hook calls accordingly, and updates their
interfaces and hook function implementations.  This appears to resolve
the crashes for me.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2011-04-12 14:55:25 +01:00
Ian Campbell 1e7545fd7c tools: hvmloader: select BIOS through xenstore.
Allow the toolstack to select the BIOS to use via a xenstore key.

Defaults to "rombios" for compatibility with toolstacks which do not
write the key (e.g. xend).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
2011-04-12 14:00:49 +01:00
Ian Campbell 575f9fbdfa tools: hvmloader: Refactor MP table setup into struct bios_config
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-04-12 13:47:16 +01:00
Ian Campbell 9134c2f6cf tools: hvmloader: Refactor ACPI table setup into struct bios_config
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-04-12 13:46:49 +01:00
Ian Campbell d195595bc3 tools: hvmloader: Refactor VM86 and E820 setup into struct bios_config
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2011-04-12 13:46:20 +01:00
Ian Campbell 6b4d8dbd51 tools: hvmloader: refactor highbios and bios_info setup into struct bios_config
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-04-12 13:45:59 +01:00
Ian Campbell 7128e9e70e tools: hvmloader: Refactor APIC, PCI and SMP setup into struct bios_config
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-04-12 13:45:31 +01:00
Ian Campbell 548977fea1 tools: hvmloader: add bios_config data structure
For now abstract away the actual ROM bits themselves and the various
load addresses.

Create a rombios.c to contain the ROMBIOS specific parts. ROMBIOS is
still statically selected for the time being.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-04-12 13:44:38 +01:00
Ian Campbell 5b7274efbc tools: hvmloader: Define $(OBJS) directly instead of via $(SRCS)
$(SRCS) isn't used for anything else.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-04-12 13:43:45 +01:00
Ian Campbell 79388968ed tools: hvmloader: rename roms.h to roms.inc
It's not really a header, it's an autogenerated data file.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-04-12 13:41:43 +01:00
Ian Campbell 364f616ba8 tools: hvmloader: remove rombios_sz, just use sizeof(rombios)
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-04-12 13:40:49 +01:00
Ian Campbell 893beb07e5 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>
2011-04-12 13:39:56 +01:00
Ian Campbell 26021e6729 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>
2011-04-12 13:39:22 +01:00
Ian Campbell 0891c42aea 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>
2011-04-12 13:38:38 +01:00
Ian Campbell 9978e0e2b7 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>
2011-04-12 13:38:01 +01:00
Ian Campbell 529cddb195 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>
2011-04-12 13:37:03 +01:00
Ian Campbell ac7802b593 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>
2011-04-12 13:36:17 +01:00
Ian Campbell ddff13d94c 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>
2011-04-12 13:34:30 +01:00
Shriram Rajagopalan 7d75f6881e 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>
2011-04-12 13:28:51 +01:00
Jan Beulich 8d247c677a 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>
2011-04-12 13:27:27 +01:00
Wei Wang 9b130249ea 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>
2011-04-12 13:26:19 +01:00
Wei Wang 9dc2af3fd6 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>
2011-04-12 13:20:57 +01:00
Keir Fraser a2b5f21469 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>
2011-04-09 12:42:24 +01:00
Jim Fehlig a0968ec753 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>
2011-04-08 16:56:08 +01:00
Shriram Rajagopalan 5bb2e121f0 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>
2011-04-08 16:49:25 +01:00
Shriram Rajagopalan d732509e34 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>
2011-04-08 16:49:04 +01:00
Ian Campbell be1806baf4 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>
2011-04-08 16:40:58 +01:00
Ian Campbell 4f704ac600 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>
2011-04-08 16:40:19 +01:00
Ian Campbell bdd91be493 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>
2011-04-08 16:39:53 +01:00
Ian Campbell 44714d9fb7 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>
2011-04-08 16:39:19 +01:00
Ian Campbell 847ac5c71d 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>
2011-04-08 16:38:59 +01:00
Ian Campbell 77df1186c8 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>
2011-04-08 16:38:36 +01:00
Ian Campbell 455e8b7f10 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>
2011-04-08 16:38:06 +01:00
Ian Campbell d658d039cd 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>
2011-04-08 16:36:20 +01:00
Ian Campbell 138c8514f9 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>
2011-04-08 16:22:51 +01:00
Ian Campbell bc57ea8ce5 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>
2011-04-08 16:21:12 +01:00
Ian Campbell e5407d0985 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>
2011-04-08 16:17:18 +01:00
Tim Deegan 0d64bb7057 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>
2011-04-07 15:08:32 +01:00
Tim Deegan 33ba1e8196 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>
2011-04-07 15:08:05 +01:00
Tim Deegan 756f04dbee 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>
2011-04-07 15:06:47 +01:00
Tim Deegan 679a2b9021 xen: another unsigned comparison < 0
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-04-07 15:06:06 +01:00
Gianni Tedesco b972d1abef 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>
2011-04-07 12:13:58 +01:00
Liu, Jinsong 4f4d5c8d79 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>
2011-04-07 12:12:38 +01:00
Liu, Jinsong 51402ed609 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>
2011-04-07 12:12:01 +01:00
Tim Deegan fd6ee4bb06 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>
2011-04-07 11:39:35 +01:00
Tim Deegan f08e80a9df 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>
2011-04-07 11:12:55 +01:00
Ian Campbell bbfc7c3807 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>
2011-04-06 16:50:16 +01:00
Keir Fraser e15c160c0f 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>
2011-04-06 15:52:50 +01:00