]> xenbits.xensource.com Git - xen.git/log
xen.git
15 years agoxm: Fix xm network-list for XenAPI
Keir Fraser [Mon, 22 Feb 2010 10:00:24 +0000 (10:00 +0000)]
xm: Fix xm network-list for XenAPI

When I use XenAPI, MAC addresses are not shown by xm network-list.
MAC addresses are shown by this patch.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
15 years agopaging: Remove noisy printk
Keir Fraser [Mon, 22 Feb 2010 09:58:48 +0000 (09:58 +0000)]
paging: Remove noisy printk

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
15 years agotmem: When failing allocs from "midsize alloc zone", try the tmem
Keir Fraser [Wed, 17 Feb 2010 15:54:40 +0000 (15:54 +0000)]
tmem: When failing allocs from "midsize alloc zone", try the tmem
pools rather than fail outright.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agopaging_domctl: Add missing breaks in switch stmt.
Keir Fraser [Wed, 17 Feb 2010 12:11:13 +0000 (12:11 +0000)]
paging_domctl: Add missing breaks in switch stmt.

From: Tim Deegan <Tim.Deegan@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoMask AMD CPUID masks in software before writing them to the MSRs
Keir Fraser [Wed, 17 Feb 2010 12:05:45 +0000 (12:05 +0000)]
Mask AMD CPUID masks in software before writing them to the MSRs

Mask AMD CPUID masks in software before writing them to the MSRs.
Setting bits in the CPUID mask MSR that are not set in the unmasked
CPUID response can cause those bits to be set in the masked response.
Avoid that by explicitly masking in software.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
15 years agox86/mcheck: do not blindly de-reference dom0 et al
Keir Fraser [Wed, 17 Feb 2010 12:04:50 +0000 (12:04 +0000)]
x86/mcheck: do not blindly de-reference dom0 et al

Since machine checks and CMCIs can happen before Dom0 even gets
constructed, the handlers of these events have to avoid de-referencing
respective pointers without checking.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agoAdded tag 4.0.0-rc4 for changeset 912295f1b1f3
Keir Fraser [Tue, 16 Feb 2010 18:11:17 +0000 (18:11 +0000)]
Added tag 4.0.0-rc4 for changeset 912295f1b1f3

15 years agoUpdate Xen version to 4.0.0-rc4 4.0.0-rc4
Keir Fraser [Tue, 16 Feb 2010 18:11:04 +0000 (18:11 +0000)]
Update Xen version to 4.0.0-rc4

15 years agoAdded tag 4.0.0-rc3 for changeset 7d565d58f498
Keir Fraser [Tue, 16 Feb 2010 11:55:21 +0000 (11:55 +0000)]
Added tag 4.0.0-rc3 for changeset 7d565d58f498

15 years agoUpdate Xen version to 4.0.0-rc3 4.0.0-rc3
Keir Fraser [Tue, 16 Feb 2010 11:55:18 +0000 (11:55 +0000)]
Update Xen version to 4.0.0-rc3

15 years agohotplug: ignore xenstore-read error
Keir Fraser [Tue, 16 Feb 2010 09:28:39 +0000 (09:28 +0000)]
hotplug: ignore xenstore-read error

The failure to read "backend/tap/<domid>/*" in the xenstore is a usual
case since the domain is gone after xenstore-ls command is executed.
The error should be ignored.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
15 years agocpuidle: do not enter deep C state if there is urgent VCPU
Keir Fraser [Tue, 16 Feb 2010 09:27:45 +0000 (09:27 +0000)]
cpuidle: do not enter deep C state if there is urgent VCPU

when VCPU is polling on event channel, it usually has urgent task
running, e.g. spin_lock, in this case, it is better for cpuidle driver
not to enter deep C state.

This patch fix the issue that SLES 11 SP1 domain0 hangs in the box of
large number of CPUs (>= 64 CPUs).

Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Tian Kevin <kevin.tian@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoWhen tmem is enabled, reserve a fraction of memory
Keir Fraser [Mon, 15 Feb 2010 17:54:04 +0000 (17:54 +0000)]
When tmem is enabled, reserve a fraction of memory
for allocations of 0<order<9 to avoid fragmentation
issues.

Signed-off by: Dan Magenheimer <dan.magenheimer@oracle.com>

15 years agoIf the 'sched' parameter is unrecognized, choose the first scheduler
Keir Fraser [Mon, 15 Feb 2010 17:49:14 +0000 (17:49 +0000)]
If the 'sched' parameter is unrecognized, choose the first scheduler

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
15 years agoxend: Remove redundant 'name' from LEGACY_CFG_TYPES and LEGACY_XENSTORE_VM_PARAMS
Keir Fraser [Mon, 15 Feb 2010 08:19:07 +0000 (08:19 +0000)]
xend: Remove redundant 'name' from LEGACY_CFG_TYPES and LEGACY_XENSTORE_VM_PARAMS

