Commit Graph
20928 Commits
Author SHA1 Message Date
Keir Fraser 01c8d49675 blktap2: disable presently broken memshr extension
Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
2010-02-11 19:50:42 +00:00
Keir Fraser 1d1987220a 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>
2010-02-11 19:50:05 +00:00
Keir Fraser 540e623874 VT-d: fix coding style in acpi_find_matched_drhd_unit()
Signed-off-by: Weidong Han <weidong.han@intel.com>
2010-02-11 19:49:31 +00:00
Keir Fraser 275c052dac 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>
2010-02-11 19:48:58 +00:00
Keir Fraser 0fd6ab35d1 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>
2010-02-10 13:30:57 +00:00
Keir Fraser 931df711f2 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>
2010-02-10 13:30:16 +00:00
Keir Fraser e1fadda8bd 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>
2010-02-10 13:27:55 +00:00
Keir Fraser e9603f14e3 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>
2010-02-10 09:20:56 +00:00
Keir Fraser 01d99a3212 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>
2010-02-10 09:19:16 +00:00
Keir Fraser b14339379a 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>
2010-02-10 09:18:43 +00:00
Keir Fraser 948593955a 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>
2010-02-10 09:18:11 +00:00
Keir Fraser 8d835167c2 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>
2010-02-10 09:09:35 +00:00
Keir Fraser 541a47d53d 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>
2010-02-10 09:07:48 +00:00
Keir Fraser 9a83712ebe xenpm: Fix ia64 build
cpuid_eax() is x86-specific.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
2010-02-10 09:06:59 +00:00
Keir Fraser cfc536c55a 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>
2010-02-08 10:18:51 +00:00
Keir Fraser 407b049aeb 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>
2010-02-08 10:18:14 +00:00
Keir Fraser e0e58ddbf3 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>
2010-02-08 10:14:48 +00:00
Keir Fraser 2f98a8cad0 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>
2010-02-08 08:50:03 +00:00
Keir Fraser 8e2626b7d7 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>
2010-02-08 08:49:19 +00:00
Keir Fraser d2a92c94a1 xenpm: Allow user to enable/disable dbs governor turbo mode.
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
2010-02-08 08:48:40 +00:00
Keir Fraser 43d6e1096b 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>
2010-02-08 08:43:25 +00:00
Keir Fraser a73520207b remus: Only build kernel module if parent kernel has IMQ configured.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-02-08 08:41:51 +00:00
Keir Fraser 7283e6eae8 blktap2: Fix non-Linux build
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-02-05 13:57:20 +00:00
Keir Fraser e7a5d6fa85 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>
2010-02-05 10:37:24 +00:00
Keir Fraser 95861f88c7 Update QEMU_TAG to d463cfee458bacfe1ee3cb9c3b4ce46a6be06edf 2010-02-05 10:36:43 +00:00
Keir Fraser e9703a99de 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>
2010-02-05 10:36:17 +00:00
Keir Fraser 10d13f8ac6 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>
2010-02-05 10:35:57 +00:00
Keir Fraser af43e76ed6 Revert changeset 20898:8c1889297084 2010-02-04 19:40:19 +00:00
Keir Fraser e670c28c9f 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>
2010-02-04 13:16:39 +00:00
Keir Fraser 7a381d2707 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>
2010-02-04 13:16:03 +00:00
Keir Fraser 47f441d6b6 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>
2010-02-04 13:09:30 +00:00
Keir Fraser 8973872b34 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>
2010-02-04 09:09:13 +00:00
Keir Fraser 3c29b3fd3c 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>
2010-02-04 09:08:05 +00:00
Keir Fraser 22cce0547c 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>
2010-02-04 09:04:33 +00:00
Keir Fraser f3bbcc7995 tools: Do not append trailing slash to XEN_ROOT in Makefiles
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-02-04 09:03:42 +00:00
Keir Fraser d10651be94 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>
2010-02-04 08:53:49 +00:00
Keir Fraser 265394cb0d 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>
2010-02-04 08:53:16 +00:00
Keir Fraser 37ee852d25 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>
2010-02-03 09:46:38 +00:00
Keir Fraser afe765651d 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>
2010-02-03 09:46:01 +00:00
Keir Fraser 91e172bf6b 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>
2010-02-03 09:45:40 +00:00
Keir Fraser ada9d8c9f2 xl: Do not duplicate last line of config file when trying compat mode.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-02-03 09:45:25 +00:00
Keir Fraser afea05486c xend: Disallow "/" in domain names
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2010-02-03 09:45:02 +00:00
Keir Fraser 3cb68d2b59 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>
2010-02-03 09:44:12 +00:00
Keir Fraser 1921835bf4 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>
2010-02-03 09:42:45 +00:00
Keir Fraser 049ad7d34e 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>
2010-02-03 09:38:57 +00:00
Keir Fraser a90054b38b 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>
2010-02-03 09:38:00 +00:00
Keir Fraser 283444b7cd 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>
2010-02-03 09:37:40 +00:00
Keir Fraser e0b0cd61d2 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>
2010-02-03 09:36:37 +00:00
Keir Fraser 7a223440b7 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>
2010-02-03 09:35:56 +00:00
Keir Fraser eddd8e3955 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>
2010-02-03 09:35:23 +00:00