[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [linux-2.6.18-xen] merge with linux-2.6.18-xen.hg
# HG changeset patch # User Alex Williamson <alex.williamson@xxxxxx> # Date 1207070971 21600 # Node ID ad7ad9af265e3276d084f8074192bec9d3867747 # Parent bb2f8ba47833ad7798957bd64670ec5019127c8c # Parent 06ffa3eb5e3ff1cf517c15b40a8cd757bc827950 merge with linux-2.6.18-xen.hg --- Documentation/i2c/busses/i2c-i801 | 5 arch/i386/kernel/pci-dma-xen.c | 33 ++++ arch/i386/pci/irq-xen.c | 4 arch/i386/pci/irq.c | 4 drivers/i2c/busses/Kconfig | 1 drivers/i2c/busses/i2c-i801.c | 4 drivers/scsi/ahci.c | 6 drivers/scsi/ata_piix.c | 40 +++++ drivers/xen/balloon/sysfs.c | 2 drivers/xen/blkback/blkback.c | 4 drivers/xen/blkfront/blkfront.c | 2 drivers/xen/core/gnttab.c | 39 ++--- drivers/xen/core/xen_sysfs.c | 4 drivers/xen/fbfront/xenfb.c | 197 +++++++++++++++++++++++----- drivers/xen/fbfront/xenkbd.c | 10 + drivers/xen/pciback/passthrough.c | 10 + drivers/xen/pciback/xenbus.c | 20 +- drivers/xen/pcifront/xenbus.c | 2 drivers/xen/xenbus/xenbus_xs.c | 31 +++- include/asm-i386/mach-xen/asm/dma-mapping.h | 8 - include/asm-i386/mach-xen/asm/page.h | 7 include/linux/pci_ids.h | 6 include/xen/interface/arch-ia64.h | 6 include/xen/interface/arch-ia64/sioemu.h | 42 +++++ include/xen/interface/arch-powerpc.h | 2 include/xen/interface/arch-x86/hvm/save.h | 3 include/xen/interface/arch-x86/xen-x86_64.h | 2 include/xen/interface/arch-x86/xen.h | 2 include/xen/interface/domctl.h | 19 ++ include/xen/interface/hvm/ioreq.h | 10 - include/xen/interface/hvm/params.h | 5 include/xen/interface/hvm/save.h | 4 include/xen/interface/io/fbif.h | 29 +++- include/xen/interface/io/ring.h | 24 ++- include/xen/interface/io/xs_wire.h | 3 include/xen/interface/kexec.h | 8 - include/xen/interface/physdev.h | 6 include/xen/interface/trace.h | 8 + include/xen/interface/xen-compat.h | 9 - include/xen/interface/xen.h | 6 sound/pci/hda/hda_intel.c | 3 41 files changed, 501 insertions(+), 129 deletions(-) diff -r bb2f8ba47833 -r ad7ad9af265e Documentation/i2c/busses/i2c-i801 --- a/Documentation/i2c/busses/i2c-i801 Tue Mar 25 12:37:54 2008 -0600 +++ b/Documentation/i2c/busses/i2c-i801 Tue Apr 01 11:29:31 2008 -0600 @@ -10,6 +10,11 @@ Supported adapters: * Intel 6300ESB * Intel 82801FB/FR/FW/FRW (ICH6) * Intel ICH7 + * Intel 82801G (ICH7) + * Intel 82801H (ICH9) + * Intel 82801I (ICH9) + * Intel Tolapai + * Intel ICH10 Datasheets: Publicly available at the Intel website Authors: diff -r bb2f8ba47833 -r ad7ad9af265e arch/i386/kernel/pci-dma-xen.c --- a/arch/i386/kernel/pci-dma-xen.c Tue Mar 25 12:37:54 2008 -0600 +++ b/arch/i386/kernel/pci-dma-xen.c Tue Apr 01 11:29:31 2008 -0600 @@ -76,6 +76,39 @@ do { \ BUG(); \ } \ } while (0) + +static int check_pages_physically_contiguous(unsigned long pfn, + unsigned int offset, + size_t length) +{ + unsigned long next_mfn; + int i; + int nr_pages; + + next_mfn = pfn_to_mfn(pfn); + nr_pages = (offset + length + PAGE_SIZE-1) >> PAGE_SHIFT; + + for (i = 1; i < nr_pages; i++) { + if (pfn_to_mfn(++pfn) != ++next_mfn) + return 0; + } + return 1; +} + +int range_straddles_page_boundary(paddr_t p, size_t size) +{ + extern unsigned long *contiguous_bitmap; + unsigned long pfn = p >> PAGE_SHIFT; + unsigned int offset = p & ~PAGE_MASK; + + if (offset + size <= PAGE_SIZE) + return 0; + if (test_bit(pfn, contiguous_bitmap)) + return 0; + if (check_pages_physically_contiguous(pfn, offset, size)) + return 0; + return 1; +} int dma_map_sg(struct device *hwdev, struct scatterlist *sg, int nents, diff -r bb2f8ba47833 -r ad7ad9af265e arch/i386/pci/irq-xen.c --- a/arch/i386/pci/irq-xen.c Tue Mar 25 12:37:54 2008 -0600 +++ b/arch/i386/pci/irq-xen.c Tue Apr 01 11:29:31 2008 -0600 @@ -553,6 +553,10 @@ static __init int intel_router_probe(str case PCI_DEVICE_ID_INTEL_ICH9_3: case PCI_DEVICE_ID_INTEL_ICH9_4: case PCI_DEVICE_ID_INTEL_ICH9_5: + case PCI_DEVICE_ID_INTEL_ICH10_0: + case PCI_DEVICE_ID_INTEL_ICH10_1: + case PCI_DEVICE_ID_INTEL_ICH10_2: + case PCI_DEVICE_ID_INTEL_ICH10_3: r->name = "PIIX/ICH"; r->get = pirq_piix_get; r->set = pirq_piix_set; diff -r bb2f8ba47833 -r ad7ad9af265e arch/i386/pci/irq.c --- a/arch/i386/pci/irq.c Tue Mar 25 12:37:54 2008 -0600 +++ b/arch/i386/pci/irq.c Tue Apr 01 11:29:31 2008 -0600 @@ -549,6 +549,10 @@ static __init int intel_router_probe(str case PCI_DEVICE_ID_INTEL_ICH9_3: case PCI_DEVICE_ID_INTEL_ICH9_4: case PCI_DEVICE_ID_INTEL_ICH9_5: + case PCI_DEVICE_ID_INTEL_ICH10_0: + case PCI_DEVICE_ID_INTEL_ICH10_1: + case PCI_DEVICE_ID_INTEL_ICH10_2: + case PCI_DEVICE_ID_INTEL_ICH10_3: r->name = "PIIX/ICH"; r->get = pirq_piix_get; r->set = pirq_piix_set; diff -r bb2f8ba47833 -r ad7ad9af265e drivers/i2c/busses/Kconfig --- a/drivers/i2c/busses/Kconfig Tue Mar 25 12:37:54 2008 -0600 +++ b/drivers/i2c/busses/Kconfig Tue Apr 01 11:29:31 2008 -0600 @@ -126,6 +126,7 @@ config I2C_I801 ESB2 ICH8 ICH9 + ICH10 This driver can also be built as a module. If so, the module will be called i2c-i801. diff -r bb2f8ba47833 -r ad7ad9af265e drivers/i2c/busses/i2c-i801.c --- a/drivers/i2c/busses/i2c-i801.c Tue Mar 25 12:37:54 2008 -0600 +++ b/drivers/i2c/busses/i2c-i801.c Tue Apr 01 11:29:31 2008 -0600 @@ -34,6 +34,8 @@ ESB2 269B ICH8 283E ICH9 2930 + ICH10 3A30 + ICH10 3A60 This driver supports several versions of Intel's I/O Controller Hubs (ICH). For SMBus support, they are similar to the PIIX4 and are part of Intel's '810' and other chipsets. @@ -459,6 +461,8 @@ static struct pci_device_id i801_ids[] = { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB2_17) }, { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_5) }, { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_6) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH10_4) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH10_5) }, { 0, } }; diff -r bb2f8ba47833 -r ad7ad9af265e drivers/scsi/ahci.c --- a/drivers/scsi/ahci.c Tue Mar 25 12:37:54 2008 -0600 +++ b/drivers/scsi/ahci.c Tue Apr 01 11:29:31 2008 -0600 @@ -339,6 +339,12 @@ static const struct pci_device_id ahci_p board_ahci }, /* ICH9 */ { PCI_VENDOR_ID_INTEL, 0x294e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, board_ahci }, /* ICH9M */ + { PCI_VENDOR_ID_INTEL, 0x3a02, PCI_ANY_ID, PCI_ANY_ID, 0, 0, + board_ahci }, /* ICH10 */ + { PCI_VENDOR_ID_INTEL, 0x3a05, PCI_ANY_ID, PCI_ANY_ID, 0, 0, + board_ahci }, /* ICH10 */ + { PCI_VENDOR_ID_INTEL, 0x3a25, PCI_ANY_ID, PCI_ANY_ID, 0, 0, + board_ahci }, /* ICH10 */ /* JMicron */ { 0x197b, 0x2360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, diff -r bb2f8ba47833 -r ad7ad9af265e drivers/scsi/ata_piix.c --- a/drivers/scsi/ata_piix.c Tue Mar 25 12:37:54 2008 -0600 +++ b/drivers/scsi/ata_piix.c Tue Apr 01 11:29:31 2008 -0600 @@ -126,6 +126,7 @@ enum { ich7m_sata_ahci = 7, ich8_sata_ahci = 8, ich9_sata_ahci = 9, + ich8_2port_sata = 10, /* constants for mapping table */ P0 = 0, /* port 0 */ @@ -193,10 +194,10 @@ static const struct pci_device_id piix_p { 0x8086, 0x27c4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich7m_sata_ahci }, /* Enterprise Southbridge 2 (where's the datasheet?) */ { 0x8086, 0x2680, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci }, - /* SATA Controller 1 IDE (ICH8, no datasheet yet) */ + /* SATA Controller 1 IDE (ICH8) */ { 0x8086, 0x2820, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, - /* SATA Controller 2 IDE (ICH8, ditto) */ - { 0x8086, 0x2825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, + /* SATA Controller 2 IDE (ICH8) */ + { 0x8086, 0x2825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, /* Mobile SATA Controller IDE (ICH8M, ditto) */ { 0x8086, 0x2828, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, /* SATA Controller 1 IDE (ICH9) */ @@ -211,6 +212,14 @@ static const struct pci_device_id piix_p { 0x8086, 0x292d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_sata_ahci }, /* Mobile SATA Controller 2 IDE (ICH9M) */ { 0x8086, 0x292e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich9_sata_ahci }, + /* SATA Controller IDE (ICH10) */ + { 0x8086, 0x3a00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, + /* SATA Controller IDE (ICH10) */ + { 0x8086, 0x3a06, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, + /* SATA Controller IDE (ICH10) */ + { 0x8086, 0x3a20, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, + /* SATA Controller IDE (ICH10) */ + { 0x8086, 0x3a26, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, { } /* terminate list */ }; @@ -394,6 +403,18 @@ static const struct piix_map_db ich9_map }, }; +static const struct piix_map_db ich8_2port_map_db = { + .mask = 0x3, + .port_enable = 0x3, + .map = { + /* PM PS SM SS MAP */ + { P0, NA, P1, NA }, /* 00b */ + { RV, RV, RV, RV }, /* 01b */ + { RV, RV, RV, RV }, /* 10b */ + { RV, RV, RV, RV }, + }, +}; + static const struct piix_map_db *piix_map_db_table[] = { [ich5_sata] = &ich5_map_db, [esb_sata] = &ich5_map_db, @@ -403,6 +424,7 @@ static const struct piix_map_db *piix_ma [ich7m_sata_ahci] = &ich7m_map_db, [ich8_sata_ahci] = &ich8_map_db, [ich9_sata_ahci] = &ich9_map_db, + [ich8_2port_sata] = &ich8_2port_map_db, }; static struct ata_port_info piix_port_info[] = { @@ -525,6 +547,18 @@ static struct ata_port_info piix_port_in .mwdma_mask = 0x07, /* mwdma0-2 */ .udma_mask = 0x7f, /* udma0-6 */ .port_ops = &piix_sata_ops, + }, + + /* ich8_2port_sata: 11: */ + { + .sht = &piix_sht, + .host_flags = ATA_FLAG_SATA | + PIIX_FLAG_CHECKINTR | PIIX_FLAG_SCR | + PIIX_FLAG_AHCI, + .pio_mask = 0x1f, /* pio0-4 */ + .mwdma_mask = 0x07, /* mwdma0-2 */ + .udma_mask = ATA_UDMA6, + .port_ops = &piix_pata_ops, }, }; diff -r bb2f8ba47833 -r ad7ad9af265e drivers/xen/balloon/sysfs.c --- a/drivers/xen/balloon/sysfs.c Tue Mar 25 12:37:54 2008 -0600 +++ b/drivers/xen/balloon/sysfs.c Tue Apr 01 11:29:31 2008 -0600 @@ -39,7 +39,7 @@ #include <xen/platform-compat.h> #endif -#define BALLOON_CLASS_NAME "memory" +#define BALLOON_CLASS_NAME "xen_memory" #define BALLOON_SHOW(name, format, args...) \ static ssize_t show_##name(struct sys_device *dev, \ diff -r bb2f8ba47833 -r ad7ad9af265e drivers/xen/blkback/blkback.c --- a/drivers/xen/blkback/blkback.c Tue Mar 25 12:37:54 2008 -0600 +++ b/drivers/xen/blkback/blkback.c Tue Apr 01 11:29:31 2008 -0600 @@ -173,8 +173,8 @@ static void fast_flush_area(pending_req_ handle = pending_handle(req, i); if (handle == BLKBACK_INVALID_HANDLE) continue; - gnttab_set_unmap_op(&unmap[i], vaddr(req, i), GNTMAP_host_map, - handle); + gnttab_set_unmap_op(&unmap[invcount], vaddr(req, i), + GNTMAP_host_map, handle); pending_handle(req, i) = BLKBACK_INVALID_HANDLE; invcount++; } diff -r bb2f8ba47833 -r ad7ad9af265e drivers/xen/blkfront/blkfront.c --- a/drivers/xen/blkfront/blkfront.c Tue Mar 25 12:37:54 2008 -0600 +++ b/drivers/xen/blkfront/blkfront.c Tue Apr 01 11:29:31 2008 -0600 @@ -817,7 +817,7 @@ static void blkif_recover(struct blkfron int j; /* Stage 1: Make a safe copy of the shadow state. */ - copy = kmalloc(sizeof(info->shadow), GFP_KERNEL | __GFP_NOFAIL); + copy = kmalloc(sizeof(info->shadow), GFP_KERNEL | __GFP_NOFAIL | __GFP_HIGH); memcpy(copy, info->shadow, sizeof(info->shadow)); /* Stage 2: Set up free list. */ diff -r bb2f8ba47833 -r ad7ad9af265e drivers/xen/core/gnttab.c --- a/drivers/xen/core/gnttab.c Tue Mar 25 12:37:54 2008 -0600 +++ b/drivers/xen/core/gnttab.c Tue Apr 01 11:29:31 2008 -0600 @@ -52,7 +52,7 @@ /* External tools reserve first few grant table entries. */ #define NR_RESERVED_ENTRIES 8 #define GNTTAB_LIST_END 0xffffffff -#define GREFS_PER_GRANT_FRAME (PAGE_SIZE / sizeof(grant_entry_t)) +#define ENTRIES_PER_GRANT_FRAME (PAGE_SIZE / sizeof(grant_entry_t)) static grant_ref_t **gnttab_list; static unsigned int nr_grant_frames; @@ -69,6 +69,9 @@ static int gnttab_expand(unsigned int re #define RPP (PAGE_SIZE / sizeof(grant_ref_t)) #define gnttab_entry(entry) (gnttab_list[(entry) / RPP][(entry) % RPP]) + +#define nr_freelist_frames(grant_frames) \ + (((grant_frames) * ENTRIES_PER_GRANT_FRAME + RPP - 1) / RPP) static int get_free_entries(int count) { @@ -372,24 +375,25 @@ static int grow_gnttab_list(unsigned int static int grow_gnttab_list(unsigned int more_frames) { unsigned int new_nr_grant_frames, extra_entries, i; + unsigned int nr_glist_frames, new_nr_glist_frames; new_nr_grant_frames = nr_grant_frames + more_frames; - extra_entries = more_frames * GREFS_PER_GRANT_FRAME; - - for (i = nr_grant_frames; i < new_nr_grant_frames; i++) - { + extra_entries = more_frames * ENTRIES_PER_GRANT_FRAME; + + nr_glist_frames = nr_freelist_frames(nr_grant_frames); + new_nr_glist_frames = nr_freelist_frames(new_nr_grant_frames); + for (i = nr_glist_frames; i < new_nr_glist_frames; i++) { gnttab_list[i] = (grant_ref_t *)__get_free_page(GFP_ATOMIC); if (!gnttab_list[i]) goto grow_nomem; } - - for (i = GREFS_PER_GRANT_FRAME * nr_grant_frames; - i < GREFS_PER_GRANT_FRAME * new_nr_grant_frames - 1; i++) + for (i = ENTRIES_PER_GRANT_FRAME * nr_grant_frames; + i < ENTRIES_PER_GRANT_FRAME * new_nr_grant_frames - 1; i++) gnttab_entry(i) = i + 1; gnttab_entry(i) = gnttab_free_head; - gnttab_free_head = GREFS_PER_GRANT_FRAME * nr_grant_frames; + gnttab_free_head = ENTRIES_PER_GRANT_FRAME * nr_grant_frames; gnttab_free_count += extra_entries; nr_grant_frames = new_nr_grant_frames; @@ -399,7 +403,7 @@ static int grow_gnttab_list(unsigned int return 0; grow_nomem: - for ( ; i >= nr_grant_frames; i--) + for ( ; i >= nr_glist_frames; i--) free_page((unsigned long) gnttab_list[i]); return -ENOMEM; } @@ -699,8 +703,8 @@ static int gnttab_expand(unsigned int re unsigned int cur, extra; cur = nr_grant_frames; - extra = ((req_entries + (GREFS_PER_GRANT_FRAME-1)) / - GREFS_PER_GRANT_FRAME); + extra = ((req_entries + (ENTRIES_PER_GRANT_FRAME-1)) / + ENTRIES_PER_GRANT_FRAME); if (cur + extra > max_nr_grant_frames()) return -ENOSPC; @@ -713,7 +717,7 @@ int __devinit gnttab_init(void) int __devinit gnttab_init(void) { int i; - unsigned int max_nr_glist_frames; + unsigned int max_nr_glist_frames, nr_glist_frames; unsigned int nr_init_grefs; if (!is_running_on_xen()) @@ -725,16 +729,15 @@ int __devinit gnttab_init(void) /* Determine the maximum number of frames required for the * grant reference free list on the current hypervisor. */ - max_nr_glist_frames = (boot_max_nr_grant_frames * - GREFS_PER_GRANT_FRAME / - (PAGE_SIZE / sizeof(grant_ref_t))); + max_nr_glist_frames = nr_freelist_frames(boot_max_nr_grant_frames); gnttab_list = kmalloc(max_nr_glist_frames * sizeof(grant_ref_t *), GFP_KERNEL); if (gnttab_list == NULL) return -ENOMEM; - for (i = 0; i < nr_grant_frames; i++) { + nr_glist_frames = nr_freelist_frames(nr_grant_frames); + for (i = 0; i < nr_glist_frames; i++) { gnttab_list[i] = (grant_ref_t *)__get_free_page(GFP_KERNEL); if (gnttab_list[i] == NULL) goto ini_nomem; @@ -743,7 +746,7 @@ int __devinit gnttab_init(void) if (gnttab_resume() < 0) return -ENODEV; - nr_init_grefs = nr_grant_frames * GREFS_PER_GRANT_FRAME; + nr_init_grefs = nr_grant_frames * ENTRIES_PER_GRANT_FRAME; for (i = NR_RESERVED_ENTRIES; i < nr_init_grefs - 1; i++) gnttab_entry(i) = i + 1; diff -r bb2f8ba47833 -r ad7ad9af265e drivers/xen/core/xen_sysfs.c --- a/drivers/xen/core/xen_sysfs.c Tue Mar 25 12:37:54 2008 -0600 +++ b/drivers/xen/core/xen_sysfs.c Tue Apr 01 11:29:31 2008 -0600 @@ -104,6 +104,10 @@ static ssize_t uuid_show(struct hyp_sysf { char *vm, *val; int ret; + extern int xenstored_ready; + + if (!xenstored_ready) + return -EBUSY; vm = xenbus_read(XBT_NIL, "vm", "", NULL); if (IS_ERR(vm)) diff -r bb2f8ba47833 -r ad7ad9af265e drivers/xen/fbfront/xenfb.c --- a/drivers/xen/fbfront/xenfb.c Tue Mar 25 12:37:54 2008 -0600 +++ b/drivers/xen/fbfront/xenfb.c Tue Apr 01 11:29:31 2008 -0600 @@ -62,15 +62,21 @@ struct xenfb_info struct xenfb_page *page; unsigned long *mfns; int update_wanted; /* XENFB_TYPE_UPDATE wanted */ + int feature_resize; /* Backend has resize feature */ + struct xenfb_resize resize; + int resize_dpy; + spinlock_t resize_lock; struct xenbus_device *xbdev; }; /* - * How the locks work together - * - * There are two locks: spinlock dirty_lock protecting the dirty - * rectangle, and mutex mm_lock protecting mappings. + * There are three locks: + * spinlock resize_lock protecting resize_dpy and resize + * spinlock dirty_lock protecting the dirty rectangle + * mutex mm_lock protecting mappings. + * + * How the dirty and mapping locks work together * * The problem is that dirty rectangle and mappings aren't * independent: the dirty rectangle must cover all faulted pages in @@ -129,35 +135,62 @@ struct xenfb_info * * Oh well, we wont be updating the writes to this page anytime soon. */ +#define MB_ (1024*1024) +#define XENFB_DEFAULT_FB_LEN (XENFB_WIDTH * XENFB_HEIGHT * XENFB_DEPTH / 8) + +enum {KPARAM_MEM, KPARAM_WIDTH, KPARAM_HEIGHT, KPARAM_CNT}; +static int video[KPARAM_CNT] = {2, XENFB_WIDTH, XENFB_HEIGHT}; +module_param_array(video, int, NULL, 0); +MODULE_PARM_DESC(video, + "Size of video memory in MB and width,height in pixels, default = (2,800,600)"); static int xenfb_fps = 20; -static unsigned long xenfb_mem_len = XENFB_WIDTH * XENFB_HEIGHT * XENFB_DEPTH / 8; static int xenfb_remove(struct xenbus_device *); -static void xenfb_init_shared_page(struct xenfb_info *); +static void xenfb_init_shared_page(struct xenfb_info *, struct fb_info *); static int xenfb_connect_backend(struct xenbus_device *, struct xenfb_info *); static void xenfb_disconnect_backend(struct xenfb_info *); +static void xenfb_send_event(struct xenfb_info *info, + union xenfb_out_event *event) +{ + __u32 prod; + + prod = info->page->out_prod; + /* caller ensures !xenfb_queue_full() */ + mb(); /* ensure ring space available */ + XENFB_OUT_RING_REF(info->page, prod) = *event; + wmb(); /* ensure ring contents visible */ + info->page->out_prod = prod + 1; + + notify_remote_via_irq(info->irq); +} + static void xenfb_do_update(struct xenfb_info *info, int x, int y, int w, int h) { union xenfb_out_event event; - __u32 prod; - + + memset(&event, 0, sizeof(event)); event.type = XENFB_TYPE_UPDATE; event.update.x = x; event.update.y = y; event.update.width = w; event.update.height = h; - prod = info->page->out_prod; /* caller ensures !xenfb_queue_full() */ - mb(); /* ensure ring space available */ - XENFB_OUT_RING_REF(info->page, prod) = event; - wmb(); /* ensure ring contents visible */ - info->page->out_prod = prod + 1; - - notify_remote_via_irq(info->irq); + xenfb_send_event(info, &event); +} + +static void xenfb_do_resize(struct xenfb_info *info) +{ + union xenfb_out_event event; + + memset(&event, 0, sizeof(event)); + event.resize = info->resize; + + /* caller ensures !xenfb_queue_full() */ + xenfb_send_event(info, &event); } static int xenfb_queue_full(struct xenfb_info *info) @@ -209,11 +242,26 @@ static void xenfb_update_screen(struct x xenfb_do_update(info, x1, y1, x2 - x1, y2 - y1); } +static void xenfb_handle_resize_dpy(struct xenfb_info *info) +{ + unsigned long flags; + + spin_lock_irqsave(&info->resize_lock, flags); + if (info->resize_dpy) { + if (!xenfb_queue_full(info)) { + info->resize_dpy = 0; + xenfb_do_resize(info); + } + } + spin_unlock_irqrestore(&info->resize_lock, flags); +} + static int xenfb_thread(void *data) { struct xenfb_info *info = data; while (!kthread_should_stop()) { + xenfb_handle_resize_dpy(info); if (info->dirty) { info->dirty = 0; xenfb_update_screen(info); @@ -413,6 +461,57 @@ static int xenfb_mmap(struct fb_info *fb return 0; } +static int +xenfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) +{ + struct xenfb_info *xenfb_info; + int required_mem_len; + + xenfb_info = info->par; + + if (!xenfb_info->feature_resize) { + if (var->xres == video[KPARAM_WIDTH] && + var->yres == video[KPARAM_HEIGHT] && + var->bits_per_pixel == xenfb_info->page->depth) { + return 0; + } + return -EINVAL; + } + + /* Can't resize past initial width and height */ + if (var->xres > video[KPARAM_WIDTH] || var->yres > video[KPARAM_HEIGHT]) + return -EINVAL; + + required_mem_len = var->xres * var->yres * (xenfb_info->page->depth / 8); + if (var->bits_per_pixel == xenfb_info->page->depth && + var->xres <= info->fix.line_length / (XENFB_DEPTH / 8) && + required_mem_len <= info->fix.smem_len) { + var->xres_virtual = var->xres; + var->yres_virtual = var->yres; + return 0; + } + return -EINVAL; +} + +static int xenfb_set_par(struct fb_info *info) +{ + struct xenfb_info *xenfb_info; + unsigned long flags; + + xenfb_info = info->par; + + spin_lock_irqsave(&xenfb_info->resize_lock, flags); + xenfb_info->resize.type = XENFB_TYPE_RESIZE; + xenfb_info->resize.width = info->var.xres; + xenfb_info->resize.height = info->var.yres; + xenfb_info->resize.stride = info->fix.line_length; + xenfb_info->resize.depth = info->var.bits_per_pixel; + xenfb_info->resize.offset = 0; + xenfb_info->resize_dpy = 1; + spin_unlock_irqrestore(&xenfb_info->resize_lock, flags); + return 0; +} + static struct fb_ops xenfb_fb_ops = { .owner = THIS_MODULE, .fb_setcolreg = xenfb_setcolreg, @@ -420,6 +519,8 @@ static struct fb_ops xenfb_fb_ops = { .fb_copyarea = xenfb_copyarea, .fb_imageblit = xenfb_imageblit, .fb_mmap = xenfb_mmap, + .fb_check_var = xenfb_check_var, + .fb_set_par = xenfb_set_par, }; static irqreturn_t xenfb_event_handler(int rq, void *dev_id, @@ -450,6 +551,8 @@ static int __devinit xenfb_probe(struct { struct xenfb_info *info; struct fb_info *fb_info; + int fb_size; + int val; int ret; info = kzalloc(sizeof(*info), GFP_KERNEL); @@ -457,11 +560,27 @@ static int __devinit xenfb_probe(struct xenbus_dev_fatal(dev, -ENOMEM, "allocating info structure"); return -ENOMEM; } + + /* Limit kernel param videoram amount to what is in xenstore */ + if (xenbus_scanf(XBT_NIL, dev->otherend, "videoram", "%d", &val) == 1) { + if (val < video[KPARAM_MEM]) + video[KPARAM_MEM] = val; + } + + /* If requested res does not fit in available memory, use default */ + fb_size = video[KPARAM_MEM] * MB_; + if (video[KPARAM_WIDTH] * video[KPARAM_HEIGHT] * XENFB_DEPTH/8 > fb_size) { + video[KPARAM_WIDTH] = XENFB_WIDTH; + video[KPARAM_HEIGHT] = XENFB_HEIGHT; + fb_size = XENFB_DEFAULT_FB_LEN; + } + dev->dev.driver_data = info; info->xbdev = dev; info->irq = -1; info->x1 = info->y1 = INT_MAX; spin_lock_init(&info->dirty_lock); + spin_lock_init(&info->resize_lock); mutex_init(&info->mm_lock); init_waitqueue_head(&info->wq); init_timer(&info->refresh); @@ -469,12 +588,12 @@ static int __devinit xenfb_probe(struct info->refresh.data = (unsigned long)info; INIT_LIST_HEAD(&info->mappings); - info->fb = vmalloc(xenfb_mem_len); + info->fb = vmalloc(fb_size); if (info->fb == NULL) goto error_nomem; - memset(info->fb, 0, xenfb_mem_len); - - info->nr_pages = (xenfb_mem_len + PAGE_SIZE - 1) >> PAGE_SHIFT; + memset(info->fb, 0, fb_size); + + info->nr_pages = (fb_size + PAGE_SIZE - 1) >> PAGE_SHIFT; info->pages = kmalloc(sizeof(struct page *) * info->nr_pages, GFP_KERNEL); @@ -489,8 +608,6 @@ static int __devinit xenfb_probe(struct info->page = (void *)__get_free_page(GFP_KERNEL | __GFP_ZERO); if (!info->page) goto error_nomem; - - xenfb_init_shared_page(info); fb_info = framebuffer_alloc(sizeof(u32) * 256, NULL); /* see fishy hackery below */ @@ -504,9 +621,9 @@ static int __devinit xenfb_probe(struct fb_info->screen_base = info->fb; fb_info->fbops = &xenfb_fb_ops; - fb_info->var.xres_virtual = fb_info->var.xres = info->page->width; - fb_info->var.yres_virtual = fb_info->var.yres = info->page->height; - fb_info->var.bits_per_pixel = info->page->depth; + fb_info->var.xres_virtual = fb_info->var.xres = video[KPARAM_WIDTH]; + fb_info->var.yres_virtual = fb_info->var.yres = video[KPARAM_HEIGHT]; + fb_info->var.bits_per_pixel = XENFB_DEPTH; fb_info->var.red = (struct fb_bitfield){16, 8, 0}; fb_info->var.green = (struct fb_bitfield){8, 8, 0}; @@ -518,9 +635,9 @@ static int __devinit xenfb_probe(struct fb_info->var.vmode = FB_VMODE_NONINTERLACED; fb_info->fix.visual = FB_VISUAL_TRUECOLOR; - fb_info->fix.line_length = info->page->line_length; + fb_info->fix.line_length = fb_info->var.xres * (XENFB_DEPTH / 8); fb_info->fix.smem_start = 0; - fb_info->fix.smem_len = xenfb_mem_len; + fb_info->fix.smem_len = fb_size; strcpy(fb_info->fix.id, "xen"); fb_info->fix.type = FB_TYPE_PACKED_PIXELS; fb_info->fix.accel = FB_ACCEL_NONE; @@ -533,6 +650,8 @@ static int __devinit xenfb_probe(struct xenbus_dev_fatal(dev, ret, "fb_alloc_cmap"); goto error; } + + xenfb_init_shared_page(info, fb_info); ret = register_framebuffer(fb_info); if (ret) { @@ -571,7 +690,7 @@ static int xenfb_resume(struct xenbus_de struct xenfb_info *info = dev->dev.driver_data; xenfb_disconnect_backend(info); - xenfb_init_shared_page(info); + xenfb_init_shared_page(info, info->fb_info); return xenfb_connect_backend(dev, info); } @@ -597,9 +716,11 @@ static int xenfb_remove(struct xenbus_de return 0; } -static void xenfb_init_shared_page(struct xenfb_info *info) +static void xenfb_init_shared_page(struct xenfb_info *info, + struct fb_info * fb_info) { int i; + int epd = PAGE_SIZE / sizeof(info->mfns[0]); for (i = 0; i < info->nr_pages; i++) info->pages[i] = vmalloc_to_page(info->fb + i * PAGE_SIZE); @@ -607,13 +728,14 @@ static void xenfb_init_shared_page(struc for (i = 0; i < info->nr_pages; i++) info->mfns[i] = vmalloc_to_mfn(info->fb + i * PAGE_SIZE); - info->page->pd[0] = vmalloc_to_mfn(info->mfns); - info->page->pd[1] = 0; - info->page->width = XENFB_WIDTH; - info->page->height = XENFB_HEIGHT; - info->page->depth = XENFB_DEPTH; - info->page->line_length = (info->page->depth / 8) * info->page->width; - info->page->mem_length = xenfb_mem_len; + for (i = 0; i * epd < info->nr_pages; i++) + info->page->pd[i] = vmalloc_to_mfn(&info->mfns[i * epd]); + + info->page->width = fb_info->var.xres; + info->page->height = fb_info->var.yres; + info->page->depth = fb_info->var.bits_per_pixel; + info->page->line_length = fb_info->fix.line_length; + info->page->mem_length = fb_info->fix.smem_len; info->page->in_cons = info->page->in_prod = 0; info->page->out_cons = info->page->out_prod = 0; } @@ -712,6 +834,11 @@ static void xenfb_backend_changed(struct val = 0; if (val) info->update_wanted = 1; + + if (xenbus_scanf(XBT_NIL, dev->otherend, + "feature-resize", "%d", &val) < 0) + val = 0; + info->feature_resize = val; break; case XenbusStateClosing: diff -r bb2f8ba47833 -r ad7ad9af265e drivers/xen/fbfront/xenkbd.c --- a/drivers/xen/fbfront/xenkbd.c Tue Mar 25 12:37:54 2008 -0600 +++ b/drivers/xen/fbfront/xenkbd.c Tue Apr 01 11:29:31 2008 -0600 @@ -297,6 +297,16 @@ static void xenkbd_backend_changed(struc */ if (dev->state != XenbusStateConnected) goto InitWait; /* no InitWait seen yet, fudge it */ + + /* Set input abs params to match backend screen res */ + if (xenbus_scanf(XBT_NIL, info->xbdev->otherend, + "width", "%d", &val) > 0 ) + input_set_abs_params(info->ptr, ABS_X, 0, val, 0, 0); + + if (xenbus_scanf(XBT_NIL, info->xbdev->otherend, + "height", "%d", &val) > 0 ) + input_set_abs_params(info->ptr, ABS_Y, 0, val, 0, 0); + break; case XenbusStateClosing: diff -r bb2f8ba47833 -r ad7ad9af265e drivers/xen/pciback/passthrough.c --- a/drivers/xen/pciback/passthrough.c Tue Mar 25 12:37:54 2008 -0600 +++ b/drivers/xen/pciback/passthrough.c Tue Apr 01 11:29:31 2008 -0600 @@ -47,6 +47,8 @@ int pciback_add_pci_dev(struct pciback_d struct passthrough_dev_data *dev_data = pdev->pci_dev_data; struct pci_dev_entry *dev_entry; unsigned long flags; + unsigned int domain, bus, devfn; + int err; dev_entry = kmalloc(sizeof(*dev_entry), GFP_KERNEL); if (!dev_entry) @@ -57,9 +59,13 @@ int pciback_add_pci_dev(struct pciback_d list_add_tail(&dev_entry->list, &dev_data->dev_list); spin_unlock_irqrestore(&dev_data->lock, flags); - /* TODO: Publish virtual domain:bus:slot.func here. */ + /* Publish this device. */ + domain = (unsigned int)pci_domain_nr(dev->bus); + bus = (unsigned int)dev->bus->number; + devfn = dev->devfn; + err = publish_cb(pdev, domain, bus, devfn, devid); - return 0; + return err; } void pciback_release_pci_dev(struct pciback_device *pdev, struct pci_dev *dev) diff -r bb2f8ba47833 -r ad7ad9af265e drivers/xen/pciback/xenbus.c --- a/drivers/xen/pciback/xenbus.c Tue Mar 25 12:37:54 2008 -0600 +++ b/drivers/xen/pciback/xenbus.c Tue Apr 01 11:29:31 2008 -0600 @@ -348,7 +348,6 @@ static int pciback_reconfigure(struct pc substate = XenbusStateUnknown; switch (substate) { - /* case XenbusStateUnknown: */ case XenbusStateInitialising: dev_dbg(&pdev->xdev->dev, "Attaching dev-%d ...\n", i); @@ -382,10 +381,14 @@ static int pciback_reconfigure(struct pc if (err) goto out; - /* TODO: if we are to support multiple pci roots - * (CONFIG_XEN_PCIDEV_BACKEND_PASS), publish newly - * added root here. - */ + /* Publish pci roots. */ + err = pciback_publish_pci_roots(pdev, pciback_publish_pci_root); + if (err) { + xenbus_dev_fatal(pdev->xdev, err, + "Error while publish PCI root" + "buses for frontend"); + goto out; + } err = xenbus_printf(XBT_NIL, pdev->xdev->nodename, state_str, "%d", @@ -431,10 +434,11 @@ static int pciback_reconfigure(struct pc if(err) goto out; - /* TODO: if we are to support multiple pci roots - * (CONFIG_XEN_PCIDEV_BACKEND_PASS), remove unnecessary - * root here. + /* TODO: If at some point we implement support for pci + * root hot-remove on pcifront side, we'll need to + * remove unnecessary xenstore nodes of pci roots here. */ + break; default: diff -r bb2f8ba47833 -r ad7ad9af265e drivers/xen/pcifront/xenbus.c --- a/drivers/xen/pcifront/xenbus.c Tue Mar 25 12:37:54 2008 -0600 +++ b/drivers/xen/pcifront/xenbus.c Tue Apr 01 11:29:31 2008 -0600 @@ -332,7 +332,7 @@ static int pcifront_detach_devices(struc if (err >= 0) err = -EINVAL; xenbus_dev_fatal(pdev->xdev, err, - "Error reading PCI root %d", i); + "Error reading PCI device %d", i); goto out; } diff -r bb2f8ba47833 -r ad7ad9af265e drivers/xen/xenbus/xenbus_xs.c --- a/drivers/xen/xenbus/xenbus_xs.c Tue Mar 25 12:37:54 2008 -0600 +++ b/drivers/xen/xenbus/xenbus_xs.c Tue Apr 01 11:29:31 2008 -0600 @@ -629,6 +629,8 @@ void unregister_xenbus_watch(struct xenb char token[sizeof(watch) * 2 + 1]; int err; + BUG_ON(watch->flags & XBWF_new_thread); + sprintf(token, "%lX", (long)watch); down_read(&xs_state.watch_mutex); @@ -738,16 +740,29 @@ static int xenwatch_thread(void *unused) list_del(ent); spin_unlock(&watch_events_lock); - if (ent != &watch_events) { - msg = list_entry(ent, struct xs_stored_msg, list); - if (msg->u.watch.handle->flags & XBWF_new_thread) - kthread_run(xenwatch_handle_callback, - msg, "xenwatch_cb"); - else - xenwatch_handle_callback(msg); + if (ent == &watch_events) { + mutex_unlock(&xenwatch_mutex); + continue; } - mutex_unlock(&xenwatch_mutex); + msg = list_entry(ent, struct xs_stored_msg, list); + + /* + * Unlock the mutex before running an XBWF_new_thread + * handler. kthread_run can block which can deadlock + * against unregister_xenbus_watch() if we need to + * unregister other watches in order to make + * progress. This can occur on resume before the swap + * device is attached. + */ + if (msg->u.watch.handle->flags & XBWF_new_thread) { + mutex_unlock(&xenwatch_mutex); + kthread_run(xenwatch_handle_callback, + msg, "xenwatch_cb"); + } else { + xenwatch_handle_callback(msg); + mutex_unlock(&xenwatch_mutex); + } } return 0; diff -r bb2f8ba47833 -r ad7ad9af265e include/asm-i386/mach-xen/asm/dma-mapping.h --- a/include/asm-i386/mach-xen/asm/dma-mapping.h Tue Mar 25 12:37:54 2008 -0600 +++ b/include/asm-i386/mach-xen/asm/dma-mapping.h Tue Apr 01 11:29:31 2008 -0600 @@ -22,13 +22,7 @@ address_needs_mapping(struct device *hwd return (addr & ~mask) != 0; } -static inline int -range_straddles_page_boundary(paddr_t p, size_t size) -{ - extern unsigned long *contiguous_bitmap; - return ((((p & ~PAGE_MASK) + size) > PAGE_SIZE) && - !test_bit(p >> PAGE_SHIFT, contiguous_bitmap)); -} +extern int range_straddles_page_boundary(paddr_t p, size_t size); #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) diff -r bb2f8ba47833 -r ad7ad9af265e include/asm-i386/mach-xen/asm/page.h --- a/include/asm-i386/mach-xen/asm/page.h Tue Mar 25 12:37:54 2008 -0600 +++ b/include/asm-i386/mach-xen/asm/page.h Tue Apr 01 11:29:31 2008 -0600 @@ -126,9 +126,10 @@ typedef struct { unsigned long pgprot; } == _PAGE_PRESENT ? \ machine_to_phys(__pte_val(x)) : \ __pte_val(x)) -#define __pte(x) ({ unsigned long _x = (x); \ - (pte_t)(((_x) & (_PAGE_PRESENT|_PAGE_IO)) == _PAGE_PRESENT ? \ - phys_to_machine(_x) : (_x)); }) +#define __pte(x) ({ unsigned long _x = (x); \ + if ((_x & (_PAGE_PRESENT|_PAGE_IO)) == _PAGE_PRESENT) \ + _x = phys_to_machine(_x); \ + ((pte_t) { _x }); }) #define __pmd_val(x) __pud_val((x).pud) #define __pud_val(x) __pgd_val((x).pgd) #define __pgd(x) ({ unsigned long _x = (x); \ diff -r bb2f8ba47833 -r ad7ad9af265e include/linux/pci_ids.h --- a/include/linux/pci_ids.h Tue Mar 25 12:37:54 2008 -0600 +++ b/include/linux/pci_ids.h Tue Apr 01 11:29:31 2008 -0600 @@ -2209,6 +2209,12 @@ #define PCI_DEVICE_ID_INTEL_MCH_PC 0x3599 #define PCI_DEVICE_ID_INTEL_MCH_PC1 0x359a #define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e +#define PCI_DEVICE_ID_INTEL_ICH10_0 0x3a14 +#define PCI_DEVICE_ID_INTEL_ICH10_1 0x3a16 +#define PCI_DEVICE_ID_INTEL_ICH10_2 0x3a18 +#define PCI_DEVICE_ID_INTEL_ICH10_3 0x3a1a +#define PCI_DEVICE_ID_INTEL_ICH10_4 0x3a30 +#define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60 #define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000 #define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010 #define PCI_DEVICE_ID_INTEL_82371SB_2 0x7020 diff -r bb2f8ba47833 -r ad7ad9af265e include/xen/interface/arch-ia64.h --- a/include/xen/interface/arch-ia64.h Tue Mar 25 12:37:54 2008 -0600 +++ b/include/xen/interface/arch-ia64.h Tue Apr 01 11:29:31 2008 -0600 @@ -23,8 +23,14 @@ * */ +#include "xen.h" + #ifndef __HYPERVISOR_IF_IA64_H__ #define __HYPERVISOR_IF_IA64_H__ + +#if !defined(__GNUC__) || defined(__STRICT_ANSI__) +#error "Anonymous structs/unions are a GNU extension." +#endif /* Structural guest handles introduced in 0x00030201. */ #if __XEN_INTERFACE_VERSION__ >= 0x00030201 diff -r bb2f8ba47833 -r ad7ad9af265e include/xen/interface/arch-ia64/sioemu.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/include/xen/interface/arch-ia64/sioemu.h Tue Apr 01 11:29:31 2008 -0600 @@ -0,0 +1,42 @@ +/****************************************************************************** + * sioemu.h + * + * Copyright (c) 2008 Tristan Gingold <tgingold@xxxxxxx> + * + * 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_PUBLIC_IA64_SIOEMU_H__ +#define __XEN_PUBLIC_IA64_SIOEMU_H__ + +/* Defines the callback entry point. r8=ip, r9=data. + Must be called per-vcpu. */ +#define SIOEMU_HYPERCALL_SET_CALLBACK 0x01 + +/* Finish sioemu fw initialization and start firmware. r8=ip. */ +#define SIOEMU_HYPERCALL_START_FW 0x02 + +/* Add IO pages in physmap. */ +#define SIOEMU_HYPERCALL_ADD_IO_PHYSMAP 0x03 + +/* Get wallclock time. */ +#define SIOEMU_HYPERCALL_GET_TIME 0x04 + +/* Return from callback. r16=0. + Unmask vcpu events. */ +#define SIOEMU_HYPERPRIVOP_CALLBACK_RETURN 0x01 + +#endif /* __XEN_PUBLIC_IA64_SIOEMU_H__ */ diff -r bb2f8ba47833 -r ad7ad9af265e include/xen/interface/arch-powerpc.h --- a/include/xen/interface/arch-powerpc.h Tue Mar 25 12:37:54 2008 -0600 +++ b/include/xen/interface/arch-powerpc.h Tue Apr 01 11:29:31 2008 -0600 @@ -21,6 +21,8 @@ * * Authors: Hollis Blanchard <hollisb@xxxxxxxxxx> */ + +#include "xen.h" #ifndef __XEN_PUBLIC_ARCH_PPC_64_H__ #define __XEN_PUBLIC_ARCH_PPC_64_H__ diff -r bb2f8ba47833 -r ad7ad9af265e include/xen/interface/arch-x86/hvm/save.h --- a/include/xen/interface/arch-x86/hvm/save.h Tue Mar 25 12:37:54 2008 -0600 +++ b/include/xen/interface/arch-x86/hvm/save.h Tue Apr 01 11:29:31 2008 -0600 @@ -271,8 +271,7 @@ DECLARE_HVM_SAVE_TYPE(LAPIC, 5, struct h DECLARE_HVM_SAVE_TYPE(LAPIC, 5, struct hvm_hw_lapic); struct hvm_hw_lapic_regs { - /* A 4k page of register state */ - uint8_t data[0x400]; + uint8_t data[1024]; }; DECLARE_HVM_SAVE_TYPE(LAPIC_REGS, 6, struct hvm_hw_lapic_regs); diff -r bb2f8ba47833 -r ad7ad9af265e include/xen/interface/arch-x86/xen-x86_64.h --- a/include/xen/interface/arch-x86/xen-x86_64.h Tue Mar 25 12:37:54 2008 -0600 +++ b/include/xen/interface/arch-x86/xen-x86_64.h Tue Apr 01 11:29:31 2008 -0600 @@ -140,7 +140,7 @@ struct iret_context { /* Bottom of iret stack frame. */ }; -#ifdef __GNUC__ +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) /* Anonymous union includes both 32- and 64-bit names (e.g., eax/rax). */ #define __DECL_REG(name) union { \ uint64_t r ## name, e ## name; \ diff -r bb2f8ba47833 -r ad7ad9af265e include/xen/interface/arch-x86/xen.h --- a/include/xen/interface/arch-x86/xen.h Tue Mar 25 12:37:54 2008 -0600 +++ b/include/xen/interface/arch-x86/xen.h Tue Apr 01 11:29:31 2008 -0600 @@ -23,6 +23,8 @@ * * Copyright (c) 2004-2006, K A Fraser */ + +#include "../xen.h" #ifndef __XEN_PUBLIC_ARCH_X86_XEN_H__ #define __XEN_PUBLIC_ARCH_X86_XEN_H__ diff -r bb2f8ba47833 -r ad7ad9af265e include/xen/interface/domctl.h --- a/include/xen/interface/domctl.h Tue Mar 25 12:37:54 2008 -0600 +++ b/include/xen/interface/domctl.h Tue Apr 01 11:29:31 2008 -0600 @@ -53,6 +53,9 @@ struct xen_domctl_createdomain { /* Is this an HVM guest (as opposed to a PV guest)? */ #define _XEN_DOMCTL_CDF_hvm_guest 0 #define XEN_DOMCTL_CDF_hvm_guest (1U<<_XEN_DOMCTL_CDF_hvm_guest) + /* Use hardware-assisted paging if available? */ +#define _XEN_DOMCTL_CDF_hap 1 +#define XEN_DOMCTL_CDF_hap (1U<<_XEN_DOMCTL_CDF_hap) uint32_t flags; }; typedef struct xen_domctl_createdomain xen_domctl_createdomain_t; @@ -373,6 +376,8 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_hyper #define XEN_DOMAINSETUP_hvm_guest (1UL<<_XEN_DOMAINSETUP_hvm_guest) #define _XEN_DOMAINSETUP_query 1 /* Get parameters (for save) */ #define XEN_DOMAINSETUP_query (1UL<<_XEN_DOMAINSETUP_query) +#define _XEN_DOMAINSETUP_sioemu_guest 2 +#define XEN_DOMAINSETUP_sioemu_guest (1UL<<_XEN_DOMAINSETUP_sioemu_guest) typedef struct xen_domctl_arch_setup { uint64_aligned_t flags; /* XEN_DOMAINSETUP_* */ #ifdef __ia64__ @@ -436,6 +441,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_sendt /* Assign PCI device to HVM guest. Sets up IOMMU structures. */ #define XEN_DOMCTL_assign_device 37 #define XEN_DOMCTL_test_assign_device 45 +#define XEN_DOMCTL_deassign_device 47 struct xen_domctl_assign_device { uint32_t machine_bdf; /* machine PCI ID of assigned device */ }; @@ -445,6 +451,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_assig /* Pass-through interrupts: bind real irq -> hvm devfn. */ #define XEN_DOMCTL_bind_pt_irq 38 +#define XEN_DOMCTL_unbind_pt_irq 48 typedef enum pt_irq_type_e { PT_IRQ_TYPE_PCI, PT_IRQ_TYPE_ISA @@ -553,6 +560,17 @@ struct xen_domctl_set_opt_feature { }; typedef struct xen_domctl_set_opt_feature xen_domctl_set_opt_feature_t; DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_opt_feature_t); + +/* + * Set the target domain for a domain + */ +#define XEN_DOMCTL_set_target 46 +struct xen_domctl_set_target { + domid_t target; +}; +typedef struct xen_domctl_set_target xen_domctl_set_target_t; +DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_target_t); + struct xen_domctl { uint32_t cmd; @@ -590,6 +608,7 @@ struct xen_domctl { struct xen_domctl_pin_mem_cacheattr pin_mem_cacheattr; struct xen_domctl_ext_vcpucontext ext_vcpucontext; struct xen_domctl_set_opt_feature set_opt_feature; + struct xen_domctl_set_target set_target; uint8_t pad[128]; } u; }; diff -r bb2f8ba47833 -r ad7ad9af265e include/xen/interface/hvm/ioreq.h --- a/include/xen/interface/hvm/ioreq.h Tue Mar 25 12:37:54 2008 -0600 +++ b/include/xen/interface/hvm/ioreq.h Tue Apr 01 11:29:31 2008 -0600 @@ -34,14 +34,8 @@ #define IOREQ_TYPE_PIO 0 /* pio */ #define IOREQ_TYPE_COPY 1 /* mmio ops */ -#define IOREQ_TYPE_AND 2 -#define IOREQ_TYPE_OR 3 -#define IOREQ_TYPE_XOR 4 -#define IOREQ_TYPE_XCHG 5 -#define IOREQ_TYPE_ADD 6 #define IOREQ_TYPE_TIMEOFFSET 7 #define IOREQ_TYPE_INVALIDATE 8 /* mapcache */ -#define IOREQ_TYPE_SUB 9 /* * VMExit dispatcher should cooperate with instruction decoder to @@ -114,11 +108,11 @@ struct buffered_piopage { }; #endif /* defined(__ia64__) */ -#if defined(__i386__) || defined(__x86_64__) #define ACPI_PM1A_EVT_BLK_ADDRESS 0x0000000000001f40 #define ACPI_PM1A_CNT_BLK_ADDRESS (ACPI_PM1A_EVT_BLK_ADDRESS + 0x04) #define ACPI_PM_TMR_BLK_ADDRESS (ACPI_PM1A_EVT_BLK_ADDRESS + 0x08) -#endif /* defined(__i386__) || defined(__x86_64__) */ +#define ACPI_GPE0_BLK_ADDRESS (ACPI_PM_TMR_BLK_ADDRESS + 0x20) +#define ACPI_GPE0_BLK_LEN 0x08 #endif /* _IOREQ_H_ */ diff -r bb2f8ba47833 -r ad7ad9af265e include/xen/interface/hvm/params.h --- a/include/xen/interface/hvm/params.h Tue Mar 25 12:37:54 2008 -0600 +++ b/include/xen/interface/hvm/params.h Tue Apr 01 11:29:31 2008 -0600 @@ -81,6 +81,9 @@ #define HVMPTM_no_missed_ticks_pending 2 #define HVMPTM_one_missed_tick_pending 3 -#define HVM_NR_PARAMS 11 +/* Boolean: Enable virtual HPET (high-precision event timer)? (x86-only) */ +#define HVM_PARAM_HPET_ENABLED 11 + +#define HVM_NR_PARAMS 12 #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */ diff -r bb2f8ba47833 -r ad7ad9af265e include/xen/interface/hvm/save.h --- a/include/xen/interface/hvm/save.h Tue Mar 25 12:37:54 2008 -0600 +++ b/include/xen/interface/hvm/save.h Tue Apr 01 11:29:31 2008 -0600 @@ -39,6 +39,10 @@ * Internal mechanisms should be kept in Xen-private headers. */ +#if !defined(__GNUC__) || defined(__STRICT_ANSI__) +#error "Anonymous structs/unions are a GNU extension." +#endif + /* * Each entry is preceded by a descriptor giving its type and length */ diff -r bb2f8ba47833 -r ad7ad9af265e include/xen/interface/io/fbif.h --- a/include/xen/interface/io/fbif.h Tue Mar 25 12:37:54 2008 -0600 +++ b/include/xen/interface/io/fbif.h Tue Apr 01 11:29:31 2008 -0600 @@ -50,12 +50,29 @@ struct xenfb_update int32_t height; /* rect height */ }; +/* + * Framebuffer resize notification event + * Capable backend sets feature-resize in xenstore. + */ +#define XENFB_TYPE_RESIZE 3 + +struct xenfb_resize +{ + uint8_t type; /* XENFB_TYPE_RESIZE */ + int32_t width; /* width in pixels */ + int32_t height; /* height in pixels */ + int32_t stride; /* stride in bytes */ + int32_t depth; /* depth in bits */ + int32_t offset; /* offset of the framebuffer in bytes */ +}; + #define XENFB_OUT_EVENT_SIZE 40 union xenfb_out_event { uint8_t type; struct xenfb_update update; + struct xenfb_resize resize; char pad[XENFB_OUT_EVENT_SIZE]; }; @@ -109,15 +126,17 @@ struct xenfb_page * Each directory page holds PAGE_SIZE / sizeof(*pd) * framebuffer pages, and can thus map up to PAGE_SIZE * * PAGE_SIZE / sizeof(*pd) bytes. With PAGE_SIZE == 4096 and - * sizeof(unsigned long) == 4, that's 4 Megs. Two directory - * pages should be enough for a while. + * sizeof(unsigned long) == 4/8, that's 4 Megs 32 bit and 2 Megs + * 64 bit. 256 directories give enough room for a 512 Meg + * framebuffer with a max resolution of 12,800x10,240. Should + * be enough for a while with room leftover for expansion. */ - unsigned long pd[2]; + unsigned long pd[256]; }; /* - * Wart: xenkbd needs to know resolution. Put it here until a better - * solution is found, but don't leak it to the backend. + * Wart: xenkbd needs to know default resolution. Put it here until a + * better solution is found, but don't leak it to the backend. */ #ifdef __KERNEL__ #define XENFB_WIDTH 800 diff -r bb2f8ba47833 -r ad7ad9af265e include/xen/interface/io/ring.h --- a/include/xen/interface/io/ring.h Tue Mar 25 12:37:54 2008 -0600 +++ b/include/xen/interface/io/ring.h Tue Apr 01 11:29:31 2008 -0600 @@ -26,6 +26,14 @@ #ifndef __XEN_PUBLIC_IO_RING_H__ #define __XEN_PUBLIC_IO_RING_H__ + +#include "../xen-compat.h" + +#if __XEN_INTERFACE_VERSION__ < 0x00030208 +#define xen_mb() mb() +#define xen_rmb() rmb() +#define xen_wmb() wmb() +#endif typedef unsigned int RING_IDX; @@ -211,12 +219,12 @@ typedef struct __name##_back_ring __name (((_cons) - (_r)->rsp_prod_pvt) >= RING_SIZE(_r)) #define RING_PUSH_REQUESTS(_r) do { \ - wmb(); /* back sees requests /before/ updated producer index */ \ + xen_wmb(); /* back sees requests /before/ updated producer index */ \ (_r)->sring->req_prod = (_r)->req_prod_pvt; \ } while (0) #define RING_PUSH_RESPONSES(_r) do { \ - wmb(); /* front sees responses /before/ updated producer index */ \ + xen_wmb(); /* front sees resps /before/ updated producer index */ \ (_r)->sring->rsp_prod = (_r)->rsp_prod_pvt; \ } while (0) @@ -253,9 +261,9 @@ typedef struct __name##_back_ring __name #define RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(_r, _notify) do { \ RING_IDX __old = (_r)->sring->req_prod; \ RING_IDX __new = (_r)->req_prod_pvt; \ - wmb(); /* back sees requests /before/ updated producer index */ \ + xen_wmb(); /* back sees requests /before/ updated producer index */ \ (_r)->sring->req_prod = __new; \ - mb(); /* back sees new requests /before/ we check req_event */ \ + xen_mb(); /* back sees new requests /before/ we check req_event */ \ (_notify) = ((RING_IDX)(__new - (_r)->sring->req_event) < \ (RING_IDX)(__new - __old)); \ } while (0) @@ -263,9 +271,9 @@ typedef struct __name##_back_ring __name #define RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(_r, _notify) do { \ RING_IDX __old = (_r)->sring->rsp_prod; \ RING_IDX __new = (_r)->rsp_prod_pvt; \ - wmb(); /* front sees responses /before/ updated producer index */ \ + xen_wmb(); /* front sees resps /before/ updated producer index */ \ (_r)->sring->rsp_prod = __new; \ - mb(); /* front sees new responses /before/ we check rsp_event */ \ + xen_mb(); /* front sees new resps /before/ we check rsp_event */ \ (_notify) = ((RING_IDX)(__new - (_r)->sring->rsp_event) < \ (RING_IDX)(__new - __old)); \ } while (0) @@ -274,7 +282,7 @@ typedef struct __name##_back_ring __name (_work_to_do) = RING_HAS_UNCONSUMED_REQUESTS(_r); \ if (_work_to_do) break; \ (_r)->sring->req_event = (_r)->req_cons + 1; \ - mb(); \ + xen_mb(); \ (_work_to_do) = RING_HAS_UNCONSUMED_REQUESTS(_r); \ } while (0) @@ -282,7 +290,7 @@ typedef struct __name##_back_ring __name (_work_to_do) = RING_HAS_UNCONSUMED_RESPONSES(_r); \ if (_work_to_do) break; \ (_r)->sring->rsp_event = (_r)->rsp_cons + 1; \ - mb(); \ + xen_mb(); \ (_work_to_do) = RING_HAS_UNCONSUMED_RESPONSES(_r); \ } while (0) diff -r bb2f8ba47833 -r ad7ad9af265e include/xen/interface/io/xs_wire.h --- a/include/xen/interface/io/xs_wire.h Tue Mar 25 12:37:54 2008 -0600 +++ b/include/xen/interface/io/xs_wire.h Tue Apr 01 11:29:31 2008 -0600 @@ -46,7 +46,8 @@ enum xsd_sockmsg_type XS_WATCH_EVENT, XS_ERROR, XS_IS_DOMAIN_INTRODUCED, - XS_RESUME + XS_RESUME, + XS_SET_TARGET }; #define XS_WRITE_NONE "NONE" diff -r bb2f8ba47833 -r ad7ad9af265e include/xen/interface/kexec.h --- a/include/xen/interface/kexec.h Tue Mar 25 12:37:54 2008 -0600 +++ b/include/xen/interface/kexec.h Tue Apr 01 11:29:31 2008 -0600 @@ -130,10 +130,10 @@ typedef struct xen_kexec_load { #define KEXEC_RANGE_MA_XEN 1 /* machine address and size of Xen itself */ #define KEXEC_RANGE_MA_CPU 2 /* machine address and size of a CPU note */ #define KEXEC_RANGE_MA_XENHEAP 3 /* machine address and size of xenheap - * Note that although this is adjacent - * to Xen it exists in a separate EFI - * region on ia64, and thus needs to be - * inserted into iomem_machine separately */ + * Note that although this is adjacent + * to Xen it exists in a separate EFI + * region on ia64, and thus needs to be + * inserted into iomem_machine separately */ #define KEXEC_RANGE_MA_BOOT_PARAM 4 /* machine address and size of * the ia64_boot_param */ #define KEXEC_RANGE_MA_EFI_MEMMAP 5 /* machine address and size of diff -r bb2f8ba47833 -r ad7ad9af265e include/xen/interface/physdev.h --- a/include/xen/interface/physdev.h Tue Mar 25 12:37:54 2008 -0600 +++ b/include/xen/interface/physdev.h Tue Apr 01 11:29:31 2008 -0600 @@ -81,7 +81,11 @@ DEFINE_XEN_GUEST_HANDLE(physdev_set_iopl #define PHYSDEVOP_set_iobitmap 7 struct physdev_set_iobitmap { /* IN */ - XEN_GUEST_HANDLE_00030205(uint8) bitmap; +#if __XEN_INTERFACE_VERSION__ >= 0x00030205 + XEN_GUEST_HANDLE(uint8) bitmap; +#else + uint8_t *bitmap; +#endif uint32_t nr_ports; }; typedef struct physdev_set_iobitmap physdev_set_iobitmap_t; diff -r bb2f8ba47833 -r ad7ad9af265e include/xen/interface/trace.h --- a/include/xen/interface/trace.h Tue Mar 25 12:37:54 2008 -0600 +++ b/include/xen/interface/trace.h Tue Apr 01 11:29:31 2008 -0600 @@ -141,6 +141,14 @@ struct t_rec { * field, indexes into an array of struct t_rec's. */ struct t_buf { + /* Assume the data buffer size is X. X is generally not a power of 2. + * CONS and PROD are incremented modulo (2*X): + * 0 <= cons < 2*X + * 0 <= prod < 2*X + * This is done because addition modulo X breaks at 2^32 when X is not a + * power of 2: + * (((2^32 - 1) % X) + 1) % X != (2^32) % X + */ uint32_t cons; /* Offset of next item to be consumed by control tools. */ uint32_t prod; /* Offset of next item to be produced by Xen. */ /* Records follow immediately after the meta-data header. */ diff -r bb2f8ba47833 -r ad7ad9af265e include/xen/interface/xen-compat.h --- a/include/xen/interface/xen-compat.h Tue Mar 25 12:37:54 2008 -0600 +++ b/include/xen/interface/xen-compat.h Tue Apr 01 11:29:31 2008 -0600 @@ -27,7 +27,7 @@ #ifndef __XEN_PUBLIC_XEN_COMPAT_H__ #define __XEN_PUBLIC_XEN_COMPAT_H__ -#define __XEN_LATEST_INTERFACE_VERSION__ 0x00030207 +#define __XEN_LATEST_INTERFACE_VERSION__ 0x00030208 #if defined(__XEN__) || defined(__XEN_TOOLS__) /* Xen is built with matching headers and implements the latest interface. */ @@ -41,11 +41,4 @@ #error "These header files do not support the requested interface version." #endif -/* Fields defined as a Xen guest handle since 0x00030205. */ -#if __XEN_INTERFACE_VERSION__ >= 0x00030205 -#define XEN_GUEST_HANDLE_00030205(type) XEN_GUEST_HANDLE(type) -#else -#define XEN_GUEST_HANDLE_00030205(type) type * -#endif - #endif /* __XEN_PUBLIC_XEN_COMPAT_H__ */ diff -r bb2f8ba47833 -r ad7ad9af265e include/xen/interface/xen.h --- a/include/xen/interface/xen.h Tue Mar 25 12:37:54 2008 -0600 +++ b/include/xen/interface/xen.h Tue Apr 01 11:29:31 2008 -0600 @@ -263,7 +263,11 @@ struct mmuext_op { /* SET_LDT */ unsigned int nr_ents; /* TLB_FLUSH_MULTI, INVLPG_MULTI */ - XEN_GUEST_HANDLE_00030205(void) vcpumask; +#if __XEN_INTERFACE_VERSION__ >= 0x00030205 + XEN_GUEST_HANDLE(void) vcpumask; +#else + void *vcpumask; +#endif } arg2; }; typedef struct mmuext_op mmuext_op_t; diff -r bb2f8ba47833 -r ad7ad9af265e sound/pci/hda/hda_intel.c --- a/sound/pci/hda/hda_intel.c Tue Mar 25 12:37:54 2008 -0600 +++ b/sound/pci/hda/hda_intel.c Tue Apr 01 11:29:31 2008 -0600 @@ -81,6 +81,7 @@ MODULE_SUPPORTED_DEVICE("{{Intel, ICH6}, "{Intel, ESB2}," "{Intel, ICH8}," "{Intel, ICH9}," + "{Intel, ICH10}," "{ATI, SB450}," "{ATI, SB600}," "{ATI, RS600}," @@ -1637,6 +1638,8 @@ static struct pci_device_id azx_ids[] = { 0x8086, 0x284b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH8 */ { 0x8086, 0x293e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH9 */ { 0x8086, 0x293f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH9 */ + { 0x8086, 0x3a3e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH10 */ + { 0x8086, 0x3a6e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH10 */ { 0x1002, 0x437b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATI }, /* ATI SB450 */ { 0x1002, 0x4383, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATI }, /* ATI SB600 */ { 0x1002, 0x793b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATIHDMI }, /* ATI RS600 HDMI */ _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |