Commit Graph
2896 Commits
Author SHA1 Message Date
kaf24@firebug.cl.cam.ac.uk 7e127cd35f Allow non-privileged domains restricted access to
I/O memory and physical interrupts, under control
of domain0. Capabilities are maintained as rangesets
in Xen.

Signed-off-by: Ryan Wilson <hap9@epoch.ncsc.mil>
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-12-31 14:15:22 +01:00
kaf24@firebug.cl.cam.ac.uk 9be588cacb Fix a missing break in ioemu command-line parsing switch
statement.

Signed-off-by: Xin Li <xin.b.li@intel.com>
2005-12-30 17:12:40 +01:00
kaf24@firebug.cl.cam.ac.uk 0129e126c4 Avoid xen crash if there is no VMX support. If a platform
doesn't support VMX, creating VMX domain will crash xen
HV.

Signed-off-by: Xin Li <xin.b.li@intel.com>
2005-12-30 17:07:34 +01:00
kaf24@firebug.cl.cam.ac.uk aafd5e14e1 Virtual TPM persistent states contain VTPM secrets, which are encrypted
using symmetric keys and stored on disk along with those symmetric keys.
The attached patch uses the TPM to encrypt the symmetric keys and other
global secrets before saving them to disk.

Signed-off-by: Vinnie Scarlata <vincent.r.scarlata@intel.com>
2005-12-30 11:31:12 +01:00
kaf24@firebug.cl.cam.ac.uk 5fb7e24473 Set up X11 authorization when a VMX domain uses SDL.
Signed-off-by: Hiromichi Itou <ito@begi.net>
2005-12-28 15:14:23 +01:00
Ian.Campbell@xensource.com efec87263e Only build xenctx on x86_32 and x86_64.
Signed-off-by: Ian Campbell <Ian.Campbell@XenSource.com>
2005-12-23 09:12:41 +00:00
Ian.Campbell@xensource.com e201be5d57 Merge. 2005-12-22 16:15:33 +00:00
emellor@leeni.uk.xensource.com 27efc4fd12 This patch fixes a bug/typo of main.py.
1. show option "-c" of help of xm dmesg
2. fix value of parameter of arg_check of xm log
3. fix aliases of vbd-create and vbd-destroy

Signed-off-by Yoshinori Katase <y_katase@soft.fujitsu.com>
2005-12-22 15:38:10 +00:00
Ian.Campbell@xensource.com 40924689a9 Add support to xenctx for printing stack traces on x86_32 and x86_64.
To support this add xc_translate_foreign_address to libxc. This function
walks page tables and translates virtual addresses using a given domain
and vcpu page table.

Signed-off-by: Ian Campbell <Ian.Campbell@XenSource.com>
2005-12-22 14:33:19 +00:00
djm@kirby.fc.hp.com a220ae9a8d Merge 2005-12-21 11:56:19 -06:00
djm@kirby.fc.hp.com 08b3de8dee diff -r 545ba1b126ca tools/libxc/xc_linux_build.c
--- a/tools/libxc/xc_linux_build.c      Tue Dec 20 20:11:17 2005
+++ b/tools/libxc/xc_linux_build.c      Wed Dec 21 11:50:08 2005
@@ -296,9 +296,13 @@
     unsigned long *page_array = NULL;
     struct load_funcs load_funcs;
     struct domain_setup_info dsi;
+    unsigned long vinitrd_start;
+    unsigned long vinitrd_end;
+    unsigned long v_end;
     unsigned long start_page, pgnr;
     start_info_t *start_info;
     int rc;
+    unsigned long i;
 
     rc = probeimageformat(image, image_size, &load_funcs);
     if ( rc != 0 )
@@ -310,11 +314,13 @@
     if ( rc != 0 )
         goto error_out;
 
-    dsi.v_start = round_pgdown(dsi.v_start);
-    dsi.v_end   = round_pgup(dsi.v_end);
+    dsi.v_start      = round_pgdown(dsi.v_start);
+    vinitrd_start    = round_pgup(dsi.v_end);
+    vinitrd_end      = vinitrd_start + initrd_len;
+    v_end            = round_pgup(vinitrd_end);
 
     start_page = dsi.v_start >> PAGE_SHIFT;