Two 'name's are defined in LEGACY_CFG_TYPES of XendConfig.py.
LEGACY_XENSTORE_VM_PARAMS also is same.
This patch removes redundant 'name's.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
15 years agoxenpaging: Small code style cleanups
Keir Fraser [Mon, 15 Feb 2010 08:18:14 +0000 (08:18 +0000)]
xenpaging: Small code style cleanups

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoFix a small bug about HVM_MAX_VCPUS related array
Keir Fraser [Mon, 15 Feb 2010 08:15:08 +0000 (08:15 +0000)]
Fix a small bug about HVM_MAX_VCPUS related array

Currently it doesn't block running, anyway, it better fix the small
bug considering if in the future HVM_MAX_VCPUS will not necessarily be
8x value.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>=
15 years agohvmloader: Fix an ACPI asl bug.
Keir Fraser [Mon, 15 Feb 2010 08:14:21 +0000 (08:14 +0000)]
hvmloader: Fix an ACPI asl bug.

Fix an ACPI asl bug by explicitly convert PRS to buffer, otherwise PRS
would be parsed as integer if less than 32/64 bits (according to ACPI
1.0 or 2.0).

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
15 years agoVcpu hotplug: Move ACPI processor from \_PR to \_SB
Keir Fraser [Mon, 15 Feb 2010 08:13:26 +0000 (08:13 +0000)]
Vcpu hotplug: Move ACPI processor from \_PR to \_SB

Move processor from \_PR to \_SB. ACPI processor can be defined
under \_PR or \_SB. However, recently os like linux 2.6.30/32 support
cpu hotplug better for \_SB processor object.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agox86_64: widen bit width usable for struct domain allocation
Keir Fraser [Fri, 12 Feb 2010 09:24:18 +0000 (09:24 +0000)]
x86_64: widen bit width usable for struct domain allocation

With it being a PDX (instead of a PFN) that gets stored when a 32-bit
quantity is needed, we should also account for the bits removed during
PFN-to-PDX conversion when doing the allocation.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agoRemus: increase failover timeout from 500ms to 1s
Keir Fraser [Fri, 12 Feb 2010 09:23:10 +0000 (09:23 +0000)]
Remus: increase failover timeout from 500ms to 1s

500ms is aggressive enough to trigger split-brain under fairly
ordinary workloads, particularly for HVM. The long-term fix is to
integrate with a real HA monitor like linux HA.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
15 years agokeyhandler: Do not serialise keyhandlers; increase scratch array size.
Keir Fraser [Fri, 12 Feb 2010 09:21:57 +0000 (09:21 +0000)]
keyhandler: Do not serialise keyhandlers; increase scratch array size.

Although serialising keyhandlers is safer, and in particular
protects access to shared heyhandler_scratch[], in debug scenarios it
is probably better to 'have a go' when requested - and assume the user
knows what they are doing.

Meanwhile, increase scratch array size to 1024. That's enough for more
than a dozen lines of 80-column text, and should be plenty in any
practical situation.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agohvmloader: Fix parallel build of ACPI tables.
Keir Fraser [Fri, 12 Feb 2010 09:16:10 +0000 (09:16 +0000)]
hvmloader: Fix parallel build of ACPI tables.

Make build.c dependency on ssdt_{pm,tpm}.h explicit, else they can be
built in the wrong order.

Also, improve naming of target DSDT structures, and specify -p option
to iasl so that all generated files for a given target have
target-unique names, hence build can proceed safely in parallel.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agohvmloader: Fix comment style in ssdt_tpm.asl
Keir Fraser [Fri, 12 Feb 2010 09:14:16 +0000 (09:14 +0000)]
hvmloader: Fix comment style in ssdt_tpm.asl

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agohvmloader: Build a compatibility DSDT with only 15 processor objects.
Keir Fraser [Thu, 11 Feb 2010 22:42:18 +0000 (22:42 +0000)]
hvmloader: Build a compatibility DSDT with only 15 processor objects.

Deploy this smaller DSDT where possible: this is required to boot
Windows 2000, which only supports up to 15 processors and will blue
screen if it sees more processor objects than that (even inactive
ones).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agohvmloader: Remove checked-in ready-compiled SSDT_PM and SSDT_TPM.
Keir Fraser [Thu, 11 Feb 2010 21:49:47 +0000 (21:49 +0000)]
hvmloader: Remove checked-in ready-compiled SSDT_PM and SSDT_TPM.

These can be built at the same time as the DSDT.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agohvmloader: Do not leave compiled DSDT checked in to tree.
Keir Fraser [Thu, 11 Feb 2010 21:21:41 +0000 (21:21 +0000)]
hvmloader: Do not leave compiled DSDT checked in to tree.

