Commit Graph
6763 Commits
Author SHA1 Message Date
Keir Fraser f43f4f1d28 ia64: fix make install under tools/debugger/xenitp
This patch fixes the following error with make install under
the directory, tools/debugger/xenitp by checking whether
the variable is length zero string.

> # make install
> ../../../tools/cross-install -d -m0755 -p //usr/bin
> [ -z " xenitp" ] || ../../../tools/cross-install -d -m0755 -p
> //usr/lib/xen/bin
> ../../../tools/cross-install -d -m0755 -p //usr/share/man/man1
> ../../../tools/cross-install -d -m0755 -p //usr/share/man/man8
> ../../../tools/cross-install -m0755 -p   //usr/bin
> install: too few arguments
> Try `install --help' for more information.
> make: *** [install] Error 1

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-09-24 10:19:07 +01:00
Keir Fraser c2c1029070 hvm, save/restore: Skip page batches which contain no valid pages.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-23 17:11:33 +01:00
Keir Fraser 0e7c1355bc acm, xend: Catch bad vlan identifiers
Add code to intercept badly formatted VLAN identifiers or
those that are out of range.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-09-23 12:30:42 +01:00
Keir Fraser c134d74fda libxc: Wrapper functions for cpu online/offline
Signed-off-by: Shan Haitao <haitao.shan@intel.com>
2008-09-22 16:10:25 +01:00
Keir Fraser 13ad235ee7 xentop: Fix display of long domain names.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-22 14:04:27 +01:00
Keir Fraser dd7746fbf3 xenctx: fix xenctx --all option on x86
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2008-09-22 11:16:56 +01:00
Keir Fraser 11825aea19 xend: Refactor vmmetrics destruction.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-09-22 11:15:39 +01:00
Keir Fraser bbc10fbb40 xm list: Return unique exit code for non-existent domain
This patch will make xm return a exit code of 3 if `xm list
<non_existant_domain>` is done rather than the generic code of 1.  I
used 3 because XendClient had a macro setup pointing
ERROR_INVALID_DOMAIN to 3.

From: "Shaun R." <mailinglists@unix-scripts.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-18 10:41:41 +01:00
Keir Fraser 549e1d9ec5 x86, amd, hvm: pass through one more cpuid cache description leaf
Add a missing CPUID leaf that contains AMD-specific cache info.
Without this, Windows can spin trying to prefetch memory buffers using
a stride length of zero.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-18 10:39:53 +01:00
Keir Fraser 19dc3860dc Remove internal tools/ioemu tree.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-18 10:32:40 +01:00
Keir Fraser f2878b5bb1 xc_save/xc_restore: Fix wrong data type
xc_interface_open() may return -1, but if we define xc_fd as unsigned
int, then -1 will be > 0.

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-17 14:16:02 +01:00
Keir Fraser 5c4eccd644 xm: Remove obsolete mechanism using vncviewer -listen
Without this patch, vncviewer processes remain as follows.
This patch fixes it.

> # pgrep -fl vnc
> 4303 vncviewer -log *:stdout:0 -listen 5501
> 5089 vncviewer -log *:stdout:0 -listen 5502
> 5763 vncviewer -log *:stdout:0 -listen 5503

details:
Since 21dd1fdb73d8 there have been (as far as I can see) three
separate mechanisms for achieving a VNC display:
 1. xm spawns vncviewer after getting vnc display info
     from qemu-dm via xenstore  (introduced in 21dd1fdb73d8)
 2. xm spawns vncviewer -listen and qemu-dm connects to it
 3. qemu-dm spawns vncviewer (!)

The latter two are rather strange - No.3 is very strange indeed.
So I decided that rather than try to get No.2 or No.3 on track for
going into qemu upstream, No.2 and No.3 would be dropped.
After discussion on xen-devel the mechanism No.1 was introduced,
above.

No.1 is controlled by the --spawn-vncviewer (and --vncviewer-autopass)
command line options to xm, by analogy with the -c option.

Nos.2 and 3 are controlled by elements of the domain configuration
file - and their code still remains.  So if you turn all of the vnc
options on you can get several vncviewers (although only one of them
will work).

This patch removes the support for the passive connection mode No.2
After all ioemu-remote will never connect to such a vncviewer.
The options to engage this functionality were already removed from
the example config files by Keir in 18241:bf4ef45e6a38.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-09-17 13:11:40 +01:00
Keir Fraser 6266fa7f24 xsm: dummy module - implement missing stub
- This minor patch implements the missing stub function
security_label_to_details in the dummy module.  This stub function is
necessary to create domains with network interfaces for modules that
do not implement the security_label_to_details function.

Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
2008-09-15 11:36:20 +01:00
Keir Fraser 30c988711c $(XEN_ROOT) absolutification fixes for ioemu-remote (incl stubdom)
* Move code for generating an absolute version of XEN_ROOT
   into a common make variable set in Config.mk
 * Use this common code when invoking make -C ioemu-dir clean
   from tools/, which avoids a problem where `make clean' fails
   because qemu's (ioemu-remote's) build system wants to run
   `make clean' in `tests' but XEN_ROOT is a confection involving
   ../'s.
 * Use this common code in stubdom/Makefile, instead of $(abspath...)
   as the latter is a relatively new feature in GNU make and is not
   available in all the places that we want to be able to build
   (cf c/s 17997:3f23e01d31985899dbd1660b166f229f1ee74292)

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2008-09-12 13:15:36 +01:00
Keir Fraser b0a9e1205f xenstore: Fix a memory leak in 'xs_is_domain_introduced'.
Signed-off-by: Konrad Rzeszutek <konrad@virtualiron.com>
2008-09-11 18:00:06 +01:00
Keir Fraser e8ca11f2f6 xendomains script: A few bug fixes.
Contributed-by: Artur Linhart <AL.LINUX@bcpraha.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2008-09-11 15:16:11 +01:00
Keir Fraser a3e1f638ca xm: domid casting bug
- This patch fixes a small casting bug in xm.  The value of domid was
  not returned as an int, causing commands like 'xm vncviewer domid'
  to fail.

Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
2008-09-11 11:58:08 +01:00
Keir Fraser 4b4f92e98d x86, xend: Fix processing of cpuid config parameters
There is an python indentation issue keeping the full range of syntax
for the cpuid config file parameter from working correctly.  This
patch fixes that.  It also fixes some misspelling and a missing 'x' in
two of the example config files (must have 32 bits represented for
cpuid registers).