-    pgnr = (dsi.v_end - dsi.v_start) >> PAGE_SHIFT;
+    pgnr = (v_end - dsi.v_start) >> PAGE_SHIFT;
     if ( (page_array = malloc(pgnr * sizeof(unsigned long))) == NULL )
     {
         PERROR("Could not allocate memory");
@@ -326,9 +332,38 @@
         PERROR("Could not get the page frame list");
         goto error_out;
     }
+
+#define _p(a) ((void *) (a))
+
+    printf("VIRTUAL MEMORY ARRANGEMENT:\n"
+           " Loaded kernel: %p->%p\n"
+           " Init. ramdisk: %p->%p\n"
+           " TOTAL:         %p->%p\n",
+           _p(dsi.v_kernstart), _p(dsi.v_kernend), 
+           _p(vinitrd_start),   _p(vinitrd_end),
+           _p(dsi.v_start),     _p(v_end));
+    printf(" ENTRY ADDRESS: %p\n", _p(dsi.v_kernentry));
 
     (load_funcs.loadimage)(image, image_size, xc_handle, dom, page_array,
                            &dsi);
+
+    /* Load the initial ramdisk image. */
+    if ( initrd_len != 0 )
+    {
+        for ( i = (vinitrd_start - dsi.v_start);
+              i < (vinitrd_end - dsi.v_start); i += PAGE_SIZE )
+        {
+            char page[PAGE_SIZE];
+            if ( gzread(initrd_gfd, page, PAGE_SIZE) == -1 )
+            {
+                PERROR("Error reading initrd image, could not");
+                goto error_out;
+            }
+            xc_copy_to_domain_page(xc_handle, dom,
+                                   page_array[i>>PAGE_SHIFT], page);
+        }
+    }
+
 
     *pvke = dsi.v_kernentry;
 
@@ -358,6 +393,13 @@
     start_info->store_evtchn = store_evtchn;
     start_info->console_mfn   = nr_pages - 1;
     start_info->console_evtchn = console_evtchn;
+    if ( initrd_len != 0 )
+    {
+        ctxt->initrd.start    = vinitrd_start;
+        ctxt->initrd.size     = initrd_len;
+    }
+    strncpy((char *)ctxt->cmdline, cmdline, IA64_COMMAND_LINE_SIZE);
+    ctxt->cmdline[IA64_COMMAND_LINE_SIZE-1] = '\0';
     munmap(start_info, PAGE_SIZE);
 
     free(page_array);
diff -r 545ba1b126ca xen/arch/ia64/xen/dom_fw.c
--- a/xen/arch/ia64/xen/dom_fw.c        Tue Dec 20 20:11:17 2005
+++ b/xen/arch/ia64/xen/dom_fw.c        Wed Dec 21 11:50:08 2005
@@ -861,9 +861,14 @@
        bp->console_info.orig_x = 0;
        bp->console_info.orig_y = 24;
        bp->fpswa = 0;
-        bp->initrd_start = (dom0_start+dom0_size) -
-                (PAGE_ALIGN(ia64_boot_param->initrd_size) + 4*1024*1024);
-        bp->initrd_size = ia64_boot_param->initrd_size;
+        if (d == dom0){
+                bp->initrd_start = (dom0_start+dom0_size) -
+                        (PAGE_ALIGN(ia64_boot_param->initrd_size) + 4*1024*1024);
+                bp->initrd_size = ia64_boot_param->initrd_size;
+        }else{
+                bp->initrd_start = d->arch.initrd_start;
+                bp->initrd_size  = d->arch.initrd_len;
+       }
                 printf(" initrd start %0xlx", bp->initrd_start);
                 printf(" initrd size %0xlx", bp->initrd_size);
 
diff -r 545ba1b126ca xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c        Tue Dec 20 20:11:17 2005
+++ b/xen/arch/ia64/xen/domain.c        Wed Dec 21 11:50:08 2005
@@ -297,6 +297,9 @@
 
        *regs = c->regs;
        d->arch.sys_pgnr = c->sys_pgnr;