It's big and small changes generate huge diffs. People building the
firmware will have to ensure they have iasl installed.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoDump full vCPU polling mask from 'e' key handler
Keir Fraser [Thu, 11 Feb 2010 21:14:12 +0000 (21:14 +0000)]
Dump full vCPU polling mask from 'e' key handler

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agokeyhandler: global shared scratch space for temporary strings
Keir Fraser [Thu, 11 Feb 2010 21:08:06 +0000 (21:08 +0000)]
keyhandler: global shared scratch space for temporary strings

Put one static definition in one place and we can make it as big as we
think reasonable.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoVT-d: get rid of duplicated definition
Keir Fraser [Thu, 11 Feb 2010 19:51:15 +0000 (19:51 +0000)]
VT-d: get rid of duplicated definition

free_pgtable_maddr was implemented the same for x86 and IA64, so it's
not necessary to define it separately for x86 and IA64. This patch
moves free_pgtable_maddr definition to iommu.c to avoid duplicated
definition.

Signed-off-by: Weidong Han <weidong.han@intel.com>
15 years agoblktap2: disable presently broken memshr extension
Keir Fraser [Thu, 11 Feb 2010 19:50:42 +0000 (19:50 +0000)]
blktap2: disable presently broken memshr extension

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
15 years agotools/xenpaging: fix bug of Segmentation fault
Keir Fraser [Thu, 11 Feb 2010 19:50:05 +0000 (19:50 +0000)]
tools/xenpaging: fix bug of Segmentation fault

Segmentation fault occurs in two situations:
1. argc is less than 3
2. xenpaging_init() fault

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
15 years agoVT-d: fix coding style in acpi_find_matched_drhd_unit()
Keir Fraser [Thu, 11 Feb 2010 19:49:31 +0000 (19:49 +0000)]
VT-d: fix coding style in acpi_find_matched_drhd_unit()

Signed-off-by: Weidong Han <weidong.han@intel.com>
15 years agoVT-d: ensure zapping ACPI DMAR signature in acpi_parse_dmar
Keir Fraser [Thu, 11 Feb 2010 19:48:58 +0000 (19:48 +0000)]
VT-d: ensure zapping ACPI DMAR signature in acpi_parse_dmar

VT-d is owned by Xen hypervisor. Xen zaps ACPI DMAR signature to
prevent dom0 to use VT-d. This patch changes the direct return when
DMAR width is zero, instead zaps ACPI DMAR signature before return.

Signed-off-by: Weidong Han <weidong.han@intel.com>
15 years agotools/xenbaked: fix bug of Segmentation fault
Keir Fraser [Wed, 10 Feb 2010 13:30:57 +0000 (13:30 +0000)]
tools/xenbaked: fix bug of Segmentation fault

Run xenbaked will cause Segmentation fault, because
the method to get pointers of trace buffer metadata
is wrong. Fix this bug according to xentrace.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
15 years agolibxc: fix bug in xc_tbuf_get_size()
Keir Fraser [Wed, 10 Feb 2010 13:30:16 +0000 (13:30 +0000)]
libxc: fix bug in xc_tbuf_get_size()

The size in pages of trace buffer should be t_info->tbuf_size
rather than t_info pages.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
15 years agoRemove hardcoded instances of TIMER_SLOP.
Keir Fraser [Wed, 10 Feb 2010 13:27:55 +0000 (13:27 +0000)]
Remove hardcoded instances of TIMER_SLOP.

They aren't needed at all, since slop now only delays a timer firing,
rather than allowing it to happen early.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agox86: move trampoline location
Keir Fraser [Wed, 10 Feb 2010 09:20:56 +0000 (09:20 +0000)]
x86: move trampoline location

A partner of ours is reporting boot failures (Xen not even emitting a
single message) over iSCSI on new (UEFI based) systems. After
pointing at their BIOS initially I finally remembered to take a look
at the memory map a native kernel booted this way see - and voila, the
BIOS reports memory starting at 0x8d000 as reserved. Xen, however,
places about 12k of (trampoline) data at 0x8c000.

For now, move the trampolien down by 4kB to 0x88000. Later we may
choose the location dynamically based on E820 information, if this
proves to be an ongoing problem.

One thing this patch enforces in any case is a single point of
definition for the hard coded location, so that at least adjusting it
won't require more than a single line change in the future.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agotools/remus: fix build in (symlinked) read-only source tree
Keir Fraser [Wed, 10 Feb 2010 09:19:16 +0000 (09:19 +0000)]
tools/remus: fix build in (symlinked) read-only source tree

Modifying source files should generally be avoided; if it is being
done, care should at least be taken to not attempt writes to read-only
files.

While at it, also force the whole ugly construct to fail if any of its
commands fails.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agoFix domain reference leaks
Keir Fraser [Wed, 10 Feb 2010 09:18:43 +0000 (09:18 +0000)]
Fix domain reference leaks

