Commit Graph
20813 Commits
Author SHA1 Message Date
Keir Fraser c9aa64e062 xend: NUMA: fix division by zero on unpopulated nodes
nodes without memory will currently be disabled by also moving the
physical cores connected to them to other nodes. This leads to nodes
without CPUs and thus to a division by zero in the node allocation
algorithm.  Attached patch fixes this by checking for 0 before the
division. This fixes domain creation on boxes with memory-less nodes.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
2010-01-17 18:01:08 +00:00
Keir Fraser 185c296921 libxenlight: Add the line number to the config file parsing error message
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-01-17 17:57:44 +00:00
Keir Fraser b558580d6f libxl: add a newline to xl logging
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-01-17 17:57:11 +00:00
Keir Fraser 4a7e234457 x86: A further fix to xen_in_range().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-01-15 08:27:27 +00:00
Keir Fraser 46785b54f8 Make sure the minimum shadow allocation is never zero.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-01-14 14:11:25 +00:00
Keir Fraser 2d8eb0f62d libxc: Fix IOCTL_PRIVCMD_MMAPBATCH_V2 fallback check
privcmd_ioctl returns EINVAL if the type is not supported.
This fixes the guest booting issue caused by C/S 20791.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-01-14 14:10:40 +00:00
Keir Fraser 58a1c38594 x86: Fix and clarify 20803:50bd4235f486
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-01-14 11:46:53 +00:00
Keir Fraser fb95b70c12 xend: Fix wait-for-stubdom loop to avoid possible infinite loop
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-01-14 10:14:17 +00:00
Keir Fraser 56b0c617c9 Linux: Use losetup -f where available.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-01-14 10:12:58 +00:00
Keir Fraser 53374cadd7 x86: Fix xen_in_range() for fragmented percpu data area.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-01-14 10:03:44 +00:00
Keir Fraser 735f8ebd53 xend, NUMA: Fix computation of needed nodes
Enumerate the best nodes and add CPU affinity until all VCPUs can be
backed by at least one physical core. This should fix problems with
asymmetric NUMA configurations and cropped number of CPUs in Xen.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
2010-01-14 09:44:08 +00:00
Keir Fraser 0b5e4f99ae libxenlight: fix name to domid conversion.
also simplify massively the function that iterate over all domains to
find the corresponding domid to a name.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-14 09:42:40 +00:00
Keir Fraser 9ff53e8d1a libxenlight: add error in disk_add if phystype is not recognized
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-14 09:42:06 +00:00
Keir Fraser b325401ccf libxenlight: add fuse around generic_device_add related to invalid kinds
prevent segfault in case the backend or frontend kinds have
not been set to a correct kind value (or not initilized).

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-14 09:41:34 +00:00
Keir Fraser 4137596283 libxenlight: initialize enum to 1, to prevent defaulting to the 0
values when structure when not properly initialized by the client.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-14 09:40:55 +00:00
Keir Fraser 2effe36292 libxenlight: add some return values testing in stubdom
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-14 09:40:01 +00:00
Keir Fraser a243d80da3 x86 hvm: Change default setting of guest CPUID RDTSCP bit
Expose RDTSCP CPUID to guest only when tsc_mode == TSC_MODE_DEFAULT
and host_tsc_is_safe() returns 1.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
2010-01-13 08:33:34 +00:00
Keir Fraser 54954172e4 x86: fix unmaskable msi assignment issue.
Currently, unmasked msi irq's EOI write is deferred untile guest
writes EOI, so needs to keep eoi_vector unchanged before guest writes
EOI. However, irq migration breaks the assumption and changs
eoi_vector when interrupts are generated through new vector.

The patch removes the dependency for eoi_vector and directly recoreds
the irq info in the EOI stack, and when guest writes EOI, just do the
physical EOI for the specific irq(recorded in EOI stack)on the cpus
according to the cpu_eoi_map.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
2010-01-13 08:18:38 +00:00
Keir Fraser a5f80565fb x86: minor cleanup to arch_memory_op()
There's a function-wide variable rc, so no need to re-declare it in
individual case handling blocks.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-01-13 08:17:00 +00:00
Keir Fraser 9cf11a576c Update Xen version to 4.0.0-rc2-pre 2010-01-13 08:16:37 +00:00
Keir Fraser b3eb2c1e8b x86: add and use XEN_DOMCTL_getpageframeinfo3
To support wider than 28-bit MFNs, add XEN_DOMCTL_getpageframeinfo3
(with the type replacing the passed in MFN rather than getting or-ed
into it) to properly back xc_get_pfn_type_batch().

