Commit Graph
21736 Commits
Author SHA1 Message Date
Ian Jackson 0c85cce09c tools/hotplug: locking.sh script: fix lock directory remains on error bug
_release_lock should be used instead of release_lock.
sigerr is introduced so that it can be redefined by
xen-hotplug-common.sh to a version which writes error status to xenstore.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2010-07-06 13:10:14 +01:00
Ian Jackson 2157eba42a tools/xenstore: add XS_RESTRICT operation to C xenstore client libs.
The OCaml xenstored supports the XS_RESTRICT operation, which
deprivileges a dom0 xenstore connection so it can only affect one
domain's entries.   Add the relevant definitions to the C libraries
so that callers can use it.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-06 11:57:20 +01:00
Ian Jackson f2402d342d Merge 2010-07-06 11:54:40 +01:00
Keir Fraser 621441dcd1 Add an exact-node request flag for mem allocations.
Signed-off-by : Dulloor <dulloor@gmail.com>
2010-07-05 08:40:26 +01:00
Keir Fraser 52ff658b7e x2APIC: improve enabling logic
This patch masks PIC and IOAPIC RTE's before x2APIC enabling, unmask
and restore them after x2APIC enabling. It also really enables
interrupt remapping before x2APIC enabling instead of just checking
interrupt remapping setting. This patch also handles all x2APIC
configuration including BIOS settings and command line
settings. Especially, it handles that BIOS hands over in x2APIC mode
(when there is apic id > 255). It checks if x2APIC is already enabled
by BIOS. If already enabled, it will disable interrupt remapping and
queued invalidation first, then enable them again.

Signed-off-by: Weidong Han <weidong.han@intel.com>
2010-07-05 08:31:29 +01:00
Keir Fraser 19fbbfffdc x2APIC/VT-d: improve interrupt remapping and queued invalidation enabling and disabling
x2APIC depends on interrupt remapping, so interrupt remapping needs to
be enabled before x2APIC. Usually x2APIC is not enabled
(x2apic_enabled=0) when enable interrupt remapping, although x2APIC
will be enabled later. So it needs to pass a parameter to set
interrupt mode in intremap_enable, instead of checking
x2apic_enable. This patch adds a parameter "eim" to intremap_enable to
achieve it.  Interrupt remapping and queued invalidation are already
enabled when enable x2apic, so it needn't to enable them again when
setup iommu. This patch checks if interrupt remapping and queued
invalidation are already enable or not, and won't enable them if
already enabled. It does the similar in disabling, that's to say don't
disable them if already disabled.

Signed-off-by: Weidong Han <weidong.han@intel.com>
2010-07-05 08:30:25 +01:00
Keir Fraser 600814950b x2APIC/VT-d: allocate iommu when create a drhd
A drhd is created when parse ACPI DMAR table, but drhd->iommu is not
allocated until iommu setup. But iommu is needed by x2APIC which will
enable interrupt remapping before iommu setup. This patch allocates
iommu when create drhd. And then drhd->ecap can be removed because
it's the same as iommu->ecap.

Signed-off-by: Weidong Han <weidong.han@intel.com>
2010-07-05 08:29:10 +01:00
Keir Fraser 34b9ec5289 VT-d: No need to emulate WBINVD when force snooping feature available
There is no cache coherency issue if VT-d engine's force snooping
feature available.

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
2010-07-05 08:28:08 +01:00
Keir Fraser 093e295b3c VMX: fix ept pages free up when ept superpage split fails:
1) implement ept super page split in a recursive way to
   form an ept sub tree before real installation;
2) free an ept sub tree also in a recursive way.
3) change ept_next_level last input parameter from shift
   bits # to next walk level;

Signed-off-by: Xin Li <xin.li@intel.com>
2010-07-05 08:27:26 +01:00
Keir Fraser 712b05770c trace: insert compiler memory barriers
This is to ensure fields shared writably with Dom0 get read only once
for any consistency checking followed by actual calculations.

I realized there was another multiple-read issue, a fix for which is
also included (which at once simplifies __insert_record()).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-07-05 08:24:18 +01:00
Keir Fraser 2604adda4f AMD OSVW (OS Visible Workaround) for Xen
This path enables AMD OSVW (OS Visible Workaround) feature for
Xen. New AMD errata will have a OSVW id assigned in the future. OS is
supposed to check OSVW status MSR to find out whether CPU has a
specific erratum. Legacy errata are also supported in this patch:
traditional family/model/stepping approach will be used if OSVW
feature isn't applicable.  This patch is adapted from Hans Rosenfeld's
patch submitted to Linux kernel.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
Signed-off-by: Hans Rosenfeld <hands.rosenfeld@amd.com>
Acked-by: Jan Beulich <jbeulich@novell.com>
2010-07-02 19:04:57 +01:00
Keir Fraser 2156299cf0 x86: Fix (bogus) use-before-initialise compiler warning.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-07-02 19:03:16 +01:00
Keir Fraser 8f0aaeab8a VMX: cleanup ept_set_entry:
1) more strict input parameters checking;
2) better comments;
3) fewer variable;
4) change direct_mmio type to bool_t.