Besides two unlikely/rarely hit ones in x86 code, the main offender
was tmh_client_from_cli_id(), which didn't even have a counterpart
(albeit it had a comment correctly saying that it causes d->refcnt to
get incremented). Unfortunately(?) this required a bit of code
restructuring (as I needed to change the code anyway, I also fixed
a couple os missing bounds checks which would sooner or later be
reported as security vulnerabilities), so I would hope Dan could give
it his blessing before it gets applied.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agox86: MCE fixes
Keir Fraser [Wed, 10 Feb 2010 09:18:11 +0000 (09:18 +0000)]
x86: MCE fixes

- fill_vmsr_data() leaked a domain reference; since the caller already
  obtained one, there's no need to obtain another one here
- intel_UCR_handler() could call put_domain() with a NULL pointer
- mcheck_mca_logout() updated a local data structure that wasn't used
  after the update

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agotmem: Disable by default: enable with Xen boot param 'tmem'
Keir Fraser [Wed, 10 Feb 2010 09:09:35 +0000 (09:09 +0000)]
tmem: Disable by default: enable with Xen boot param 'tmem'

This reverts 20758:4e56f809ddbf and 20655:3c5b5c4c1d79

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoxend: Enlarge the memory balloon size for domain creation since shadow
Keir Fraser [Wed, 10 Feb 2010 09:07:48 +0000 (09:07 +0000)]
xend: Enlarge the memory balloon size for domain creation since shadow
pre-allocation size has changed from 1M to 4M.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
15 years agoxenpm: Fix ia64 build
Keir Fraser [Wed, 10 Feb 2010 09:06:59 +0000 (09:06 +0000)]
xenpm: Fix ia64 build

cpuid_eax() is x86-specific.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
15 years agoDump machine check context for fatal machine check
Keir Fraser [Mon, 8 Feb 2010 10:18:51 +0000 (10:18 +0000)]
Dump machine check context for fatal machine check

This small patches enable Xen hypervisor to always dump machine check
ontext, previously it will not print anything if fatal MCE happens. It
also add checking for NULL pointer.

It also change the address passing to guest to always use guest
mfn. It should benifit non-translated guest.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
15 years agoDon't scrub broken pages
Keir Fraser [Mon, 8 Feb 2010 10:18:14 +0000 (10:18 +0000)]
Don't scrub broken pages

Don't touch the poison pages when scrub the pages. Consuming poison
page will contaminate the CPU context and may cause system crash.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
15 years agoSome time-handling fixes.
Keir Fraser [Mon, 8 Feb 2010 10:14:48 +0000 (10:14 +0000)]
Some time-handling fixes.

Fixes my domU boot hangs (when using vtsc) due to vtsc_offset less
then local cpu's stime_local_stamp, leading to bogus
vcpu_time_info.tsc_timestamp.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agotools/xenconsole: fix Segmentation fault
Keir Fraser [Mon, 8 Feb 2010 08:50:03 +0000 (08:50 +0000)]
tools/xenconsole: fix Segmentation fault

Segmentation fault occurs if DOMID isn't specified.
Some check be added to output error message in this situation.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
15 years agoHandle bogus serial ports that appear normal, but don't generate
Keir Fraser [Mon, 8 Feb 2010 08:49:19 +0000 (08:49 +0000)]
Handle bogus serial ports that appear normal, but don't generate
interrupts e.g. the "remote serial console" on Blades.

Authored-by: Gary Grebus <Gary.Grebus@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
15 years agoxenpm: Allow user to enable/disable dbs governor turbo mode.
Keir Fraser [Mon, 8 Feb 2010 08:48:40 +0000 (08:48 +0000)]
xenpm: Allow user to enable/disable dbs governor turbo mode.

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
15 years agovmx: Don't enable irq for machine check vmexit handling
Keir Fraser [Mon, 8 Feb 2010 08:43:25 +0000 (08:43 +0000)]
vmx: Don't enable irq for machine check vmexit handling

We should not enable irq for machine check VMExit

In changeset 18658:824892134573, IRQ is enabled during VMExit except
external interrupt. The exception should apply for machine check also,
because :
a) The mce_logout_lock should be held in irq_disabled context.
b) The machine check event should be handled as quickly as possible,
enable irq will increase the period greatly.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoremus: Only build kernel module if parent kernel has IMQ configured.
Keir Fraser [Mon, 8 Feb 2010 08:41:51 +0000 (08:41 +0000)]
remus: Only build kernel module if parent kernel has IMQ configured.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoblktap2: Fix non-Linux build
Keir Fraser [Fri, 5 Feb 2010 13:57:20 +0000 (13:57 +0000)]
blktap2: Fix non-Linux build

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoRemus: fix ia64 build
Keir Fraser [Fri, 5 Feb 2010 10:37:24 +0000 (10:37 +0000)]
Remus: fix ia64 build