With xc_get_pfn_type_batch() only used internally to libxc, move its
prototype from xenctrl.h to xc_private.h.

This also fixes a couple of bugs in pre-existing code:
- the failure path for init_mem_info() leaked minfo->pfn_type,
- one error path of the XEN_DOMCTL_getpageframeinfo2 handler used
  put_domain() where rcu_unlock_domain() was meant, and
- the XEN_DOMCTL_getpageframeinfo2 handler could call
  xsm_getpageframeinfo() with an invalid struct page_info pointer.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-01-13 08:14:01 +00:00
Keir Fraser 9fececad98 libxc: use new (replacement) mmap-batch ioctl
Replace all calls to xc_map_foreign_batch() where the caller doesn't
look at the passed in array to check for errors by calls to
xc_map_foreign_pages(). Replace all remaining calls by such to the
newly introduced xc_map_foreign_bulk().

As a sideband modification (needed while writing the patch to ensure
they're unused) eliminate unused parameters to
uncanonicalize_pagetable() and xc_map_foreign_batch_single(). Also
unmap live_p2m_frame_list earlier in map_and_save_p2m_table(),
reducing the peak amount of virtual address space required.

All supported OSes other than Linux continue to use the old ioctl for
the time being.

Also change libxc's MAJOR to 4.0 to reflect the API change.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-01-13 08:12:56 +00:00
Keir Fraser d092fb82a2 Added tag 4.0.0-rc1 for changeset 67b5ad8ae87e 2010-01-12 07:17:40 +00:00
Keir Fraser d007bbddf6 Update Xen version for 4.0.0-rc1 4.0.0-rc1 2010-01-12 07:11:28 +00:00
Keir Fraser 4d5c98f988 libxenlight: remove ctx dangerously passed to children
apart from ctx->waitpid, it's potentially harmful to call into
logging.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-12 07:06:12 +00:00
Keir Fraser 246098effc libxenlight: remove ctx argument to exec
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-12 07:05:22 +00:00
Keir Fraser 02bc370591 libxenlight: typo in old patch, lead to waitpid forever instead of
waitpid with WNOHANG

fixes qemu starting problem

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-12 07:04:46 +00:00
Keir Fraser bfc7ebaee1 libxenlight: misc cleanup
wait_for_device_model expect two pointer as the end not 2 integers.
remove debugging message in libxl_list

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-12 07:03:54 +00:00
Keir Fraser 0d8907b049 libxenlight: do not try to set memory target with a number we haven't
verified in set-mem.

checking that memory string conversion what done properly instead of
sending a request to balloon a domain to 0 memory.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-12 07:03:14 +00:00
Keir Fraser f777e25427 libxenlight: tests a lots more of xl return value inside the library
and in xl.

introducing a domain where the xenguest build function has fail, lead
to having xenstored receiving SIGBUS, since it's trying to access some
of the domain's memory, which haven't been properly allocated. (it
doesn't seems to be a way to make xenstored more robust to this though
since xc_map_foreign_range just succeed).

make xl a lot more robust regarding all those random errors possible.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-12 07:02:29 +00:00
Keir Fraser 60e8e9aabc blktap: make memshr optional
Attached patch makes memshr optional for blktap/blktap2.
This fixes build for platforms where memshr isn't build on.
While there, make indentation consistent.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2010-01-12 07:01:21 +00:00
Keir Fraser b57e4ee13e xend, pciquirk: fix uninitialized variable
Fixes uninitialized variable when there's no
PERMISSIVE_CONFIG_FILE

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2010-01-12 06:56:56 +00:00
Keir Fraser e1ca3df9bd tools: build fixes for NetBSD
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2010-01-12 06:55:24 +00:00
Keir Fraser 018d9dd53f x86_32: Fix the build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-01-09 08:14:44 +00:00
Keir Fraser cb50fe8f52 libxenlight: initialize domid to -1 in domain_create
prevent call site that doesn't check return values to try to do
operation on domain 0.
instead they use domid -1, which is unlikely to exist.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-08 11:48:36 +00:00
Keir Fraser 718090f23e libxenlight: don't try to delete path when they doesn't exists.
fix segfault in destroy when creation hasn't been done properly.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-08 11:48:02 +00:00
Keir Fraser f3ae927106 libxenlight: simplify the logic of domain_list to just return 1024 domains maximum
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-08 11:47:28 +00:00
Keir Fraser 1765cc2255 libxenlight: remove all cloning logic.
replace by simpler xl ctx init/free calls.
also don't segfault if there's no callback for log.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-08 11:46:52 +00:00
Keir Fraser 1bb7406a32 libxenlight: don't use the cloning logic in dm_xenstore_record_pid.
use call to lowlevel functions to do the same things.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-08 11:46:17 +00:00
Keir Fraser 59d9a14fc6 libxenlight: returns errors if xc and/or xs has not been initialized properly.
fixed segfault when xenstore or xc are not available.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-08 11:45:34 +00:00
Keir Fraser aa73db2add libxenlight: don't free ifname, can lead to double free
ifname is mostly handled directly in xl now, do not attempts to free
this.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-08 11:44:58 +00:00
Keir Fraser 823db1c4ab libxenlight: don't ignore ctx_init errors if there is one.
ctx_init can return error, and ignoring the errors, would lead to
segfault later. fix all call sites to check return values.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-08 11:44:15 +00:00
Keir Fraser 55a8fc5f3b VT-d: get rid of trailing whitespace
Signed-off-by: Weidong Han <weidong.han@intel.com>
2010-01-08 11:39:33 +00:00
Keir Fraser dbaa1e3603 xend: fix options for assigned pci
pci global options and per-device options for HVM device model have
been broken for some time, the patch tries to fix the problem. It:
    * maintains global options in xend, and merge it into
      per-device option when creating the backend
    * merge the global options also into the parameter of pci-ins
      dm-command

The second one is there because the backend is effectively skipped
in ioemu at present, ioemu solely relies on the parameter string to
create the device.

Cc: Simon Horman <horms@verge.net.au>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Qing He <qing.he@intel.com>
2010-01-08 11:39:06 +00:00
Keir Fraser 17fed54483 [IA64] support XEN_DOMCTL_mem_sharing_op
Because memory sharing is not implemented on ia64, only
XEN_DOMCTL_MEM_SHARING_OP_CONTROL is supported.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
2010-01-08 11:37:44 +00:00
Keir Fraser 66e24c20de xend: Fix xc.physinfo() Py_BuildValue format string.
Fix for 20762:a1d0a575b4ba

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
2010-01-08 11:33:37 +00:00
Keir Fraser c7aa338584 tmem: Reduce verbosity on failed memory allocations.
Reduce tmem complaints per Jan's concerns in this thread
http://lists.xensource.com/archives/html/xen-devel/2010-01/msg00155.html
Now complains only if tmem HAS memory to relinquish and
memory request has order>0.

Signed-off by: Dan Magenheimer <dan.magenheimer@oracle.com>
2010-01-08 11:25:22 +00:00
Keir Fraser 925a248ade EPT: Walk and print EPT tables on an unexpected EPT violation
Wrote this when I was tracking down the HAP-PoD problem, figured it
might come in handy sometime.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-01-08 11:24:18 +00:00
Keir Fraser 445386cebb x86: fix NUMA handling (c/s 20599:e5a757ce7845)
c/s 20599 caused the hash shift to become significantly smaller on
systems with an SRAT like this

(XEN) SRAT: Node 0 PXM 0 0-a0000
(XEN) SRAT: Node 0 PXM 0 100000-80000000
(XEN) SRAT: Node 1 PXM 1 80000000-d0000000
(XEN) SRAT: Node 1 PXM 1 100000000-130000000

Comined with the static size of the memnodemap[] array, NUMA got
therefore disabled on such systems. The backport from Linux was really
incomplete, as Linux much earlier had already introduced a dynamcially
allocated memnodemap[].

Further, doing to/from pdx translations on addresses just past a valid
range is not correct, as it may strip/fail to insert non-zero bits in
this case.

Finally, using 63 as the cover-it-all shift value is invalid on 32bit,
since pdx values are unsigned long.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-01-08 11:22:41 +00:00
Keir Fraser b8a5529c45 Handle PoD case in hvm_hap_nested_page_fault()
The new combined nested page fault handling doesn't consider the case
where the gfn_to_mfn() translation caused the page to be transparently
populated.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-01-06 12:45:23 +00:00