+        d->arch.initrd_start = c->initrd.start;
+        d->arch.initrd_len   = c->initrd.size;
+        d->arch.cmdline      = c->cmdline;
        new_thread(v, regs->cr_iip, 0, 0);
 
        v->vcpu_info->arch.evtchn_vector = c->vcpu.evtchn_vector;
@@ -365,7 +368,7 @@
                    regs->r28 = dom_fw_setup(d,saved_command_line,256L);
                else {
                    regs->ar_rsc |= (2 << 2); /* force PL2/3 */
-                   regs->r28 = dom_fw_setup(d,"nomca nosmp xencons=tty0 console=tty0 root=/dev/hda1",256L);  //FIXME
+                   regs->r28 = dom_fw_setup(d,d->arch.cmdline,256L);
                }
                VCPU(v, banknum) = 1;
                VCPU(v, metaphysical_mode) = 1;
diff -r 545ba1b126ca xen/include/asm-ia64/domain.h
--- a/xen/include/asm-ia64/domain.h     Tue Dec 20 20:11:17 2005
+++ b/xen/include/asm-ia64/domain.h     Wed Dec 21 11:50:08 2005
@@ -38,6 +38,9 @@
     u64 image_len;
     u64 entry;
 #endif
+    unsigned long initrd_start;
+    unsigned long initrd_len;
+    char *cmdline;
 };
 #define xen_vastart arch.xen_vastart
 #define xen_vaend arch.xen_vaend
diff -r 545ba1b126ca xen/include/public/arch-ia64.h
--- a/xen/include/public/arch-ia64.h    Tue Dec 20 20:11:17 2005
+++ b/xen/include/public/arch-ia64.h    Wed Dec 21 11:50:08 2005
@@ -276,6 +276,12 @@
     unsigned long start_info_pfn;
 } arch_shared_info_t;
 
+typedef struct {
+    unsigned long start;
+    unsigned long size; 
+} arch_initrd_info_t;
+
+#define IA64_COMMAND_LINE_SIZE 512
 typedef struct vcpu_guest_context {
 #define VGCF_FPU_VALID (1<<0)
 #define VGCF_VMX_GUEST (1<<1)
@@ -289,6 +295,8 @@
     cpu_user_regs_t regs;
     arch_vcpu_info_t vcpu;
     arch_shared_info_t shared;
+    arch_initrd_info_t initrd;
+    char cmdline[IA64_COMMAND_LINE_SIZE];
 } vcpu_guest_context_t;
 
 #endif /* !__ASSEMBLY__ */
2005-12-21 09:07:09 -06:00
kaf24@firebug.cl.cam.ac.uk c19d7d7430 Add support for MOVSX/MOVSXD/MOVZX (move-with-extend)
instructions to the generic x86 emulator. Also add
preliminary support for 16-bit addressing: decode the
ModR/M byte properly but still need to access and update
implicit memory operands (esp,esi,edi) with correct width.
Work is also needed to support real-mode addressing.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-12-21 14:29:23 +01:00
emellor@leeni.uk.xensource.com 9f929dc9af Merged. 2005-12-20 17:16:24 +00:00
emellor@leeni.uk.xensource.com c5ea66cfd2 Changed UUID / Xen handle formatting to be compatible with the OSF DCE UUIDs.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-20 17:16:15 +00:00
kaf24@firebug.cl.cam.ac.uk 4cbd6b3272 Add sound blaster support to VMX device model.
Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
2005-12-20 12:55:19 +01:00
kaf24@firebug.cl.cam.ac.uk b5bdea9ad6 This patch fix several issue to support >2G 64bit vmx guest in IA-32e
platform, it includes:
1) One fix on xc_vmx_build.c
2) Change ram_size/phys_ram_size in qemu from int to uint64_t
3) One fix on pcnet unsigned short to unsigned long conversion.

Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Signed-off-by: Xin Li           <xin.b.li@intel.com>
2005-12-20 12:50:09 +01:00
kaf24@firebug.cl.cam.ac.uk 41a6310c5e Move some useful cryptographic enveloping code into their own
functions so they can be used by other parts of the VTPM code.

Signed-off-by: Vinnie Scarlata <vincent.r.scarlata@intel.com>
2005-12-16 18:54:57 +01:00
stekloff@elm3b216.beaverton.ibm.com 6bcfa6dc80 Changed create_disk_image to default to making "disk.img", which is what
xm-test is looking for by default.

Signed-off-by: Daniel Stekloff <dsteklof@us.ibm.com>
2005-12-16 11:51:06 +00:00
stekloff@elm3b216.beaverton.ibm.com 5ad4f375ad Added information for running xm-test in HVM / VMX mode.
Signed-off-by: Daniel Stekloff <dsteklof@us.ibm.com>
2005-12-16 11:50:27 +00:00
nivedita@hex b212532248 Xend http access turned off by default.
Signed-off-by: Nivedita Singhvi (niv@us.ibm.com)
2005-12-16 11:46:58 +00:00
djm@kirby.fc.hp.com 2137b122b6 Small patch to avoid a stack overflow (VTI only).
Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
2005-12-15 14:51:10 -06:00
kaf24@firebug.cl.cam.ac.uk 026d31df5c Add debugging flag for domains to make domu debugging a run-time option
Signed-off-by: Kip Macy kmacy@fsmware.ckm
2005-12-15 21:50:12 +01:00
kaf24@firebug.cl.cam.ac.uk 1f5fb04e43 Add MP debug support to gdbserver.
Signed-off-by: Kip Macy <kip.macy@gmail.com>
2005-12-15 21:02:21 +01:00
emellor@leeni.uk.xensource.com bf991c09c6 Replace calls to deprecated xm set-vcpus with calls to new shiny xm vcpu-set.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-15 13:55:05 +00:00
emellor@leeni.uk.xensource.com d5461c7b29 Fix block_attach_shared tests. When the sharing check succeeds, the domain
is created but left paused, so it is necessary to destroy the domain afterwards,
whether the test succeeded or failed.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-15 13:49:07 +00:00
emellor@leeni.uk.xensource.com 822fceff34 Someone seems to have gotten carried away with cut & paste, and then
didn't test.

Signed-off-by: Jim Dykman <dykman@us.ibm.com>
2005-12-15 13:39:16 +00:00
emellor@leeni.uk.xensource.com c25bfd147c Added error message if the user attempts to shutdown Domain-0.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2005-12-14 12:03:40 +00:00
stekloff@elm3b216.beaverton.ibm.com b945dd3342 Adding SKIP() to tests that aren't supported for VMX domains.
Signed-off-by: Dan Stekloff <dsteklof@us.ibm.com>
2005-12-14 11:59:19 +00:00
emellor@leeni.uk.xensource.com 933f5440b4 Added mkdir -p $XENDOMAINS_SAVE, to ensure that the directory exists before
trying to save into it.
 
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-14 11:56:25 +00:00
emellor@leeni.uk.xensource.com c215f50020 Added a stress test for the Xenstore-Python interface layer.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-14 11:54:39 +00:00
emellor@leeni.uk.xensource.com d6f8e9a68e Merged. 2005-12-13 18:08:26 +00:00
emellor@leeni.uk.xensource.com a2529a2204 Added unit test for VMX configuration files.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-13 18:08:17 +00:00
emellor@leeni.uk.xensource.com 54fd0f2fb9 When we see a httplib.BadStatusLine, sleep 5 seconds and then retry. This
happens when Xend crashes, so retrying once allows it to restart and recover.
If we see Xend crash twice, we give up, but throw a more polite exception than
the BadStatusLine splat that we got previously.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-13 18:07:51 +00:00
emellor@leeni.uk.xensource.com 464379d285 Resurrect vifname xm create vif option support. This was present in earlier
versions of Xen, and allows one to name a vif when it is created.  This is
useful for integration with IP accounting packages, for example.

Closes bug #439.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-13 18:06:03 +00:00
danms@us.ibm.com dc0c9e694b Grab the test ID from the report submission response and provide a link
to the user's test report
Signed-off-by: Dan Smith <danms@us.ibm.com>
2005-12-13 18:00:50 +00:00
emellor@leeni.uk.xensource.com dc3c184731 Fix reference to HttpXendClientProtocol. This was previously referring to the
abstract base class, which was never going to work.  (This is debugging code
only, so I presume that no-one has used it for a long time, but it's doing no
harm hanging around.)

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-13 17:31:35 +00:00
emellor@leeni.uk.xensource.com 056647a91c Merged. 2005-12-13 16:26:33 +00:00
emellor@leeni.uk.xensource.com bf68bfcf48 Change the way domain configuration is handled in xm-test.
This will simplify the way we differentiate between HV and PV domains,
as well as make it easier to run normal tests in either HV or PV mode.