This patch fixes the following error:
  /xen-unstable.hg/tools/remus/kmod/sch_queue.c: In function
  `is_foreign':
  /xen-unstable.hg/tools/remus/kmod/sch_queue.c:51: error:
  `phys_to_machine_mapping' undeclared (first use in this function)

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
15 years agoUpdate QEMU_TAG to d463cfee458bacfe1ee3cb9c3b4ce46a6be06edf
Keir Fraser [Fri, 5 Feb 2010 10:36:43 +0000 (10:36 +0000)]
Update QEMU_TAG to d463cfee458bacfe1ee3cb9c3b4ce46a6be06edf

15 years agolibxl: Properly parse vbd names
Keir Fraser [Fri, 5 Feb 2010 10:36:17 +0000 (10:36 +0000)]
libxl: Properly parse vbd names

Implement proper parsing of vbd names, as documented here:
  From: Ian Jackson <Ian.Jackson@eu.citrix.com>
  Subject: Xen vbd numbering
  Date: Wed, 03 Feb 2010 16:51:47 GMT
  Message-ID: <19305.43376.600816.817077@mariner.uk.xensource.com>
  http://lists.xensource.com/archives/html/xen-devel/2010-02/msg00183.html

Previously, xvd and numerical specification were broken in libxl.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl: notice if vbd virt device specifier ("path") unrecognised
Keir Fraser [Fri, 5 Feb 2010 10:35:57 +0000 (10:35 +0000)]
libxl: notice if vbd virt device specifier ("path") unrecognised

Previously, specifying a virtual device string the vbd that couldn't
be parsed would result in attempting to actually create the device
with vbd number -1 !

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoRevert changeset 20898:8c1889297084
Keir Fraser [Thu, 4 Feb 2010 19:40:19 +0000 (19:40 +0000)]
Revert changeset 20898:8c1889297084

15 years agolibxc: Reorder functions in xc_misc.c to avoid weak symbol problem
Keir Fraser [Thu, 4 Feb 2010 13:16:39 +0000 (13:16 +0000)]
libxc: Reorder functions in xc_misc.c to avoid weak symbol problem

Using a function, and then declaring it weak later, has undefined
behaviour:
  cc1: warnings being treated as errors
  xc_misc.c:388: error: weak declaration of 'xc_map_foreign_bulk'
  after first use results in unspecified behavior

So swap the functions xc_map_foreign_pages and xc_map_foreign_bulk.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxenlight: Do not build libconfig, but require it as a prerequisite
Keir Fraser [Thu, 4 Feb 2010 13:16:03 +0000 (13:16 +0000)]
libxenlight: Do not build libconfig, but require it as a prerequisite

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agomem hotplug: Fix an incorrect sanity check in memory add
Keir Fraser [Thu, 4 Feb 2010 13:09:30 +0000 (13:09 +0000)]
mem hotplug: Fix an incorrect sanity check in memory add

Current, memory hot-add will fail if the new added memory is bigger
than current max_pages. This is really a stupid checking, considering
user may hot-add the biggest address riser card firstly.

This patch fix this issue. It check if all new added memory is
unpopulated, if yes, then it is ok.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
15 years agoVT-d, tools: Intel IGD passthrough 2/2: hvm config file example
Keir Fraser [Thu, 4 Feb 2010 09:09:13 +0000 (09:09 +0000)]
VT-d, tools: Intel IGD passthrough 2/2: hvm config file example

Add an option into hvm config file to enable graphics passthrough
including discrete and IGD. To passthrough graphics to guest, need to
set gfx_passthru=1, and also specify graphics device BDF in pci
passthrough option, like pci=['xx:xx.x'] in hvm config file.

Signed-off-by: Weidong Han <weidong.han@intel.com>
15 years agoVT-d, tools: Intel IGD passthrough 1/2: vendor-specific FLR
Keir Fraser [Thu, 4 Feb 2010 09:08:05 +0000 (09:08 +0000)]
VT-d, tools: Intel IGD passthrough 1/2: vendor-specific FLR

Due to FLR capability of IGD is not exposed on some platforms, this
patch uses vendor specific FLR to reset those IGDs.

Signed-off-by: Weidong Han <weidong.han@intel.com>
15 years agox86: Intel EPT entry structure changes.
Keir Fraser [Thu, 4 Feb 2010 09:04:33 +0000 (09:04 +0000)]
x86: Intel EPT entry structure changes.

 - Intel SDM defines bit6 in EPT page table entry as "Ignore PAT
   memory type", so change the abbreviation from "igmt" to "ipat".

 - Change the mfn and avail2 fields according to SDM definition.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
15 years agotools: Do not append trailing slash to XEN_ROOT in Makefiles
Keir Fraser [Thu, 4 Feb 2010 09:03:42 +0000 (09:03 +0000)]
tools: Do not append trailing slash to XEN_ROOT in Makefiles

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agox86: make max_mfn returned from XENMEM_machphys_mapping dynamic
Keir Fraser [Thu, 4 Feb 2010 08:53:49 +0000 (08:53 +0000)]
x86: make max_mfn returned from XENMEM_machphys_mapping dynamic