Signed-off-by: Xin Li <xin.li@intel.com>
2010-07-02 19:00:04 +01:00
Keir Fraser faba8d7d41 Remove stale file xen/arch/x86/hvm/vmx/vpmu.c
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-07-02 18:59:36 +01:00
Keir Fraser ee310a9ca9 io: make shared ring pad field less enticing for users by adding a __ prefix
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Daniel Stodden <daniel.stodden@citrix.com>
Cc: Dongxiao Xu <dongxiao.xu@intel.com>
2010-07-02 18:58:28 +01:00
Keir Fraser 1b9cecdb88 blktap2: make protocol specific usage of shared sring explicit
I don't think protocol specific data really belongs in this header
but since it is already there and we seem to be stuck with it let's at
least make the users explicit lest people get caught out by future new
fields moving the pad field around.

This is the Xen portion of this change. The kernel portion will be
sent separately. There is no dependency between the two.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Daniel Stodden <daniel.stodden@citrix.com>
Cc: Dongxiao Xu <dongxiao.xu@intel.com>
2010-07-02 18:58:02 +01:00
Keir Fraser ac9fb79947 trace: fix security issues
After getting a report of 3.2.3's xenmon crashing Xen (as it turned
out this was because c/s 17000 was backported to that tree without
also applying c/s 17515), I figured that the hypervisor shouldn't rely
on any specific state of the actual trace buffer (as it is shared
writable with Dom0)

[GWD: Volatile quantifiers have been taken out and moved to another
patch]

To make clear what purpose specific variables have and/or where they
got loaded from, the patch also changes the type of some of them to be
explicitly u32/s32, and removes pointless assertions (like checking an
unsigned variable to be >= 0).

I also took the prototype adjustment of __trace_var() as an
opportunity to simplify the TRACE_xD() macros. Similar simplification
could be done on the (quite numerous) direct callers of the function.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-07-02 18:56:34 +01:00
Keir Fraser d505477d64 trace: adjust printk()s
They should be lower level or rate limited.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-07-02 18:53:37 +01:00
Keir Fraser 43b0124af6 trace: improve check_tbuf_size()
It didn't consider the case of the incoming size not allowing for the
2*data_size range for t_buf->{prod,cons}

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-07-02 18:53:10 +01:00
Keir Fraser 79fdc7a419 trace: Fix T_INFO_FIRST_OFFSET calculation
This wasn't defined correctly, thus allowing in the
num_online_cpus() == NR_CPUS case to pass a corrupted MFN to
Dom0.

Reported-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-07-02 18:52:45 +01:00
Keir Fraser 6634a6768c gdbsx: Always build -- remove build-time config option.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-07-02 18:52:12 +01:00
Ian Jackson 7478722bee update QEMU_TAG to add968aaf68cb57257428f8cfadb209f2614a6d8 2010-07-02 18:04:54 +01:00
Ian Jackson c55f511297 tools/pygrub: --not-really option for debugging
Add a --not-really option to pygrub that lets us see what files it would
have extracted instead of actually extracting them.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-02 17:57:53 +01:00
Ian Jackson 79b518480a tools/pygrub: Fix a typo handling device specs with no partition part
pygrub: fix a typo that causes exceptions when looking at device
specifications that don't have a partition part (e.g. (hd0)).

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-02 17:56:05 +01:00
Ian Jackson baa1aae9cf tools/debugger/gdb: Remove gdb
This code is not maintained, does not work properly, and no-one is
using it.  Delete it, following discussion on xen-devel.
2010-07-02 17:46:01 +01:00
Ian Jackson cb2b6edf55 Merge 2010-07-02 17:34:44 +01:00
Keir Fraser 8c5c89fc7c xenpaging: Fix 32-bit build after fixed-width type changes.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-06-30 22:12:54 +01:00
Keir Fraser a61e7a3565 Fix #GPF injection into compat guests in vm86 code
not to let the guest disable interrupts in the real EFLAGS.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-06-30 18:12:43 +01:00
Keir Fraser 7664456355 Use gfn_to_mfn_query() rather then gfn_to_mfn() when changing P2M types
Use gfn_to_mfn_query() rather then gfn_to_mfn() when changing
P2M types since we do not really want to force a PoD allocation
as a side effect.

Signed-off-by: Paul Durrant <Paul.Durrant@citrix.com>
2010-06-30 18:11:42 +01:00
Keir Fraser 1b2b50ec3f x86: fix an off-by-one pirq range check
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-06-30 18:11:09 +01:00
Keir Fraser 3f3ba5b3d4 VMX: remove useless super page recomputing in ept_set_entry.
Caller to ept_set_entry must give a valid order that hardware
supports, see set_p2m_entry in p2m.c.

