From 2d02990327542b7a3bbc1f3c0ca277e78794ce16 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Fri, 20 Aug 2004 07:43:55 +0000 Subject: bitkeeper revision 1.1159.45.7 (4125abbbALjz7ttvo9UYMDVzVkYmFA) misc cleanups --- tools/check/chk | 4 +++- xen/arch/x86/shadow.c | 11 ++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/tools/check/chk b/tools/check/chk index 632da544cb..16de110bc1 100755 --- a/tools/check/chk +++ b/tools/check/chk @@ -12,6 +12,8 @@ function usage { exit 1 } +export PATH=${PATH}:/sbin:/usr/sbin + case $1 in build) check="CHECK-BUILD" @@ -67,4 +69,4 @@ if [ "$failed" == "1" ] ; then else echo "OK" >> ${info} exit 0 -fi \ No newline at end of file +fi diff --git a/xen/arch/x86/shadow.c b/xen/arch/x86/shadow.c index 06445943ab..e1fac065d0 100644 --- a/xen/arch/x86/shadow.c +++ b/xen/arch/x86/shadow.c @@ -440,13 +440,10 @@ int shadow_mode_control(struct domain *d, dom0_shadow_control_t *sc) unsigned int cmd = sc->op; int rc = 0; - if (d == current) - printk("Attempt to control your _own_ shadow tables. I hope you know what you're doing!\n"); + domain_pause(d); + synchronise_pagetables(~0UL); - domain_pause(d); - synchronise_pagetables(d->processor); - - spin_lock(&d->mm.shadow_lock); + spin_lock(&d->mm.shadow_lock); if ( cmd == DOM0_SHADOW_CONTROL_OP_OFF ) { @@ -475,7 +472,7 @@ int shadow_mode_control(struct domain *d, dom0_shadow_control_t *sc) spin_unlock(&d->mm.shadow_lock); - domain_unpause(d); + domain_unpause(d); return rc; } -- cgit v1.2.3 From cc248cb6078e151feccf5fbba4d7c4ceee418224 Mon Sep 17 00:00:00 2001 From: "akw27@labyrinth.cl.cam.ac.uk" Date: Fri, 20 Aug 2004 09:01:10 +0000 Subject: bitkeeper revision 1.1159.45.8 (4125bdd65AGH_yEQnU1cGd31tL8SuA) Add a timeout to blkif connect. --- linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c b/linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c index e28274a457..7a50b14fb2 100644 --- a/linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c +++ b/linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c @@ -1215,12 +1215,15 @@ int __init xlblk_init(void) * for notifications before proceeding. For now we assume that we * will be notified of exactly one interface. */ - while ( blkif_state != BLKIF_STATE_CONNECTED ) + for ( i=0; (blkif_state != BLKIF_STATE_CONNECTED) && (i < 10*HZ); i++ ) { set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(1); } + if (blkif_state != BLKIF_STATE_CONNECTED) + printk(KERN_INFO "Timeout connecting block device driver!\n"); + return 0; } -- cgit v1.2.3 From cdbd963b5b8129dbf19d57be582c2761484b755f Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Fri, 20 Aug 2004 13:11:26 +0000 Subject: bitkeeper revision 1.1159.46.1 (4125f87eJIsxVuchHslHHEkNUjqjRA) Fix page refcnt in net backend. --- linux-2.6.7-xen-sparse/drivers/xen/netback/netback.c | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-2.6.7-xen-sparse/drivers/xen/netback/netback.c b/linux-2.6.7-xen-sparse/drivers/xen/netback/netback.c index a28115fe0c..74b618d8a4 100644 --- a/linux-2.6.7-xen-sparse/drivers/xen/netback/netback.c +++ b/linux-2.6.7-xen-sparse/drivers/xen/netback/netback.c @@ -748,6 +748,7 @@ static int __init netback_init(void) for ( i = 0; i < MAX_PENDING_REQS; i++ ) { page = virt_to_page(MMAP_VADDR(i)); + set_page_count(page, 1); SetPageForeign(page); PageForeignDestructor(page) = netif_page_release; } -- cgit v1.2.3 From 2a7eb6c380b8cc2c0e973d8a2c92b9d47e249dbf Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Fri, 20 Aug 2004 14:02:42 +0000 Subject: bitkeeper revision 1.1159.45.10 (412604827jsxItilS5gG-ddy0MGfzA) Quieten skb alloc failures in net frontend. --- .../drivers/xen/netfront/netfront.c | 54 ++++++++++++++-------- 1 file changed, 35 insertions(+), 19 deletions(-) diff --git a/linux-2.6.7-xen-sparse/drivers/xen/netfront/netfront.c b/linux-2.6.7-xen-sparse/drivers/xen/netfront/netfront.c index 0011273abd..6e3d1ab6dc 100644 --- a/linux-2.6.7-xen-sparse/drivers/xen/netfront/netfront.c +++ b/linux-2.6.7-xen-sparse/drivers/xen/netfront/netfront.c @@ -27,12 +27,15 @@ #include #if 0 -#define dprintf(fmt, args...) printk(KERN_INFO "[XEN] %s" fmt, __FUNCTION__, ##args) +#define DPRINTK(fmt, args...) \ + printk(KERN_INFO "[XEN] %s" fmt, __FUNCTION__, ##args) #else -#define dprintf(fmt, args...) do {} while(0) +#define DPRINTK(fmt, args...) ((void)0) #endif -#define RX_BUF_SIZE ((PAGE_SIZE/2)+1) /* Fool the slab allocator :-) */ +#ifndef __GFP_NOWARN +#define __GFP_NOWARN 0 +#endif static void network_tx_buf_gc(struct net_device *dev); static void network_alloc_rx_buffers(struct net_device *dev); @@ -163,11 +166,22 @@ static int netctrl_connected_count(void) } netctrl.connected_n = connected; - dprintf("> connected_n=%d interface_n=%d\n", + DPRINTK("> connected_n=%d interface_n=%d\n", netctrl.connected_n, netctrl.interface_n); return connected; } +static inline struct sk_buff *alloc_skb_page(void) +{ + struct sk_buff *skb; + skb = __dev_alloc_skb((PAGE_SIZE/2)+1, GFP_ATOMIC|__GFP_NOWARN); +#if 0 + if ( skb && unlikely(((unsigned long)skb->head & (PAGE_SIZE-1)) != 0) ) + panic("alloc_skb needs to provide us page-aligned buffers."); +#endif + return skb; +} + static int network_open(struct net_device *dev) { struct net_private *np = dev->priv; @@ -246,15 +260,11 @@ static void network_alloc_rx_buffers(struct net_device *dev) return; do { - skb = dev_alloc_skb(RX_BUF_SIZE); - if ( unlikely(skb == NULL) ) + if ( unlikely((skb = alloc_skb_page()) == NULL) ) break; skb->dev = dev; - if ( unlikely(((unsigned long)skb->head & (PAGE_SIZE-1)) != 0) ) - panic("alloc_skb needs to provide us page-aligned buffers."); - id = GET_ID_FROM_FREELIST(np->rx_skbs); np->rx_skbs[id] = skb; @@ -325,8 +335,8 @@ static int network_start_xmit(struct sk_buff *skb, struct net_device *dev) if ( unlikely((((unsigned long)skb->data & ~PAGE_MASK) + skb->len) >= PAGE_SIZE) ) { - struct sk_buff *new_skb = dev_alloc_skb(RX_BUF_SIZE); - if ( unlikely(new_skb == NULL) ) + struct sk_buff *new_skb; + if ( unlikely((new_skb = alloc_skb_page()) == NULL) ) return 1; skb_put(new_skb, skb->len); memcpy(new_skb->data, skb->data, skb->len); @@ -628,8 +638,8 @@ static void netif_status_change(netif_fe_interface_status_changed_t *status) struct net_device *dev; struct net_private *np; - dprintf(">\n"); - dprintf("> status=%d handle=%d mac=%02x:%02x:%02x:%02x:%02x:%02x\n", + DPRINTK(">\n"); + DPRINTK("> status=%d handle=%d mac=%02x:%02x:%02x:%02x:%02x:%02x\n", status->status, status->handle, status->mac[0], status->mac[1], status->mac[2], @@ -804,7 +814,7 @@ static void netif_driver_status_change( int err = 0; int i; - dprintf("> nr_interfaces=%d\n", status->nr_interfaces); + DPRINTK("> nr_interfaces=%d\n", status->nr_interfaces); netctrl.interface_n = status->nr_interfaces; netctrl.connected_n = 0; @@ -856,20 +866,26 @@ static int wait_for_interfaces(void) int err = 0, conn = 0; int wait_i, wait_n = 100; - dprintf(">\n"); + DPRINTK(">\n"); + for ( wait_i = 0; wait_i < wait_n; wait_i++) { - dprintf("> wait_i=%d\n", wait_i); + DPRINTK("> wait_i=%d\n", wait_i); conn = netctrl_connected(); if(conn) break; set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(10); } - if(conn <= 0){ + + if ( conn <= 0 ) + { err = netctrl_err(-ENETDOWN); - printk(KERN_WARNING "[XEN] Failed to connect all virtual interfaces: err=%d\n", err); + printk(KERN_WARNING "[XEN] Failed to connect all virtual interfaces: " + "err=%d\n", err); } - dprintf("< err=%d\n", err); + + DPRINTK("< err=%d\n", err); + return err; } -- cgit v1.2.3 From 9a20894392084046e9f503ec1881eab2362fcfe1 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Fri, 20 Aug 2004 15:19:36 +0000 Subject: bitkeeper revision 1.1159.47.1 (41261688nlAL_qxZPnYEzHLXT049dg) Initialise xen block-front device before ide and scsi so we get a change of grabing their majors of we've been asked. --- .rootkeys | 1 + linux-2.6.7-xen-sparse/arch/xen/Makefile | 2 -- linux-2.6.7-xen-sparse/drivers/Makefile | 54 ++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 linux-2.6.7-xen-sparse/drivers/Makefile diff --git a/.rootkeys b/.rootkeys index 6089d9aa83..8914576fd3 100644 --- a/.rootkeys +++ b/.rootkeys @@ -172,6 +172,7 @@ 40f56239sFcjHiIRmnObRIDF-zaeKQ linux-2.6.7-xen-sparse/arch/xen/kernel/process.c 40f562392LBhwmOxVPsYdkYXMxI_ZQ linux-2.6.7-xen-sparse/arch/xen/kernel/reboot.c 3f68905c5eiA-lBMQSvXLMWS1ikDEA linux-2.6.7-xen-sparse/arch/xen/kernel/xen_proc.c +41261688yS8eAyy-7kzG4KBs0xbYCA linux-2.6.7-xen-sparse/drivers/Makefile 4108f5c1WfTIrs0HZFeV39sttekCTw linux-2.6.7-xen-sparse/drivers/char/mem.c 4111308bZAIzwf_Kzu6x1TZYZ3E0_Q linux-2.6.7-xen-sparse/drivers/char/tty_io.c 40f56239Dp_vMTgz8TEbvo1hjHGc3w linux-2.6.7-xen-sparse/drivers/xen/Makefile diff --git a/linux-2.6.7-xen-sparse/arch/xen/Makefile b/linux-2.6.7-xen-sparse/arch/xen/Makefile index 227bea1244..e3772803d3 100644 --- a/linux-2.6.7-xen-sparse/arch/xen/Makefile +++ b/linux-2.6.7-xen-sparse/arch/xen/Makefile @@ -24,8 +24,6 @@ UTS_MACHINE := $(XENARCH) core-y += arch/xen/kernel/ -drivers-y += drivers/xen/ - include/.asm-ignore: @rm -f include/.asm-ignore @mv include/asm include/.asm-ignore diff --git a/linux-2.6.7-xen-sparse/drivers/Makefile b/linux-2.6.7-xen-sparse/drivers/Makefile new file mode 100644 index 0000000000..1e2b996294 --- /dev/null +++ b/linux-2.6.7-xen-sparse/drivers/Makefile @@ -0,0 +1,54 @@ +# +# Makefile for the Linux kernel device drivers. +# +# 15 Sep 2000, Christoph Hellwig +# Rewritten to use lists instead of if-statements. +# + +obj-$(CONFIG_PCI) += pci/ +obj-$(CONFIG_PARISC) += parisc/ +obj-$(CONFIG_ACPI_BOOT) += acpi/ +# PnP must come after ACPI since it will eventually need to check if acpi +# was used and do nothing if so +obj-$(CONFIG_PNP) += pnp/ + +# char/ comes before serial/ etc so that the VT console is the boot-time +# default. + +obj-y += char/ +obj-y += serial/ +obj-$(CONFIG_PARPORT) += parport/ +obj-y += base/ block/ misc/ net/ media/ +obj-$(CONFIG_NUBUS) += nubus/ +obj-$(CONFIG_ATM) += atm/ +obj-$(CONFIG_PPC_PMAC) += macintosh/ +obj-$(CONFIG_ARCH_XEN) += xen/ +obj-$(CONFIG_IDE) += ide/ +obj-$(CONFIG_FC4) += fc4/ +obj-$(CONFIG_SCSI) += scsi/ +obj-$(CONFIG_FUSION) += message/ +obj-$(CONFIG_IEEE1394) += ieee1394/ +obj-y += cdrom/ video/ +obj-$(CONFIG_MTD) += mtd/ +obj-$(CONFIG_PCMCIA) += pcmcia/ +obj-$(CONFIG_DIO) += dio/ +obj-$(CONFIG_SBUS) += sbus/ +obj-$(CONFIG_ZORRO) += zorro/ +obj-$(CONFIG_MAC) += macintosh/ +obj-$(CONFIG_PARIDE) += block/paride/ +obj-$(CONFIG_TC) += tc/ +obj-$(CONFIG_USB) += usb/ +obj-$(CONFIG_USB_GADGET) += usb/gadget/ +obj-$(CONFIG_INPUT) += input/ +obj-$(CONFIG_GAMEPORT) += input/gameport/ +obj-$(CONFIG_SERIO) += input/serio/ +obj-$(CONFIG_I2O) += message/ +obj-$(CONFIG_I2C) += i2c/ +obj-$(CONFIG_PHONE) += telephony/ +obj-$(CONFIG_MD) += md/ +obj-$(CONFIG_BT) += bluetooth/ +obj-$(CONFIG_ISDN) += isdn/ +obj-$(CONFIG_MCA) += mca/ +obj-$(CONFIG_EISA) += eisa/ +obj-$(CONFIG_CPU_FREQ) += cpufreq/ +obj-y += firmware/ -- cgit v1.2.3 From 5b401367bf9f11d71890105bb62c317875a6300e Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Fri, 20 Aug 2004 16:05:33 +0000 Subject: bitkeeper revision 1.1159.45.12 (4126214drloFPpuSWsnIRb0lHMIafA) Enable a more generous set of options in the 2.6.7 kernels --- linux-2.6.7-xen-sparse/arch/xen/Kconfig.drivers | 9 +- .../arch/xen/configs/xen0_defconfig | 341 ++++++++++++++------- .../arch/xen/configs/xenU_defconfig | 110 +++++-- 3 files changed, 335 insertions(+), 125 deletions(-) diff --git a/linux-2.6.7-xen-sparse/arch/xen/Kconfig.drivers b/linux-2.6.7-xen-sparse/arch/xen/Kconfig.drivers index 8294419857..508bc7a174 100644 --- a/linux-2.6.7-xen-sparse/arch/xen/Kconfig.drivers +++ b/linux-2.6.7-xen-sparse/arch/xen/Kconfig.drivers @@ -4,12 +4,15 @@ menu "Device Drivers" source "drivers/base/Kconfig" -if XEN_PHYSDEV_ACCESS +source "drivers/scsi/Kconfig" source "drivers/block/Kconfig" +source "drivers/md/Kconfig" + +# Always include scsi and block to enable iscsi, loop0 etc. + +if XEN_PHYSDEV_ACCESS source "drivers/ide/Kconfig" -source "drivers/scsi/Kconfig" source "drivers/cdrom/Kconfig" -source "drivers/md/Kconfig" endif source "net/Kconfig" diff --git a/linux-2.6.7-xen-sparse/arch/xen/configs/xen0_defconfig b/linux-2.6.7-xen-sparse/arch/xen/configs/xen0_defconfig index bda8feb206..fa9420f276 100644 --- a/linux-2.6.7-xen-sparse/arch/xen/configs/xen0_defconfig +++ b/linux-2.6.7-xen-sparse/arch/xen/configs/xen0_defconfig @@ -10,6 +10,7 @@ CONFIG_NO_IDLE_HZ=y # CONFIG_XEN_PRIVILEGED_GUEST=y CONFIG_XEN_PHYSDEV_ACCESS=y +# CONFIG_XEN_WRITABLE_PAGETABLES is not set CONFIG_FOREIGN_PAGES=y CONFIG_PAGESIZED_SKBS=y CONFIG_X86=y @@ -34,10 +35,11 @@ CONFIG_SYSVIPC=y CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 -# CONFIG_HOTPLUG is not set +CONFIG_HOTPLUG=y # CONFIG_IKCONFIG is not set # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set CONFIG_FUTEX=y CONFIG_EPOLL=y CONFIG_IOSCHED_NOOP=y @@ -63,11 +65,6 @@ CONFIG_XENARCH="i386" CONFIG_MMU=y CONFIG_UID16=y CONFIG_GENERIC_ISA_DMA=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 @@ -77,9 +74,6 @@ CONFIG_MPENTIUM4=y # CONFIG_MK7 is not set # CONFIG_MK8 is not set # CONFIG_MCRUSOE 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 @@ -106,7 +100,6 @@ CONFIG_X86_CPUID=y # CONFIG_EDD is not set CONFIG_NOHIGHMEM=y # CONFIG_HIGHMEM4G is not set -# CONFIG_HIGHMEM64G is not set CONFIG_HAVE_DEC_LOCK=y # CONFIG_REGPARM is not set @@ -126,11 +119,35 @@ CONFIG_ISA=y # CONFIG_MCA is not set # CONFIG_SCx200 is not set +# +# PCMCIA/CardBus support +# +CONFIG_PCMCIA=m +# CONFIG_PCMCIA_DEBUG is not set +CONFIG_YENTA=m +CONFIG_CARDBUS=y +# CONFIG_I82092 is not set +# CONFIG_I82365 is not set +# CONFIG_TCIC is not set +CONFIG_PCMCIA_PROBE=y + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + # # Kernel hacking # -# CONFIG_DEBUG_KERNEL is not set +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 @@ -152,88 +169,8 @@ CONFIG_BINFMT_ELF=y # # Generic Driver Options # - -# -# Block devices -# -# CONFIG_BLK_DEV_FD is not set -# CONFIG_BLK_DEV_XD is not set -# CONFIG_BLK_CPQ_DA is not set -# CONFIG_BLK_CPQ_CISS_DA is not set -# CONFIG_BLK_DEV_DAC960 is not set -# CONFIG_BLK_DEV_UMEM is not set -CONFIG_BLK_DEV_LOOP=y -# CONFIG_BLK_DEV_CRYPTOLOOP is not set -# CONFIG_BLK_DEV_NBD is not set -# CONFIG_BLK_DEV_CARMEL is not set -CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_RAM_SIZE=4096 -# CONFIG_BLK_DEV_INITRD is not set -# CONFIG_LBD is not set - -# -# ATA/ATAPI/MFM/RLL support -# -CONFIG_IDE=y -CONFIG_BLK_DEV_IDE=y - -# -# Please see Documentation/ide.txt for help/info on IDE drives -# -# CONFIG_BLK_DEV_HD_IDE is not set -CONFIG_BLK_DEV_IDEDISK=y -# CONFIG_IDEDISK_MULTI_MODE is not set -CONFIG_BLK_DEV_IDECD=y -# CONFIG_BLK_DEV_IDETAPE is not set -# CONFIG_BLK_DEV_IDEFLOPPY is not set -# CONFIG_BLK_DEV_IDESCSI is not set -# CONFIG_IDE_TASK_IOCTL is not set -# CONFIG_IDE_TASKFILE_IO is not set - -# -# IDE chipset support/bugfixes -# -CONFIG_IDE_GENERIC=y -# CONFIG_BLK_DEV_CMD640 is not set -CONFIG_BLK_DEV_IDEPCI=y -# CONFIG_IDEPCI_SHARE_IRQ is not set -# CONFIG_BLK_DEV_OFFBOARD is not set -CONFIG_BLK_DEV_GENERIC=y -# CONFIG_BLK_DEV_OPTI621 is not set -# CONFIG_BLK_DEV_RZ1000 is not set -CONFIG_BLK_DEV_IDEDMA_PCI=y -# CONFIG_BLK_DEV_IDEDMA_FORCED is not set -CONFIG_IDEDMA_PCI_AUTO=y -# CONFIG_IDEDMA_ONLYDISK is not set -CONFIG_BLK_DEV_ADMA=y -# CONFIG_BLK_DEV_AEC62XX is not set -# CONFIG_BLK_DEV_ALI15X3 is not set -# CONFIG_BLK_DEV_AMD74XX is not set -# CONFIG_BLK_DEV_ATIIXP is not set -# CONFIG_BLK_DEV_CMD64X is not set -# CONFIG_BLK_DEV_TRIFLEX is not set -# CONFIG_BLK_DEV_CY82C693 is not set -# CONFIG_BLK_DEV_CS5520 is not set -# CONFIG_BLK_DEV_CS5530 is not set -# CONFIG_BLK_DEV_HPT34X is not set -# CONFIG_BLK_DEV_HPT366 is not set -# CONFIG_BLK_DEV_SC1200 is not set -CONFIG_BLK_DEV_PIIX=y -# CONFIG_BLK_DEV_NS87415 is not set -# CONFIG_BLK_DEV_PDC202XX_OLD is not set -# CONFIG_BLK_DEV_PDC202XX_NEW is not set -CONFIG_BLK_DEV_SVWKS=y -# CONFIG_BLK_DEV_SIIMAGE is not set -# CONFIG_BLK_DEV_SIS5513 is not set -# CONFIG_BLK_DEV_SLC90E66 is not set -# CONFIG_BLK_DEV_TRM290 is not set -# CONFIG_BLK_DEV_VIA82CXXX is not set -# CONFIG_IDE_ARM is not set -# CONFIG_IDE_CHIPSETS is not set -CONFIG_BLK_DEV_IDEDMA=y -# CONFIG_IDEDMA_IVB is not set -CONFIG_IDEDMA_AUTO=y -# CONFIG_BLK_DEV_HD is not set +# CONFIG_FW_LOADER is not set +# CONFIG_DEBUG_DRIVER is not set # # SCSI device support @@ -344,14 +281,115 @@ CONFIG_SCSI_QLA2XXX=y # CONFIG_SCSI_DEBUG is not set # -# Old CD-ROM drivers (not SCSI, not IDE) +# PCMCIA SCSI adapter support # -# CONFIG_CD_NO_IDESCSI is not set +# CONFIG_PCMCIA_AHA152X is not set +# CONFIG_PCMCIA_FDOMAIN is not set +# CONFIG_PCMCIA_NINJA_SCSI is not set +# CONFIG_PCMCIA_QLOGIC is not set +# CONFIG_PCMCIA_SYM53C500 is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set +CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_CRYPTOLOOP is not set +CONFIG_BLK_DEV_NBD=y +# CONFIG_BLK_DEV_CARMEL is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_SIZE=4096 +CONFIG_BLK_DEV_INITRD=y +# CONFIG_LBD is not set # # Multi-device support (RAID and LVM) # -# CONFIG_MD is not set +CONFIG_MD=y +CONFIG_BLK_DEV_MD=m +# CONFIG_MD_LINEAR is not set +CONFIG_MD_RAID0=m +CONFIG_MD_RAID1=m +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_RAID6 is not set +# CONFIG_MD_MULTIPATH is not set +CONFIG_BLK_DEV_DM=y +# CONFIG_DM_CRYPT is not set + +# +# ATA/ATAPI/MFM/RLL support +# +CONFIG_IDE=y +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_HD_IDE is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDECS is not set +CONFIG_BLK_DEV_IDECD=y +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set +# CONFIG_IDE_TASK_IOCTL is not set +# CONFIG_IDE_TASKFILE_IO is not set + +# +# IDE chipset support/bugfixes +# +CONFIG_IDE_GENERIC=y +# CONFIG_BLK_DEV_CMD640 is not set +CONFIG_BLK_DEV_IDEPCI=y +# CONFIG_IDEPCI_SHARE_IRQ is not set +# CONFIG_BLK_DEV_OFFBOARD is not set +CONFIG_BLK_DEV_GENERIC=y +# CONFIG_BLK_DEV_OPTI621 is not set +# CONFIG_BLK_DEV_RZ1000 is not set +CONFIG_BLK_DEV_IDEDMA_PCI=y +# CONFIG_BLK_DEV_IDEDMA_FORCED is not set +CONFIG_IDEDMA_PCI_AUTO=y +# CONFIG_IDEDMA_ONLYDISK is not set +CONFIG_BLK_DEV_ADMA=y +# CONFIG_BLK_DEV_AEC62XX is not set +# CONFIG_BLK_DEV_ALI15X3 is not set +# CONFIG_BLK_DEV_AMD74XX is not set +# CONFIG_BLK_DEV_ATIIXP is not set +# CONFIG_BLK_DEV_CMD64X is not set +# CONFIG_BLK_DEV_TRIFLEX is not set +# CONFIG_BLK_DEV_CY82C693 is not set +# CONFIG_BLK_DEV_CS5520 is not set +# CONFIG_BLK_DEV_CS5530 is not set +# CONFIG_BLK_DEV_HPT34X is not set +# CONFIG_BLK_DEV_HPT366 is not set +# CONFIG_BLK_DEV_SC1200 is not set +CONFIG_BLK_DEV_PIIX=y +# CONFIG_BLK_DEV_NS87415 is not set +# CONFIG_BLK_DEV_PDC202XX_OLD is not set +# CONFIG_BLK_DEV_PDC202XX_NEW is not set +CONFIG_BLK_DEV_SVWKS=y +# CONFIG_BLK_DEV_SIIMAGE is not set +# CONFIG_BLK_DEV_SIS5513 is not set +# CONFIG_BLK_DEV_SLC90E66 is not set +# CONFIG_BLK_DEV_TRM290 is not set +# CONFIG_BLK_DEV_VIA82CXXX is not set +# CONFIG_IDE_ARM is not set +# CONFIG_IDE_CHIPSETS is not set +CONFIG_BLK_DEV_IDEDMA=y +# CONFIG_IDEDMA_IVB is not set +CONFIG_IDEDMA_AUTO=y +# CONFIG_BLK_DEV_HD is not set + +# +# Old CD-ROM drivers (not SCSI, not IDE) +# +# CONFIG_CD_NO_IDESCSI is not set # # Networking support @@ -370,7 +408,7 @@ CONFIG_INET=y # CONFIG_IP_MULTICAST is not set # CONFIG_IP_ADVANCED_ROUTER is not set CONFIG_IP_PNP=y -# CONFIG_IP_PNP_DHCP is not set +CONFIG_IP_PNP_DHCP=y # CONFIG_IP_PNP_BOOTP is not set # CONFIG_IP_PNP_RARP is not set # CONFIG_NET_IPIP is not set @@ -380,8 +418,60 @@ CONFIG_IP_PNP=y # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set + +# +# IP: Virtual Server Configuration +# +# CONFIG_IP_VS is not set # CONFIG_IPV6 is not set -# CONFIG_NETFILTER is not set +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +CONFIG_BRIDGE_NETFILTER=y + +# +# IP: Netfilter Configuration +# +CONFIG_IP_NF_CONNTRACK=m +CONFIG_IP_NF_FTP=m +# CONFIG_IP_NF_IRC is not set +# CONFIG_IP_NF_TFTP is not set +# CONFIG_IP_NF_AMANDA is not set +# CONFIG_IP_NF_QUEUE is not set +CONFIG_IP_NF_IPTABLES=m +# CONFIG_IP_NF_MATCH_LIMIT is not set +# CONFIG_IP_NF_MATCH_IPRANGE is not set +# CONFIG_IP_NF_MATCH_MAC is not set +# CONFIG_IP_NF_MATCH_PKTTYPE is not set +# CONFIG_IP_NF_MATCH_MARK is not set +# CONFIG_IP_NF_MATCH_MULTIPORT is not set +# CONFIG_IP_NF_MATCH_TOS is not set +# CONFIG_IP_NF_MATCH_RECENT is not set +# CONFIG_IP_NF_MATCH_ECN is not set +# CONFIG_IP_NF_MATCH_DSCP is not set +# CONFIG_IP_NF_MATCH_AH_ESP is not set +# CONFIG_IP_NF_MATCH_LENGTH is not set +# CONFIG_IP_NF_MATCH_TTL is not set +# CONFIG_IP_NF_MATCH_TCPMSS is not set +# CONFIG_IP_NF_MATCH_HELPER is not set +# CONFIG_IP_NF_MATCH_STATE is not set +# CONFIG_IP_NF_MATCH_CONNTRACK is not set +# CONFIG_IP_NF_MATCH_OWNER is not set +# CONFIG_IP_NF_MATCH_PHYSDEV is not set +# CONFIG_IP_NF_FILTER is not set +# CONFIG_IP_NF_NAT is not set +# CONFIG_IP_NF_MANGLE is not set +# CONFIG_IP_NF_TARGET_LOG is not set +# CONFIG_IP_NF_TARGET_ULOG is not set +# CONFIG_IP_NF_TARGET_TCPMSS is not set +# CONFIG_IP_NF_ARPTABLES is not set +# CONFIG_IP_NF_COMPAT_IPCHAINS is not set +# CONFIG_IP_NF_COMPAT_IPFWADM is not set +# CONFIG_IP_NF_RAW is not set + +# +# Bridge: Netfilter Configuration +# +# CONFIG_BRIDGE_NF_EBTABLES is not set # # SCTP Configuration (EXPERIMENTAL) @@ -459,6 +549,8 @@ CONFIG_TULIP=y # CONFIG_DE4X5 is not set # CONFIG_WINBOND_840 is not set # CONFIG_DM9102 is not set +# CONFIG_PCMCIA_XIRCOM is not set +# CONFIG_PCMCIA_XIRTULIP is not set # CONFIG_AT1700 is not set # CONFIG_DEPCA is not set # CONFIG_HP100 is not set @@ -524,6 +616,11 @@ CONFIG_TIGON3=y # # CONFIG_NET_RADIO is not set +# +# PCMCIA network device support +# +# CONFIG_NET_PCMCIA is not set + # # Wan interfaces # @@ -629,6 +726,11 @@ CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_FTAPE is not set # CONFIG_AGP is not set # CONFIG_DRM is not set + +# +# PCMCIA character devices +# +# CONFIG_SYNCLINK_CS is not set # CONFIG_MWAVE is not set # CONFIG_RAW_DRIVER is not set # CONFIG_HANGCHECK_TIMER is not set @@ -663,7 +765,10 @@ CONFIG_EXT3_FS_XATTR=y CONFIG_JBD=y # CONFIG_JBD_DEBUG is not set CONFIG_FS_MBCACHE=y -# CONFIG_REISERFS_FS is not set +CONFIG_REISERFS_FS=y +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set +# CONFIG_REISERFS_FS_XATTR is not set # CONFIG_JFS_FS is not set # CONFIG_XFS_FS is not set # CONFIG_MINIX_FS is not set @@ -675,13 +780,18 @@ CONFIG_FS_MBCACHE=y # # CD-ROM/DVD Filesystems # -# CONFIG_ISO9660_FS is not set +CONFIG_ISO9660_FS=y +CONFIG_JOLIET=y +CONFIG_ZISOFS=y +CONFIG_ZISOFS_FS=y # CONFIG_UDF_FS is not set # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +CONFIG_FAT_FS=m +CONFIG_MSDOS_FS=m +CONFIG_VFAT_FS=m # CONFIG_NTFS_FS is not set # @@ -721,11 +831,14 @@ CONFIG_NFS_FS=y CONFIG_NFS_V3=y # CONFIG_NFS_V4 is not set # CONFIG_NFS_DIRECTIO is not set -# CONFIG_NFSD is not set +CONFIG_NFSD=m +CONFIG_NFSD_V3=y +# CONFIG_NFSD_V4 is not set +CONFIG_NFSD_TCP=y CONFIG_ROOT_NFS=y CONFIG_LOCKD=y CONFIG_LOCKD_V4=y -# CONFIG_EXPORTFS is not set +CONFIG_EXPORTFS=m CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set # CONFIG_SMB_FS is not set @@ -791,10 +904,30 @@ CONFIG_NLS_ISO8859_1=y # # Cryptographic options # -# CONFIG_CRYPTO is not set +CONFIG_CRYPTO=y +CONFIG_CRYPTO_HMAC=y +# CONFIG_CRYPTO_NULL is not set +# CONFIG_CRYPTO_MD4 is not set +CONFIG_CRYPTO_MD5=m +CONFIG_CRYPTO_SHA1=m +# CONFIG_CRYPTO_SHA256 is not set +# CONFIG_CRYPTO_SHA512 is not set +CONFIG_CRYPTO_DES=m +# CONFIG_CRYPTO_BLOWFISH is not set +# CONFIG_CRYPTO_TWOFISH is not set +# CONFIG_CRYPTO_SERPENT is not set +CONFIG_CRYPTO_AES=m +# CONFIG_CRYPTO_CAST5 is not set +# CONFIG_CRYPTO_CAST6 is not set +# CONFIG_CRYPTO_ARC4 is not set +# CONFIG_CRYPTO_DEFLATE is not set +# CONFIG_CRYPTO_MICHAEL_MIC is not set +CONFIG_CRYPTO_CRC32C=m +# CONFIG_CRYPTO_TEST is not set # # Library routines # CONFIG_CRC32=y CONFIG_LIBCRC32C=y +CONFIG_ZLIB_INFLATE=y diff --git a/linux-2.6.7-xen-sparse/arch/xen/configs/xenU_defconfig b/linux-2.6.7-xen-sparse/arch/xen/configs/xenU_defconfig index a8cc83f752..2824268104 100644 --- a/linux-2.6.7-xen-sparse/arch/xen/configs/xenU_defconfig +++ b/linux-2.6.7-xen-sparse/arch/xen/configs/xenU_defconfig @@ -10,6 +10,7 @@ CONFIG_NO_IDLE_HZ=y # # CONFIG_XEN_PRIVILEGED_GUEST is not set # CONFIG_XEN_PHYSDEV_ACCESS is not set +# CONFIG_XEN_WRITABLE_PAGETABLES is not set # CONFIG_FOREIGN_PAGES is not set # CONFIG_PAGESIZED_SKBS is not set CONFIG_X86=y @@ -62,11 +63,6 @@ CONFIG_XENARCH="i386" CONFIG_MMU=y CONFIG_UID16=y CONFIG_GENERIC_ISA_DMA=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 @@ -76,9 +72,6 @@ CONFIG_MPENTIUM4=y # CONFIG_MK7 is not set # CONFIG_MK8 is not set # CONFIG_MCRUSOE 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 @@ -105,7 +98,6 @@ CONFIG_X86_CPUID=y # CONFIG_EDD is not set CONFIG_NOHIGHMEM=y # CONFIG_HIGHMEM4G is not set -# CONFIG_HIGHMEM64G is not set CONFIG_HAVE_DEC_LOCK=y # CONFIG_REGPARM is not set @@ -136,6 +128,59 @@ CONFIG_BINFMT_ELF=y # Generic Driver Options # +# +# 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 + +# +# SCSI low-level drivers +# +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_SATA is not set +# CONFIG_SCSI_EATA_PIO is not set +# CONFIG_SCSI_DEBUG is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD 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_SIZE=4096 +CONFIG_BLK_DEV_INITRD=y +# CONFIG_LBD is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set + # # Networking support # @@ -250,25 +295,33 @@ CONFIG_EXT3_FS_XATTR=y CONFIG_JBD=y # CONFIG_JBD_DEBUG is not set CONFIG_FS_MBCACHE=y -# CONFIG_REISERFS_FS is not set +CONFIG_REISERFS_FS=y +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set +# CONFIG_REISERFS_FS_XATTR is not set # CONFIG_JFS_FS is not set # CONFIG_XFS_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set -# CONFIG_AUTOFS_FS is not set -# CONFIG_AUTOFS4_FS is not set +CONFIG_AUTOFS_FS=y +CONFIG_AUTOFS4_FS=y # # CD-ROM/DVD Filesystems # -# CONFIG_ISO9660_FS is not set +CONFIG_ISO9660_FS=y +CONFIG_JOLIET=y +CONFIG_ZISOFS=y +CONFIG_ZISOFS_FS=y # CONFIG_UDF_FS is not set # # DOS/FAT/NT Filesystems # -# CONFIG_FAT_FS is not set +CONFIG_FAT_FS=m +CONFIG_MSDOS_FS=m +CONFIG_VFAT_FS=m # CONFIG_NTFS_FS is not set # @@ -278,7 +331,8 @@ CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y CONFIG_SYSFS=y # CONFIG_DEVFS_FS is not set -# CONFIG_DEVPTS_FS_XATTR is not set +CONFIG_DEVPTS_FS_XATTR=y +# CONFIG_DEVPTS_FS_SECURITY is not set CONFIG_TMPFS=y # CONFIG_HUGETLBFS is not set # CONFIG_HUGETLB_PAGE is not set @@ -378,10 +432,30 @@ CONFIG_NLS_ISO8859_1=y # # Cryptographic options # -# CONFIG_CRYPTO is not set +CONFIG_CRYPTO=y +# CONFIG_CRYPTO_HMAC is not set +# CONFIG_CRYPTO_NULL is not set +# CONFIG_CRYPTO_MD4 is not set +CONFIG_CRYPTO_MD5=m +# CONFIG_CRYPTO_SHA1 is not set +# CONFIG_CRYPTO_SHA256 is not set +# CONFIG_CRYPTO_SHA512 is not set +# CONFIG_CRYPTO_DES is not set +# CONFIG_CRYPTO_BLOWFISH is not set +# CONFIG_CRYPTO_TWOFISH is not set +# CONFIG_CRYPTO_SERPENT is not set +# CONFIG_CRYPTO_AES is not set +# CONFIG_CRYPTO_CAST5 is not set +# CONFIG_CRYPTO_CAST6 is not set +# CONFIG_CRYPTO_ARC4 is not set +# CONFIG_CRYPTO_DEFLATE is not set +# CONFIG_CRYPTO_MICHAEL_MIC is not set +CONFIG_CRYPTO_CRC32C=m +# CONFIG_CRYPTO_TEST is not set # # Library routines # -CONFIG_CRC32=y -CONFIG_LIBCRC32C=y +# CONFIG_CRC32 is not set +CONFIG_LIBCRC32C=m +CONFIG_ZLIB_INFLATE=y -- cgit v1.2.3 From 1143caf2de0467cec229d3f2b740f86d7530f885 Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Fri, 20 Aug 2004 16:23:45 +0000 Subject: bitkeeper revision 1.1159.48.1 (4126259181cq4hyB3cquYrgpQokAIQ) Framework for grant-table implementation in Xen. --- .rootkeys | 2 + xen/arch/x86/domain.c | 17 ++++-- xen/common/domain.c | 8 ++- xen/common/grant_table.c | 134 ++++++++++++++++++++++++++++++++++++++++++ xen/common/kernel.c | 2 + xen/common/page_alloc.c | 2 + xen/include/asm-x86/mm.h | 1 + xen/include/xen/grant_table.h | 38 ++++++++++++ xen/include/xen/sched.h | 8 +-- 9 files changed, 200 insertions(+), 12 deletions(-) create mode 100644 xen/common/grant_table.c create mode 100644 xen/include/xen/grant_table.h diff --git a/.rootkeys b/.rootkeys index 6089d9aa83..90083cba2e 100644 --- a/.rootkeys +++ b/.rootkeys @@ -571,6 +571,7 @@ 3ddb79bdYO5D8Av12NHqPeSviav7cg xen/common/domain.c 40f2b4a27xPOh3R6zD4M_aabz-TDyg xen/common/elf.c 3fba5b96H0khoxNiKbjdi0inpXV-Pw xen/common/event_channel.c +41262590gGIOn-1pvF5KpUu8Wb6_JA xen/common/grant_table.c 3ddb79bd9drcFPVxd4w2GPOIjLlXpA xen/common/kernel.c 3e4cd9d8LAAghUY0hNIK72uc2ch_Nw xen/common/keyhandler.c 3ddb79bduhSEZI8xa7IbGQCpap5y2A xen/common/lib.c @@ -719,6 +720,7 @@ 3ddb79c2O729EttZTYu1c8LcsUO_GQ xen/include/xen/elf.h 3ddb79c0HIghfBF8zFUdmXhOU8i6hA xen/include/xen/errno.h 3ddb79c1W0lQca8gRV7sN6j3iY4Luw xen/include/xen/event.h +41262590CyJy4vd42dnqzsn8-eeGvw xen/include/xen/grant_table.h 3ddb79c0GurNF9tDWqQbAwJFH8ugfA xen/include/xen/init.h 3ddb79c1nzaWu8NoF4xCCMSFJR4MlA xen/include/xen/ioport.h 3ddb79c2qAxCOABlkKtD8Txohe-qEw xen/include/xen/irq.h diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index c95d5021c9..7a3afdd753 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -472,13 +472,19 @@ void domain_relinquish_memory(struct domain *d) */ destroy_gdt(d); - /* Relinquish Xen-heap pages. Currently this can only be 'shared_info'. */ - page = virt_to_page(d->shared_info); - if ( test_and_clear_bit(_PGC_allocated, &page->u.inuse.count_info) ) - put_page(page); + /* Use a recursive lock, as we may enter 'free_domheap_page'. */ + spin_lock_recursive(&d->page_alloc_lock); + + /* Relinquish Xen-heap pages. */ + list_for_each_safe ( ent, tmp, &d->xenpage_list ) + { + page = list_entry(ent, struct pfn_info, list); + + if ( test_and_clear_bit(_PGC_allocated, &page->u.inuse.count_info) ) + put_page(page); + } /* Relinquish all pages on the domain's allocation list. */ - spin_lock_recursive(&d->page_alloc_lock); /* may enter free_domheap_page */ list_for_each_safe ( ent, tmp, &d->page_list ) { page = list_entry(ent, struct pfn_info, list); @@ -507,6 +513,7 @@ void domain_relinquish_memory(struct domain *d) } while ( unlikely(y != x) ); } + spin_unlock_recursive(&d->page_alloc_lock); } diff --git a/xen/common/domain.c b/xen/common/domain.c index 4ca9f58135..7f5d2bafe8 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -45,7 +45,7 @@ struct domain *do_createdomain(domid_t dom_id, unsigned int cpu) spin_lock_init(&d->page_alloc_lock); INIT_LIST_HEAD(&d->page_list); - d->max_pages = d->tot_pages = 0; + INIT_LIST_HEAD(&d->xenpage_list); /* Per-domain PCI-device list. */ spin_lock_init(&d->pcidev_lock); @@ -53,12 +53,13 @@ struct domain *do_createdomain(domid_t dom_id, unsigned int cpu) if ( d->domain != IDLE_DOMAIN_ID ) { - if ( init_event_channels(d) != 0 ) + if ( (init_event_channels(d) != 0) || (grant_table_create(d) != 0) ) { + destroy_event_channels(d); free_domain_struct(d); return NULL; } - + /* We use a large intermediate to avoid overflow in sprintf. */ sprintf(buf, "Domain-%u", dom_id); strncpy(d->name, buf, MAX_DOMAIN_NAME); @@ -256,6 +257,7 @@ void domain_destruct(struct domain *d) write_unlock_irqrestore(&tasklist_lock, flags); destroy_event_channels(d); + grant_table_destroy(d); free_perdomain_pt(d); free_xenheap_page((unsigned long)d->shared_info); diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c new file mode 100644 index 0000000000..f1a73cb36a --- /dev/null +++ b/xen/common/grant_table.c @@ -0,0 +1,134 @@ +/****************************************************************************** + * common/grant_table.c + * + * Mechanism for granting foreign access to page frames, and receiving + * page-ownership transfers. + * + * Copyright (c) 2004 K A Fraser + * + * 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 + */ + +#define __GRANT_TABLE_IMPLEMENTATION__ +typedef struct grant_table grant_table_t; + +#include +#include +#include + +/* Active grant entry - used for shadowing GTF_permit_access grants. */ +typedef struct { + u32 counts; /* Reference count information. */ + u16 next; /* Mapping hash chain. */ + domid_t domid; /* Domain being granted access. */ + unsigned long frame; /* Frame being granted. */ +} active_grant_entry_t; + +/* Bitfields in active_grant_entry_t:counts. */ + /* Grant is pinned by 'domid' for read mappings and I/O. */ +#define _GNTCNT_read_pinned (0) +#define GNTCNT_read_pinned (1<<_GNTCNT_read_pinned) + /* Grant is pinned by 'domid' for write mappings and I/O. */ +#define _GNTCNT_write_pinned (1) +#define GNTCNT_write_pinned (1<<_GNTCNT_write_pinned) + /* Grant is pinned in IOMMU (read-only unless GNTCNT_write_pinned). */ +#define _GNTCNT_io_pinned (2) +#define GNTCNT_io_pinned (1<<_GNTCNT_io_pinned) + /* Grant is mappable (read-only unless GNTCNT_write_pinned). */ +#define _GNTCNT_mappable (3) +#define GNTCNT_mappable (1<<_GNTCNT_mappable) + /* Count of writable page mappings. (!GNTCNT_write_pinned => count==0). */ +#define GNTCNT_wmap_shift (4) +#define GNTCNT_wmap_mask (0x3FFFU << GNTCNT_wmap_shift) + /* Count of read-only page mappings. */ +#define GNTCNT_rmap_shift (18) +#define GNTCNT_rmap_mask (0x3FFFU << GNTCNT_rmap_shift) + +#define MAPHASH_SZ (256) +#define MAPHASH(_k) ((_k) & (MAPHASH_SZ-1)) +#define MAPHASH_INVALID (0xFFFFU) + +#define NR_GRANT_ENTRIES (PAGE_SIZE / sizeof(grant_entry_t)) + +/* Per-domain grant information. */ +struct grant_table { + /* Shared grant table (see include/hypervisor-ifs/grant_table.h). */ + grant_entry_t *shared; + /* Active grant table. */ + active_grant_entry_t *active; + /* Lock protecting updates to maphash and shared grant table. */ + spinlock_t lock; + /* Hash table: frame -> active grant entry. */ + u16 maphash[MAPHASH_SZ]; +}; + +int grant_table_create(struct domain *d) +{ + grant_table_t *t; + int i; + + if ( (t = xmalloc(sizeof(grant_table_t))) == NULL ) + goto no_mem; + + /* Simple stuff. */ + t->shared = NULL; + t->active = NULL; + spin_lock_init(&t->lock); + for ( i = 0; i < MAPHASH_SZ; i++ ) + t->maphash[i] = MAPHASH_INVALID; + + /* Active grant-table page. */ + if ( (t->active = xmalloc(sizeof(active_grant_entry_t) * + NR_GRANT_ENTRIES)) == NULL ) + goto no_mem; + + /* Set up shared grant-table page. */ + if ( (t->shared = (void *)alloc_xenheap_page()) == NULL ) + goto no_mem; + memset(t->shared, 0, PAGE_SIZE); + SHARE_PFN_WITH_DOMAIN(virt_to_page(t->shared), d); + + /* Okay, install the structure. */ + d->grant_table = t; + return 0; + + no_mem: + if ( t != NULL ) + { + if ( t->active != NULL ) + xfree(t->active); + xfree(t); + } + return -ENOMEM; +} + +void grant_table_destroy(struct domain *d) +{ + grant_table_t *t; + + if ( (t = d->grant_table) != NULL ) + { + /* Free memory relating to this grant table. */ + d->grant_table = NULL; + free_xenheap_page((unsigned long)t->shared); + xfree(t->active); + xfree(t); + } +} + +void grant_table_init(void) +{ + /* Nothing. */ +} diff --git a/xen/common/kernel.c b/xen/common/kernel.c index 707cede7f1..6c0775c9d2 100644 --- a/xen/common/kernel.c +++ b/xen/common/kernel.c @@ -304,6 +304,8 @@ void cmain(multiboot_info_t *mbi) start_of_day(); + grant_table_init(); + /* Create initial domain 0. */ new_dom = do_createdomain(0, 0); if ( new_dom == NULL ) diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 323ecd244e..52da9c042b 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -418,6 +418,8 @@ void free_domheap_pages(struct pfn_info *pg, int order) if ( unlikely(IS_XEN_HEAP_FRAME(pg)) ) { spin_lock_recursive(&d->page_alloc_lock); + for ( i = 0; i < (1 << order); i++ ) + list_del(&pg[i].list); d->xenheap_pages -= 1 << order; drop_dom_ref = (d->xenheap_pages == 0); spin_unlock_recursive(&d->page_alloc_lock); diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h index a2fc40e0b3..5cd3c01ae6 100644 --- a/xen/include/asm-x86/mm.h +++ b/xen/include/asm-x86/mm.h @@ -109,6 +109,7 @@ struct pfn_info (_pfn)->u.inuse.count_info = PGC_allocated | 1; \ if ( unlikely((_dom)->xenheap_pages++ == 0) ) \ get_knownalive_domain(_dom); \ + list_add_tail(&(_pfn)->list, &(_dom)->xenpage_list); \ spin_unlock(&(_dom)->page_alloc_lock); \ } while ( 0 ) diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h new file mode 100644 index 0000000000..92a81de929 --- /dev/null +++ b/xen/include/xen/grant_table.h @@ -0,0 +1,38 @@ +/****************************************************************************** + * include/xen/grant_table.h + * + * Mechanism for granting foreign access to page frames, and receiving + * page-ownership transfers. + * + * Copyright (c) 2004 K A Fraser + * + * 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 + */ + +#ifndef __XEN_GRANT_H__ +#define __XEN_GRANT_H__ + +#ifndef __GRANT_TABLE_IMPLEMENTATION__ +typedef void grant_table_t; +#endif + +/* Start-of-day system initialisation. */ +void grant_table_init(void); + +/* Create/destroy per-domain grant table context. */ +int grant_table_create(struct domain *d); +void grant_table_destroy(struct domain *d); + +#endif /* __XEN_GRANT_H__ */ diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index af74cf5380..dfea4b7509 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -4,16 +4,13 @@ #include #include #include -#ifdef LINUX_2_6 -#include -#endif #include #include #include #include #include #include - +#include #include #include #include @@ -95,6 +92,7 @@ struct domain spinlock_t page_alloc_lock; /* protects all the following fields */ struct list_head page_list; /* linked list, of size tot_pages */ + struct list_head xenpage_list; /* linked list, of size xenheap_pages */ unsigned int tot_pages; /* number of pages currently possesed */ unsigned int max_pages; /* maximum value for tot_pages */ unsigned int xenheap_pages; /* # pages allocated from Xen heap */ @@ -121,6 +119,8 @@ struct domain unsigned int max_event_channel; spinlock_t event_channel_lock; + grant_table_t *grant_table; + /* * Interrupt to event-channel mappings. Updates should be protected by the * domain's event-channel spinlock. Read accesses can also synchronise on -- cgit v1.2.3 From ec114986f0332aedfb148ca5aa19570bc14c6740 Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Fri, 20 Aug 2004 16:42:16 +0000 Subject: bitkeeper revision 1.1159.45.14 (412629e8AO8Ty3LNUQeMVLVbHFMAQQ) Fix SET_FOREIGNDOM --- xen/arch/x86/memory.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/memory.c b/xen/arch/x86/memory.c index 5152e39648..1cced82a7d 100644 --- a/xen/arch/x86/memory.c +++ b/xen/arch/x86/memory.c @@ -864,12 +864,17 @@ static int do_extended_command(unsigned long ptr, unsigned long val) case MMUEXT_SET_FOREIGNDOM: domid = (domid_t)(val >> 16); + if ( (e = percpu_info[cpu].foreign) != NULL ) + put_domain(e); + percpu_info[cpu].foreign = NULL; + if ( !IS_PRIV(d) ) { switch ( domid ) { case DOMID_IO: - get_knownalive_domain(e = dom_io); + get_knownalive_domain(dom_io); + percpu_info[cpu].foreign = dom_io; break; default: MEM_LOG("Dom %u cannot set foreign dom\n", d->domain); @@ -879,19 +884,18 @@ static int do_extended_command(unsigned long ptr, unsigned long val) } else { - if ( (e = percpu_info[cpu].foreign) != NULL ) - put_domain(e); - percpu_info[cpu].foreign = e = find_domain_by_id(domid); if ( e == NULL ) { switch ( domid ) { case DOMID_XEN: - get_knownalive_domain(e = dom_xen); + get_knownalive_domain(dom_xen); + percpu_info[cpu].foreign = dom_xen; break; case DOMID_IO: - get_knownalive_domain(e = dom_io); + get_knownalive_domain(dom_io); + percpu_info[cpu].foreign = dom_io; break; default: MEM_LOG("Unknown domain '%u'", domid); -- cgit v1.2.3 From 6e92cd3227a9d10e90dea2e4f687f1386d706508 Mon Sep 17 00:00:00 2001 From: "iap10@tetris.cl.cam.ac.uk" Date: Fri, 20 Aug 2004 17:46:52 +0000 Subject: bitkeeper revision 1.1159.45.15 (4126390c2dSRHYLR3YNd9JysCy4XTw) Export new mapping interface 'xc_map_foreign' --- tools/libxc/xc.h | 7 +++++++ tools/libxc/xc_linux_restore.c | 4 ++-- tools/libxc/xc_linux_save.c | 37 ++++++++++++++------------------- tools/libxc/xc_private.c | 4 ++-- tools/libxc/xc_private.h | 17 ---------------- tools/python/xen/lowlevel/xu/xu.c | 43 ++++++++++++++++----------------------- 6 files changed, 43 insertions(+), 69 deletions(-) diff --git a/tools/libxc/xc.h b/tools/libxc/xc.h index 8b54ed0207..0da159d870 100644 --- a/tools/libxc/xc.h +++ b/tools/libxc/xc.h @@ -231,4 +231,11 @@ int xc_domain_setmaxmem(int xc_handle, unsigned int max_memkb); +void *xc_map_foreign_range(int xc_handle, u32 dom, + int size, int prot, + unsigned long mfn ); + +void *xc_map_foreign_batch(int xc_handle, u32 dom, int prot, + unsigned long *arr, int num ); + #endif /* __XC_H__ */ diff --git a/tools/libxc/xc_linux_restore.c b/tools/libxc/xc_linux_restore.c index 6d4f0906aa..3c984b4f19 100644 --- a/tools/libxc/xc_linux_restore.c +++ b/tools/libxc/xc_linux_restore.c @@ -325,7 +325,7 @@ int xc_linux_restore(int xc_handle, XcIOContext *ioctxt) } } - if ( (region_base = mfn_mapper_map_batch( xc_handle, dom, + if ( (region_base = xc_map_foreign_batch( xc_handle, dom, PROT_WRITE, region_mfn, j )) == 0 ) @@ -631,7 +631,7 @@ printf("XXXXXXXXXXXXXXX pin L2\n"); } if ( (live_pfn_to_mfn_table = - mfn_mapper_map_batch(xc_handle, dom, + xc_map_foreign_batch(xc_handle, dom, PROT_WRITE, pfn_to_mfn_frame_list, (nr_pfns+1023)/1024 )) == 0 ) diff --git a/tools/libxc/xc_linux_save.c b/tools/libxc/xc_linux_save.c index cfcc6cd0c8..57b4f1ab56 100644 --- a/tools/libxc/xc_linux_save.c +++ b/tools/libxc/xc_linux_save.c @@ -30,18 +30,8 @@ /* * Returns TRUE if the given machine frame number has a unique mapping * in the guest's pseudophysical map. - * 0x80000000-3 mark the shared_info, and blk/net rings */ -#if 0 -#define MFN_IS_IN_PSEUDOPHYS_MAP(_mfn) \ - (((_mfn) < (1024*1024)) && \ - (((live_mfn_to_pfn_table[_mfn] < nr_pfns) && \ - (live_pfn_to_mfn_table[live_mfn_to_pfn_table[_mfn]] == (_mfn))) || \ - ((live_mfn_to_pfn_table[_mfn] >= 0x80000000) && \ - (live_mfn_to_pfn_table[_mfn] <= 0x80000003)) || \ - (live_pfn_to_mfn_table[live_mfn_to_pfn_table[_mfn]] == 0x80000004))) -#endif #define MFN_IS_IN_PSEUDOPHYS_MAP(_mfn) \ (((_mfn) < (1024*1024)) && \ ((live_mfn_to_pfn_table[_mfn] < nr_pfns) && \ @@ -60,6 +50,8 @@ _res; \ }) +#define is_mapped(pfn) (!((pfn) & 0x80000000UL)) + static inline int test_bit ( int nr, volatile void * addr) { return (((unsigned long*)addr)[nr/(sizeof(unsigned long)*8)] >> @@ -384,7 +376,7 @@ int xc_linux_save(int xc_handle, XcIOContext *ioctxt) /* Map the shared info frame */ - live_shinfo = mfn_mapper_map_single(xc_handle, domid, + live_shinfo = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE, PROT_READ, shared_info_frame); @@ -395,7 +387,7 @@ int xc_linux_save(int xc_handle, XcIOContext *ioctxt) /* the pfn_to_mfn_frame_list fits in a single page */ live_pfn_to_mfn_frame_list = - mfn_mapper_map_single(xc_handle, domid, + xc_map_foreign_range(xc_handle, domid, PAGE_SIZE, PROT_READ, live_shinfo->arch.pfn_to_mfn_frame_list ); @@ -410,7 +402,7 @@ int xc_linux_save(int xc_handle, XcIOContext *ioctxt) (its not clear why it would want to change them, and we'll be OK from a safety POV anyhow. */ - live_pfn_to_mfn_table = mfn_mapper_map_batch(xc_handle, domid, + live_pfn_to_mfn_table = xc_map_foreign_batch(xc_handle, domid, PROT_READ, live_pfn_to_mfn_frame_list, (nr_pfns+1023)/1024 ); @@ -421,12 +413,12 @@ int xc_linux_save(int xc_handle, XcIOContext *ioctxt) /* Setup the mfn_to_pfn table mapping */ mfn_to_pfn_table_start_mfn = xc_get_m2p_start_mfn( xc_handle ); - +printf("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n"); live_mfn_to_pfn_table = - mfn_mapper_map_single(xc_handle, DOMID_XEN, + xc_map_foreign_range(xc_handle, DOMID_XEN, PAGE_SIZE*1024, PROT_READ, mfn_to_pfn_table_start_mfn ); - +printf("BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB\n"); /* Canonicalise the pfn-to-mfn table frame-number list. */ memcpy( pfn_to_mfn_frame_list, live_pfn_to_mfn_frame_list, PAGE_SIZE ); @@ -530,7 +522,7 @@ printf("GO LIVE!!\n"); { mfn = live_pfn_to_mfn_table[i]; - if( (live_mfn_to_pfn_table[mfn] != i) && (mfn != 0x80000001) ) + if( (live_mfn_to_pfn_table[mfn] != i) && (mfn != 0xffffffffUL) ) { printf("i=0x%x mfn=%lx live_mfn_to_pfn_table=%lx\n", i,mfn,live_mfn_to_pfn_table[mfn]); @@ -629,7 +621,8 @@ printf("GO LIVE!!\n"); pfn_batch[batch] = n; pfn_type[batch] = live_pfn_to_mfn_table[n]; - if( pfn_type[batch] == 0x80000001 ){ + if( ! is_mapped(pfn_type[batch]) ) + { /* not currently in pusedo-physical map -- set bit in to_fix that we must send this page in last_iter unless its sent sooner anyhow */ @@ -660,7 +653,7 @@ printf("GO LIVE!!\n"); if ( batch == 0 ) goto skip; /* vanishingly unlikely... */ - if ( (region_base = mfn_mapper_map_batch(xc_handle, domid, + if ( (region_base = xc_map_foreign_batch(xc_handle, domid, PROT_READ, pfn_type, batch)) == 0 ){ @@ -870,7 +863,7 @@ printf("type fail: page %i mfn %08lx\n",j,pfn_type[j]); for ( i = 0, j = 0; i < nr_pfns; i++ ) { - if ( live_pfn_to_mfn_table[i] >= 0x80000000UL ) + if ( ! is_mapped(live_pfn_to_mfn_table[i]) ) j++; } @@ -882,7 +875,7 @@ printf("type fail: page %i mfn %08lx\n",j,pfn_type[j]); for ( i = 0, j = 0; i < nr_pfns; ) { - if ( live_pfn_to_mfn_table[i] >= 0x80000000UL ) + if ( ! is_mapped(live_pfn_to_mfn_table[i]) ) { pfntab[j++] = i; } @@ -901,7 +894,7 @@ printf("type fail: page %i mfn %08lx\n",j,pfn_type[j]); /* Map the suspend-record MFN to pin it. The page must be owned by domid for this to succeed. */ - p_srec = mfn_mapper_map_single(xc_handle, domid, + p_srec = xc_map_foreign_range(xc_handle, domid, sizeof(*p_srec), PROT_READ, ctxt.cpu_ctxt.esi); if (!p_srec){ diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c index 47d2fa5230..795ac6e83b 100644 --- a/tools/libxc/xc_private.c +++ b/tools/libxc/xc_private.c @@ -133,7 +133,7 @@ void unmap_pfn(void *pm_handle, void *vaddr) /*******************/ -void *mfn_mapper_map_batch(int xc_handle, domid_t dom, int prot, +void *xc_map_foreign_batch(int xc_handle, u32 dom, int prot, unsigned long *arr, int num ) { privcmd_mmapbatch_t ioctlx; @@ -158,7 +158,7 @@ void *mfn_mapper_map_batch(int xc_handle, domid_t dom, int prot, /*******************/ -void *mfn_mapper_map_single(int xc_handle, domid_t dom, +void *xc_map_foreign_range(int xc_handle, u32 dom, int size, int prot, unsigned long mfn ) { diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h index d70f7df58a..9da98a25ab 100644 --- a/tools/libxc/xc_private.h +++ b/tools/libxc/xc_private.h @@ -220,23 +220,6 @@ typedef struct mfn_mapper { } mfn_mapper_t; -void * mfn_mapper_map_single(int xc_handle, domid_t dom, int size, int prot, - unsigned long mfn ); - -void * mfn_mapper_map_batch(int xc_handle, domid_t dom, int prot, - unsigned long *arr, int num ); - -mfn_mapper_t * mfn_mapper_init(int xc_handle, domid_t dom, int size, int prot); - -void * mfn_mapper_base(mfn_mapper_t *t); - -void mfn_mapper_close(mfn_mapper_t *t); - -int mfn_mapper_flush_queue(mfn_mapper_t *t); - -void * mfn_mapper_queue_entry(mfn_mapper_t *t, int offset, - unsigned long mfn, int size ); - long long xc_domain_get_cpu_usage( int xc_handle, domid_t domid ); #include "xc_io.h" diff --git a/tools/python/xen/lowlevel/xu/xu.c b/tools/python/xen/lowlevel/xu/xu.c index 3b078e7d33..344cb8cc4b 100644 --- a/tools/python/xen/lowlevel/xu/xu.c +++ b/tools/python/xen/lowlevel/xu/xu.c @@ -679,11 +679,12 @@ static PyTypeObject xu_message_type = { * *********************** PORT *********************** */ -static control_if_t *map_control_interface(int fd, unsigned long pfn) +static control_if_t *map_control_interface(int fd, unsigned long pfn, + u32 dom) { - char *vaddr = mmap(NULL, PAGE_SIZE, PROT_READ|PROT_WRITE, - MAP_SHARED, fd, pfn * PAGE_SIZE); - if ( vaddr == MAP_FAILED ) + char *vaddr = xc_map_foreign_range( fd, dom, PAGE_SIZE, + PROT_READ|PROT_WRITE, pfn ); + if ( vaddr == NULL ) return NULL; return (control_if_t *)(vaddr + 2048); } @@ -695,8 +696,8 @@ static void unmap_control_interface(int fd, control_if_t *c) typedef struct xu_port_object { PyObject_HEAD; - int mem_fd; int xc_handle; + int connected; u32 remote_dom; int local_port, remote_port; control_if_t *interface; @@ -908,35 +909,25 @@ static int __xu_port_connect(xu_port_object *xup) { xc_dominfo_t info; - if ( xup->mem_fd != -1 ) - return 0; - - if ( (xup->mem_fd = open("/dev/mem", O_RDWR)) == -1 ) + if ( xup->connected ) { - PyErr_SetString(port_error, "Could not open '/dev/mem'"); - return -1; + return 0; } - set_cloexec(xup->mem_fd); - - /* Set the General-Purpose Subject whose page frame will be mapped. */ - (void)ioctl(xup->mem_fd, _IO('M', 1), (unsigned long)xup->remote_dom); if ( (xc_domain_getinfo(xup->xc_handle, xup->remote_dom, 1, &info) != 1) || (info.domid != xup->remote_dom) ) { PyErr_SetString(port_error, "Failed to obtain domain status"); - (void)close(xup->mem_fd); - xup->mem_fd = -1; return -1; } xup->interface = - map_control_interface(xup->mem_fd, info.shared_info_frame); + map_control_interface(xup->xc_handle, info.shared_info_frame, + xup->remote_dom); + if ( xup->interface == NULL ) { PyErr_SetString(port_error, "Failed to map domain control interface"); - (void)close(xup->mem_fd); - xup->mem_fd = -1; return -1; } @@ -946,16 +937,16 @@ static int __xu_port_connect(xu_port_object *xup) xup->rx_req_prod = xup->interface->rx_req_prod; xup->rx_resp_cons = xup->interface->rx_resp_prod; + xup->connected = 1; + return 0; } static void __xu_port_disconnect(xu_port_object *xup) { - if ( xup->mem_fd == -1 ) - return; - unmap_control_interface(xup->mem_fd, xup->interface); - (void)close(xup->mem_fd); - xup->mem_fd = -1; + if ( xup->connected ) + unmap_control_interface(xup->xc_handle, xup->interface); + xup->connected = 0; } static PyObject *xu_port_connect(PyObject *self, PyObject *args) @@ -1057,8 +1048,8 @@ static PyObject *xu_port_new(PyObject *self, PyObject *args) xup = PyObject_New(xu_port_object, &xu_port_type); + xup->connected = 0; xup->remote_dom = dom; - xup->mem_fd = -1; /* currently disconnected */ if ( (xup->xc_handle = xc_interface_open()) == -1 ) { -- cgit v1.2.3 From 23bb5ee5188adeb6a37b8294c14aff5f4256d8d8 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Fri, 20 Aug 2004 18:19:24 +0000 Subject: bitkeeper revision 1.1159.45.16 (412640acjI6W8MIoA2W2ArmKgPNJcA) Fix bad migration interaction with /lib/tls emulation code. --- linux-2.6.7-xen-sparse/arch/xen/kernel/reboot.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/linux-2.6.7-xen-sparse/arch/xen/kernel/reboot.c b/linux-2.6.7-xen-sparse/arch/xen/kernel/reboot.c index 83fec94857..ff56d12631 100644 --- a/linux-2.6.7-xen-sparse/arch/xen/kernel/reboot.c +++ b/linux-2.6.7-xen-sparse/arch/xen/kernel/reboot.c @@ -94,6 +94,13 @@ static void __do_suspend(void) HYPERVISOR_suspend(virt_to_machine(suspend_record) >> PAGE_SHIFT); + HYPERVISOR_vm_assist(VMASST_CMD_enable, + VMASST_TYPE_4gb_segments); +#ifdef CONFIG_XEN_WRITABLE_PAGETABLES + HYPERVISOR_vm_assist(VMASST_CMD_enable, + VMASST_TYPE_writeable_pagetables); +#endif + shutting_down = -1; memcpy(&start_info, &suspend_record->resume_info, sizeof(start_info)); -- cgit v1.2.3