This helps debugging in the guest kernels, as then MFNs there can then
be range checked based on the reported value.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agox86: fix frame table initialization when hotplug memory regions were detected
Keir Fraser [Thu, 4 Feb 2010 08:53:16 +0000 (08:53 +0000)]
x86: fix frame table initialization when hotplug memory regions were detected

max_idx is not a pdx, and hence needs to be converted to one in all
cases where it is being passed to pdx_to_page().

Also, just like for max_pdx, the conversion result of max_idx may
point into an address space hole, and hence it must not be used
directly as an argument to pdx_to_page(). Note that this doesn't apply
to the arguments passed to memset(), as the size argument would be
zero in the case of hitting an address space hole.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agoVT-d: fix a bug in enable_ats_device
Keir Fraser [Wed, 3 Feb 2010 09:46:38 +0000 (09:46 +0000)]
VT-d: fix a bug in enable_ats_device

In enable_ats_device, it should enable ATS if find matched atsr unit
for a device, and don't enable it if no matched atsr unit. But current
code does contrarily. This patch fixes it.

Signed-off-by: Weidong Han <Weidong.han@intel.com>
15 years agolibxc: Check there's enough memory for segments we're creating
Keir Fraser [Wed, 3 Feb 2010 09:46:01 +0000 (09:46 +0000)]
libxc: Check there's enough memory for segments we're creating

Previously, xc_dom_alloc_segment would go ahead even if the segment
we're trying to create is too big for the domain's RAM (or the
requested addr is out of range).  It would pass invalid parameters to
xc_dom_seg_to_ptr giving undefined behaviour.

Fixing xc_dom_seg_to_ptr to fail is not sufficient because we want to
provide a comprehensible explanation to the caller - which may
ultimately be the user.

In particular, with this change attempting "xl create" with a ramdisk
image bigger than the guest's specified RAM will provide a useful
error message mentioning the ramdisk.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxc: Check full range of pfns for xc_dom_pfn_to_ptr
Keir Fraser [Wed, 3 Feb 2010 09:45:40 +0000 (09:45 +0000)]
libxc: Check full range of pfns for xc_dom_pfn_to_ptr

Previously, passing a valid pfn but an overly large count to
xc_dom_pfn_to_ptr, and functions which call it, would run off the end
of the pfn array giving undefined behaviour.

It is tempting to change this check to an assert, as no callers should
be providing invalid parameters here.  But this is probably best not
done while frozen for 4.0.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoxl: Do not duplicate last line of config file when trying compat mode.
Keir Fraser [Wed, 3 Feb 2010 09:45:25 +0000 (09:45 +0000)]
xl: Do not duplicate last line of config file when trying compat mode.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoxend: Disallow "/" in domain names
Keir Fraser [Wed, 3 Feb 2010 09:45:02 +0000 (09:45 +0000)]
xend: Disallow "/" in domain names

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
15 years agotboot: fix S3 issue for Intel Trusted Execution Technology.
Keir Fraser [Wed, 3 Feb 2010 09:44:12 +0000 (09:44 +0000)]
tboot: fix S3 issue for Intel Trusted Execution Technology.

Those unmapped pages cause page fault when MACing them and finally
cause S3 failure.

Signed-off-by: Shane Wang <shane.wang@intel.com>
15 years agotools/xen-detect: fix printing xen version
Keir Fraser [Wed, 3 Feb 2010 09:42:45 +0000 (09:42 +0000)]
tools/xen-detect: fix printing xen version

check_for_xen() should return xen version rather than
boolean true if signature XenVMM is found.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
15 years agolibxc: Export do_mca hypercall to user space tools.
Keir Fraser [Wed, 3 Feb 2010 09:38:57 +0000 (09:38 +0000)]
libxc: Export do_mca hypercall to user space tools.

This is mainly for software trigger MCE operation, so that test suites
can trigger software MCE.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
15 years agoRemus: ensure kernel modules are built before attempting to install
Keir Fraser [Wed, 3 Feb 2010 09:38:00 +0000 (09:38 +0000)]
Remus: ensure kernel modules are built before attempting to install
them

make tools seems to skip straight to the install target.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
15 years agoRemus: use imqebt instead of ebtables
Keir Fraser [Wed, 3 Feb 2010 09:37:40 +0000 (09:37 +0000)]
Remus: use imqebt instead of ebtables

I added a standalone IMQ-aware ebtables version in the initial Remus
submission, but forgot to actually activate it. This fixes that
oversight.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
15 years agoxentrace: Disable tracing, then read records one more time.
Keir Fraser [Wed, 3 Feb 2010 09:36:37 +0000 (09:36 +0000)]
xentrace: Disable tracing, then read records one more time.

When interrupted, first disable tracing, then read through the records
one last time.

