Commit Graph
10046 Commits
Author SHA1 Message Date
stekloff@elm3b216.beaverton.ibm.com 9c8277a2d8 This patch resizes the file system on the xm-test HVM disk.img to use
the entire space available.

Signed-off-by: Daniel Stekloff <dsteklof@us.ibm.com>
2006-05-19 16:29:34 +01:00
emellor@leeni.uk.xensource.com 09eb4b87f7 Merged. 2006-05-19 16:21:49 +01:00
emellor@leeni.uk.xensource.com ddc7a4667e The enforce_dom0_cpus test sets the number of vcpus for the Dom0 and
checks to see if they have been set correctly. We found that on
multi-proc systems, it takes a certain amount of time for the number of
vcpus to change.

This patch checks the number of vcpus inside a loop until it is correct
or 20 seconds elapse, whichever happens first. If after 20 seconds the
number of vcpus is not changed correctly, an error is raised.

Signed-off-by: Rajagopalan Subrahmanian <raj.subrahmanian@unisys.com>
2006-05-19 16:21:43 +01:00
kaf24@firebug.cl.cam.ac.uk 573e986d56 Several page allocations, done in the hypervisor when starting an HVM
domain, are not checked.  This can cause the physical machine to crash
when starting the HVM domain during low-memory conditions.

Kudos to Charles Arnold for catching the problem with
shadow_direct_map_init.

Signed-off-by: Charles Coffing <ccoffing@novell.com>
2006-05-19 16:10:52 +01:00
kaf24@firebug.cl.cam.ac.uk 37d3005e62 [XEND] An empirical and more conservative memory-overhead estimate for PV and HVM guests.
This patch calculates the overhead needed for HVM domains.  If HVM is
supported by the hardware, I add a little ballooning overhead to
paravirtualized VMs also, to avoid low-memory situations.  (There are
various unchecked alloc_domheap_pages calls in shadow*.c that I am
trying to avoid tripping over for now...)  The values in this patch work
fine on 32 bit; I may update them later based on feedback and/or testing
on 64 bit.

Signed-off-by: Charles Coffing <ccoffing@novell.com>
2006-05-19 16:08:51 +01:00
kaf24@firebug.cl.cam.ac.uk 0a44ca5991 [XEND] separate concept of initial memory size and overhead memory size.
When a domain (whether para- or fully-virtualized) reports how much
overhead memory it requires (via getDomainMemory in image.py), all such
memory was immediately allocated to the domain itself.  This is
certainly incorrect for HVM domains, since additional
increase_reservation calls are made later in qemu.  Since all ballooned
memory is already taken, qemu will fail.  The fix is to treat the
requested memory size and the overhead size as separate values.  The
requested memory size is immediately allocated to the new domain; the
overhead is left unallocated for whatever else might need it later.

Signed-off-by: Charles Coffing <ccoffing@novell.com>
2006-05-19 16:07:36 +01:00
kaf24@firebug.cl.cam.ac.uk e7c2054604 [XM-TEST] Use explicit (IP id==packet size) on hping2 tests to avoid
problems with IP id==0

Signed-off-by: Jim Dykman <dykman@us.ibm.com>
2006-05-19 16:01:08 +01:00
kaf24@firebug.cl.cam.ac.uk 1e36436a10 [NET] front: Remove duplicate maybe_wake_tx
Since network_tx_buf_gc unconditionally calls network_maybe_wake_tx at
the end, there is no need to call it again right after a call to
network_tx_buf_gc.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2006-05-19 15:58:46 +01:00
kaf24@firebug.cl.cam.ac.uk e1b53df502 Fix xentrace_format to deal with more than 16 CPUs.
Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
2006-05-19 15:52:35 +01:00
kaf24@firebug.cl.cam.ac.uk cd04d3a538 [NET] front: remove use of typedefs for structures.
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
2006-05-19 15:51:26 +01:00
kaf24@firebug.cl.cam.ac.uk 2861a0ce8e Place typedefs on their own separate lines in the Xen public headers.
Makes it easier to share with Linux tree.

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
2006-05-19 15:51:06 +01:00
kaf24@firebug.cl.cam.ac.uk c00e364b1f Introduce is_running_on_xen() to test whether we are running on Xen before
initialising a Xen-specific driver or subsystem.

