[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] Merge.
# HG changeset patch # User sos22@xxxxxxxxxxxxxxxxxxxx # Node ID edf1fab8661877d6241cd390bf0f4e1e790e01b4 # Parent f658587fdaacfd96a6eb9f231b5189f5855cc866 # Parent 5fcc346d6fe086436977a9b171f2bdb3a177d828 Merge. Signed-off-by: Steven Smith, sos22@xxxxxxxxx diff -r f658587fdaac -r edf1fab86618 linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c --- a/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c Thu Jan 26 17:00:40 2006 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c Thu Jan 26 17:02:21 2006 @@ -14,7 +14,6 @@ #include <asm-xen/xen-public/xen.h> #include <asm/fixmap.h> #include <asm/uaccess.h> -#include <asm-xen/xen_proc.h> #include <asm-xen/linux-public/privcmd.h> #include <asm-xen/gnttab.h> #include <asm/synch_bitops.h> @@ -340,81 +339,6 @@ spin_unlock_irqrestore(&gnttab_list_lock, flags); } -/* - * ProcFS operations - */ - -#ifdef CONFIG_PROC_FS - -static struct proc_dir_entry *grant_pde; -static struct file_operations grant_file_ops; - -static int -grant_read(char *page, char **start, off_t off, int count, int *eof, - void *data) -{ - int len; - unsigned int i; - grant_entry_t *gt; - - gt = (grant_entry_t *)shared; - len = 0; - - for (i = 0; i < NR_GRANT_ENTRIES; i++) { - if (len > (PAGE_SIZE - 200)) { - len += sprintf( page + len, "Truncated.\n"); - break; - } - } - - if (gt[i].flags) { - len += sprintf(page + len, - "Grant: ref (0x%x) flags (0x%hx) " - "dom (0x%hx) frame (0x%x)\n", - i, - gt[i].flags, - gt[i].domid, - gt[i].frame ); - } - - *eof = 1; - return len; -} - -static int -grant_write(struct file *file, const char __user *buffer, unsigned long count, - void *data) -{ - /* TODO: implement this */ - return -ENOSYS; -} - -static int __init -gnttab_proc_init(void) -{ - /* - * /proc/xen/grant : used by libxc to access grant tables - */ - if ((grant_pde = create_xen_proc_entry("grant", 0600)) == NULL) { - WPRINTK("Unable to create grant xen proc entry\n"); - return -1; - } - - grant_file_ops.read = grant_pde->proc_fops->read; - grant_file_ops.write = grant_pde->proc_fops->write; - - grant_pde->proc_fops = &grant_file_ops; - - grant_pde->read_proc = &grant_read; - grant_pde->write_proc = &grant_write; - - return 0; -} - -device_initcall(gnttab_proc_init); - -#endif /* CONFIG_PROC_FS */ - int gnttab_resume(void) { diff -r f658587fdaac -r edf1fab86618 tools/libxc/Makefile --- a/tools/libxc/Makefile Thu Jan 26 17:00:40 2006 +++ b/tools/libxc/Makefile Thu Jan 26 17:02:21 2006 @@ -17,7 +17,6 @@ SRCS += xc_core.c SRCS += xc_domain.c SRCS += xc_evtchn.c -SRCS += xc_gnttab.c SRCS += xc_misc.c SRCS += xc_physdev.c SRCS += xc_private.c diff -r f658587fdaac -r edf1fab86618 tools/libxc/xc_linux_build.c --- a/tools/libxc/xc_linux_build.c Thu Jan 26 17:00:40 2006 +++ b/tools/libxc/xc_linux_build.c Thu Jan 26 17:02:21 2006 @@ -241,16 +241,16 @@ l2_pgentry_t *vl2tab=NULL, *vl2e=NULL; l3_pgentry_t *vl3tab=NULL, *vl3e=NULL; l4_pgentry_t *vl4tab=NULL, *vl4e=NULL; - unsigned long l2tab = 0; - unsigned long l1tab = 0; - unsigned long l3tab = 0; - unsigned long l4tab = 0; + unsigned long l2tab = 0, pl2tab; + unsigned long l1tab = 0, pl1tab; + unsigned long l3tab = 0, pl3tab; + unsigned long l4tab = 0, pl4tab; unsigned long ppt_alloc; unsigned long count; /* First allocate page for page dir. */ ppt_alloc = (vpt_start - dsi_v_start) >> PAGE_SHIFT; - alloc_pt(l4tab, vl4tab); + alloc_pt(l4tab, vl4tab, pl4tab); vl4e = &vl4tab[l4_table_offset(dsi_v_start)]; if (shadow_mode_enabled) ctxt->ctrlreg[3] = pl4tab; @@ -261,28 +261,37 @@ { if ( !((unsigned long)vl1e & (PAGE_SIZE-1)) ) { - alloc_pt(l1tab, vl1tab); + alloc_pt(l1tab, vl1tab, pl1tab); if ( !((unsigned long)vl2e & (PAGE_SIZE-1)) ) { - alloc_pt(l2tab, vl2tab); + alloc_pt(l2tab, vl2tab, pl2tab); if ( !((unsigned long)vl3e & (PAGE_SIZE-1)) ) { - alloc_pt(l3tab, vl3tab); + alloc_pt(l3tab, vl3tab, pl3tab); vl3e = &vl3tab[l3_table_offset(dsi_v_start + (count<<PAGE_SHIFT))]; - *vl4e = l3tab | L4_PROT; + if (shadow_mode_enabled) + *vl4e = pl3tab | L4_PROT; + else + *vl4e = l3tab | L4_PROT; vl4e++; } vl2e = &vl2tab[l2_table_offset(dsi_v_start + (count<<PAGE_SHIFT))]; - *vl3e = l2tab | L3_PROT; + if (shadow_mode_enabled) + *vl3e = pl2tab | L3_PROT; + else + *vl3e = l2tab | L3_PROT; vl3e++; } vl1e = &vl1tab[l1_table_offset(dsi_v_start + (count<<PAGE_SHIFT))]; - *vl2e = l1tab | L2_PROT; + if (shadow_mode_enabled) + *vl2e = pl1tab | L2_PROT; + else + *vl2e = l1tab | L2_PROT; vl2e++; } - if (shadow_mode_enable) { + if (shadow_mode_enabled) { *vl1e = (count << PAGE_SHIFT) | L1_PROT; } else { *vl1e = (page_array[count] << PAGE_SHIFT) | L1_PROT; diff -r f658587fdaac -r edf1fab86618 tools/libxc/xenctrl.h --- a/tools/libxc/xenctrl.h Thu Jan 26 17:00:40 2006 +++ b/tools/libxc/xenctrl.h Thu Jan 26 17:02:21 2006 @@ -13,7 +13,6 @@ #include <sys/ptrace.h> #include <xen/xen.h> #include <xen/dom0_ops.h> -#include <xen/grant_table.h> #include <xen/version.h> #include <xen/event_channel.h> #include <xen/sched.h> @@ -467,63 +466,6 @@ int num, unsigned long *arr); -/*\ - * GRANT TABLE FUNCTIONS -\*/ - -/** - * This function opens a handle to the more restricted grant table hypervisor - * interface. This may be used where the standard interface is not - * available because the domain is not privileged. - * This function can be called multiple times within a single process. - * Multiple processes can have an open hypervisor interface at the same time. - * - * Each call to this function should have a corresponding call to - * xc_grant_interface_close(). - * - * This function can fail if a Xen-enabled kernel is not currently running. - * - * @return a handle to the hypervisor grant table interface or -1 on failure - */ -int xc_grant_interface_open(void); - -/** - * This function closes an open grant table hypervisor interface. - * - * This function can fail if the handle does not represent an open interface or - * if there were problems closing the interface. - * - * @parm xc_handle a handle to an open grant table hypervisor interface - * @return 0 on success, -1 otherwise. - */ -int xc_grant_interface_close(int xc_handle); - -int xc_gnttab_map_grant_ref(int xc_handle, - uint64_t host_virt_addr, - uint32_t dom, - grant_ref_t ref, - uint16_t flags, - int16_t *status, - grant_handle_t *handle, - uint64_t *dev_bus_addr); - -int xc_gnttab_unmap_grant_ref(int xc_handle, - uint64_t host_virt_addr, - uint64_t dev_bus_addr, - grant_handle_t handle, - int16_t *status); - -int xc_gnttab_setup_table(int xc_handle, - uint32_t dom, - uint16_t nr_frames, - int16_t *status, - unsigned long **frame_list); - -/* Grant debug builds only: */ -int xc_gnttab_dump_table(int xc_handle, - uint32_t dom, - int16_t *status); - /* Get current total pages allocated to a domain. */ long xc_get_tot_pages(int xc_handle, uint32_t domid); diff -r f658587fdaac -r edf1fab86618 tools/python/xen/xm/create.py --- a/tools/python/xen/xm/create.py Thu Jan 26 17:00:40 2006 +++ b/tools/python/xen/xm/create.py Thu Jan 26 17:02:21 2006 @@ -395,6 +395,13 @@ gopts.var('xauthority', val='XAUTHORITY', fn=set_value, default=None, use="X11 Authority to use") + +gopts.var('uuid', val='', + fn=set_value, default=None, + use="""xenstore UUID (universally unique identifier) to use. One + will be randomly generated if this option is not set, just like MAC + addresses for virtual network interfaces. This must be a unique + value across the entire cluster.""") def err(msg): @@ -566,6 +573,8 @@ map(add_conf, ['name', 'memory', 'ssidref', 'maxmem', 'restart', 'on_poweroff', 'on_reboot', 'on_crash', 'vcpus']) + if vals.uuid is not None: + config.append(['uuid', vals.uuid]) if vals.cpu is not None: config.append(['cpu', vals.cpu]) if vals.cpus is not None: diff -r f658587fdaac -r edf1fab86618 tools/xm-test/README --- a/tools/xm-test/README Thu Jan 26 17:00:40 2006 +++ b/tools/xm-test/README Thu Jan 26 17:02:21 2006 @@ -70,10 +70,19 @@ If HVM / VMX support is enabled, the ramdisk/bin/create_disk_image script will be run to create a full virt disk.img in the ramdisk directory. The script, by default, will look in /boot for the first non-Xen kernel it -runs across. If you wish to use a different kernel or the script fails -to find a kernel, please run the script manually to make a disk.img -using the -k option. Xm-test will look for disk.img in the ramdisk -directory when run by default. +runs across. If you'd like to set xm-test to use a specific kernel, +rather than the first one it finds in /boot, you can configure it in +with the "--with-vmx-kernel=KERNEL" option: + +# ./autogen +# ./configure --enable-vmx-support --with-vmx-kernel=KERNEL +# make + +Otherwise, you can always rerun the create script using the -k option +to use a specific kernel. + +Xm-test will look for disk.img in the ramdisk directory when run by +default. Running diff -r f658587fdaac -r edf1fab86618 tools/xm-test/configure.ac --- a/tools/xm-test/configure.ac Thu Jan 26 17:00:40 2006 +++ b/tools/xm-test/configure.ac Thu Jan 26 17:02:21 2006 @@ -37,6 +37,14 @@ AM_CONDITIONAL(VMX, test x$ENABLE_VMX = xTrue) AC_SUBST(ENABLE_VMX) + +AC_ARG_WITH(vmx-kernel, + [[ --with-vmx-kernel=kernel Use this kernel for vmx disk.img testing]], + VMXKERNEL=$withval, + VMXKERNEL="no") + +dnl substitute @VMXKERNEL@ in all Makefiles +AC_SUBST(VMXKERNEL) AC_SUBST(TENV) AC_SUBST(PACKAGE_VERSION) diff -r f658587fdaac -r edf1fab86618 tools/xm-test/ramdisk/Makefile.am --- a/tools/xm-test/ramdisk/Makefile.am Thu Jan 26 17:00:40 2006 +++ b/tools/xm-test/ramdisk/Makefile.am Thu Jan 26 17:02:21 2006 @@ -45,7 +45,11 @@ disk.img: $(XMTEST_VER_IMG) chmod a+x $(VMX_SCRIPT) - $(VMX_SCRIPT) -r $(XMTEST_VER_IMG) + @if test "$(VMXKERNEL)" = "no" ; then \ + $(VMX_SCRIPT) -r $(XMTEST_VER_IMG); \ + else \ + $(VMX_SCRIPT) -r $(XMTEST_VER_IMG) -k $(VMXKERNEL); \ + fi existing: @[ -f $(XMTEST_VER_IMG) ] && ln -sf $(XMTEST_VER_IMG) initrd.img || \ diff -r f658587fdaac -r edf1fab86618 xen/arch/x86/mm.c --- a/xen/arch/x86/mm.c Thu Jan 26 17:00:40 2006 +++ b/xen/arch/x86/mm.c Thu Jan 26 17:02:21 2006 @@ -1826,8 +1826,7 @@ break; case MMUEXT_NEW_BASEPTR: - if (shadow_mode_translate(current->domain)) - mfn = __gpfn_to_mfn(current->domain, mfn); + mfn = __gpfn_to_mfn(current->domain, mfn); okay = new_guest_cr3(mfn); percpu_info[cpu].deferred_ops &= ~DOP_FLUSH_TLB; break; @@ -2664,7 +2663,7 @@ long do_set_gdt(unsigned long *frame_list, unsigned int entries) { - int nr_pages = (entries + 511) / 512; + int i, nr_pages = (entries + 511) / 512; unsigned long frames[16]; long ret; diff -r f658587fdaac -r edf1fab86618 xen/arch/x86/x86_32/entry.S --- a/xen/arch/x86/x86_32/entry.S Thu Jan 26 17:00:40 2006 +++ b/xen/arch/x86/x86_32/entry.S Thu Jan 26 17:02:21 2006 @@ -478,13 +478,13 @@ .previous domain_crash_synchronous_string: - .asciz "domain_crash_sync from entry.S %lx\n" - + .asciz "domain_crash_sync called from entry.S (%lx)\n" + domain_crash_synchronous: - pushl $domain_crash_synchronous_string - call printf - jmp __domain_crash_synchronous - + pushl $domain_crash_synchronous_string + call printf + jmp __domain_crash_synchronous + ALIGN process_guest_exception_and_events: leal VCPU_trap_bounce(%ebx),%edx diff -r f658587fdaac -r edf1fab86618 xen/arch/x86/x86_64/entry.S --- a/xen/arch/x86/x86_64/entry.S Thu Jan 26 17:00:40 2006 +++ b/xen/arch/x86/x86_64/entry.S Thu Jan 26 17:02:21 2006 @@ -436,6 +436,14 @@ .quad FLT12,domain_crash_synchronous , FLT13,domain_crash_synchronous .previous +domain_crash_synchronous_string: + .asciz "domain_crash_sync called from entry.S\n" + +domain_crash_synchronous: + leaq domain_crash_synchronous_string(%rip),%rdi + call printf + jmp __domain_crash_synchronous + ALIGN /* %rbx: struct vcpu */ process_guest_exception_and_events: diff -r f658587fdaac -r edf1fab86618 xen/common/domain.c --- a/xen/common/domain.c Thu Jan 26 17:00:40 2006 +++ b/xen/common/domain.c Thu Jan 26 17:02:21 2006 @@ -130,8 +130,8 @@ { for_each_vcpu(d, v) sched_rem_domain(v); + gnttab_release_mappings(d); domain_relinquish_resources(d); - gnttab_release_mappings(d); put_domain(d); send_guest_virq(dom0->vcpu[0], VIRQ_DOM_EXC); diff -r f658587fdaac -r edf1fab86618 xen/include/xen/sched.h --- a/xen/include/xen/sched.h Thu Jan 26 17:00:40 2006 +++ b/xen/include/xen/sched.h Thu Jan 26 17:02:21 2006 @@ -240,7 +240,7 @@ */ extern void __domain_crash(struct domain *d); #define domain_crash(d) do { \ - printf("domain_crash called from %s:%d\n", __FILE__, __LINE__); \ + printk("domain_crash called from %s:%d\n", __FILE__, __LINE__); \ __domain_crash(d); \ } while (0) @@ -250,7 +250,7 @@ */ extern void __domain_crash_synchronous(void) __attribute__((noreturn)); #define domain_crash_synchronous() do { \ - printf("domain_crash_sync called from %s:%d\n", __FILE__, __LINE__); \ + printk("domain_crash_sync called from %s:%d\n", __FILE__, __LINE__); \ __domain_crash_synchronous(); \ } while (0) diff -r f658587fdaac -r edf1fab86618 tools/libxc/xc_gnttab.c --- a/tools/libxc/xc_gnttab.c Thu Jan 26 17:00:40 2006 +++ /dev/null Thu Jan 26 17:02:21 2006 @@ -1,142 +0,0 @@ -/****************************************************************************** - * xc_gnttab.c - * - * API for manipulating and accessing grant tables - * - * Copyright (c) 2005 Christopher Clark - * based on xc_evtchn.c Copyright (c) 2004, K A Fraser. - */ - -#include "xc_private.h" -#include "xen/grant_table.h" - -static int -do_gnttab_op(int xc_handle, - unsigned long cmd, - void *op, - unsigned long count) -{ - int ret = -1; - DECLARE_HYPERCALL; - - hypercall.op = __HYPERVISOR_grant_table_op; - hypercall.arg[0] = cmd; - hypercall.arg[1] = (unsigned long)op; - hypercall.arg[2] = count; - - if ( mlock(op, 64) ) - { - PERROR("do_gnttab_op: op mlock failed"); - goto out; - } - - if ( (ret = do_xen_hypercall(xc_handle, &hypercall)) < 0 ) - ERROR("do_gnttab_op: HYPERVISOR_grant_table_op failed: %d", ret); - - safe_munlock(op, 64); - out: - return ret; -} - - -int xc_gnttab_map_grant_ref(int xc_handle, - uint64_t host_virt_addr, - uint32_t dom, - grant_ref_t ref, - uint16_t flags, - int16_t *status, - grant_handle_t *handle, - uint64_t *dev_bus_addr) -{ - struct gnttab_map_grant_ref op; - int rc; - - op.host_addr = host_virt_addr; - op.dom = (domid_t)dom; - op.ref = ref; - op.flags = flags; - - if ( (rc = do_gnttab_op(xc_handle, GNTTABOP_map_grant_ref, - &op, 1)) == 0 ) - { - *status = op.status; - *handle = op.handle; - *dev_bus_addr = op.dev_bus_addr; - } - - return rc; -} - - -int xc_gnttab_unmap_grant_ref(int xc_handle, - uint64_t host_virt_addr, - uint64_t dev_bus_addr, - grant_handle_t handle, - int16_t *status) -{ - struct gnttab_unmap_grant_ref op; - int rc; - - op.host_addr = host_virt_addr; - op.dev_bus_addr = dev_bus_addr; - op.handle = handle; - - if ( (rc = do_gnttab_op(xc_handle, GNTTABOP_unmap_grant_ref, - &op, 1)) == 0 ) - { - *status = op.status; - } - - return rc; -} - -int xc_gnttab_setup_table(int xc_handle, - uint32_t dom, - uint16_t nr_frames, - int16_t *status, - unsigned long **frame_list) -{ - struct gnttab_setup_table op; - int rc, i; - - op.dom = (domid_t)dom; - op.nr_frames = nr_frames; - - if ( (rc = do_gnttab_op(xc_handle, GNTTABOP_setup_table, &op, 1)) == 0 ) - { - *status = op.status; - for ( i = 0; i < nr_frames; i++ ) - (*frame_list)[i] = op.frame_list[i]; - } - - return rc; -} - -int xc_gnttab_dump_table(int xc_handle, - uint32_t dom, - int16_t *status) -{ - struct gnttab_dump_table op; - int rc; - - op.dom = (domid_t)dom; - - if ( (rc = do_gnttab_op(xc_handle, GNTTABOP_dump_table, &op, 1)) == 0 ) - *status = op.status; - - return rc; -} - -int xc_grant_interface_open(void) -{ - int fd = open("/proc/xen/grant", O_RDWR); - if ( fd == -1 ) - PERROR("Could not obtain handle on grant command interface"); - return fd; - -} - -int xc_grant_interface_close(int xc_grant_handle) -{ - return close(xc_grant_handle); -} _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |