Mailing List Archive

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
ChangeSet 1.1316, 2005/03/18 09:12:08+00:00, kaf24@firebug.cl.cam.ac.uk

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk



0 files changed




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xen-changelog
Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk [ In reply to ]
ChangeSet 1.1318, 2005/03/18 09:18:40+00:00, kaf24@firebug.cl.cam.ac.uk

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk



0 files changed




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xen-changelog
Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk [ In reply to ]
ChangeSet 1.1324, 2005/03/19 20:37:32+00:00, kaf24@firebug.cl.cam.ac.uk

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk



linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig | 14 -
xen/common/physdev.c | 221 ++++++++++------
2 files changed, 162 insertions(+), 73 deletions(-)


diff -Nru a/linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig b/linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig
--- a/linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig 2005-03-19 16:04:07 -05:00
+++ b/linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig 2005-03-19 16:04:07 -05:00
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.11-xen0
-# Fri Mar 11 01:02:42 2005
+# Sat Mar 19 19:42:39 2005
#
CONFIG_XEN=y
CONFIG_ARCH_XEN=y
@@ -13,10 +13,12 @@
CONFIG_XEN_PRIVILEGED_GUEST=y
CONFIG_XEN_PHYSDEV_ACCESS=y
CONFIG_XEN_BLKDEV_BACKEND=y
+# CONFIG_XEN_BLKDEV_TAP_BE is not set
CONFIG_XEN_NETDEV_BACKEND=y
CONFIG_XEN_BLKDEV_FRONTEND=y
CONFIG_XEN_NETDEV_FRONTEND=y
# CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
+# CONFIG_XEN_BLKDEV_TAP is not set
CONFIG_XEN_WRITABLE_PAGETABLES=y
CONFIG_XEN_SCRUB_PAGES=y
CONFIG_X86=y
@@ -886,6 +888,16 @@
# USB Gadget Support
#
# CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# InfiniBand support
+#
+# CONFIG_INFINIBAND is not set

#
# MMC/SD Card support
diff -Nru a/xen/common/physdev.c b/xen/common/physdev.c
--- a/xen/common/physdev.c 2005-03-19 16:04:07 -05:00
+++ b/xen/common/physdev.c 2005-03-19 16:04:07 -05:00
@@ -1,5 +1,4 @@
-/* -*- Mode:C; c-basic-offset:4; tab-width:4 -*-
- ****************************************************************************
+/****************************************************************************
* (c) 2004 - Rolf Neugebauer - Intel Research Cambridge
* (c) 2004 - Keir Fraser - University of Cambridge
****************************************************************************
@@ -86,31 +85,93 @@
}

/* Add a device to a per-domain device-access list. */
-static void add_dev_to_task(struct domain *p,
- struct pci_dev *dev, int acc)
+static int add_dev_to_task(struct domain *p, struct pci_dev *dev,
+ int acc)
{
- phys_dev_t *pdev;
+ phys_dev_t *physdev;

- if ( (pdev = find_pdev(p, dev)) )
- {
- /* Sevice already on list: update access permissions. */
- pdev->flags = acc;
- return;
- }
-
- if ( (pdev = xmalloc(sizeof(phys_dev_t))) == NULL )
+ if ( (physdev = xmalloc(phys_dev_t)) == NULL )
{
INFO("Error allocating pdev structure.\n");
- return;
+ return -ENOMEM;
}

- pdev->dev = dev;
- pdev->flags = acc;
- pdev->state = 0;
- list_add(&pdev->node, &p->pcidev_list);
+ physdev->dev = dev;
+ physdev->flags = acc;
+ physdev->state = 0;
+ list_add(&physdev->node, &p->pcidev_list);

if ( acc == ACC_WRITE )
- pdev->owner = p;
+ physdev->owner = p;
+
+ return 0;
+}
+
+/* Remove a device from a per-domain device-access list. */
+static void remove_dev_from_task(struct domain *p, struct pci_dev *dev)
+{
+ phys_dev_t *physdev = find_pdev(p, dev);
+
+ if ( physdev == NULL )
+ BUG();
+
+ list_del(&physdev->node);
+
+ xfree(physdev);
+}
+
+static int setup_ioport_memory_access(domid_t dom, struct domain* p,
+ struct exec_domain* ed,
+ struct pci_dev *pdev)
+{
+ struct exec_domain* edc;
+ int i, j;
+
+ /* Now, setup access to the IO ports and memory regions for the device. */
+ if ( ed->arch.io_bitmap == NULL )
+ {
+ if ( (ed->arch.io_bitmap = xmalloc_array(u8, IOBMP_BYTES)) == NULL )
+ return -ENOMEM;
+
+ memset(ed->arch.io_bitmap, 0xFF, IOBMP_BYTES);
+
+ ed->arch.io_bitmap_sel = ~0ULL;
+
+ for_each_exec_domain(p, edc) {
+ if (edc == ed)
+ continue;
+ edc->arch.io_bitmap = ed->arch.io_bitmap;
+ }
+ }
+
+ for ( i = 0; i < DEVICE_COUNT_RESOURCE; i++ )
+ {
+ struct resource *r = &pdev->resource[i];
+
+ if ( r->flags & IORESOURCE_IO )
+ {
+ /* Give the domain access to the IO ports it needs. Currently,
+ * this will allow all processes in that domain access to those
+ * ports as well. This will do for now, since driver domains don't
+ * run untrusted processes! */
+ INFO("Giving domain %u IO resources (%lx - %lx) "
+ "for device %s\n", dom, r->start, r->end, pdev->slot_name);
+ for ( j = r->start; j < r->end + 1; j++ )
+ {
+ clear_bit(j, ed->arch.io_bitmap);
+ clear_bit(j / IOBMP_BITS_PER_SELBIT, &ed->arch.io_bitmap_sel);
+ }
+ }
+ /* rights to IO memory regions are checked when the domain maps them */
+ }
+
+ for_each_exec_domain(p, edc) {
+ if (edc == ed)
+ continue;
+ edc->arch.io_bitmap_sel = ed->arch.io_bitmap_sel;
+ }
+
+ return 0;
}

/*
@@ -121,14 +182,17 @@
* bridge, then the domain should get access to all the leaf devices below
* that bridge (XXX this is unimplemented!).
*/
-int physdev_pci_access_modify(
- domid_t dom, int bus, int dev, int func, int enable)
+int physdev_pci_access_modify(domid_t dom, int bus, int dev, int func,
+ int enable)
{
struct domain *p;
+ struct exec_domain *ed;
struct pci_dev *pdev;
- int i, j, rc = 0;
-
- if ( !IS_PRIV(current) )
+ phys_dev_t *physdev;
+ int rc = 0;
+ int oldacc = -1, allocated_physdev = 0;
+
+ if ( !IS_PRIV(current->domain) )
BUG();

if ( (bus > PCI_BUSMAX) || (dev > PCI_DEVMAX) || (func > PCI_FUNCMAX) )
@@ -145,64 +209,60 @@
if ( (p = find_domain_by_id(dom)) == NULL )
return -ESRCH;

+ ed = p->exec_domain[0]; /* XXX */
+
/* Make the domain privileged. */
- set_bit(DF_PHYSDEV, &p->flags);
+ set_bit(DF_PHYSDEV, &p->d_flags);
/* FIXME: MAW for now make the domain REALLY privileged so that it
* can run a backend driver (hw access should work OK otherwise) */
- set_bit(DF_PRIVILEGED, &p->flags);
+ set_bit(DF_PRIVILEGED, &p->d_flags);

/* Grant write access to the specified device. */
if ( (pdev = pci_find_slot(bus, PCI_DEVFN(dev, func))) == NULL )
{
INFO(" dev does not exist\n");
rc = -ENODEV;
- goto out;
+ goto clear_privilege;
+ }
+
+ if ( (physdev = find_pdev(p, pdev)) != NULL) {
+ /* Sevice already on list: update access permissions. */
+ oldacc = physdev->flags;
+ physdev->flags = ACC_WRITE;
+ } else {
+ if ( (rc = add_dev_to_task(p, pdev, ACC_WRITE)) < 0)
+ goto clear_privilege;
+ allocated_physdev = 1;
}
- add_dev_to_task(p, pdev, ACC_WRITE);

INFO(" add RW %02x:%02x:%02x\n", pdev->bus->number,
PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));