Signed-off-by: Bruce Rogers <brogers@novell.com>
2008-09-10 10:51:48 +01:00
Keir Fraser 792f9bc05e xc_domain_save: Do not poll-wait for guest to shutdown -- it should
already be suspended when the (*suspend)() function returns.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-09 15:33:27 +01:00
Keir Fraser 93bce41b77 ioemu: Fix bug in map cache
This small patch fixes an issue leading to a crash (segfault, although
with earlier changesets I was seeing sigbus - not sure what changed)
in qemu-dm when the following conditions occur:

1. A valid mapping for a bucket on a low address exists

2. Immediately after accessing memory mapped in this bucket, an access
occurs to a high (beyond assigned ram) address beyond the 1GB limit
for 32bit map cache wrapping around to the previous bucket's entry
number.

3. The next call to map cache again accesses the low address.

In this scenario, the guest mem for the low bucket has been unmapped
by the remap_bucket caused by 2., but because the valid_mapping
bit-test fails, map_cache returns before last_address_index has been
updated. The subsequent call to map_cache therefore never remaps the
low, valid bucket and instead returns a vaddr pointing to memory that
has failed to get mapped.

Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
2008-09-09 15:05:58 +01:00
Keir Fraser 8a64d79e8d ioemu: various fixes to 18394:dade7f0bdc8d
- fix ioemu segv with old firmware
  Without notifying ioemu of address, ioemu will segv.

- fix qemu-dm segv with malicous firmware
  If notifying ioemu more than once, ioemu will segv.