Signed-off-by: Xin Li <xin.li@intel.com>
2010-06-30 18:09:16 +01:00
Keir Fraser b5103d692a x86 oprofile: use rdmsrl/wrmsrl
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2010-06-29 18:20:14 +01:00
Keir Fraser 79bdfbb588 trace: share t_info pages only in read-only mode
There's no need to share writably the t_info pages (Dom0 only wants
[and needs] to read it)

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-06-29 18:18:42 +01:00
Keir Fraser cecde1f967 Use fixed-width types in the memory event interface
Set the types in the public memory_event header file to use
fixed-sized and self-aligned fields rather than "unsigned long".  AIUI
this feature only works with 64-bit hypervisors but I think this
change will be necessary to use 32-on-64 dom0 tools.

This breaks compatibility with older builds of the tools, but I can't
see any way to avoid it short of __attribute__((__packed__)).

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Patrick Colp <pjcolp@cs.ubc.ca>
2010-06-29 18:17:44 +01:00
Keir Fraser af2b4aaad0 x86: Only build memory-event features on 64-bit Xen
32-bit Xen doesn't have enough p2m types to support them.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-06-29 18:16:41 +01:00
Ian Jackson 18aaa3fea9 Merge 2010-06-29 18:02:35 +01:00
Ian Jackson 4b544ba535 tools/pygrub: Fix default when out of range
This is the patch to fix pyGrub default value when it's being set out of
range. This patch makes the quiet and interactive mode select the same
default image when the default value for boot entry is out of range,
i.e. when the guest is having wrong configuration in it's boot loader
(like 3 entries with default mistakenly set to 10 etc).

When the boot entry number is being set out of range it falls back to 0
(first entry of boot loader).

Signed-off-by: Michal Novotny <minovotn@redhat.com>
2010-06-29 16:23:13 +01:00
Ian Jackson fa5685207c tools/xend: Revert 21541:7ff0e885b5c3 "a few blktap2 fixes"
Following discussion on xen-devel.  This changeset is doubtful and in
any case incomplete.
2010-06-29 16:21:20 +01:00
Ian Jackson ce9f534104 tools/ocaml: libxl ocaml bindings
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-06-29 15:15:57 +01:00
Ian Jackson 7237f39cb3 update QEMU_TAG to 109ed219afc4be5cc5c22f912bb125d1fb102bb2 2010-06-29 15:09:59 +01:00
Ian Jackson f706d9e9af tools: init.d/xencommons: Wait for xenstored to start before setting dom0 name
On one of my boxes, the xenstore-write setting dom0's name starts
before xenstored is actually ready to handle the connection properly,
resulting in the name set failing.  Wait for xenstored to be up and
responding to reads before continuing, timing out after 30 seconds.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-06-29 15:07:17 +01:00
Ian Jackson 8209429099 tools: init.d/xencommons: Make init script more verbose
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-06-29 15:06:27 +01:00
Ian Jackson b616bee08b tools/xend, xm: add a command to get the state of VMs
add a command "domstate" to get the state of Vms, which may have one state of
{'shutoff', 'idle','shutdown','running','crashed','paused' or 'paused by
admin"}.

For case of pause, I distinguish it into two conditions. One is "paused" the
other is "paused by admin".
"pasued by admin" means that users pause a domain voluntary by "xm paused
VM" or " API"

Signed-off-by James (Song Wei) <jsong@novell.com>
2010-06-29 14:52:51 +01:00
Keir Fraser d9edd37387 gpxe: Add eb-roms.h to hgignore list and build ROMs serially.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-06-29 13:43:18 +01:00
Keir Fraser 98ed7531a4 gpxe: Build e1000 ROM with PCI-ID matching that advertised by qemu-dm.
Also build gpxe without -Werror and require it always to be built (do
not include a pre-built binary in our source repo).

Portions of this patch are from Gianni Tedesco <gianni.tedesco@citrix.com>

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-06-29 13:33:37 +01:00
Keir Fraser 4580002f0f x86: send_IPI_mask() ignores offline CPUs in given cpumask.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-06-29 13:16:22 +01:00
Ian Jackson 2aaf60746f Merge 2010-06-28 17:40:16 +01:00
Ian Jackson 7bbf69bc87 tools/ocaml: Add .NOTPARALLEL to Makefile
tools/ocaml was capable of descending into lib/* and xenstored/
simultaneously, obviously with poor results.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-06-28 17:35:10 +01:00
Ian Jackson 4f5a16eb5c libxl: Specify no nics to qemu when no emulated nics
qemu will default to one emulated NIC if no network configuration is
specified on the command-line.  If there are no emualted NICs (i.e.,
no NICs or all NICs are PV), specify no nics to avoid getting an
emulated NIC by default.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-06-28 17:13:43 +01:00
Ian Jackson 28d7162231 libxl: Pass bridge config info into xenstore
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-06-28 17:10:38 +01:00