Commit Graph
19028 Commits
Author SHA1 Message Date
Keir Fraser 4ef2a41a2d hvmloader: Fix SMBIOS memory device length boundary condition.
dev_memsize ends up 0 when it shouldn't be on 16G boundary conditions.

Signed-off-by: Bill Rieske <brieske@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-12 10:23:55 +00:00
Keir Fraser bef2c17dbc Do not print `***' when compiling unless we fall over
This has finally bugged me enough to do something about it:

make prints `***' when it stops due to an error.  With make -j, and/or
with automated build systems, this error marker can be in the middle
of a large logfile.  It is useful to be able to search for it.

Therefore change occurrences of `*' to `=' for information and warning
messages.  `***' is reserved for cases where the build stops.

A corresponding change is being applied to qemu-xen-unstable.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-01-12 10:17:12 +00:00
Keir Fraser 9f8501582f Use -MMD -MF in tools/* rather than -Wp,-M...
If you use -MMD -MF then the correct .o filename is written to the
.*.d file as the compiler driver arranges everything.  This was done
in 19010:275abe1c5d24 for the hypervisor.

In this patch we do the same elsewhere in the xen-unstable tree,
particularly tools/.  Specifically:
 * Change tools/Rules.mk to add -MMD -MF ... to CFLAGS and set DEPS.
 * Remove -Wp,-MD... from every other Makefile
 * Remove setting of DEPS from every other Makefile
 * Ensure that every Makefile says -include $(DEPS)
 * Ensure that every Makefile's clean target removes $(DEPS)

Some Makefiles were already halfway there, but often for a different
variable name eg PROG_DEP.  The variable name is now standardised in
Rules.mk as DEPS.

I have done a test build with this change, on Debian etch.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-01-12 10:16:05 +00:00
Keir Fraser ceff4bb8a3 stubdom: Fix compilation after libelf header changes
Changeset 19011:7df072566b8c moved some of the libelf headers.
However, no changes were made to stubdom/Makefile.

stubdom/Makefile unfortunately contains embedded in it knowledge about
the header directory structures, and must therefore typically be
updated if new header directories are created.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-01-09 16:56:54 +00:00
Keir Fraser 49e486455b AMD IOMMU: Allocate I/O pagetable from domheap instead of xenheap
Signed-off-by: Wei Wang <wei.wang2@amd.com>
2009-01-09 15:57:57 +00:00
Keir Fraser 0d1fa649fe hvmloader: MTRR UC type covers the pci regions only.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-09 13:00:10 +00:00
Keir Fraser 31b8c8391c hvmloader: Dynamically size the PCI hole.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-09 12:41:25 +00:00
Keir Fraser 3e50af3d87 New XENMAPSPACE_gmfn parameter for XENMEM_add_to_physmap.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-09 11:44:35 +00:00
Keir Fraser a562362b25 xend: Fix a ssl migration hang issue
When another VM is started by xend, the spawned qemu process will keep
the p2cwrite file descriptor open.
Thus there will be two open descriptors associated with the write end
of the pipe. The read end of the pipe only sees EOF when the qemu
process has terminated.

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
2009-01-09 10:04:24 +00:00
Keir Fraser e3a9e577ae hvmloader: Reserve BIOS memory and VGA memory at top of 4GB memory hole.
To make memory management easier in hvmloader, defer building a
generic E820 map until the end of hvmloader bootstrap.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-08 16:59:21 +00:00
Keir Fraser da510a16e2 Print domain max_pages in 'q' debug output.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-08 16:53:15 +00:00
Keir Fraser ad8b20cc85 x86, hvm: Move E820 table creation into hvmloader, extend
hvm_info_table to describe memory parameters in a simpler form from
domain builder to hvmloader.

Also move reserved special page mappings immediately below the 4GB
boundary.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-08 15:27:20 +00:00
Keir Fraser 85eff2ee28 xm: Fix syntax error.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-08 15:18:30 +00:00
Keir Fraser 54562e0cdf hvmloader: Simplify access to hvm_info_table.
Also require the table to be present.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-08 13:49:05 +00:00
Keir Fraser 5381a090a1 Fix gcc make-dep cmdline options.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-08 13:37:16 +00:00
Keir Fraser 21b9b29dc4 x86: Re-instate warnings for HVM guest writes to read-only memory.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-08 13:21:06 +00:00
Keir Fraser 8ce65842ad Move libelf headers out of xen public header dir.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-01-08 13:15:49 +00:00
Keir Fraser 68b1230ae3 Auto-build dependency files in hypervisor build tree.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-08 13:08:37 +00:00
Keir Fraser c6d8d541e9 x86-64: guest directed placement of initial p->m map
By adding another ELF note, the kernel can now direct the hypervisor
(for Dom0) and in the future also the tools (for DomU-s) to place the
initial phys->mach translation table at other than an address
immediately above the kernel/initrd images. This eliminates the size
restriction imposed on this table by Linux (the kernel loads above the
-2Gb boundary, and hence the entire initial mapping cannot reach or
even exceed 2Gb).

There are a few items in this patch I'm not particularly happy with,
but couldn't think of a better solution:
- there is a hidden assumption that pages allocated for the domain are
  put on the domain's page list sequentially
- the way backward compatibility is maintained is placing requirements
  on the kernel side that make the code somewhat convoluted (because
  it
  needs to check where the map is actually placed in quite a few
  places)
- code is there to use 1Gb mappings for the hypervisor created table,
  but lacking a machine with 512G+ memory for immediate testing I
  can't
  verify this works; I know that 2Mb mappings work, and hence imply
  that 1Gb ones would too (of course, if the kernel replaces the table
  - like Linux does -, it cannot use 2Mb/1Gb mappings or even try to
  re-use the page table entries, but I don't consider this a problem)

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-01-08 11:32:39 +00:00
Keir Fraser f5bf427cd3 passthough: MSI-INTx translation documentation
Signed-off-by: Qing He <qing.he@intel.com>
2009-01-08 11:27:11 +00:00
Keir Fraser f86db27518 pci: add config options for MSI-INTx translation in HVM
Add a config file option 'pci_msitranslate' to enable MSI-INTx
translation in HVM, and also a per-device option 'msitranslate' to
allow device base to be overridden

Signed-off-by: Qing He <qing.he@intel.com>
2009-01-08 11:26:58 +00:00
Keir Fraser 925d7f9d82 pci: add pci option support for XenAPI sever
Allow the per-device options for passthrough pci devices
This patch is for XenAPI server

A new key-value pair element of 'pci' named 'pci_opt' is added
to xml config file

Signed-off-by: Qing He <qing.he@intel.com>
2009-01-08 11:26:16 +00:00
Keir Fraser 925b2ca585 pci: add pci option support for XML-RPC server
Allow the per-device options for passthrough pci devices
for exmaple, in domain config file:
    pci = ['01:00.0,opt1=val1,opt2=val2', '01:00.1' ]
or in the PCI hotplug case:
    xm pci-attach -o opt1=val1 --options=opt2=val2 <domid> 01:00.0 6

This patch is for xml-rpc server

Signed-off-by: Qing He <qing.he@intel.com>
2009-01-08 11:25:43 +00:00
Keir Fraser 11f8ac5ebf passthrough: MSI-INTx translation for HVM
The patch adds a new type of pt_irq: PT_IRQ_TYPE_MSI_TRANSLATE.
With it, guest dpci irq can now use msi as the underlying pirq
while injected as INTx irq.

Signed-off-by: Qing He <qing.he@intel.com>
2009-01-08 11:25:06 +00:00
Keir Fraser 6df92ebc30 xenpm tool enhancements
Two enhancements are made in this patch:

1. Make cpuid in command line optional: if user does not provide
cpuid, xenpm will operate on all the CPUs. this will easy the xenpm
usage. e.g. to set the cpufreq governor, user usually want to set the
governor on all CPUs. User can accomplish this easily with this
enhancement.

2. Add another option "xenpm start" to calculate the Cx/Px state
residency percentage during specified period. when user issue "xenpm
start", xenpm will start to record the Cx/Px state residency. when
user issue CTRL-C, xenpm will stop and show the Cx/Px state residency
and percentage of this period. this is helpful to measure the xenpm
effect for speficied workload.

Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>Signed-off-by: Ke Yu <ke.yu@intel.com>
2009-01-08 11:21:23 +00:00
Keir Fraser 51f2134fab x86: remove pointless dom0 check
This check is redundant with a check a few dozen lines up resulting in
a panic().

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-01-08 11:19:38 +00:00
Keir Fraser b2d41b2077 Enable debug build by default, for better dev testing.
In particular this may hopefully give better detection of latent
spinlock bugs.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-07 11:25:00 +00:00
Keir Fraser b988ec6b11 cpufreq: stats_lock doesn't appear to need to be irq-safe.
Changing this fixes some bugchecks (xmalloc() with irqs disabled).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-07 11:21:50 +00:00
Isaku Yamahata 21887335cd [IA64] stub for XENMEM_[gs]et_pod_target.
This patch adds the stub for XENMEM_[gs]et_pod_target.
Without this patch, domain builder aborts on the error.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-01-07 14:28:33 +09:00
Isaku Yamahata 7e9a3beb1e [IA64] ia64 counter part of 5b44cfde9666.
This patch defines ia64 xc_hvm_build_target_mem() which
is referenced by xc.c.
Without this patch, xend doesn't boot complaining
that symbol, xc_hvm_build_target_mem, is missing.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-01-07 14:27:03 +09:00
Isaku Yamahata e2b255ceff [IA64] compilation fix of xenctx
This patch fixes the following compilation error caused by
18963:9cc632cc6d40 of xen-unstable.hg

> xenctx.c: In function 'print_ctx':
> xenctx.c:430: error: request for member 'c' in something not a structure or union
> xenctx.c:431: error: 'vcpu_guest_context_any_t' has no member named 'regs'
> xenctx.c:484: error: 'vcpu_guest_context_any_t' has no member named 'event_callback_ip'

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-01-07 12:20:31 +09:00
Isaku Yamahata 4d44b2eab3 merge with xen-unstable.hg 2009-01-07 12:20:18 +09:00
Isaku Yamahata fc10580219 [IA64] stubs for populate on demand.
add stub functions of populate on demand to compile.
This patch fixes the following compile error.

> xen/common/built_in.o: In function `populate_physmap':
> xen/common/memory.c:116: undefined reference to `guest_physmap_mark_populate_on_demand'
> xen/common/built_in.o: In function `decrease_reservation':
> xen/common/memory.c:205: undefined reference to `p2m_pod_decrease_reservation'

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-01-07 12:19:36 +09:00
Keir Fraser 303e213ce3 rombios: Get rid of annoying delay at F12 boot menu.
Instead require the F12 to be pressed before the menu prompt appears.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-06 16:06:13 +00:00
Keir Fraser 872a09d262 rombios: Allow option ROMs to extend up to 0xEA000.
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-06 16:02:10 +00:00
Keir Fraser 15c5bb9f92 xend: Fix error handling in device_create().
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2009-01-06 14:01:39 +00:00
Keir Fraser e3b7dde955 rombios: Do not initialise PCI devices after hvmloader.
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2009-01-06 14:00:58 +00:00
Keir Fraser f498e9065d hvm: Tell Viridian-enabled OS to relax timer interrupt checks.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-06 13:58:13 +00:00
Keir Fraser ece13f1fb3 x86: Disable MSI as it seems to be triggering ASSERT at irq.c:269.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-06 13:27:55 +00:00
Keir Fraser 7e72c30726 libxc: Define xc_ffs{8,16,32,64} functions. Use them.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-06 09:14:39 +00:00
Isaku Yamahata ed848f202a [IA64] Fix some IPF Xen VT-d bugs.
In arch_domain_create(): when xen creates Dom0, need_iommu(d) is false,
so iommu_domain_init() is not invoked, as a result, eventually iommu is
not enabled properly.
Note: d->need_iommu is set to 1 only by assign_device() which is never
called for dom0. And it is called via XEN_DOMCTL_assign_device hypercall.

In IA64 Xen, physdev_map_pirq()/physdev_unmap_pirq() are kept dummy since
we don't support MSI in IA64 Xen now, but here they shouldn't return
-ENOSYS because xend invokes them (the x86 version of them is necessary
for x86 Xen); in IPF Xen if they return -ENOSYS, xend would disallow us
to create IPF HVM guest with devices assigned. Here They can return 0 instead.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-01-06 18:05:32 +09:00
Keir Fraser c5e9f7aa3a x86: Poison initmem at end of Xen bootstrap
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-05 11:55:24 +00:00
Keir Fraser 0f326f46eb vmx: Print advanced features during boot
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-05 11:52:34 +00:00
Keir Fraser cbd07b72a3 Download external tarballs from xenbits.xensource.com
I have copied the tarballs that the xen-unstable build downloads to
xenbits.xensource.com (which also hosts our hg and git).  This patch
changes the download URLs to use that location.

That way the build will depend on only one external machine, under one
administration, rather than many.  Also it means that the build won't
break if these sites become permanently unavailable or are rearranged
and we don't run a risk of having to panic and beg if a file should go
missing.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-01-05 11:19:16 +00:00
Keir Fraser 75c35a3fb6 Cpufreq: simplify cpufreq_statistic_lock init
Singed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
2009-01-05 11:16:41 +00:00
Keir Fraser 34c6decb5e Cpufreq: prevent negative px resident time, add spinlock to avoid race
Due to NOW() value may drift between different cpus, we add protection
to prevent negative px resident time.
Due to both cpufreq logic and xenpm may race accessing
cpufreq_statistic_data, we add spinlock to avoid race.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
2009-01-05 11:16:12 +00:00
Keir Fraser 8005ca26cb Cpufreq: remove redundant fragments
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
2009-01-05 11:15:40 +00:00
Keir Fraser dca0b1a805 vtd hotplug: check if a device can be hot-plugged.
When we statically assign a pci device (the pci=3D['xx:xx.x'] string
in guest config file) to guest, we make many checkings (for instance,
if the device is specified in 'pciback.hide', if it has
non-page-aligned MMIO BARs, if it has a proper FLR capability, if the
related devices should be co-assigned). However, with respect to the
guest hotplug, we only check if the device exists and not assigned yet
-- this is not enough, for instance, now xend allows us to assign an
in-use device (being used by Dom0) to an HVM guest (because
xc.test_assigned() returns OK) -- this will cause disaster... The
patch adds some necessary checkings.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-01-05 11:14:18 +00:00
Keir Fraser 19e94db949 vtd: avoid redundant context mapping
After changeset 18934 (VT-d: Fix PCI-X device assignment), my assigned
PCI E1000 NIC doesn't work in guest.

The NIC is 03:00.0. Its parent bridge is: 00:1e.0.
In domain_context_mapping():
   case DEV_TYPE_PCI:
   After we domain_context_mapping_one() 03:00.0 and 00:1e.0, the
   'secbus' is 3 and 'bus' is 0,  so we domain_context_mapping_one()
   03:00.0 again -- this redundant invocation returns -EINVAL because
   we have created the mapping but haven't changed pdev->domain from
   Dom0 to a new domain at this time and eventually the
   XEN_DOMCTL_assign_device hypercall returns a failure.

The attached patch detects this case and avoids the redundant
invocation.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-01-05 11:13:22 +00:00
Keir Fraser 1d6e30c679 xenctx: compat-mode/HVM support
Add support to xenctx for guests that have a different word size
to the tools (x86 only, but shouldn't break ia64).  Again, only 32-bit
HVM guests are supported until EFER.LMA is easier to get at.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2009-01-05 11:08:53 +00:00