Usually such cases don't happen, but malicious guest can
do it intentionally.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-09-09 15:02:51 +01:00
Keir Fraser 03a0c0a048 libxc: fix xc_memory_op(): handles XENMEM_remove_from_phsymap case.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-09-09 15:02:32 +01:00
Keir Fraser a69a857adb Revert 18415:3e72ab517e44 (xend: move the call to XendDevices.destroy_device_state())
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-09-09 14:45:23 +01:00
Keir Fraser 652f427342 xentrace 7/7: Add option to log to a circular buffer and dump to disk
on signal.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
2008-09-08 16:02:13 +01:00
Keir Fraser be608b5e9b xentrace 6/7: Updated formats file.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
2008-09-08 16:00:53 +01:00
Keir Fraser a9318ed8b2 xentrace 4/7: Add some missing things to the xentrace options string
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
2008-09-08 15:52:50 +01:00
Keir Fraser 0705c231d9 xc_save: ignore the first suspend event channel notification
I've noticed that the suspend event channel becomes pending as soon as
it is bound. I'm not sure why or whether this is intentional, but it
means that the suspend function will return before the domain has
completed suspending unless the first notification is cleared. Without
this patch, xc_domain_save may find that the guest has not suspended
and sleep in 10ms chunks until it does. Typically this is several
milliseconds of wasted time.

From: Brendan Cully <brendan@cs.ubc.ca>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-08 11:16:23 +01:00
Keir Fraser 112dcc7dd0 xc_save: Clean up (*suspend)() callback hook.
Sigend-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-08 11:13:03 +01:00
Keir Fraser a2567b2631 xc_save: Janitorial work.
Remove an unused variable.
Replace errx by warnx when cleanup code follows.

From: Brendan Cully <brendan@cs.ubc.ca>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-08 10:55:09 +01:00
Keir Fraser 406b8494bb lsevtchn: Improve this evtchn reporting tool.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-05 11:56:35 +01:00
Keir Fraser b95d528041 ioemu: fix offset of MSI-X memory-mapped table.
Current code does not set dev->msix->table_off variable.
The offset of MSI-X memory mapped table is treated as 0.
The wrong region is unmapped from guest physical memory space.
As a result, guest device driver can't access memory mapped resource.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
2008-09-05 11:18:20 +01:00
Keir Fraser 8790685cfd xsm: A few hacks to get XSM-disabled (aka dummy) mode working.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-04 16:29:38 +01:00
Keir Fraser 1df7998ba6 xsm: Fix __import__() usage on Python 2.4 and earlier.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-04 11:55:48 +01:00
Keir Fraser a8c72fbc90 ioemu: support PCI Express Capability Structure version 1.
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
2008-09-04 11:28:17 +01:00
Keir Fraser 3129d6f2ea xsm, flask: sample flask policy
- The patch includes a policy for xen that can be booted into
  enforcing mode and supports creation and management of
  paravirtualized guests.  The policy follows the dom0/domU usage
  model, extension to other models or the addition of management or IO
  permissions should be much more straightforward now. The option
  flask_enforcing=1 can be passed on the xen line in grub to boot
  into enforcing mode.

- The policy provides a basic policy for booting the platform and
  creating a domU with the label system_u:object_r:domU_t.  The policy
  can be easily extended to support new types by modifying the xen.te
  source file.

- The policy includes some basic macros which may be helpful in
  extending the policy.

- The policy is compatible with and requires the most recent XSM
  patch, xsm-flask-io-sysctl-hooks-090308.diff.

- The policy is not built as part of the make all as it requires the
  SELinux policy compiler which may/may not be installed on all
  systems.  Users must go into the tools/flask/policy directory and
  explicitly compile the policy.

Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
2008-09-04 11:26:25 +01:00
Keir Fraser 06cfe5df7b xsm, python tools: remove autogenerated xsm.py
- The patch does away with the autogenerated xsm.py file and
introduces a config parameter in xend-config.sxp to determine the
security module. The parameter is (xsm_module_name {acm, dummy,
flask}).  The default setting/option is dummy.  .hgignore is also
updated to stop ignoring xsm.py on commits.