/* Is the device a bridge or cardbus? */
- if ( pdev->hdr_type != PCI_HEADER_TYPE_NORMAL )
+ if ( pdev->hdr_type != PCI_HEADER_TYPE_NORMAL ) {
INFO("XXX can't give access to bridge devices yet\n");
-
- /* Now, setup access to the IO ports and memory regions for the device. */
-
- if ( p->thread.io_bitmap == NULL )
- {
- if ( (p->thread.io_bitmap = xmalloc(IOBMP_BYTES)) == NULL )
- {
- rc = -ENOMEM;
- goto out;
- }
- memset(p->thread.io_bitmap, 0xFF, IOBMP_BYTES);
-
- p->thread.io_bitmap_sel = ~0ULL;
+ rc = -EPERM;
+ goto remove_dev;
}

- for ( i = 0; i < DEVICE_COUNT_RESOURCE; i++ )
- {
- struct resource *r = &pdev->resource[i];
-
- if ( r->flags & IORESOURCE_IO )
- {


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xen-changelog
Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk [ In reply to ]
ChangeSet 1.1327, 2005/03/20 09:40:50+00:00, kaf24@firebug.cl.cam.ac.uk

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk



0 files changed




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xen-changelog
Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk [ In reply to ]
ChangeSet 1.1336, 2005/03/21 09:52:57+00:00, kaf24@firebug.cl.cam.ac.uk

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk



0 files changed




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xen-changelog
Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk [ In reply to ]
ChangeSet 1.1338, 2005/03/21 18:05:36+00:00, kaf24@firebug.cl.cam.ac.uk

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk



0 files changed




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xen-changelog
Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk [ In reply to ]
ChangeSet 1.1352, 2005/03/23 09:08:07+00:00, kaf24@firebug.cl.cam.ac.uk

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk



tools/libxc/xc_private.h | 13 ++++
xen/common/domain.c | 144 +++++++++++++++++++++++++++++++++++++----------
2 files changed, 129 insertions(+), 28 deletions(-)


diff -Nru a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
--- a/tools/libxc/xc_private.h 2005-03-23 05:03:38 -05:00
+++ b/tools/libxc/xc_private.h 2005-03-23 05:03:38 -05:00
@@ -199,4 +199,17 @@

unsigned long xc_get_m2p_start_mfn ( int xc_handle );

+long xc_get_tot_pages(int xc_handle, u32 domid);
+
+int xc_copy_to_domain_page(int xc_handle, u32 domid,
+ unsigned long dst_pfn, void *src_page);
+
+unsigned long xc_get_filesz(int fd);
+
+char *xc_read_kernel_image(const char *filename, unsigned long *size);
+
+void xc_map_memcpy(unsigned long dst, char *src, unsigned long size,
+ int xch, u32 dom, unsigned long *parray,
+ unsigned long vstart);
+
#endif /* __XC_PRIVATE_H__ */
diff -Nru a/xen/common/domain.c b/xen/common/domain.c
--- a/xen/common/domain.c 2005-03-23 05:03:38 -05:00
+++ b/xen/common/domain.c 2005-03-23 05:03:38 -05:00
@@ -7,6 +7,7 @@
#include <xen/config.h>
#include <xen/init.h>
#include <xen/lib.h>
+#include <xen/sched.h>
#include <xen/errno.h>
#include <xen/sched.h>
#include <xen/mm.h>
@@ -16,7 +17,7 @@
#include <asm/shadow.h>
#include <public/dom0_ops.h>
#include <asm/domain_page.h>
-#include <public/io/domain_controller.h>
+#include <asm/debugger.h>

/* Both these structures are protected by the domlist_lock. */
rwlock_t domlist_lock = RW_LOCK_UNLOCKED;
@@ -28,20 +29,23 @@
struct domain *do_createdomain(domid_t dom_id, unsigned int cpu)
{
struct domain *d, **pd;
+ struct exec_domain *ed;

if ( (d = alloc_domain_struct()) == NULL )
return NULL;

- atomic_set(&d->refcnt, 1);
- atomic_set(&d->pausecnt, 0);
+ ed = d->exec_domain[0];

- shadow_lock_init(d);
+ atomic_set(&d->refcnt, 1);
+ atomic_set(&ed->pausecnt, 0);

d->id = dom_id;
- d->processor = cpu;
+ ed->processor = cpu;
d->create_time = NOW();

- memcpy(&d->thread, &idle0_task.thread, sizeof(d->thread));
+ spin_lock_init(&d->time_lock);
+
+ spin_lock_init(&d->big_lock);

spin_lock_init(&d->page_alloc_lock);
INIT_LIST_HEAD(&d->page_list);
@@ -59,9 +63,9 @@
return NULL;
}

- arch_do_createdomain(d);
+ arch_do_createdomain(ed);

- sched_add_domain(d);
+ sched_add_domain(ed);

if ( d->id != IDLE_DOMAIN_ID )
{
@@ -127,10 +131,13 @@

void domain_kill(struct domain *d)
{
+ struct exec_domain *ed;
+
domain_pause(d);
- if ( !test_and_set_bit(DF_DYING, &d->flags) )
+ if ( !test_and_set_bit(DF_DYING, &d->d_flags) )
{
- sched_rem_domain(d);
+ for_each_exec_domain(d, ed)
+ sched_rem_domain(ed);
domain_relinquish_memory(d);
put_domain(d);
}
@@ -139,24 +146,32 @@

void domain_crash(void)
{
- if ( current->id == 0 )
+ struct domain *d = current->domain;
+
+ if ( d->id == 0 )
BUG();

- set_bit(DF_CRASHED, &current->flags);
+ set_bit(DF_CRASHED, &d->d_flags);

- send_guest_virq(dom0, VIRQ_DOM_EXC);
+ send_guest_virq(dom0->exec_domain[0], VIRQ_DOM_EXC);

__enter_scheduler();
BUG();
}

+extern void trap_to_xendbg(void);
+
void domain_shutdown(u8 reason)
{
- if ( current->id == 0 )
+ struct domain *d = current->domain;
+
+ if ( d->id == 0 )
{
extern void machine_restart(char *);
extern void machine_halt(void);

+ debugger_trap_immediate();
+
if ( reason == SHUTDOWN_poweroff )
{
printk("Domain 0 halted: halting machine.\n");
@@ -175,10 +190,10 @@
BUG();
}

- current->shutdown_code = reason;
- set_bit(DF_SHUTDOWN, &current->flags);
+ d->shutdown_code = reason;
+ set_bit(DF_SHUTDOWN, &d->d_flags);

- send_guest_virq(dom0, VIRQ_DOM_EXC);
+ send_guest_virq(dom0->exec_domain[0], VIRQ_DOM_EXC);

__enter_scheduler();
}
@@ -214,7 +229,7 @@
struct domain **pd;
atomic_t old, new;

- if ( !test_bit(DF_DYING, &d->flags) )
+ if ( !test_bit(DF_DYING, &d->d_flags) )
BUG();

/* May be already destructed, or get_domain() can race us. */
@@ -247,38 +262,101 @@


/*
- * final_setup_guestos is used for final setup and launching of domains other
+ * set_info_guest is used for final setup, launching, and state modification
+ * of domains other than domain 0. ie. the domains that are being built by
+ * the userspace dom0 domain builder.
+ */
+int set_info_guest(struct domain *p, dom0_setdomaininfo_t *setdomaininfo)
+{
+ int rc = 0;
+ full_execution_context_t *c = NULL;
+ unsigned long vcpu = setdomaininfo->exec_domain;
+ struct exec_domain *ed;
+
+ if ( (vcpu >= MAX_VIRT_CPUS) || ((ed = p->exec_domain[vcpu]) == NULL) )
+ return -EINVAL;
+
+ if (test_bit(DF_CONSTRUCTED, &p->d_flags) &&
+ !test_bit(EDF_CTRLPAUSE, &ed->ed_flags))
+ return -EINVAL;
+
+ if ( (c = xmalloc(full_execution_context_t)) == NULL )
+ return -ENOMEM;
+
+ if ( copy_from_user(c, setdomaininfo->ctxt, sizeof(*c)) )
+ {
+ rc = -EFAULT;
+ goto out;
+ }
+
+ if ( (rc = arch_set_info_guest(ed, c)) != 0 )
+ goto out;
+
+ set_bit(DF_CONSTRUCTED, &p->d_flags);
+
+ out:
+ if ( c != NULL )
+ xfree(c);
+ return rc;
+}
+
+/*
+ * final_setup_guest is used for final setup and launching of domains other
* than domain 0. ie. the domains that are being built by the userspace dom0
* domain builder.
*/
-int final_setup_guestos(struct domain *p, dom0_builddomain_t *builddomain)
+long do_boot_vcpu(unsigned long vcpu, full_execution_context_t *ctxt)
{
+ struct domain *d = current->domain;
+ struct exec_domain *ed;
int rc = 0;
full_execution_context_t *c;

- if ( (c = xmalloc(sizeof(*c))) == NULL )
+ if ( (vcpu >= MAX_VIRT_CPUS) || (d->exec_domain[vcpu] != NULL) )
+ return -EINVAL;
+
+ if ( alloc_exec_domain_struct(d, vcpu) == NULL )
return -ENOMEM;

- if ( test_bit(DF_CONSTRUCTED, &p->flags) )
+ if ( (c = xmalloc(full_execution_context_t)) == NULL )
{
- rc = -EINVAL;
+ rc = -ENOMEM;
goto out;
}

- if ( copy_from_user(c, builddomain->ctxt, sizeof(*c)) )
+ if ( copy_from_user(c, ctxt, sizeof(*c)) )
{
rc = -EFAULT;
goto out;
}
-
- if ( (rc = arch_final_setup_guestos(p,c)) != 0 )
+
+ ed = d->exec_domain[vcpu];
+
+ atomic_set(&ed->pausecnt, 0);
+
+ memcpy(&ed->arch, &idle0_exec_domain.arch, sizeof(ed->arch));
+
+ arch_do_boot_vcpu(ed);
+
+ sched_add_domain(ed);
+
+ if ( (rc = arch_set_info_guest(ed, c)) != 0 ) {
+ sched_rem_domain(ed);


-------------------------------------------------------
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click
_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xen-changelog
Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk [ In reply to ]
ChangeSet 1.1360.1.18, 2005/03/25 23:02:49+00:00, kaf24@firebug.cl.cam.ac.uk

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk



time.c | 49 ++++++++++++++++++++++++++++++-------------------
1 files changed, 30 insertions(+), 19 deletions(-)


diff -Nru a/xen/arch/x86/time.c b/xen/arch/x86/time.c
--- a/xen/arch/x86/time.c 2005-03-25 19:06:03 -05:00
+++ b/xen/arch/x86/time.c 2005-03-25 19:06:03 -05:00
@@ -1,5 +1,4 @@
-/* -*- Mode:C; c-basic-offset:4; tab-width:4 -*-
- ****************************************************************************
+/****************************************************************************
* (C) 2002-2003 - Rolf Neugebauer - Intel Research Cambridge
* (C) 2002-2003 University of Cambridge
****************************************************************************
@@ -52,7 +51,7 @@
static unsigned long wc_sec, wc_usec; /* UTC time at last 'time update'. */
static rwlock_t time_lock = RW_LOCK_UNLOCKED;

-static void timer_interrupt(int irq, void *dev_id, struct xen_regs *regs)
+void timer_interrupt(int irq, void *dev_id, struct xen_regs *regs)
{
write_lock_irq(&time_lock);

@@ -275,19 +274,13 @@
return now;
}

-
-int update_dom_time(struct domain *d)
+static inline void __update_dom_time(struct exec_domain *ed)
{
+ struct domain *d = ed->domain;
shared_info_t *si = d->shared_info;
- unsigned long flags;

- if ( d->last_propagated_timestamp == full_tsc_irq )
- return 0;
-
- read_lock_irqsave(&time_lock, flags);
+ spin_lock(&d->time_lock);

- d->last_propagated_timestamp = full_tsc_irq;
-
si->time_version1++;
wmb();

@@ -300,11 +293,20 @@
wmb();
si->time_version2++;

- read_unlock_irqrestore(&time_lock, flags);
-
- return 1;
+ spin_unlock(&d->time_lock);
}

+void update_dom_time(struct exec_domain *ed)
+{
+ unsigned long flags;
+
+ if ( ed->domain->shared_info->tsc_timestamp != full_tsc_irq )
+ {
+ read_lock_irqsave(&time_lock, flags);
+ __update_dom_time(ed);
+ read_unlock_irqrestore(&time_lock, flags);
+ }
+}

/* Set clock to <secs,usecs> after 00:00:00 UTC, 1 January, 1970. */
void do_settime(unsigned long secs, unsigned long usecs, u64 system_time_base)
@@ -326,12 +328,11 @@
wc_sec = secs;
wc_usec = _usecs;

- write_unlock_irq(&time_lock);
-
/* Others will pick up the change at the next tick. */
- current->last_propagated_timestamp = 0; /* force propagation */
- (void)update_dom_time(current);
+ __update_dom_time(current);
send_guest_virq(current, VIRQ_TIMER);
+
+ write_unlock_irq(&time_lock);
}


@@ -386,3 +387,13 @@

setup_irq(0, &irq0);
}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xen-changelog
Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk [ In reply to ]
ChangeSet 1.1380, 2005/03/28 18:52:25+01:00, kaf24@firebug.cl.cam.ac.uk

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk



mtrr/generic.c | 3 +-
mtrr/main.c | 3 --
smpboot.c | 71 +++++++++++++++++++++++++++++++++++++--------------------
3 files changed, 50 insertions(+), 27 deletions(-)


diff -Nru a/xen/arch/x86/mtrr/generic.c b/xen/arch/x86/mtrr/generic.c
--- a/xen/arch/x86/mtrr/generic.c 2005-03-28 13:04:02 -05:00
+++ b/xen/arch/x86/mtrr/generic.c 2005-03-28 13:04:02 -05:00
@@ -51,7 +51,8 @@
unsigned lo, dummy;

if (!mtrr_state.var_ranges) {
- mtrr_state.var_ranges = xmalloc(num_var_ranges * sizeof (struct mtrr_var_range));
+ mtrr_state.var_ranges = xmalloc_array(struct mtrr_var_range,
+ num_var_ranges);
if (!mtrr_state.var_ranges)
return;
}
diff -Nru a/xen/arch/x86/mtrr/main.c b/xen/arch/x86/mtrr/main.c
--- a/xen/arch/x86/mtrr/main.c 2005-03-28 13:04:02 -05:00
+++ b/xen/arch/x86/mtrr/main.c 2005-03-28 13:04:02 -05:00
@@ -136,8 +136,7 @@
int i, max;

max = num_var_ranges;
- if ((usage_table = xmalloc(max * sizeof *usage_table))
- == NULL) {
+ if ((usage_table = xmalloc_array(unsigned int, max)) == NULL) {
printk(KERN_ERR "mtrr: could not allocate\n");
return;
}
diff -Nru a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c 2005-03-28 13:04:02 -05:00
+++ b/xen/arch/x86/smpboot.c 2005-03-28 13:04:02 -05:00
@@ -374,44 +374,49 @@

static int cpucount;

+#ifdef __i386__
+static void construct_percpu_idt(unsigned int cpu)
+{
+ unsigned char idt_load[10];
+
+ idt_tables[cpu] = xmalloc_array(idt_entry_t, IDT_ENTRIES);
+ memcpy(idt_tables[cpu], idt_table, IDT_ENTRIES*sizeof(idt_entry_t));
+
+ *(unsigned short *)(&idt_load[0]) = (IDT_ENTRIES*sizeof(idt_entry_t))-1;
+ *(unsigned long *)(&idt_load[2]) = (unsigned long)idt_tables[cpu];
+ __asm__ __volatile__ ( "lidt %0" : "=m" (idt_load) );
+}
+#endif
+
/*
* Activate a secondary processor.
*/
void __init start_secondary(void)
{
unsigned int cpu = cpucount;
- /* 6 bytes suitable for passing to LIDT instruction. */
- unsigned char idt_load[6];

+ extern void percpu_traps_init(void);
extern void cpu_init(void);

set_current(idle_task[cpu]);

- /*
- * Dont put anything before smp_callin(), SMP
- * booting is too fragile that we want to limit the
- * things done here to the most necessary things.
- */
+ percpu_traps_init();
+
cpu_init();
+
smp_callin();

while (!atomic_read(&smp_commenced))
rep_nop();

+#ifdef __i386__
/*
* At this point, boot CPU has fully initialised the IDT. It is
* now safe to make ourselves a private copy.
*/
- idt_tables[cpu] = xmalloc(IDT_ENTRIES*8);
- memcpy(idt_tables[cpu], idt_table, IDT_ENTRIES*8);
- *(unsigned short *)(&idt_load[0]) = (IDT_ENTRIES*8)-1;
- *(unsigned long *)(&idt_load[2]) = (unsigned long)idt_tables[cpu];
- __asm__ __volatile__ ( "lidt %0" : "=m" (idt_load) );
+ construct_percpu_idt(cpu);
+#endif

- /*
- * low-memory mappings have been cleared, flush them from the local TLBs
- * too.
- */
local_flush_tlb();

startup_cpu_idle_loop();
@@ -640,22 +645,26 @@
*/
{
struct domain *idle;
+ struct exec_domain *ed;
unsigned long boot_error = 0;
int timeout, cpu;
- unsigned long start_eip, stack;
+ unsigned long start_eip;
+ void *stack;

cpu = ++cpucount;

if ( (idle = do_createdomain(IDLE_DOMAIN_ID, cpu)) == NULL )
panic("failed 'createdomain' for CPU %d", cpu);

- set_bit(DF_IDLETASK, &idle->flags);
+ ed = idle->exec_domain[0];

- idle->mm.pagetable = mk_pagetable(__pa(idle_pg_table));
+ set_bit(DF_IDLETASK, &idle->d_flags);
+
+ ed->arch.monitor_table = mk_pagetable(__pa(idle_pg_table));

map_cpu_to_boot_apicid(cpu, apicid);

- idle_task[cpu] = idle;
+ idle_task[cpu] = ed;

/* start_eip had better be page-aligned! */
start_eip = setup_trampoline();
@@ -663,11 +672,15 @@
/* So we see what's up. */
printk("Booting processor %d/%d eip %lx\n", cpu, apicid, start_eip);

- stack = __pa(alloc_xenheap_pages(1));
- stack_start.esp = stack + STACK_SIZE - STACK_RESERVED;
+ stack = (void *)alloc_xenheap_pages(STACK_ORDER);
+#if defined(__i386__)
+ stack_start.esp = __pa(stack) + STACK_SIZE - STACK_RESERVED;
+#elif defined(__x86_64__)
+ stack_start.esp = (unsigned long)stack + STACK_SIZE - STACK_RESERVED;
+#endif

/* Debug build: detect stack overflow by setting up a guard page. */
- memguard_guard_range(__va(stack), PAGE_SIZE);
+ memguard_guard_stack(stack);

/*
* This grunge runs the startup process for
@@ -729,7 +742,7 @@
printk("CPU%d has booted.\n", cpu);
} else {
boot_error= 1;
- if (*((volatile unsigned long *)phys_to_virt(start_eip))
+ if (*((volatile unsigned int *)phys_to_virt(start_eip))
== 0xA5A5A5A5)
/* trampoline started but...? */
printk("Stuck ??\n");
@@ -920,3 +933,13 @@
}

#endif /* CONFIG_SMP */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xen-changelog
Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk [ In reply to ]
ChangeSet 1.1381, 2005/03/28 22:16:12+01:00, kaf24@firebug.cl.cam.ac.uk

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk



b/xen/arch/x86/mm.c | 3190 ++++++++++++++++++++++++++++++++++++++
b/xen/arch/x86/setup.c | 153 -
b/xen/arch/x86/smp.c | 6
b/xen/arch/x86/smpboot.c | 71
b/xen/common/schedule.c | 243 +-
b/xen/include/asm-x86/processor.h | 247 --
xen/arch/x86/memory.c | 2369 ----------------------------
7 files changed, 3541 insertions(+), 2738 deletions(-)


diff -Nru a/xen/arch/x86/memory.c b/xen/arch/x86/memory.c
--- a/xen/arch/x86/memory.c 2005-03-29 03:03:23 -05:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,2369 +0,0 @@
-/******************************************************************************
- * arch/x86/memory.c
- *
- * Copyright (c) 2002-2004 K A Fraser
- * Copyright (c) 2004 Christian Limpach
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/*
- * A description of the x86 page table API:
- *
- * Domains trap to do_mmu_update with a list of update requests.
- * This is a list of (ptr, val) pairs, where the requested operation
- * is *ptr = val.
- *
- * Reference counting of pages:
- * ----------------------------
- * Each page has two refcounts: tot_count and type_count.
- *
- * TOT_COUNT is the obvious reference count. It counts all uses of a
- * physical page frame by a domain, including uses as a page directory,
- * a page table, or simple mappings via a PTE. This count prevents a
- * domain from releasing a frame back to the free pool when it still holds
- * a reference to it.
- *
- * TYPE_COUNT is more subtle. A frame can be put to one of three
- * mutually-exclusive uses: it might be used as a page directory, or a
- * page table, or it may be mapped writable by the domain [.of course, a
- * frame may not be used in any of these three ways!].
- * So, type_count is a count of the number of times a frame is being
- * referred to in its current incarnation. Therefore, a page can only
- * change its type when its type count is zero.
- *
- * Pinning the page type:
- * ----------------------
- * The type of a page can be pinned/unpinned with the commands
- * MMUEXT_[UN]PIN_L?_TABLE. Each page can be pinned exactly once (that is,
- * pinning is not reference counted, so it can't be nested).
- * This is useful to prevent a page's type count falling to zero, at which
- * point safety checks would need to be carried out next time the count
- * is increased again.
- *
- * A further note on writable page mappings:
- * -----------------------------------------
- * For simplicity, the count of writable mappings for a page may not
- * correspond to reality. The 'writable count' is incremented for every
- * PTE which maps the page with the _PAGE_RW flag set. However, for
- * write access to be possible the page directory entry must also have
- * its _PAGE_RW bit set. We do not check this as it complicates the
- * reference counting considerably [.consider the case of multiple
- * directory entries referencing a single page table, some with the RW
- * bit set, others not -- it starts getting a bit messy].
- * In normal use, this simplification shouldn't be a problem.
- * However, the logic can be added if required.
- *
- * One more note on read-only page mappings:
- * -----------------------------------------
- * We want domains to be able to map pages for read-only access. The
- * main reason is that page tables and directories should be readable
- * by a domain, but it would not be safe for them to be writable.
- * However, domains have free access to rings 1 & 2 of the Intel
- * privilege model. In terms of page protection, these are considered
- * to be part of 'supervisor mode'. The WP bit in CR0 controls whether
- * read-only restrictions are respected in supervisor mode -- if the
- * bit is clear then any mapped page is writable.
- *
- * We get round this by always setting the WP bit and disallowing
- * updates to it. This is very unlikely to cause a problem for guest
- * OS's, which will generally use the WP bit to simplify copy-on-write
- * implementation (in that case, OS wants a fault when it writes to
- * an application-supplied buffer).
- */
-
-#include <xen/config.h>
-#include <xen/init.h>
-#include <xen/kernel.h>
-#include <xen/lib.h>
-#include <xen/mm.h>
-#include <xen/sched.h>
-#include <xen/errno.h>
-#include <xen/perfc.h>
-#include <xen/irq.h>
-#include <xen/softirq.h>
-#include <asm/shadow.h>
-#include <asm/page.h>
-#include <asm/flushtlb.h>
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <asm/domain_page.h>
-#include <asm/ldt.h>
-
-#ifdef VERBOSE
-#define MEM_LOG(_f, _a...) \
- printk("DOM%u: (file=memory.c, line=%d) " _f "\n", \
- current->id , __LINE__ , ## _a )
-#else
-#define MEM_LOG(_f, _a...) ((void)0)
-#endif
-
-static int alloc_l2_table(struct pfn_info *page);
-static int alloc_l1_table(struct pfn_info *page);
-static int get_page_from_pagenr(unsigned long page_nr, struct domain *d);
-static int get_page_and_type_from_pagenr(unsigned long page_nr,
- u32 type,
- struct domain *d);
-
-static void free_l2_table(struct pfn_info *page);
-static void free_l1_table(struct pfn_info *page);
-
-static int mod_l2_entry(l2_pgentry_t *, l2_pgentry_t, unsigned long);
-static int mod_l1_entry(l1_pgentry_t *, l1_pgentry_t);
-
-/* Used to defer flushing of memory structures. */
-static struct {
-#define DOP_FLUSH_TLB (1<<0) /* Flush the TLB. */
-#define DOP_RELOAD_LDT (1<<1) /* Reload the LDT shadow mapping. */
- unsigned long deferred_ops;
- /* If non-NULL, specifies a foreign subject domain for some operations. */
- struct domain *foreign;
-} __cacheline_aligned percpu_info[NR_CPUS];
-
-/*
- * Returns the current foreign domain; defaults to the currently-executing
- * domain if a foreign override hasn't been specified.
- */
-#define FOREIGNDOM (percpu_info[smp_processor_id()].foreign ? : current)
-
-/* Private domain structs for DOMID_XEN and DOMID_IO. */
-static struct domain *dom_xen, *dom_io;
-
-/* Frame table and its size in pages. */
-struct pfn_info *frame_table;
-unsigned long frame_table_size;
-unsigned long max_page;
-
-void __init init_frametable(void)
-{
- unsigned long i, p;
-
- frame_table = (struct pfn_info *)FRAMETABLE_VIRT_START;
- frame_table_size = max_page * sizeof(struct pfn_info);
- frame_table_size = (frame_table_size + PAGE_SIZE - 1) & PAGE_MASK;
-
- for ( i = 0; i < frame_table_size; i += (4UL << 20) )
- {
- p = alloc_boot_pages(min(frame_table_size - i, 4UL << 20), 4UL << 20);
- if ( p == 0 )
- panic("Not enough memory for frame table\n");
- idle_pg_table[(FRAMETABLE_VIRT_START + i) >> L2_PAGETABLE_SHIFT] =
- mk_l2_pgentry(p | __PAGE_HYPERVISOR | _PAGE_PSE);
- }
-
- memset(frame_table, 0, frame_table_size);
-}
-
-void arch_init_memory(void)
-{
- unsigned long i;
-
- /*
- * We are rather picky about the layout of 'struct pfn_info'. The
- * count_info and domain fields must be adjacent, as we perform atomic
- * 64-bit operations on them. Also, just for sanity, we assert the size
- * of the structure here.
- */
- if ( (offsetof(struct pfn_info, u.inuse.domain) !=
- (offsetof(struct pfn_info, count_info) + sizeof(u32))) ||
- (sizeof(struct pfn_info) != 24) )
- {
- printk("Weird pfn_info layout (%ld,%ld,%d)\n",
- offsetof(struct pfn_info, count_info),
- offsetof(struct pfn_info, u.inuse.domain),
- sizeof(struct pfn_info));
- for ( ; ; ) ;
- }
-
- memset(percpu_info, 0, sizeof(percpu_info));
-
- /* Initialise to a magic of 0x55555555 so easier to spot bugs later. */
- memset(machine_to_phys_mapping, 0x55, 4<<20);
-
- /*
- * Initialise our DOMID_XEN domain.
- * Any Xen-heap pages that we will allow to be mapped will have
- * their domain field set to dom_xen.
- */
- dom_xen = alloc_domain_struct();
- atomic_set(&dom_xen->refcnt, 1);
- dom_xen->id = DOMID_XEN;
-
- /*
- * Initialise our DOMID_IO domain.
- * This domain owns no pages but is considered a special case when
- * mapping I/O pages, as the mappings occur at the priv of the caller.
- */
- dom_io = alloc_domain_struct();
- atomic_set(&dom_io->refcnt, 1);
- dom_io->id = DOMID_IO;
-
- /* M2P table is mappable read-only by privileged domains. */
- for ( i = 0; i < 1024; i++ )
- {
- frame_table[m2p_start_mfn+i].count_info = PGC_allocated | 1;
- /* gdt to make sure it's only mapped read-only by non-privileged
- domains. */
- frame_table[m2p_start_mfn+i].u.inuse.type_info = PGT_gdt_page | 1;
- frame_table[m2p_start_mfn+i].u.inuse.domain = dom_xen;
- }
-}
-
-static void __invalidate_shadow_ldt(struct domain *d)
-{
- int i;
- unsigned long pfn;
- struct pfn_info *page;
-
- d->mm.shadow_ldt_mapcnt = 0;
-
- for ( i = 16; i < 32; i++ )
- {
- pfn = l1_pgentry_to_pagenr(d->mm.perdomain_pt[i]);
- if ( pfn == 0 ) continue;
- d->mm.perdomain_pt[i] = mk_l1_pgentry(0);
- page = &frame_table[pfn];
- ASSERT_PAGE_IS_TYPE(page, PGT_ldt_page);
- ASSERT_PAGE_IS_DOMAIN(page, d);
- put_page_and_type(page);
- }
-
- /* Dispose of the (now possibly invalid) mappings from the TLB. */
- percpu_info[d->processor].deferred_ops |= DOP_FLUSH_TLB | DOP_RELOAD_LDT;
-}
-

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog
Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk [ In reply to ]
ChangeSet 1.1384, 2005/03/29 09:06:06+01:00, kaf24@firebug.cl.cam.ac.uk

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk



0 files changed



_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog
Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk [ In reply to ]
ChangeSet 1.1395, 2005/03/30 11:00:28+01:00, kaf24@firebug.cl.cam.ac.uk

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk



block.h | 1 +
1 files changed, 1 insertion(+)


diff -Nru a/linux-2.6.11-xen-sparse/drivers/xen/blkfront/block.h b/linux-2.6.11-xen-sparse/drivers/xen/blkfront/block.h
--- a/linux-2.6.11-xen-sparse/drivers/xen/blkfront/block.h 2005-03-30 06:03:52 -05:00
+++ b/linux-2.6.11-xen-sparse/drivers/xen/blkfront/block.h 2005-03-30 06:03:52 -05:00
@@ -46,6 +46,7 @@
#include <linux/devfs_fs_kernel.h>
#include <asm-xen/xen-public/xen.h>
#include <asm-xen/xen-public/io/blkif.h>
+#include <asm-xen/xen-public/io/ring.h>
#include <asm/io.h>
#include <asm/atomic.h>
#include <asm/uaccess.h>

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog
Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk [ In reply to ]
ChangeSet 1.1402, 2005/03/31 08:54:16+01:00, kaf24@firebug.cl.cam.ac.uk

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk



0 files changed



_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog
Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk [ In reply to ]
ChangeSet 1.1403, 2005/03/31 09:04:15+01:00, kaf24@firebug.cl.cam.ac.uk

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk



0 files changed



_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog
Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk [ In reply to ]
ChangeSet 1.1408, 2005/03/31 10:56:18+01:00, kaf24@firebug.cl.cam.ac.uk

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk



page_alloc.c | 102 +++++++++++++++++++++++++++--------------------------------
1 files changed, 47 insertions(+), 55 deletions(-)


diff -Nru a/xen/common/page_alloc.c b/xen/common/page_alloc.c
--- a/xen/common/page_alloc.c 2005-03-31 05:02:51 -05:00
+++ b/xen/common/page_alloc.c 2005-03-31 05:02:51 -05:00
@@ -24,12 +24,14 @@
#include <xen/init.h>
#include <xen/types.h>
#include <xen/lib.h>
-#include <asm/page.h>
+#include <xen/perfc.h>
+#include <xen/sched.h>
#include <xen/spinlock.h>
#include <xen/slab.h>
#include <xen/irq.h>
#include <xen/softirq.h>
#include <asm/domain_page.h>
+#include <asm/page.h>

/*
* Comma-separated list of hexadecimal page numbers containing bad bytes.
@@ -53,8 +55,9 @@
static unsigned long *alloc_bitmap;
#define PAGES_PER_MAPWORD (sizeof(unsigned long) * 8)

-#define allocated_in_map(_pn) \
-(alloc_bitmap[(_pn)/PAGES_PER_MAPWORD] & (1<<((_pn)&(PAGES_PER_MAPWORD-1))))
+#define allocated_in_map(_pn) \
+( !! (alloc_bitmap[(_pn)/PAGES_PER_MAPWORD] & \
+ (1UL<<((_pn)&(PAGES_PER_MAPWORD-1)))) )

/*
* Hint regarding bitwise arithmetic in map_{alloc,free}:
@@ -83,13 +86,13 @@

if ( curr_idx == end_idx )
{
- alloc_bitmap[curr_idx] |= ((1<<end_off)-1) & -(1<<start_off);
+ alloc_bitmap[curr_idx] |= ((1UL<<end_off)-1) & -(1UL<<start_off);
}
else
{
- alloc_bitmap[curr_idx] |= -(1<<start_off);
- while ( ++curr_idx < end_idx ) alloc_bitmap[curr_idx] = ~0L;
- alloc_bitmap[curr_idx] |= (1<<end_off)-1;
+ alloc_bitmap[curr_idx] |= -(1UL<<start_off);
+ while ( ++curr_idx < end_idx ) alloc_bitmap[curr_idx] = ~0UL;
+ alloc_bitmap[curr_idx] |= (1UL<<end_off)-1;
}
}

@@ -112,13 +115,13 @@

if ( curr_idx == end_idx )
{
- alloc_bitmap[curr_idx] &= -(1<<end_off) | ((1<<start_off)-1);
+ alloc_bitmap[curr_idx] &= -(1UL<<end_off) | ((1UL<<start_off)-1);
}
else
{
- alloc_bitmap[curr_idx] &= (1<<start_off)-1;
+ alloc_bitmap[curr_idx] &= (1UL<<start_off)-1;
while ( ++curr_idx != end_idx ) alloc_bitmap[curr_idx] = 0;
- alloc_bitmap[curr_idx] &= -(1<<end_off);
+ alloc_bitmap[curr_idx] &= -(1UL<<end_off);
}
}

@@ -167,7 +170,7 @@

if ( (bad_pfn < (bitmap_size*8)) && !allocated_in_map(bad_pfn) )
{
- printk("Marking page %08lx as bad\n", bad_pfn);
+ printk("Marking page %p as bad\n", bad_pfn);
map_alloc(bad_pfn, 1);
}
}
@@ -206,8 +209,8 @@
#define MEMZONE_DOM 1
#define NR_ZONES 2

-/* Up to 2^10 pages can be allocated at once. */
-#define MAX_ORDER 10
+/* Up to 2^20 pages can be allocated at once. */
+#define MAX_ORDER 20
static struct list_head heap[NR_ZONES][MAX_ORDER+1];

static unsigned long avail[NR_ZONES];
@@ -265,8 +268,8 @@

/* Find smallest order which can satisfy the request. */
for ( i = order; i <= MAX_ORDER; i++ )
- if ( !list_empty(&heap[zone][i]) )
- goto found;
+ if ( !list_empty(&heap[zone][i]) )
+ goto found;

/* No suitable memory blocks. Fail the request. */
spin_unlock(&heap_lock);
@@ -413,9 +416,8 @@
{
unsigned long flags;
struct pfn_info *pg;
- int i, attempts = 0;
+ int i;

- retry:
local_irq_save(flags);
pg = alloc_heap_pages(MEMZONE_XEN, order);
local_irq_restore(flags);
@@ -428,21 +430,14 @@
for ( i = 0; i < (1 << order); i++ )
{
pg[i].count_info = 0;
- pg[i].u.inuse.domain = NULL;
+ pg[i].u.inuse._domain = 0;
pg[i].u.inuse.type_info = 0;
}

return (unsigned long)page_to_virt(pg);

no_memory:
- if ( attempts++ < 8 )
- {
- xmem_cache_reap();
- goto retry;
- }
-
printk("Cannot handle page request order %d!\n", order);
- dump_slabinfo();
return 0;
}

@@ -478,55 +473,42 @@
struct pfn_info *alloc_domheap_pages(struct domain *d, unsigned int order)
{
struct pfn_info *pg;
- unsigned long mask, flushed_mask, pfn_stamp, cpu_stamp;
- int i, j;
+ unsigned long mask = 0;
+ int i;

ASSERT(!in_irq());

if ( unlikely((pg = alloc_heap_pages(MEMZONE_DOM, order)) == NULL) )
return NULL;

- flushed_mask = 0;
for ( i = 0; i < (1 << order); i++ )
{
- if ( (mask = (pg[i].u.free.cpu_mask & ~flushed_mask)) != 0 )
- {
- pfn_stamp = pg[i].tlbflush_timestamp;
- for ( j = 0; (mask != 0) && (j < smp_num_cpus); j++ )
- {
- if ( mask & (1<<j) )
- {
- cpu_stamp = tlbflush_time[j];
- if ( !NEED_FLUSH(cpu_stamp, pfn_stamp) )
- mask &= ~(1<<j);
- }
- }
-
- if ( unlikely(mask != 0) )
- {
- flush_tlb_mask(mask);
- perfc_incrc(need_flush_tlb_flush);
- flushed_mask |= mask;
- }
- }
+ mask |= tlbflush_filter_cpuset(
+ pg[i].u.free.cpu_mask & ~mask, pg[i].tlbflush_timestamp);

pg[i].count_info = 0;
- pg[i].u.inuse.domain = NULL;
+ pg[i].u.inuse._domain = 0;
pg[i].u.inuse.type_info = 0;
}

+ if ( unlikely(mask != 0) )
+ {
+ perfc_incrc(need_flush_tlb_flush);
+ flush_tlb_mask(mask);
+ }
+
if ( d == NULL )
return pg;

spin_lock(&d->page_alloc_lock);

- if ( unlikely(test_bit(DF_DYING, &d->flags)) ||
+ if ( unlikely(test_bit(DF_DYING, &d->d_flags)) ||
unlikely((d->tot_pages + (1 << order)) > d->max_pages) )
{
DPRINTK("Over-allocation for domain %u: %u > %u\n",
d->id, d->tot_pages + (1 << order), d->max_pages);
DPRINTK("...or the domain is dying (%d)\n",
- !!test_bit(DF_DYING, &d->flags));
+ !!test_bit(DF_DYING, &d->d_flags));
spin_unlock(&d->page_alloc_lock);
free_heap_pages(MEMZONE_DOM, pg, order);
return NULL;
@@ -539,7 +521,7 @@

for ( i = 0; i < (1 << order); i++ )
{
- pg[i].u.inuse.domain = d;
+ page_set_owner(&pg[i], d);
wmb(); /* Domain pointer must be visible before updating refcnt. */
pg[i].count_info |= PGC_allocated | 1;
list_add_tail(&pg[i].list, &d->page_list);
@@ -554,7 +536,7 @@
void free_domheap_pages(struct pfn_info *pg, unsigned int order)
{
int i, drop_dom_ref;
- struct domain *d = pg->u.inuse.domain;
+ struct domain *d = page_get_owner(pg);

ASSERT(!in_irq());

@@ -580,7 +562,7 @@
{
ASSERT((pg[i].u.inuse.type_info & PGT_count_mask) == 0);
pg[i].tlbflush_timestamp = tlbflush_current_time();
- pg[i].u.free.cpu_mask = 1 << d->processor;
+ pg[i].u.free.cpu_mask = d->cpuset;
list_del(&pg[i].list);
}

@@ -589,7 +571,7 @@

spin_unlock_recursive(&d->page_alloc_lock);

- if ( likely(!test_bit(DF_DYING, &d->flags)) )
+ if ( likely(!test_bit(DF_DYING, &d->d_flags)) )
{
free_heap_pages(MEMZONE_DOM, pg, order);
}
@@ -681,3 +663,13 @@
return 0;
}
__initcall(page_scrub_init);
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog
Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk [ In reply to ]
ChangeSet 1.1429, 2005/04/01 18:44:42+01:00, kaf24@firebug.cl.cam.ac.uk

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk



page_alloc.c | 102 +++++++++++++++++++++++++++--------------------------------
1 files changed, 47 insertions(+), 55 deletions(-)


diff -Nru a/xen/common/page_alloc.c b/xen/common/page_alloc.c
--- a/xen/common/page_alloc.c 2005-04-01 13:03:43 -05:00
+++ b/xen/common/page_alloc.c 2005-04-01 13:03:43 -05:00
@@ -24,12 +24,14 @@
#include <xen/init.h>
#include <xen/types.h>
#include <xen/lib.h>
-#include <asm/page.h>
+#include <xen/perfc.h>
+#include <xen/sched.h>
#include <xen/spinlock.h>
#include <xen/slab.h>
#include <xen/irq.h>
#include <xen/softirq.h>
#include <asm/domain_page.h>
+#include <asm/page.h>

/*
* Comma-separated list of hexadecimal page numbers containing bad bytes.
@@ -53,8 +55,9 @@
static unsigned long *alloc_bitmap;
#define PAGES_PER_MAPWORD (sizeof(unsigned long) * 8)

-#define allocated_in_map(_pn) \
-(alloc_bitmap[(_pn)/PAGES_PER_MAPWORD] & (1<<((_pn)&(PAGES_PER_MAPWORD-1))))
+#define allocated_in_map(_pn) \
+( !! (alloc_bitmap[(_pn)/PAGES_PER_MAPWORD] & \
+ (1UL<<((_pn)&(PAGES_PER_MAPWORD-1)))) )

/*
* Hint regarding bitwise arithmetic in map_{alloc,free}:
@@ -83,13 +86,13 @@

if ( curr_idx == end_idx )
{
- alloc_bitmap[curr_idx] |= ((1<<end_off)-1) & -(1<<start_off);
+ alloc_bitmap[curr_idx] |= ((1UL<<end_off)-1) & -(1UL<<start_off);
}
else
{
- alloc_bitmap[curr_idx] |= -(1<<start_off);
- while ( ++curr_idx < end_idx ) alloc_bitmap[curr_idx] = ~0L;
- alloc_bitmap[curr_idx] |= (1<<end_off)-1;
+ alloc_bitmap[curr_idx] |= -(1UL<<start_off);
+ while ( ++curr_idx < end_idx ) alloc_bitmap[curr_idx] = ~0UL;
+ alloc_bitmap[curr_idx] |= (1UL<<end_off)-1;
}
}

@@ -112,13 +115,13 @@

if ( curr_idx == end_idx )
{
- alloc_bitmap[curr_idx] &= -(1<<end_off) | ((1<<start_off)-1);
+ alloc_bitmap[curr_idx] &= -(1UL<<end_off) | ((1UL<<start_off)-1);
}
else
{
- alloc_bitmap[curr_idx] &= (1<<start_off)-1;
+ alloc_bitmap[curr_idx] &= (1UL<<start_off)-1;
while ( ++curr_idx != end_idx ) alloc_bitmap[curr_idx] = 0;
- alloc_bitmap[curr_idx] &= -(1<<end_off);
+ alloc_bitmap[curr_idx] &= -(1UL<<end_off);
}
}

@@ -167,7 +170,7 @@

if ( (bad_pfn < (bitmap_size*8)) && !allocated_in_map(bad_pfn) )
{
- printk("Marking page %08lx as bad\n", bad_pfn);
+ printk("Marking page %p as bad\n", bad_pfn);
map_alloc(bad_pfn, 1);
}
}
@@ -206,8 +209,8 @@
#define MEMZONE_DOM 1
#define NR_ZONES 2

-/* Up to 2^10 pages can be allocated at once. */
-#define MAX_ORDER 10
+/* Up to 2^20 pages can be allocated at once. */
+#define MAX_ORDER 20
static struct list_head heap[NR_ZONES][MAX_ORDER+1];

static unsigned long avail[NR_ZONES];
@@ -265,8 +268,8 @@

/* Find smallest order which can satisfy the request. */
for ( i = order; i <= MAX_ORDER; i++ )
- if ( !list_empty(&heap[zone][i]) )
- goto found;
+ if ( !list_empty(&heap[zone][i]) )
+ goto found;

/* No suitable memory blocks. Fail the request. */
spin_unlock(&heap_lock);
@@ -413,9 +416,8 @@
{
unsigned long flags;
struct pfn_info *pg;
- int i, attempts = 0;
+ int i;

- retry:
local_irq_save(flags);
pg = alloc_heap_pages(MEMZONE_XEN, order);
local_irq_restore(flags);
@@ -428,21 +430,14 @@
for ( i = 0; i < (1 << order); i++ )
{
pg[i].count_info = 0;
- pg[i].u.inuse.domain = NULL;
+ pg[i].u.inuse._domain = 0;
pg[i].u.inuse.type_info = 0;
}

return (unsigned long)page_to_virt(pg);

no_memory:
- if ( attempts++ < 8 )
- {
- xmem_cache_reap();
- goto retry;
- }
-
printk("Cannot handle page request order %d!\n", order);
- dump_slabinfo();
return 0;
}

@@ -478,55 +473,42 @@
struct pfn_info *alloc_domheap_pages(struct domain *d, unsigned int order)
{
struct pfn_info *pg;
- unsigned long mask, flushed_mask, pfn_stamp, cpu_stamp;
- int i, j;
+ unsigned long mask = 0;
+ int i;

ASSERT(!in_irq());

if ( unlikely((pg = alloc_heap_pages(MEMZONE_DOM, order)) == NULL) )
return NULL;

- flushed_mask = 0;
for ( i = 0; i < (1 << order); i++ )
{
- if ( (mask = (pg[i].u.free.cpu_mask & ~flushed_mask)) != 0 )
- {
- pfn_stamp = pg[i].tlbflush_timestamp;
- for ( j = 0; (mask != 0) && (j < smp_num_cpus); j++ )
- {
- if ( mask & (1<<j) )
- {
- cpu_stamp = tlbflush_time[j];
- if ( !NEED_FLUSH(cpu_stamp, pfn_stamp) )
- mask &= ~(1<<j);
- }
- }
-
- if ( unlikely(mask != 0) )
- {
- flush_tlb_mask(mask);
- perfc_incrc(need_flush_tlb_flush);
- flushed_mask |= mask;
- }
- }
+ mask |= tlbflush_filter_cpuset(
+ pg[i].u.free.cpu_mask & ~mask, pg[i].tlbflush_timestamp);

pg[i].count_info = 0;
- pg[i].u.inuse.domain = NULL;
+ pg[i].u.inuse._domain = 0;
pg[i].u.inuse.type_info = 0;
}

+ if ( unlikely(mask != 0) )
+ {
+ perfc_incrc(need_flush_tlb_flush);
+ flush_tlb_mask(mask);
+ }
+
if ( d == NULL )
return pg;

spin_lock(&d->page_alloc_lock);

- if ( unlikely(test_bit(DF_DYING, &d->flags)) ||
+ if ( unlikely(test_bit(DF_DYING, &d->d_flags)) ||
unlikely((d->tot_pages + (1 << order)) > d->max_pages) )
{
DPRINTK("Over-allocation for domain %u: %u > %u\n",
d->id, d->tot_pages + (1 << order), d->max_pages);
DPRINTK("...or the domain is dying (%d)\n",
- !!test_bit(DF_DYING, &d->flags));
+ !!test_bit(DF_DYING, &d->d_flags));
spin_unlock(&d->page_alloc_lock);
free_heap_pages(MEMZONE_DOM, pg, order);
return NULL;
@@ -539,7 +521,7 @@

for ( i = 0; i < (1 << order); i++ )
{
- pg[i].u.inuse.domain = d;
+ page_set_owner(&pg[i], d);
wmb(); /* Domain pointer must be visible before updating refcnt. */
pg[i].count_info |= PGC_allocated | 1;
list_add_tail(&pg[i].list, &d->page_list);
@@ -554,7 +536,7 @@
void free_domheap_pages(struct pfn_info *pg, unsigned int order)
{
int i, drop_dom_ref;
- struct domain *d = pg->u.inuse.domain;
+ struct domain *d = page_get_owner(pg);

ASSERT(!in_irq());

@@ -580,7 +562,7 @@
{
ASSERT((pg[i].u.inuse.type_info & PGT_count_mask) == 0);
pg[i].tlbflush_timestamp = tlbflush_current_time();
- pg[i].u.free.cpu_mask = 1 << d->processor;
+ pg[i].u.free.cpu_mask = d->cpuset;
list_del(&pg[i].list);
}

@@ -589,7 +571,7 @@

spin_unlock_recursive(&d->page_alloc_lock);

- if ( likely(!test_bit(DF_DYING, &d->flags)) )
+ if ( likely(!test_bit(DF_DYING, &d->d_flags)) )
{
free_heap_pages(MEMZONE_DOM, pg, order);
}
@@ -684,3 +666,13 @@
return 0;
}
__initcall(page_scrub_init);
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog
Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk [ In reply to ]
ChangeSet 1.1450, 2005/04/05 09:04:51+01:00, kaf24@firebug.cl.cam.ac.uk

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk



fixup.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)


diff -Nru a/linux-2.6.11-xen-sparse/arch/xen/kernel/fixup.c b/linux-2.6.11-xen-sparse/arch/xen/kernel/fixup.c
--- a/linux-2.6.11-xen-sparse/arch/xen/kernel/fixup.c 2005-04-05 05:03:24 -04:00
+++ b/linux-2.6.11-xen-sparse/arch/xen/kernel/fixup.c 2005-04-05 05:03:24 -04:00
@@ -50,8 +50,8 @@

if ( !test_and_set_bit(0, &printed) )
{
- HYPERVISOR_vm_assist(VMASST_CMD_disable,
- VMASST_TYPE_4gb_segments_notify);
+ HYPERVISOR_vm_assist(
+ VMASST_CMD_disable, VMASST_TYPE_4gb_segments_notify);

DP("");
DP("***************************************************************");
@@ -77,8 +77,8 @@

static int __init fixup_init(void)
{
- HYPERVISOR_vm_assist(VMASST_CMD_enable,
- VMASST_TYPE_4gb_segments_notify);
+ HYPERVISOR_vm_assist(
+ VMASST_CMD_enable, VMASST_TYPE_4gb_segments_notify);
return 0;
}
__initcall(fixup_init);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog
Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk [ In reply to ]
ChangeSet 1.1301, 2005/04/15 00:31:12+01:00, kaf24@firebug.cl.cam.ac.uk

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk



console.c | 94 ++++++++++++++++++++++++++++++++++++++++----------------------
1 files changed, 62 insertions(+), 32 deletions(-)


diff -Nru a/linux-2.6.11-xen-sparse/drivers/xen/console/console.c b/linux-2.6.11-xen-sparse/drivers/xen/console/console.c
--- a/linux-2.6.11-xen-sparse/drivers/xen/console/console.c 2005-04-14 20:02:55 -04:00
+++ b/linux-2.6.11-xen-sparse/drivers/xen/console/console.c 2005-04-14 20:02:55 -04:00
@@ -64,15 +64,34 @@
* warnings from standard distro startup scripts.
*/
static enum { XC_OFF, XC_DEFAULT, XC_TTY, XC_SERIAL } xc_mode = XC_DEFAULT;
+static int xc_num = -1;

static int __init xencons_setup(char *str)
{
- if ( !strcmp(str, "tty") )
- xc_mode = XC_TTY;
- else if ( !strcmp(str, "ttyS") )
+ char *q;
+ int n;
+
+ if ( !strncmp(str, "ttyS", 4) )
xc_mode = XC_SERIAL;
- else if ( !strcmp(str, "off") )
+ else if ( !strncmp(str, "tty", 3) )
+ xc_mode = XC_TTY;
+ else if ( !strncmp(str, "off", 3) )
xc_mode = XC_OFF;
+
+ switch ( xc_mode )
+ {
+ case XC_SERIAL:
+ n = simple_strtol( str+4, &q, 10 );
+ if ( q > (str + 4) ) xc_num = n;
+ break;
+ case XC_TTY:
+ n = simple_strtol( str+3, &q, 10 );
+ if ( q > (str + 3) ) xc_num = n;
+ break;
+ default:
+ break;
+ }
+
return 1;
}
__setup("xencons=", xencons_setup);
@@ -141,16 +160,12 @@
{
int rc;

- while ( count > 0 )
+ while ( (count > 0) &&
+ ((rc = HYPERVISOR_console_io(
+ CONSOLEIO_write, count, (char *)s)) > 0) )
{
- if ( (rc = HYPERVISOR_console_io(CONSOLEIO_write,
- count, (char *)s)) > 0 )
- {
- count -= rc;
- s += rc;
- }
- else
- break;
+ count -= rc;
+ s += rc;
}
}

@@ -187,8 +202,8 @@
xc_mode = XC_SERIAL;
kcons_info.write = kcons_write_dom0;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- if ( xc_mode == XC_SERIAL )
- kcons_info.flags |= CON_ENABLED;
+ if ( xc_mode == XC_SERIAL )
+ kcons_info.flags |= CON_ENABLED;
#endif
}
else
@@ -198,17 +213,26 @@
kcons_info.write = kcons_write;
}

- if ( xc_mode == XC_OFF )
- return __RETCODE;
-
- if ( xc_mode == XC_SERIAL )
+ switch ( xc_mode )
+ {
+ case XC_SERIAL:
strcpy(kcons_info.name, "ttyS");
- else
+ if ( xc_num == -1 ) xc_num = 0;
+ break;
+
+ case XC_TTY:
strcpy(kcons_info.name, "tty");
+ if ( xc_num == -1 ) xc_num = 1;
+ break;
+
+ default:
+ return __RETCODE;
+ }

wbuf = alloc_bootmem(wbuf_size);

register_console(&kcons_info);
+
return __RETCODE;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
@@ -247,7 +271,7 @@
* We use dangerous control-interface functions that require a quiescent
* system and no interrupts. Try to ensure this with a global cli().
*/
- local_irq_disable(); /* XXXsmp */
+ local_irq_disable(); /* XXXsmp */

/* Spin until console data is flushed through to the domain controller. */
while ( (wc != wp) && !ctrl_if_transmitter_empty() )
@@ -488,8 +512,10 @@
}

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-static int xencons_write(struct tty_struct *tty, const unsigned char *buf,
- int count)
+static int xencons_write(
+ struct tty_struct *tty,
+ const unsigned char *buf,
+ int count)
{
int i;
unsigned long flags;
@@ -511,8 +537,11 @@
return i;
}
#else
-static int xencons_write(struct tty_struct *tty, int from_user,
- const u_char *buf, int count)
+static int xencons_write(
+ struct tty_struct *tty,
+ int from_user,
+ const u_char *buf,
+ int count)
{
int i;
unsigned long flags;
@@ -655,7 +684,7 @@
return 0;
}

-#define DUMMY (void *)xennullcon_dummy
+#define DUMMY (void *)xennullcon_dummy

/*
* The console `switch' structure for the dummy console
@@ -718,14 +747,14 @@
if ( xc_mode == XC_SERIAL )
{
DRV(xencons_driver)->name = "ttyS";
- DRV(xencons_driver)->minor_start = 64;
- DRV(xencons_driver)->name_base = 0;
+ DRV(xencons_driver)->minor_start = 64 + xc_num;
+ DRV(xencons_driver)->name_base = 0 + xc_num;
}
else
{
DRV(xencons_driver)->name = "tty";
- DRV(xencons_driver)->minor_start = 1;
- DRV(xencons_driver)->name_base = 1;
+ DRV(xencons_driver)->minor_start = xc_num;
+ DRV(xencons_driver)->name_base = xc_num;
}

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
@@ -772,8 +801,9 @@
(void)ctrl_if_register_receiver(CMSG_CONSOLE, xencons_rx, 0);
}

- printk("Xen virtual console successfully installed as %s\n",
- DRV(xencons_driver)->name);
+ printk("Xen virtual console successfully installed as %s%d\n",
+ DRV(xencons_driver)->name,
+ DRV(xencons_driver)->name_base );

return 0;
}

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog
Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk [ In reply to ]
ChangeSet 1.1376, 2005/04/23 15:53:20+01:00, kaf24@firebug.cl.cam.ac.uk

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk



0 files changed



_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog
Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk [ In reply to ]
ChangeSet 1.1377, 2005/04/23 17:01:19+01:00, kaf24@firebug.cl.cam.ac.uk

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk



Makefile | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)


diff -Nru a/Makefile b/Makefile
--- a/Makefile 2005-04-23 13:03:47 -04:00
+++ b/Makefile 2005-04-23 13:03:47 -04:00
@@ -22,11 +22,12 @@
export DESTDIR

# Export target architecture overrides to Xen and Linux sub-trees.
-ifneq ($(TARGET_ARCH),)
-SUBARCH := $(subst x86_32,i386,$(TARGET_ARCH))
-export TARGET_ARCH SUBARCH
+ifneq ($(XEN_TARGET_ARCH),)
+SUBARCH := $(subst x86_32,i386,$(XEN_TARGET_ARCH))
+export XEN_TARGET_ARCH SUBARCH
endif

+include Config.mk
include buildconfigs/Rules.mk

.PHONY: all dist install xen tools kernels docs world clean mkpatches mrproper
@@ -161,7 +162,7 @@
uninstall:
[ ! -d $(D)/etc/xen ] || mv -f $(D)/etc/xen $(D)/etc/xen.old
rm -rf $(D)/etc/init.d/xend*
- rm -rf $(D)/usr/lib/libxc* $(D)/usr/lib/libxutil*
+ rm -rf $(D)/usr/$(LIBDIR)/libxc* $(D)/usr/$(LIBDIR)/libxutil*
rm -rf $(D)/usr/lib/python/xen $(D)/usr/include/xen
rm -rf $(D)/usr/include/xcs_proto.h $(D)/usr/include/xc.h
rm -rf $(D)/usr/sbin/xcs $(D)/usr/sbin/xcsdump $(D)/usr/sbin/xen*
@@ -170,6 +171,7 @@
rm -rf $(D)/usr/share/doc/xen $(D)/usr/man/man*/xentrace*
rm -rf $(D)/usr/bin/xen* $(D)/usr/bin/miniterm
rm -rf $(D)/boot/*xen*
+ rm -rf $(D)/lib/modules/*xen*

# Legacy targets for compatibility
linux24:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog
Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk [ In reply to ]
ChangeSet 1.1420, 2005/05/03 11:54:28+01:00, kaf24@firebug.cl.cam.ac.uk

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk



netfront.c | 18 ++++--------------
1 files changed, 4 insertions(+), 14 deletions(-)


diff -Nru a/linux-2.6.11-xen-sparse/drivers/xen/netfront/netfront.c b/linux-2.6.11-xen-sparse/drivers/xen/netfront/netfront.c
--- a/linux-2.6.11-xen-sparse/drivers/xen/netfront/netfront.c 2005-05-03 07:02:52 -04:00
+++ b/linux-2.6.11-xen-sparse/drivers/xen/netfront/netfront.c 2005-05-03 07:02:52 -04:00
@@ -393,19 +393,13 @@
= INVALID_P2M_ENTRY;

rx_mcl[i].op = __HYPERVISOR_update_va_mapping;
- rx_mcl[i].args[0] = (unsigned long)skb->head >> PAGE_SHIFT;
+ rx_mcl[i].args[0] = (unsigned long)skb->head;
rx_mcl[i].args[1] = 0;
rx_mcl[i].args[2] = 0;
}

- /*
- * We may have allocated buffers which have entries outstanding in the page
- * update queue -- make sure we flush those first!
- */
- flush_page_update_queue();
-
/* After all PTEs have been zapped we blow away stale TLB entries. */
- rx_mcl[i-1].args[2] = UVMF_FLUSH_TLB;
+ rx_mcl[i-1].args[2] = UVMF_TLB_FLUSH|UVMF_ALL;

/* Give away a batch of pages. */
rx_mcl[i].op = __HYPERVISOR_dom_mem_op;
@@ -585,7 +579,7 @@
mmu->val = __pa(skb->head) >> PAGE_SHIFT;
mmu++;
mcl->op = __HYPERVISOR_update_va_mapping;
- mcl->args[0] = (unsigned long)skb->head >> PAGE_SHIFT;
+ mcl->args[0] = (unsigned long)skb->head;
mcl->args[1] = (rx->addr & PAGE_MASK) | __PAGE_KERNEL;
mcl->args[2] = 0;
mcl++;
@@ -605,6 +599,7 @@
mcl->args[0] = (unsigned long)rx_mmu;
mcl->args[1] = mmu - rx_mmu;
mcl->args[2] = 0;
+ mcl->args[3] = DOMID_SELF;
mcl++;
(void)HYPERVISOR_multicall(rx_mcl, mcl - rx_mcl);
}
@@ -1121,18 +1116,13 @@

switch (msg->subtype) {
case CMSG_NETIF_FE_INTERFACE_STATUS:
- if (msg->length != sizeof(netif_fe_interface_status_t))
- goto error;
netif_interface_status((netif_fe_interface_status_t *) &msg->msg[0]);
break;

case CMSG_NETIF_FE_DRIVER_STATUS:
- if (msg->length != sizeof(netif_fe_driver_status_t))
- goto error;
netif_driver_status((netif_fe_driver_status_t *) &msg->msg[0]);
break;

- error:
default:
msg->length = 0;
break;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog
Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk [ In reply to ]
ChangeSet 1.1424, 2005/05/03 17:31:05+01:00, kaf24@firebug.cl.cam.ac.uk

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xxx.bk



mkbuildtree | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)


diff -Nru a/linux-2.4.29-xen-sparse/mkbuildtree b/linux-2.4.29-xen-sparse/mkbuildtree
--- a/linux-2.4.29-xen-sparse/mkbuildtree 2005-05-03 13:02:46 -04:00
+++ b/linux-2.4.29-xen-sparse/mkbuildtree 2005-05-03 13:02:46 -04:00
@@ -163,6 +163,7 @@
ln -sf ../asm-i386/mmx.h
ln -sf ../asm-i386/mpspec.h
ln -sf ../asm-i386/msgbuf.h
+ln -sf ../asm-i386/msr.h
ln -sf ../asm-i386/mtrr.h
ln -sf ../asm-i386/namei.h
ln -sf ../asm-i386/param.h
@@ -209,9 +210,9 @@
ln -sf ../../${LINUX_26}/include/asm-xen/evtchn.h
ln -sf ../../${LINUX_26}/include/asm-xen/gnttab.h
ln -sf ../../${LINUX_26}/include/asm-xen/hypervisor.h
-ln -sf ../../${LINUX_26}/include/asm-xen/multicall.h
ln -sf ../../${LINUX_26}/include/asm-xen/xen_proc.h
ln -sf ../../${LINUX_26}/include/asm-xen/asm-i386/synch_bitops.h
+ln -sf ../../${LINUX_26}/include/asm-xen/asm-i386/hypercall.h

mkdir -p linux-public && cd linux-public
ln -sf ../../../${LINUX_26}/include/asm-xen/linux-public/privcmd.h
@@ -231,7 +232,6 @@
ln -sf ../../../${LINUX_26}/arch/xen/kernel/gnttab.c
ln -sf ../../../${LINUX_26}/arch/xen/kernel/reboot.c
ln -sf ../../../${LINUX_26}/arch/xen/kernel/skbuff.c
-ln -sf ../../../${LINUX_26}/arch/xen/i386/kernel/ioport.c
ln -sf ../../../${LINUX_26}/arch/xen/i386/kernel/pci-dma.c

cd ${AD}/arch/xen/lib
@@ -282,4 +282,12 @@
cd ${AD}/arch/xen/drivers/blkif/frontend
ln -sf ../../../../../${LINUX_26}/drivers/xen/blkfront/blkfront.c

-
+cd ${AD}/arch/xen/drivers/usbif/frontend
+ln -sf ../../../../../${LINUX_26}/drivers/xen/usbfront/usbfront.c main.c
+ln -sf ../../../../../${LINUX_26}/drivers/xen/usbfront/xhci.h
+
+cd ${AD}/arch/xen/drivers/usbif/backend
+ln -sf ../../../../../${LINUX_26}/drivers/xen/usbback/common.h
+ln -sf ../../../../../${LINUX_26}/drivers/xen/usbback/control.c
+ln -sf ../../../../../${LINUX_26}/drivers/xen/usbback/interface.c
+ln -sf ../../../../../${LINUX_26}/drivers/xen/usbback/usbback.c main.c

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog
Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk [ In reply to ]
ChangeSet 1.1450, 2005/05/07 10:44:36+01:00, kaf24@firebug.cl.cam.ac.uk

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk



b/linux-2.6.11-xen-sparse/arch/xen/configs/xenU_defconfig_x86_32 | 545 ++++++++++
linux-2.6.11-xen-sparse/arch/xen/configs/xenU_defconfig | 536 ---------
2 files changed, 545 insertions(+), 536 deletions(-)


diff -Nru a/linux-2.6.11-xen-sparse/arch/xen/configs/xenU_defconfig b/linux-2.6.11-xen-sparse/arch/xen/configs/xenU_defconfig
--- a/linux-2.6.11-xen-sparse/arch/xen/configs/xenU_defconfig 2005-05-07 06:04:43 -04:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,536 +0,0 @@
-#
-# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.11-xenU
-# Wed Apr 13 23:18:37 2005
-#
-CONFIG_XEN=y
-CONFIG_ARCH_XEN=y
-CONFIG_NO_IDLE_HZ=y
-
-#
-# XEN
-#
-# CONFIG_XEN_PRIVILEGED_GUEST is not set
-# CONFIG_XEN_PHYSDEV_ACCESS is not set
-CONFIG_XEN_BLKDEV_FRONTEND=y
-CONFIG_XEN_NETDEV_FRONTEND=y
-# CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
-CONFIG_XEN_WRITABLE_PAGETABLES=y
-CONFIG_XEN_SCRUB_PAGES=y
-CONFIG_X86=y
-# CONFIG_X86_64 is not set
-CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
-
-#
-# Code maturity level options
-#
-CONFIG_EXPERIMENTAL=y
-CONFIG_CLEAN_COMPILE=y
-CONFIG_BROKEN_ON_SMP=y
-CONFIG_LOCK_KERNEL=y
-
-#
-# General setup
-#
-CONFIG_LOCALVERSION=""
-CONFIG_SWAP=y
-CONFIG_SYSVIPC=y
-# CONFIG_POSIX_MQUEUE is not set
-# CONFIG_BSD_PROCESS_ACCT is not set
-CONFIG_SYSCTL=y
-# CONFIG_AUDIT is not set
-CONFIG_LOG_BUF_SHIFT=14
-CONFIG_HOTPLUG=y
-CONFIG_KOBJECT_UEVENT=y
-# CONFIG_IKCONFIG is not set
-# CONFIG_EMBEDDED is not set
-CONFIG_KALLSYMS=y
-# CONFIG_KALLSYMS_ALL is not set
-# CONFIG_KALLSYMS_EXTRA_PASS is not set
-CONFIG_FUTEX=y
-CONFIG_EPOLL=y
-# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_SHMEM=y
-CONFIG_CC_ALIGN_FUNCTIONS=0
-CONFIG_CC_ALIGN_LABELS=0
-CONFIG_CC_ALIGN_LOOPS=0
-CONFIG_CC_ALIGN_JUMPS=0
-# CONFIG_TINY_SHMEM is not set
-
-#
-# Loadable module support
-#
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_MODULE_FORCE_UNLOAD is not set
-CONFIG_OBSOLETE_MODPARM=y
-# CONFIG_MODVERSIONS is not set
-# CONFIG_MODULE_SRCVERSION_ALL is not set
-CONFIG_KMOD=y
-
-#
-# X86 Processor Configuration
-#
-CONFIG_XENARCH="i386"
-CONFIG_MMU=y
-CONFIG_UID16=y
-CONFIG_GENERIC_ISA_DMA=y
-CONFIG_GENERIC_IOMAP=y
-# CONFIG_M386 is not set
-# CONFIG_M486 is not set
-# CONFIG_M586 is not set
-# CONFIG_M586TSC is not set
-# CONFIG_M586MMX is not set
-# CONFIG_M686 is not set
-# CONFIG_MPENTIUMII is not set
-# CONFIG_MPENTIUMIII is not set
-# CONFIG_MPENTIUMM is not set
-CONFIG_MPENTIUM4=y
-# CONFIG_MK6 is not set
-# CONFIG_MK7 is not set
-# CONFIG_MK8 is not set
-# CONFIG_MCRUSOE is not set
-# CONFIG_MEFFICEON is not set
-# CONFIG_MWINCHIPC6 is not set
-# CONFIG_MWINCHIP2 is not set
-# CONFIG_MWINCHIP3D is not set
-# CONFIG_MCYRIXIII is not set
-# CONFIG_MVIAC3_2 is not set
-# CONFIG_X86_GENERIC is not set
-CONFIG_X86_CMPXCHG=y
-CONFIG_X86_XADD=y
-CONFIG_X86_L1_CACHE_SHIFT=7
-CONFIG_RWSEM_XCHGADD_ALGORITHM=y
-CONFIG_GENERIC_CALIBRATE_DELAY=y
-CONFIG_X86_WP_WORKS_OK=y
-CONFIG_X86_INVLPG=y
-CONFIG_X86_BSWAP=y
-CONFIG_X86_POPAD_OK=y
-CONFIG_X86_GOOD_APIC=y
-CONFIG_X86_INTEL_USERCOPY=y
-CONFIG_X86_USE_PPRO_CHECKSUM=y
-# CONFIG_HPET_TIMER is not set
-# CONFIG_HPET_EMULATE_RTC is not set
-# CONFIG_SMP is not set
-CONFIG_PREEMPT=y
-CONFIG_PREEMPT_BKL=y
-CONFIG_X86_CPUID=y
-
-#
-# Firmware Drivers
-#
-# CONFIG_EDD is not set
-CONFIG_NOHIGHMEM=y
-# CONFIG_HIGHMEM4G is not set
-CONFIG_HAVE_DEC_LOCK=y
-# CONFIG_REGPARM is not set
-
-#
-# Kernel hacking
-#
-CONFIG_DEBUG_KERNEL=y
-CONFIG_EARLY_PRINTK=y
-# CONFIG_DEBUG_STACKOVERFLOW is not set
-# CONFIG_DEBUG_STACK_USAGE is not set
-# CONFIG_DEBUG_SLAB is not set
-CONFIG_MAGIC_SYSRQ=y
-# CONFIG_DEBUG_SPINLOCK is not set
-# CONFIG_DEBUG_PAGEALLOC is not set
-# CONFIG_DEBUG_INFO is not set
-# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
-# CONFIG_FRAME_POINTER is not set
-# CONFIG_4KSTACKS is not set
-CONFIG_GENERIC_HARDIRQS=y
-CONFIG_GENERIC_IRQ_PROBE=y
-CONFIG_X86_BIOS_REBOOT=y
-CONFIG_PC=y
-
-#
-# Executable file formats
-#
-CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_AOUT is not set
-# CONFIG_BINFMT_MISC is not set
-
-#
-# Device Drivers
-#
-
-#
-# Generic Driver Options
-#
-CONFIG_STANDALONE=y
-CONFIG_PREVENT_FIRMWARE_BUILD=y
-# CONFIG_FW_LOADER is not set
-# CONFIG_DEBUG_DRIVER is not set
-
-#
-# Block devices
-#
-# CONFIG_BLK_DEV_FD is not set
-# CONFIG_BLK_DEV_COW_COMMON is not set
-CONFIG_BLK_DEV_LOOP=m
-# CONFIG_BLK_DEV_CRYPTOLOOP is not set
-CONFIG_BLK_DEV_NBD=m
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_COUNT=16
-CONFIG_BLK_DEV_RAM_SIZE=4096
-CONFIG_BLK_DEV_INITRD=y
-CONFIG_INITRAMFS_SOURCE=""
-# CONFIG_LBD is not set
-# CONFIG_CDROM_PKTCDVD is not set
-
-#
-# IO Schedulers
-#
-CONFIG_IOSCHED_NOOP=y
-CONFIG_IOSCHED_AS=y
-CONFIG_IOSCHED_DEADLINE=y
-CONFIG_IOSCHED_CFQ=y
-# CONFIG_ATA_OVER_ETH is not set
-
-#
-# SCSI device support
-#
-CONFIG_SCSI=m
-CONFIG_SCSI_PROC_FS=y
-
-#
-# SCSI support type (disk, tape, CD-ROM)
-#
-CONFIG_BLK_DEV_SD=m
-# CONFIG_CHR_DEV_ST is not set
-# CONFIG_CHR_DEV_OSST is not set
-# CONFIG_BLK_DEV_SR is not set
-# CONFIG_CHR_DEV_SG is not set
-
-#
-# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
-#
-# CONFIG_SCSI_MULTI_LUN is not set
-# CONFIG_SCSI_CONSTANTS is not set
-# CONFIG_SCSI_LOGGING is not set
-
-#
-# SCSI Transport Attributes
-#
-# CONFIG_SCSI_SPI_ATTRS is not set
-# CONFIG_SCSI_FC_ATTRS is not set
-# CONFIG_SCSI_ISCSI_ATTRS is not set
-
-#
-# SCSI low-level drivers
-#
-# CONFIG_SCSI_SATA is not set
-# CONFIG_SCSI_DEBUG is not set
-
-#
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
-
-#
-# Networking support
-#
-CONFIG_NET=y
-
-#
-# Networking options
-#
-CONFIG_PACKET=y
-# CONFIG_PACKET_MMAP is not set
-# CONFIG_NETLINK_DEV is not set
-CONFIG_UNIX=y
-# CONFIG_NET_KEY is not set
-CONFIG_INET=y
-# CONFIG_IP_MULTICAST is not set

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog
Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk [ In reply to ]
ChangeSet 1.1455, 2005/05/08 09:39:44+01:00, kaf24@firebug.cl.cam.ac.uk

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk



0 files changed



_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog
Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk [ In reply to ]
ChangeSet 1.1421, 2005/05/16 17:46:06+01:00, kaf24@firebug.cl.cam.ac.uk

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk



0 files changed



_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog

1 2  View All