For ia64:
 * Call xen_init in setup_arch.
 * Remove xen_ksyms.c

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
2006-05-19 15:35:19 +01:00
kaf24@firebug.cl.cam.ac.uk d3eb6da342 Fix a crash in gdbserver-xen where it references unmapped memory if
the page directory / page table pages are not present (for example
through dereferencing NULL in the gdb session). Changes:

- map_domain_va_32 has been rewritten to match map_domain_va_pae and
  map_domain_va_64.

- All three functions have been extended to handle multiple vCPUs,
  (untested, but shuld work), and check for _PAGE_PRESENT.

- Keir's workaround for the compile error in map_domain_va_64 has been
  removed and hopefully fixed.

Signed-Off-By: Simon Kagstrom <simon.kagstrom@bth.se>
2006-05-19 15:22:11 +01:00
kaf24@firebug.cl.cam.ac.uk b8ea0809a8 [NET] front: remove unnecessary include of proc_fs.h.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-05-18 21:41:56 +01:00
kaf24@firebug.cl.cam.ac.uk 59807d3c4a Check `global' property of the arch specific virqs.
Signed-off-by Kevin Tian <Kevin.tian@intel.com>
2006-05-18 16:19:18 +01:00
kaf24@firebug.cl.cam.ac.uk 5856c39120 Remove Emacs variables settings from tail of our Linux files.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-05-18 11:39:03 +01:00
kaf24@firebug.cl.cam.ac.uk 611cde25ae Rename init_IRQ to xen_init_IRQ, so that non-x86 can use their own init_IRQ.
Signed-off-by Kevin Tian <Kevin.tian@intel.com>
2006-05-18 10:46:07 +01:00
kaf24@firebug.cl.cam.ac.uk fc87244286 Remove __TEST_HARNESS__ tests from x86_emulate: instead check for __XEN__
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-05-18 10:43:05 +01:00
kaf24@firebug.cl.cam.ac.uk 4ed20e3471 [NET] front: clean up create_netdev interface.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-05-18 10:40:55 +01:00
kaf24@firebug.cl.cam.ac.uk 479709ccc7 [NET] front: Add a sysfs interface for tuning the receive buffer values.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-05-18 10:21:11 +01:00
kaf24@firebug.cl.cam.ac.uk 4adce43f67 [NET] front: Give netfront a procectomy. The existing /proc interface
for tuning is buggy (network device names can change), and would
not be accepted in mainline.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-05-18 10:15:14 +01:00
kaf24@firebug.cl.cam.ac.uk 4b202a1f90 [NET] front: Network devices need to be freed by free_netdev not kfree.
Also, fix some missing unwinds in error path.
Still not convinced there aren't some lurking double free's in the error
paths here.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-05-18 10:12:07 +01:00
kaf24@firebug.cl.cam.ac.uk 69cb5d24d4 [NET] front: The initialization and removal functions should be tagged
with proper section attributes to save space.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-05-18 10:06:52 +01:00
kaf24@firebug.cl.cam.ac.uk 4976068a27 [NET] front: The receive buffer accounting should be unsigned to avoid
range comparison issues.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-05-18 10:05:32 +01:00
kaf24@firebug.cl.cam.ac.uk 93c5c9d181 [NET] front: Minor style fix and eliminate Emacs style comment which
is considered poor taste by current kernel community.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-05-18 10:04:26 +01:00
kaf24@firebug.cl.cam.ac.uk 7a8412d14c [NET] front: clean up transmit queue waking
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-05-18 10:02:32 +01:00
kaf24@firebug.cl.cam.ac.uk 40013e6147 [NET] front: Replace user_state with netif_running
The user_state variable is simply replicating information that's already
present through netif_running.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2006-05-18 09:41:29 +01:00
kaf24@firebug.cl.cam.ac.uk 13fa6b49ab [NET] front: Remove tx_full and unnecessary queue operations
The tx_full variable merely mirrors information already present in
the XOFF bit on the net device.  The net device architecture itself
is quite mature and can be trusted by Xen to maintain its state
correctly.

Also, it's pointless to stop the queue in close_netdev since it can
be waken up anyway since there could be a softirq running on another
CPU.  All of this is handled by unregister_netdev anyway.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2006-05-18 09:38:37 +01:00
kaf24@firebug.cl.cam.ac.uk 1f4e4f9380 Fix the build after SVM patches.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-05-18 08:55:20 +01:00
kaf24@firebug.cl.cam.ac.uk d3467d6490 SVM patch to add a host save area per core for the hypervisor and also
for the microcode.  The microcode area is not guaranteed to be
compatible with the vmcb layout, therefore will require it's own
"scratch pad".  Consolidate the per core areas into a single structure.

Signed-off-by: Tom Woller <thomas.woller@amd.com>
2006-05-18 00:03:13 +01:00
kaf24@firebug.cl.cam.ac.uk 26d9fa01fb Fix register corruption caused by c/s 9922.
From: Tom Woller <thomas.woller@amd.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-05-18 00:01:59 +01:00
kaf24@firebug.cl.cam.ac.uk 07f4ecf475 SVM patch to cleanup guest event injection logic, remove unnecessary
event_injecting variable.

Signed-off-by: Tom Woller <thomas.woller@amd.com>
2006-05-17 23:53:01 +01:00
kaf24@firebug.cl.cam.ac.uk 4032ebdf09 SVM patch to reverse the logic of the general1 intercepts for easier
reading, also add the INVD intercept with print/eip increment only.

Signed-off-by: Tom Woller <thomas.woller@amd.com>
Signed-off-by: Mats Petersson <mats.petersson@amd.com>
2006-05-17 23:51:39 +01:00
kaf24@firebug.cl.cam.ac.uk 2f01b51566 SVM patch to cleanup IOIO handling, do not use "real" mode but rather
the correct "bitness".

Signed-off-by: Tom Woller <thomas.woller@amd.com>
Signed-off-by: Mats Petersson <mats.petersson@amd.com>
2006-05-17 23:50:23 +01:00
kaf24@firebug.cl.cam.ac.uk 5280374fbb Add hotkey 'v' to hypervisor monitor to print VMCS areas.
When crashing domain due failed vmenter print processor's VMCS.

Signed-off-by: Boris Ostrovsky <bostrovsky@virtualiron.com>
2006-05-17 23:47:19 +01:00
kaf24@firebug.cl.cam.ac.uk bca9460e94 Allow to specify different time-of-day clock offsets for HVM guests.
There are some usage scenarios in which differing user domains want
to be using different base TOD clocks. This patch adds the ability
to specify the base TOD time difference.  The patch also adds a
hook point to notify another entity when the domain changes this
offset. This might occur, for instance, on a Linux domain using
hwclock -w.

Signed-off-by: Ben Thomas <ben@virtualiron.com>
2006-05-17 23:43:32 +01:00
kaf24@firebug.cl.cam.ac.uk 73e9ee97b4 Theoretically a 0 VIRT_BASE is okay. Change the bail code when
parsing elf headers to bail only when VIRT_BASE is not specified
at all.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-05-17 23:41:59 +01:00
kaf24@firebug.cl.cam.ac.uk 4d04d7278d When doing local migration, a timing-related problem occurred due to the
frontend switching to the Closed state, which could end up having
the .remove function being called after the backend has shut down. This
now fixes the problem by switching to the Closing state. 
The other part of the patch cleans up freeing of memory.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-05-17 23:28:22 +01:00
kaf24@firebug.cl.cam.ac.uk 559aac4666 VTPM_TOOLS: Restructured handlers for better clearity and created an ipc
abstraction needed for expansion to hot plug and migration support. Also
fixed a bug in savestate.

Signed-off-by: Vinnie Scarlata <Vincent.r.scarlata@intel.com>
2006-05-17 23:23:26 +01:00
kaf24@firebug.cl.cam.ac.uk 86c03b97cb This patch fixes the Linux builder so that it dies gracefully when
trying to load malformed ELF images.
Signed-off-by: Aravindh Puthiyaparambil <aravindh.puthiyaparambil@unisys.com>
2006-05-17 23:19:18 +01:00
kaf24@firebug.cl.cam.ac.uk 2045b32eff This patch fixes the x86_64 __xen_guest section allowing Mini-OS to run again.
Signed-off-by: Aravindh Puthiyaparambil <aravindh.puthiyaparambil@unisys.com>
2006-05-17 23:15:36 +01:00
kaf24@firebug.cl.cam.ac.uk 33a21ad5f8 Add some locking to the PIC device model. Improves SMP guest stability.
Signed-off-by: David Lively <dlively@virtualiron.com>
2006-05-16 19:54:41 +01:00
kaf24@firebug.cl.cam.ac.uk 8b08b9d602 Fix MOVS instruction emulation for HVM MMIO.
From: Gerd Hoffman
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-05-16 19:50:23 +01:00
kaf24@firebug.cl.cam.ac.uk 53f1439338 [MINIOS] Fix the pagefault handler to detect recursive faults.
Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
2006-05-16 16:34:27 +01:00
kaf24@firebug.cl.cam.ac.uk eca207adce Fixes to the xenoprofile Linux driver.
The active_domains code has race conditions:

* oprofile_set_active() calls set_active() method without holding
  start_sem.  This is clearly wrong, as xenoprof_set_active() makes
  several hypercalls.  oprofile_start(), for instance, could run in
  the middle of xenoprof_set_active().

* adomain_write(), adomain_read() and xenoprof_set_active() access
  global active_domains[] and adomains without synchronization.  I
  went for a simple, obvious fix and created another mutex.  Instead,
  one could move the shared data into oprof.c and protect it with
  start_sem, but that's more invasive.

Also clean up the code dealing with /dev/oprofile/active_domains:

* Use parameters instead of global variables to pass domain ids
  around.  Give those globals internal linkage.

* Allocate buffers dynamically to conserve stack space.

* Treat writes with size zero exactly like a write containing no
  domain id.  Before, zero-sized write was ignored, which is not the
  same.

* Parse domain ids as unsigned numbers.  Before, the first one was
  parsed as signed number.

  Because ispunct()-punctuation is ignored between domain ids, signs
  are still silently ignored except for the first number.  Hmm.

* Make parser accept whitespace as domain separator, because that's
  what you get when reading the file.

* EINVAL on domain ids overflowing domid_t.  Before, they were
  silently truncated.

* EINVAL on too many domain ids.  Before, the excess ones were
  silently ignored.

* Reset active domains on failure halfway through setting them.

* Fix potential buffer overflow in adomain_read().  Couldn't really
  happen because buffer was sufficient for current value of
  MAX_OPROF_DOMAINS.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
2006-05-16 14:07:56 +01:00
kaf24@firebug.cl.cam.ac.uk f00a6868cf Our 10,000th changeset! (Clean up trailing whitespace in README file :-)
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-05-16 13:46:57 +01:00
kaf24@firebug.cl.cam.ac.uk dbb16ea9d1 Fix the tools build:
1. xenctrl.h needs to include stddef.h to define size_t
 2. tbctl is broken -- remove it since xenmon and xentrace
    both automatcially enable tracing now
 3. Fix setsize after xc_tbug interface changes

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-05-16 13:35:59 +01:00
kaf24@firebug.cl.cam.ac.uk 4eabcb748c Prevent an oops in Dom0 that occurs when a CD device, specified as one
of the 'hardrives' in the 'disk=' line of a para-virtualized guest's
def file, has no media when the guest is started.

The oops occurs in vbd.c when vbd_size() is called from connect() (in
xenbus.c) and the vbd pointer is really an error code that comes from
the failed open that occurred in vbd_create().

Based on a patch from Ross Maxfield at Novell.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-05-16 09:40:38 +01:00
kaf24@firebug.cl.cam.ac.uk fc1bbeb091 Extend xentrace man page.
From: Kaleb Pederson
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-05-16 09:21:33 +01:00
kaf24@firebug.cl.cam.ac.uk b152f0ed7a Use common code for enabling tracing via xenmon and xentrace, also fixing
the last two remaining xc_private.h users outside of libxc.

Signed-off-by: John Levon <john.levon@sun.com>
2006-05-16 09:18:25 +01:00