- The patch has created an xsconstant for XS_POLICY_FLASK and updated
  the toolchain to check the instance of XS_POLICY_USE.  XS_POLICY_USE
  evalauates to XS_POLICY_FLASK or XS_POLICY_ACM or XS_POLICY_DUMMY
  depending on configuration.

- Flask relies on the current value of ssidref returned by dominfo to
  ensure that the label to sid mapping is consistent.  ssidref had
  been pop'ed from the dominfo object.  The patch addresses this
  issue.

- Flask python module style cleanups.

Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
2008-09-04 11:23:08 +01:00
Keir Fraser 87fd15ceee xend: move the call to XendDevices.destroy_device_state()
This patch moves the call to XendDevices.destroy_device_state() to the
function _remove_domain. Previously only Xen-API calls were calling
the destroy_device_state() function.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-09-03 10:38:33 +01:00
Keir Fraser c93d35a368 xend: Fix Bug 1336
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-09-02 12:06:56 +01:00
Keir Fraser a06cb3d8d8 ioemu: fix multiple pci-attach/pci-detach by removing the meaningless irq_index
For HVM guest, we can't do pci-attach/pci-detach for >64 times due to
the meaningless checking in pci_register_device(). I made a test of
300 times of attach/detach and everything now works well.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2008-09-01 10:48:09 +01:00
Keir Fraser f1a381df9c cross-install: Only apply in tools directory, and automatically wrap $INSTALL.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-30 08:36:02 +01:00
Keir Fraser d6c3ce8cb9 Update the URL for the ACPI compiler sources.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2008-08-29 16:07:36 +01:00
Keir Fraser 309459216a Run cross-compilation-aware install wrapper script.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-29 16:06:41 +01:00
Keir Fraser ec6869dadc pv-grub: fix example file
Apparently 64MB is too short for the domain builder.
No kernel option should be passed, as they are provided by menu.lst,
and would only confuse grub.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-29 10:45:09 +01:00
Keir Fraser 1ceec08ea2 hvmloader: skip upper field of 64 bit base address register.
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
2008-08-28 09:59:49 +01:00
Keir Fraser bf1bb3fa7e ioemu, passthru: make upper field of 64 bit bar writable.
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
2008-08-28 09:58:01 +01:00
Keir Fraser 309af15419 xend: Cleanup destroy and destroyDomain methods
When domains are destroyed, _prepare_phantom_paths() method
and _cleanup_phantom_devs() method are called twice as follows.

destroy()@XendDomainInfo.py
    _prepare_phantom_paths() --------------- 1
    _cleanupVm()
    destroyDomain()
        _prepare_phantom_paths() ----------- 2
        xc.domain_destroy_hook()
        xc.domain_pause()
        do_FLR()
        xc.domain_destroy()
        XendDomain.remove_domain()
        cleanupDomain()
        _cleanup_phantom_devs() ------------ 1
    _cleanup_phantom_devs() ---------------- 2
    XendDomain.domain_delete_by_dominfo()

This is a cleanup patch.  It combines destroyDomain() method
into destroy() method, then _prepare_phantom_paths() method and
_cleanup_phantom_devs() method are called only once.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-08-28 09:44:13 +01:00
Keir Fraser 2e8459a4fc stubdom: make xc_map_foreign_ranges use malloc instead of stack space
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-28 09:40:10 +01:00
Keir Fraser 8a68b82ff1 libxc: Use vcpu_guest_context_any_t instead of two pages
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-27 16:23:10 +01:00
Keir Fraser f844c8910a hvmloader: Fix e820_malloc() after bug I introduced in c/s 18383
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-27 15:16:13 +01:00
Keir Fraser 86e881097c tools/xenmon/Makefile: Move LDFLAGS after $<
gcc expects libraries needed for object files to be specified after
the object. Linking usually does not fail, unless it is optimized (for
instance, using -Wl,-as-needed).

The related Gentoo bug is 135145 [ https://bugs.gentoo.org/135145 ].

From: Robert Buchholz <rbu@gentoo.org>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-27 15:02:38 +01:00