This patch has been modified by Ewan Mellor, to match his recent changes to
remove the nics= configuration option.

Signed-off-by: Dan Smith <danms@us.ibm.com>
Signed-off-by: Dan Stekloff <dsteklof@us.ibm.com>
2005-12-13 16:26:24 +00:00
kaf24@firebug.cl.cam.ac.uk f0756c96a0 A new ACM security tool providing support to aid in the
creation/generation of the XML security policy files for the Xen ACM
security architecture.  It is a python- based, web-based tool named
xensec_gen that allows users to create or modify XML policy files
through a browser.  The resulting XML policy files can then be copied
or moved to the appropriate location in the /etc/xen/acm-security
directory structure in order to be translated into binary and used
within the Xen system.

Signed-off-by: Tom Lendacky <toml@us.ibm.com>
2005-12-13 17:12:59 +01:00
kaf24@firebug.cl.cam.ac.uk 2bdefee6ab Add an option for device model to disable key repeat.
On slow network, when creating a vmx guest remotely,
the key repeat feature may make it hard to even type
the user name and password to login in to guest OS.

Signed-off-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
2005-12-13 17:01:09 +01:00
emellor@leeni.uk.xensource.com a9b9f0585c Merged. 2005-12-13 10:57:18 +00:00
Xiaofeng Ling e697c7e8ef change the NIC configuration accordingly after remove "nics=n"
otherwise, nics=-1 will be passed to device model and cause device
model exiting.

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
2005-12-13 10:57:04 +00:00
emellor@leeni.uk.xensource.com b57b530e0a Match previous changeset removing nics option.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-13 00:56:50 +00:00
emellor@leeni.uk.xensource.com bc8ed50e6c Deprecate the nics option from the xm create configuration. Instead, we use the
entries in vif to guide the configuration.  This is much less confusing.

Closes bug #440.

Change the example configuration files to match.  Also change them to use the
XenSource OUI in the MAC addresses.  Also change xm-test to match.

Remove the obsolete ipaddr configuration entry, and the backend_mac vif config
option.

Remove the preprocess_vifs function, folding it into the configure_vifs
function, and creating a simple comma_sep_kv_to_dict helper.

Remove the configure_vfr method, as it is unused.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-13 00:15:53 +00:00
emellor@leeni.uk.xensource.com 296749cb10 Don't try and close the pipe to the grandparent if it has already been closed
(i.e. we have restarted Xend).

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-13 00:10:19 +00:00
emellor@leeni.uk.xensource.com 17d0f5bf16 Read the domid and vifid from the store, rather than horribly slicing up the
store path.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-12 17:13:38 +00:00
emellor@leeni.uk.xensource.com 742b21299e Added xend-relocation-hosts-allow option.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-12 16:48:24 +00:00
emellor@leeni.uk.xensource.com 151c1bdf9c Squelch error message from iptables (we log this later if necessary).
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-12 16:44:27 +00:00
emellor@leeni.uk.xensource.com 03bbc8cec6 Added a hosts-allow facility to TCP connections, which allows us to restrict
the acceptable connections based upon a regular expression comparison with the
FQDN or the IP address.

Use the hosts-allow facility to restrict access to the relocation socket.  This
adds the configuration option xend-relocation-hosts-allow, which takes a
space-separated sequence of regular expressions.

Pass the protocol class instance through to SocketServerConnection, rather than
a new instance of that class.  This means that the new instance need not be
passed through SocketListener.acceptConnection.

Make the SocketServerConnection and SocketListener classes start their
corresponding threads and open their sockets (in the case of SocketListener)
automatically.  This means that callers do not need to save an instance locally,
just to call run() or listen() on it.  This also means that listenTCP and
listenUnix can go -- simply creating a TCPListener or UnixListener instance is
sufficient.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-12 16:43:48 +00:00
emellor@leeni.uk.xensource.com 91da6b2f1c Minor tidy.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-12 16:32:50 +00:00