Without this patch, it's possible to get traces which interact (such
as runstate changes) on processors with higher numbers, while missing
the corresponding traces generated on lower-numbered processors.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
15 years agoxentrace: Clear lost records when disabling tracing
Keir Fraser [Wed, 3 Feb 2010 09:35:56 +0000 (09:35 +0000)]
xentrace: Clear lost records when disabling tracing

This patch clears the "lost records" flag on each cpu when tracing is
disabled.

Without this patch, the next time tracing starts, cpus with lost
records will generate lost record traces, even though buffers are
empty and no tracing has recently happened.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
15 years agoxentrace: Trace p2m events
Keir Fraser [Wed, 3 Feb 2010 09:35:23 +0000 (09:35 +0000)]
xentrace: Trace p2m events

Add more tracing to aid in debugging ballooning / PoD:
* Nested page faults for EPT/NPT systems
* set_p2m_enry
* Decrease reservation (for ballooning)
* PoD populate, zero reclaim, superpage splinter

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
15 years agoUpdate QEMU_TAG to 575ed1016f6fba1c6a6cd32a828cb468bdee96bb
Keir Fraser [Wed, 3 Feb 2010 09:33:12 +0000 (09:33 +0000)]
Update QEMU_TAG to 575ed1016f6fba1c6a6cd32a828cb468bdee96bb

15 years agohvmloader: Fix CPU hotplug notify handler in ACPI DSDT.
Keir Fraser [Wed, 3 Feb 2010 09:16:11 +0000 (09:16 +0000)]
hvmloader: Fix CPU hotplug notify handler in ACPI DSDT.

By merging PRSC and NTFY methods we simplify the code, improve
efficiency, and fix a bug where PRSC iterated 0-255 but NTDY could
only handle CPU numbers 0-127.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agopygrub: support parsing of syslinux configuration files
Keir Fraser [Mon, 1 Feb 2010 14:03:47 +0000 (14:03 +0000)]
pygrub: support parsing of syslinux configuration files

Allows booting from ISOs which use isolinux as well as guests using
extlinux.

Also add copyright header to GrubConf.py, I think the grub2 support
added last year qualifies as a substantial change.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
15 years agohvm, s3: HVM guest RTCs become unsync'ed across host S3.
Keir Fraser [Mon, 1 Feb 2010 14:03:06 +0000 (14:03 +0000)]
hvm, s3: HVM guest RTCs become unsync'ed across host S3.

Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
15 years agotools/gtraceview: fix SIGFPE
Keir Fraser [Fri, 29 Jan 2010 08:59:46 +0000 (08:59 +0000)]
tools/gtraceview: fix SIGFPE

If there are 0 or 1 valid record in xentrace file,
SIGFPE will occur. Fix it.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
15 years agoblktap2: Prefer AIO eventfd support on kernels >= 2.6.22
Keir Fraser [Fri, 29 Jan 2010 08:55:27 +0000 (08:55 +0000)]
blktap2: Prefer AIO eventfd support on kernels >= 2.6.22

Mainline kernel support for eventfd(2) in linux aio was added between
2.6.21 and 2.6.22. Libaio after 0.3.107 has the header file, but
presently few systems support it. Neither do we rely on an up-to-date
libc6.

Instead, this patch adds a header which defines custom iocb_common
struct, and works around a potentially missing sys/eventfd.h.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
15 years agoblktap2: Separate tapdisk raw I/O into different backends.
Keir Fraser [Fri, 29 Jan 2010 08:54:51 +0000 (08:54 +0000)]
blktap2: Separate tapdisk raw I/O into different backends.

Hide tapdisk support for different raw I/O interfaces behind a new
struct tio. Libaio remains to dominate the interface, requiring
everyone to dispatch iocb/ioevent structs.

Backends:
 - lio:  Kernel AIO via libaio.
 - rwio: Canonical read/write() mode.

Misc:
 - Fixes a bug in tapdisk-vbd which locks up the sync io mode.
 - Wants a PERROR macro in blktaplib.h
 - Removes dead code in qcow2raw to make it link again.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
Signed-off-by: Jake Wires <jake.wires@citrix.com>
15 years agoblktap2: Sort out tapdisk AIO init.
Keir Fraser [Fri, 29 Jan 2010 08:54:22 +0000 (08:54 +0000)]
blktap2: Sort out tapdisk AIO init.

Move event callbacks registration into tapdisk-queue. This should also
obsoletes the dummy pollfd pipe in the synchronous I/O case.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
15 years agoblktap2: Sort out tapdisk IPC init.
Keir Fraser [Fri, 29 Jan 2010 08:53:52 +0000 (08:53 +0000)]
blktap2: Sort out tapdisk IPC init.

Move I/O and event callbacks setup out of tapdisk-server, into
tapdisk-ipc.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
15 years agolibelf: make elf_phdr_is_loadable load read-only segments.
Keir Fraser [Fri, 29 Jan 2010 07:14:32 +0000 (07:14 +0000)]
libelf: make elf_phdr_is_loadable load read-only segments.

From: Brad Plant <bplant@iinet.net.au>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agopv-on-hvm: Correct the order of the argument of out*()
Keir Fraser [Fri, 29 Jan 2010 07:10:28 +0000 (07:10 +0000)]
pv-on-hvm: Correct the order of the argument of out*()

The order of the argument of outl() is wrong.
The correct order is outl(value, port). This causes kernel panic.

And outw() is also similar.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
15 years agox86 mca: Be more careful for printk in MCE context
Keir Fraser [Fri, 29 Jan 2010 06:50:23 +0000 (06:50 +0000)]
x86 mca: Be more careful for printk in MCE context

MCE may happen in printk context, and will cause deadlock if we try to
call printk again in MCE context.

A new level(mce_critical) is added to mce_verbosity for printk in mce
context. This level is only for developer that aware of such issue.
In mce_panic, force console unlock.

Singed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
15 years agox86 mca: Add MCE broadcast checkiing.
Keir Fraser [Fri, 29 Jan 2010 06:49:42 +0000 (06:49 +0000)]
x86 mca: Add MCE broadcast checkiing.

Some platform will broadcast MCE to all logical processor, while some
platform will not. Distinguish these platforms will be helpful for
unified MCA handler.

the "mce_fb" is a option to emulate the broadcast MCA in non-broadcast
platform. This is mainly for MCA software trigger.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
15 years agox86 mca: Fix the vMCE address translation for HVM guest.
Keir Fraser [Fri, 29 Jan 2010 06:49:13 +0000 (06:49 +0000)]
x86 mca: Fix the vMCE address translation for HVM guest.

Fix address translation when we inject a virtual MCE to HVM guest.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
15 years agox86 mca: Add the mised put_domain in UCR handler function.
Keir Fraser [Fri, 29 Jan 2010 06:48:37 +0000 (06:48 +0000)]
x86 mca: Add the mised put_domain in UCR handler function.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
15 years agox86 mca: Not GP fault when guest write non 0s or 1s to MCA CTL MSRs.
Keir Fraser [Fri, 29 Jan 2010 06:48:00 +0000 (06:48 +0000)]
x86 mca: Not GP fault when guest write non 0s or 1s to MCA CTL MSRs.

a) For Mci_CTL MSR, Guest can write any value to it. When read back,
it will be ANDed with the physical value. Some bit in physical value
can be 0, either because read-only in hardware (like masked by AMD's
Mci_CTL_MASK), or because Xen didn't enable it.
    If guest write some bit as 0, while that bit is 1 in host, we will
    not inject MCE corresponding that bank to guest, as we can't
    distinguish if the MCE is caused by the guest-cleared bit.

b) For MCG_CTL MSR, guest can write any value to it. When read back,
it will be ANDed with the physical value.
    If guest does not write all 1s. In mca_ctl_conflict(), we simply
    not inject any vMCE to guest if some bit is set in physical MSR
    while is cleared in guest 's vMCG_CTL MSR.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
15 years agox86 mca: Handle the vMCA bank correctly
Keir Fraser [Fri, 29 Jan 2010 06:47:24 +0000 (06:47 +0000)]
x86 mca: Handle the vMCA bank correctly

Currently the virtual MCE MSR assume all MSRs range from 0 to
MAX_NR_BANKS are always MCE MSR, this is not always correct. With this
patch, the mce_rdmsr/mce_wrmsr will only handle vMCE MSR range from 0
to the MCA banks in the host platform.
Please notice that some MSR beyond current MCA banks in the host
platform are really MCA MSRs, that should be handled by general MSR
handler.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
15 years agox86: Clean up c/s 20844:ca0759a08057
Keir Fraser [Fri, 29 Jan 2010 06:45:45 +0000 (06:45 +0000)]
x86: Clean up c/s 20844:ca0759a08057

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoxend: destroy restored domain when its device doesn't exist
Keir Fraser [Wed, 27 Jan 2010 08:59:47 +0000 (08:59 +0000)]
xend: destroy restored domain when its device doesn't exist

A migrated domain keeps on running even though its disk doesn't
exist. This situation must be undesirable.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
15 years agopygrub: improve grub 2 support
Keir Fraser [Tue, 26 Jan 2010 15:54:40 +0000 (15:54 +0000)]
pygrub: improve grub 2 support

* The "default" value can be a quoted string (containing an integer)
  so strip the quotes before interpreting.
* The "set" command takes a variable with an arbitrary name so instead
  of whitelisting the ones to ignore simply silently accept any set
  command with an unknown variable.
* Ignore the echo command.
* Handle the function { ... } syntax. Previously pygrub would error
  out with a syntax error on the closing "}" because it thought it was
  the closing bracket of a menuentry.

This makes pygrub2 work with the configuration files generated by
Debian Squeeze today.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>