WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Remove 2.6.11 patches directory.

# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 60fc40a82fa9ca43b654b00ac4effbceb577b10f
# Parent  ece694762d7a6229e4e2fcb44cc60511891fe6fb

Remove 2.6.11 patches directory.

diff -r ece694762d7a -r 60fc40a82fa9 patches/linux-2.6.11/agpgart.patch
--- a/patches/linux-2.6.11/agpgart.patch        Mon Jul 11 15:12:37 2005
+++ /dev/null   Mon Jul 11 15:35:33 2005
@@ -1,437 +0,0 @@
---- linux-2.6.11/drivers/char/agp/agp.h        2005-03-02 07:38:07 +00:00
-+++ linux-2.6.11-agp/drivers/char/agp/agp.h    2005-03-22 11:14:02 +00:00
-@@ -272,6 +272,8 @@
- #define AGP_GENERIC_SIZES_ENTRIES 11
- extern struct aper_size_info_16 agp3_generic_sizes[];
- 
-+#define virt_to_gart(x) (phys_to_gart(virt_to_phys(x)))
-+#define gart_to_virt(x) (phys_to_virt(gart_to_phys(x)))
- 
- extern int agp_off;
- extern int agp_try_unsupported_boot;
---- linux-2.6.11/drivers/char/agp/ali-agp.c    2005-03-02 07:38:13 +00:00
-+++ linux-2.6.11-agp/drivers/char/agp/ali-agp.c        2005-03-22 11:14:56 
+00:00
-@@ -150,7 +150,7 @@
-       pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp);
-       pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL,
-                       (((temp & ALI_CACHE_FLUSH_ADDR_MASK) |
--                        virt_to_phys(addr)) | ALI_CACHE_FLUSH_EN ));
-+                        virt_to_gart(addr)) | ALI_CACHE_FLUSH_EN ));
-       return addr;
- }
- 
-@@ -174,7 +174,7 @@
-       pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp);
-       pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL,
-                       (((temp & ALI_CACHE_FLUSH_ADDR_MASK) |
--                        virt_to_phys(addr)) | ALI_CACHE_FLUSH_EN));
-+                        virt_to_gart(addr)) | ALI_CACHE_FLUSH_EN));
-       agp_generic_destroy_page(addr);
- }
- 
---- linux-2.6.11/drivers/char/agp/amd-k7-agp.c 2005-03-02 07:38:33 +00:00
-+++ linux-2.6.11-agp/drivers/char/agp/amd-k7-agp.c     2005-03-22 11:14:56 
+00:00
-@@ -43,7 +43,7 @@
- 
-       SetPageReserved(virt_to_page(page_map->real));
-       global_cache_flush();
--      page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real),
-+      page_map->remapped = ioremap_nocache(virt_to_gart(page_map->real),
-                                           PAGE_SIZE);
-       if (page_map->remapped == NULL) {
-               ClearPageReserved(virt_to_page(page_map->real));
-@@ -154,7 +154,7 @@
- 
-       agp_bridge->gatt_table_real = (u32 *)page_dir.real;
-       agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped;
--      agp_bridge->gatt_bus_addr = virt_to_phys(page_dir.real);
-+      agp_bridge->gatt_bus_addr = virt_to_gart(page_dir.real);
- 
-       /* Get the address for the gart region.
-        * This is a bus address even on the alpha, b/c its
-@@ -167,7 +167,7 @@
- 
-       /* Calculate the agp offset */
-       for (i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) {
--              writel(virt_to_phys(amd_irongate_private.gatt_pages[i]->real) | 
1,
-+              writel(virt_to_gart(amd_irongate_private.gatt_pages[i]->real) | 
1,
-                       page_dir.remapped+GET_PAGE_DIR_OFF(addr));
-               readl(page_dir.remapped+GET_PAGE_DIR_OFF(addr));        /* PCI 
Posting. */
-       }
---- linux-2.6.11/drivers/char/agp/amd64-agp.c  2005-03-02 07:38:13 +00:00
-+++ linux-2.6.11-agp/drivers/char/agp/amd64-agp.c      2005-03-22 11:14:56 
+00:00
-@@ -218,7 +218,7 @@
- 
- static int amd_8151_configure(void)
- {
--      unsigned long gatt_bus = virt_to_phys(agp_bridge->gatt_table_real);
-+      unsigned long gatt_bus = virt_to_gart(agp_bridge->gatt_table_real);
- 
-       /* Configure AGP regs in each x86-64 host bridge. */
-       for_each_nb() {
-@@ -590,7 +590,7 @@
- {
-       struct agp_bridge_data *bridge = pci_get_drvdata(pdev);
- 
--      release_mem_region(virt_to_phys(bridge->gatt_table_real),
-+      release_mem_region(virt_to_gart(bridge->gatt_table_real),
-                          
amd64_aperture_sizes[bridge->aperture_size_idx].size);
-       agp_remove_bridge(bridge);
-       agp_put_bridge(bridge);
---- linux-2.6.11/drivers/char/agp/ati-agp.c    2005-03-02 07:38:13 +00:00
-+++ linux-2.6.11-agp/drivers/char/agp/ati-agp.c        2005-03-22 11:14:56 
+00:00
-@@ -61,7 +61,7 @@
- 
-       SetPageReserved(virt_to_page(page_map->real));
-       err = map_page_into_agp(virt_to_page(page_map->real));
--      page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real),
-+      page_map->remapped = ioremap_nocache(virt_to_gart(page_map->real),
-                                           PAGE_SIZE);
-       if (page_map->remapped == NULL || err) {
-               ClearPageReserved(virt_to_page(page_map->real));
---- linux-2.6.11/drivers/char/agp/backend.c    2005-03-02 07:38:13 +00:00
-+++ linux-2.6.11-agp/drivers/char/agp/backend.c        2005-03-22 11:14:56 
+00:00
-@@ -142,7 +142,7 @@
-                       return -ENOMEM;
-               }
- 
--              bridge->scratch_page_real = virt_to_phys(addr);
-+              bridge->scratch_page_real = virt_to_gart(addr);
-               bridge->scratch_page =
-                   bridge->driver->mask_memory(bridge->scratch_page_real, 0);
-       }
-@@ -186,7 +186,7 @@
- err_out:
-       if (bridge->driver->needs_scratch_page)
-               bridge->driver->agp_destroy_page(
--                              phys_to_virt(bridge->scratch_page_real));
-+                              gart_to_virt(bridge->scratch_page_real));
-       if (got_gatt)
-               bridge->driver->free_gatt_table();
-       if (got_keylist) {
-@@ -211,7 +211,7 @@
-       if (bridge->driver->agp_destroy_page &&
-           bridge->driver->needs_scratch_page)
-               bridge->driver->agp_destroy_page(
--                              phys_to_virt(bridge->scratch_page_real));
-+                              gart_to_virt(bridge->scratch_page_real));
- }
- 
- /* XXX Kludge alert: agpgart isn't ready for multiple bridges yet */
---- linux-2.6.11/drivers/char/agp/efficeon-agp.c       2005-03-02 07:37:30 
+00:00
-+++ linux-2.6.11-agp/drivers/char/agp/efficeon-agp.c   2005-03-22 11:15:17 
+00:00
-@@ -219,7 +219,7 @@
- 
-               efficeon_private.l1_table[index] = page;
- 
--              value = __pa(page) | pati | present | index;
-+              value = virt_to_gart(page) | pati | present | index;
- 
-               pci_write_config_dword(agp_bridge->dev,
-                       EFFICEON_ATTPAGE, value);
---- linux-2.6.11/drivers/char/agp/generic.c    2005-03-02 07:37:55 +00:00
-+++ linux-2.6.11-agp/drivers/char/agp/generic.c        2005-03-22 11:17:37 
+00:00
-@@ -151,7 +151,7 @@
-       }
-       if (curr->page_count != 0) {
-               for (i = 0; i < curr->page_count; i++) {
--                      
agp_bridge->driver->agp_destroy_page(phys_to_virt(curr->memory[i]));
-+                      
agp_bridge->driver->agp_destroy_page(gart_to_virt(curr->memory[i]));
-               }
-       }
-       agp_free_key(curr->key);
-@@ -204,7 +204,7 @@
-                       agp_free_memory(new);
-                       return NULL;
-               }
--              new->memory[i] = virt_to_phys(addr);
-+              new->memory[i] = virt_to_gart(addr);
-               new->page_count++;
-       }
- 
-@@ -697,8 +697,7 @@
-                               break;
-                       }
- 
--                      table = (char *) __get_free_pages(GFP_KERNEL,
--                                                        page_order);
-+                      table = alloc_gatt_pages(page_order);
- 
-                       if (table == NULL) {
-                               i++;
-@@ -729,7 +728,7 @@
-               size = ((struct aper_size_info_fixed *) temp)->size;
-               page_order = ((struct aper_size_info_fixed *) temp)->page_order;
-               num_entries = ((struct aper_size_info_fixed *) 
temp)->num_entries;
--              table = (char *) __get_free_pages(GFP_KERNEL, page_order);
-+              table = alloc_gatt_pages(page_order);
-       }
- 
-       if (table == NULL)
-@@ -744,7 +743,7 @@
-       agp_gatt_table = (void *)table;
- 
-       agp_bridge->driver->cache_flush();
--      agp_bridge->gatt_table = ioremap_nocache(virt_to_phys(table),
-+      agp_bridge->gatt_table = ioremap_nocache(virt_to_gart(table),
-                                       (PAGE_SIZE * (1 << page_order)));
-       agp_bridge->driver->cache_flush();
- 
-@@ -752,11 +751,11 @@
-               for (page = virt_to_page(table); page <= 
virt_to_page(table_end); page++)
-                       ClearPageReserved(page);
- 
--              free_pages((unsigned long) table, page_order);
-+              free_gatt_pages(table, page_order);
- 
-               return -ENOMEM;
-       }
--      agp_bridge->gatt_bus_addr = virt_to_phys(agp_bridge->gatt_table_real);
-+      agp_bridge->gatt_bus_addr = virt_to_gart(agp_bridge->gatt_table_real);
- 
-       /* AK: bogus, should encode addresses > 4GB */
-       for (i = 0; i < num_entries; i++) {
-@@ -810,7 +809,7 @@
-       for (page = virt_to_page(table); page <= virt_to_page(table_end); 
page++)
-               ClearPageReserved(page);
- 
--      free_pages((unsigned long) agp_bridge->gatt_table_real, page_order);
-+      free_gatt_pages(agp_bridge->gatt_table_real, page_order);
- 
-       agp_gatt_table = NULL;
-       agp_bridge->gatt_table = NULL;
---- linux-2.6.11/drivers/char/agp/hp-agp.c     2005-03-02 07:38:19 +00:00
-+++ linux-2.6.11-agp/drivers/char/agp/hp-agp.c 2005-03-22 11:14:56 +00:00
-@@ -110,7 +110,7 @@
-       hp->gart_size = HP_ZX1_GART_SIZE;
-       hp->gatt_entries = hp->gart_size / hp->io_page_size;
- 
--      hp->io_pdir = phys_to_virt(readq(hp->ioc_regs+HP_ZX1_PDIR_BASE));
-+      hp->io_pdir = gart_to_virt(readq(hp->ioc_regs+HP_ZX1_PDIR_BASE));
-       hp->gatt = &hp->io_pdir[HP_ZX1_IOVA_TO_PDIR(hp->gart_base)];
- 
-       if (hp->gatt[0] != HP_ZX1_SBA_IOMMU_COOKIE) {
-@@ -248,7 +248,7 @@
-       agp_bridge->mode = 
readl(hp->lba_regs+hp->lba_cap_offset+PCI_AGP_STATUS);
- 
-       if (hp->io_pdir_owner) {
--              writel(virt_to_phys(hp->io_pdir), 
hp->ioc_regs+HP_ZX1_PDIR_BASE);
-+              writel(virt_to_gart(hp->io_pdir), 
hp->ioc_regs+HP_ZX1_PDIR_BASE);
-               readl(hp->ioc_regs+HP_ZX1_PDIR_BASE);
-               writel(hp->io_tlb_ps, hp->ioc_regs+HP_ZX1_TCNFG);
-               readl(hp->ioc_regs+HP_ZX1_TCNFG);
---- linux-2.6.11/drivers/char/agp/i460-agp.c   2005-03-02 07:38:10 +00:00
-+++ linux-2.6.11-agp/drivers/char/agp/i460-agp.c       2005-03-22 11:14:56 
+00:00
-@@ -371,7 +371,7 @@
-       }
-       memset(lp->alloced_map, 0, map_size);
- 
--      lp->paddr = virt_to_phys(lpage);
-+      lp->paddr = virt_to_gart(lpage);
-       lp->refcount = 0;
-       atomic_add(I460_KPAGES_PER_IOPAGE, &agp_bridge->current_memory_agp);
-       return 0;
-@@ -382,7 +382,7 @@
-       kfree(lp->alloced_map);
-       lp->alloced_map = NULL;
- 
--      free_pages((unsigned long) phys_to_virt(lp->paddr), I460_IO_PAGE_SHIFT 
- PAGE_SHIFT);
-+      free_pages((unsigned long) gart_to_virt(lp->paddr), I460_IO_PAGE_SHIFT 
- PAGE_SHIFT);
-       atomic_sub(I460_KPAGES_PER_IOPAGE, &agp_bridge->current_memory_agp);
- }
- 
---- linux-2.6.11/drivers/char/agp/intel-agp.c  2005-03-02 07:38:09 +00:00
-+++ linux-2.6.11-agp/drivers/char/agp/intel-agp.c      2005-03-22 11:14:56 
+00:00
-@@ -285,7 +285,7 @@
-       if (new == NULL)
-               return NULL;
- 
--      new->memory[0] = virt_to_phys(addr);
-+      new->memory[0] = virt_to_gart(addr);
-       if (pg_count == 4) {
-               /* kludge to get 4 physical pages for ARGB cursor */
-               new->memory[1] = new->memory[0] + PAGE_SIZE;
-@@ -328,10 +328,10 @@
-       agp_free_key(curr->key);
-       if(curr->type == AGP_PHYS_MEMORY) {
-               if (curr->page_count == 4)
--                      i8xx_destroy_pages(phys_to_virt(curr->memory[0]));
-+                      i8xx_destroy_pages(gart_to_virt(curr->memory[0]));
-               else
-                       agp_bridge->driver->agp_destroy_page(
--                               phys_to_virt(curr->memory[0]));
-+                               gart_to_virt(curr->memory[0]));
-               vfree(curr->memory);
-       }
-       kfree(curr);
---- linux-2.6.11/drivers/char/agp/intel-mch-agp.c      2005-03-02 07:37:48 
+00:00
-+++ linux-2.6.11-agp/drivers/char/agp/intel-mch-agp.c  2005-03-22 11:14:56 
+00:00
-@@ -51,7 +51,7 @@
-       if (new == NULL)
-               return NULL;
- 
--      new->memory[0] = virt_to_phys(addr);
-+      new->memory[0] = virt_to_gart(addr);
-       new->page_count = 1;
-       new->num_scratch_pages = 1;
-       new->type = AGP_PHYS_MEMORY;
-@@ -63,7 +63,7 @@
- {
-       agp_free_key(curr->key);
-       if(curr->type == AGP_PHYS_MEMORY) {
--              
agp_bridge->driver->agp_destroy_page(phys_to_virt(curr->memory[0]));
-+              
agp_bridge->driver->agp_destroy_page(gart_to_virt(curr->memory[0]));
-               vfree(curr->memory);
-       }
-       kfree(curr);
---- linux-2.6.11/drivers/char/agp/sworks-agp.c 2005-03-02 07:38:37 +00:00
-+++ linux-2.6.11-agp/drivers/char/agp/sworks-agp.c     2005-03-22 11:14:56 
+00:00
-@@ -51,7 +51,7 @@
-       }
-       SetPageReserved(virt_to_page(page_map->real));
-       global_cache_flush();
--      page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real), 
-+      page_map->remapped = ioremap_nocache(virt_to_gart(page_map->real), 
-                                           PAGE_SIZE);
-       if (page_map->remapped == NULL) {
-               ClearPageReserved(virt_to_page(page_map->real));
-@@ -162,7 +162,7 @@
-       /* Create a fake scratch directory */
-       for(i = 0; i < 1024; i++) {
-               writel(agp_bridge->scratch_page, 
serverworks_private.scratch_dir.remapped+i);
--              writel(virt_to_phys(serverworks_private.scratch_dir.real) | 1, 
page_dir.remapped+i);
-+              writel(virt_to_gart(serverworks_private.scratch_dir.real) | 1, 
page_dir.remapped+i);
-       }
- 
-       retval = serverworks_create_gatt_pages(value->num_entries / 1024);
-@@ -174,7 +174,7 @@
- 
-       agp_bridge->gatt_table_real = (u32 *)page_dir.real;
-       agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped;
--      agp_bridge->gatt_bus_addr = virt_to_phys(page_dir.real);
-+      agp_bridge->gatt_bus_addr = virt_to_gart(page_dir.real);
- 
-       /* Get the address for the gart region.
-        * This is a bus address even on the alpha, b/c its
-@@ -187,7 +187,7 @@
-       /* Calculate the agp offset */  
- 
-       for(i = 0; i < value->num_entries / 1024; i++)
--              writel(virt_to_phys(serverworks_private.gatt_pages[i]->real)|1, 
page_dir.remapped+i);
-+              writel(virt_to_gart(serverworks_private.gatt_pages[i]->real)|1, 
page_dir.remapped+i);
- 
-       return 0;
- }
---- linux-2.6.11/drivers/char/agp/uninorth-agp.c       2005-03-02 07:38:09 
+00:00
-+++ linux-2.6.11-agp/drivers/char/agp/uninorth-agp.c   2005-03-22 11:14:56 
+00:00
-@@ -200,7 +200,7 @@
- 
-       agp_bridge->gatt_table_real = (u32 *) table;
-       agp_bridge->gatt_table = (u32 *)table;
--      agp_bridge->gatt_bus_addr = virt_to_phys(table);
-+      agp_bridge->gatt_bus_addr = virt_to_gart(table);
- 
-       for (i = 0; i < num_entries; i++) {
-               agp_bridge->gatt_table[i] =
---- linux-2.6.11/include/asm-alpha/agp.h       2005-03-02 07:37:39 +00:00
-+++ linux-2.6.11-agp/include/asm-alpha/agp.h   2005-03-22 11:18:34 +00:00
-@@ -10,4 +10,14 @@
- #define flush_agp_mappings() 
- #define flush_agp_cache() mb()
- 
-+/* Convert a physical address to an address suitable for the GART. */
-+#define phys_to_gart(x) (x)
-+#define gart_to_phys(x) (x)
-+
-+/* GATT allocation. Returns/accepts GATT kernel virtual address. */
-+#define alloc_gatt_pages(order)               \
-+      ((char *)__get_free_pages(GFP_KERNEL, (order)))
-+#define free_gatt_pages(table, order) \
-+      free_pages((unsigned long)(table), (order))
-+
- #endif
---- linux-2.6.11/include/asm-i386/agp.h        2005-03-02 07:37:31 +00:00
-+++ linux-2.6.11-agp/include/asm-i386/agp.h    2005-03-22 11:18:39 +00:00
-@@ -21,4 +21,14 @@
-    worth it. Would need a page for it. */
- #define flush_agp_cache() asm volatile("wbinvd":::"memory")
- 
-+/* Convert a physical address to an address suitable for the GART. */
-+#define phys_to_gart(x) (x)
-+#define gart_to_phys(x) (x)
-+
-+/* GATT allocation. Returns/accepts GATT kernel virtual address. */
-+#define alloc_gatt_pages(order)               \
-+      ((char *)__get_free_pages(GFP_KERNEL, (order)))
-+#define free_gatt_pages(table, order) \
-+      free_pages((unsigned long)(table), (order))
-+
- #endif
---- linux-2.6.11/include/asm-ia64/agp.h        2005-03-02 07:38:09 +00:00
-+++ linux-2.6.11-agp/include/asm-ia64/agp.h    2005-03-22 11:18:45 +00:00
-@@ -18,4 +18,14 @@
- #define flush_agp_mappings()          /* nothing */
- #define flush_agp_cache()             mb()
- 
-+/* Convert a physical address to an address suitable for the GART. */
-+#define phys_to_gart(x) (x)
-+#define gart_to_phys(x) (x)
-+
-+/* GATT allocation. Returns/accepts GATT kernel virtual address. */
-+#define alloc_gatt_pages(order)               \
-+      ((char *)__get_free_pages(GFP_KERNEL, (order)))
-+#define free_gatt_pages(table, order) \
-+      free_pages((unsigned long)(table), (order))
-+
- #endif /* _ASM_IA64_AGP_H */
---- linux-2.6.11/include/asm-ppc/agp.h 2005-03-02 07:38:08 +00:00
-+++ linux-2.6.11-agp/include/asm-ppc/agp.h     2005-03-22 11:18:52 +00:00
-@@ -10,4 +10,14 @@
- #define flush_agp_mappings()
- #define flush_agp_cache() mb()
- 
-+/* Convert a physical address to an address suitable for the GART. */
-+#define phys_to_gart(x) (x)
-+#define gart_to_phys(x) (x)
-+
-+/* GATT allocation. Returns/accepts GATT kernel virtual address. */
-+#define alloc_gatt_pages(order)               \
-+      ((char *)__get_free_pages(GFP_KERNEL, (order)))
-+#define free_gatt_pages(table, order) \
-+      free_pages((unsigned long)(table), (order))
-+
- #endif
---- linux-2.6.11/include/asm-sparc64/agp.h     2005-03-02 07:37:48 +00:00
-+++ linux-2.6.11-agp/include/asm-sparc64/agp.h 2005-03-22 11:18:59 +00:00
-@@ -8,4 +8,14 @@
- #define flush_agp_mappings() 
- #define flush_agp_cache() mb()
- 
-+/* Convert a physical address to an address suitable for the GART. */
-+#define phys_to_gart(x) (x)
-+#define gart_to_phys(x) (x)
-+
-+/* GATT allocation. Returns/accepts GATT kernel virtual address. */
-+#define alloc_gatt_pages(order)               \
-+      ((char *)__get_free_pages(GFP_KERNEL, (order)))
-+#define free_gatt_pages(table, order) \
-+      free_pages((unsigned long)(table), (order))
-+
- #endif
---- linux-2.6.11/include/asm-x86_64/agp.h      2005-03-02 07:37:30 +00:00
-+++ linux-2.6.11-agp/include/asm-x86_64/agp.h  2005-03-22 11:18:22 +00:00
-@@ -19,4 +19,14 @@
-    worth it. Would need a page for it. */
- #define flush_agp_cache() asm volatile("wbinvd":::"memory")
- 
-+/* Convert a physical address to an address suitable for the GART. */
-+#define phys_to_gart(x) (x)
-+#define gart_to_phys(x) (x)
-+
-+/* GATT allocation. Returns/accepts GATT kernel virtual address. */
-+#define alloc_gatt_pages(order)               \
-+      ((char *)__get_free_pages(GFP_KERNEL, (order)))
-+#define free_gatt_pages(table, order) \
-+      free_pages((unsigned long)(table), (order))
-+
- #endif
diff -r ece694762d7a -r 60fc40a82fa9 
patches/linux-2.6.11/i386-cpu-hotplug-updated-for-mm.patch
--- a/patches/linux-2.6.11/i386-cpu-hotplug-updated-for-mm.patch        Mon Jul 
11 15:12:37 2005
+++ /dev/null   Mon Jul 11 15:35:33 2005
@@ -1,656 +0,0 @@
-
-From: Zwane Mwaikambo <zwane@xxxxxxxxxxxxx>
-
-Find attached the i386 cpu hotplug patch updated for Ingo's latest round of
-goodies.  In order to avoid dumping cpu hotplug code into kernel/irq/* i
-dropped the cpu_online check in do_IRQ() by modifying fixup_irqs().  The
-difference being that on cpu offline, fixup_irqs() is called before we
-clear the cpu from cpu_online_map and a long delay in order to ensure that
-we never have any queued external interrupts on the APICs.  Due to my usual
-test victims being in boxes a continent away this hasn't been tested, but
-i'll cover bug reports (nudge, Nathan!  ;)
-
-1) Add CONFIG_HOTPLUG_CPU
-2) disable local APIC timer on dead cpus.
-3) Disable preempt around irq balancing to prevent CPUs going down.
-4) Print irq stats for all possible cpus.
-5) Debugging check for interrupts on offline cpus.
-6) Hacky fixup_irqs() to redirect irqs when cpus go off/online.
-7) play_dead() for offline cpus to spin inside.
-8) Handle offline cpus set in flush_tlb_others().
-9) Grab lock earlier in smp_call_function() to prevent CPUs going down.
-10) Implement __cpu_disable() and __cpu_die().
-11) Enable local interrupts in cpu_enable() after fixup_irqs()
-12) Don't fiddle with NMI on dead cpu, but leave intact on other cpus.
-13) Program IRQ affinity whilst cpu is still in cpu_online_map on offline.
-
-Signed-off-by: Zwane Mwaikambo <zwane@xxxxxxxxxxxxx>
-DESC
-ppc64: fix hotplug cpu
-EDESC
-From: Zwane Mwaikambo <zwane@xxxxxxxxxxx>
-
-I seem to have broken this when I moved the clearing of the dying cpu to 
-arch specific code.
-
-Signed-off-by: Zwane Mwaikambo <zwane@xxxxxxxxxxx>
-Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
----
-
- 25-akpm/arch/i386/Kconfig               |    9 ++
- 25-akpm/arch/i386/kernel/apic.c         |    3 
- 25-akpm/arch/i386/kernel/io_apic.c      |    2 
- 25-akpm/arch/i386/kernel/irq.c          |   66 +++++++++++++++++----
- 25-akpm/arch/i386/kernel/msr.c          |    2 
- 25-akpm/arch/i386/kernel/process.c      |   35 +++++++++++
- 25-akpm/arch/i386/kernel/smp.c          |   25 +++++---
- 25-akpm/arch/i386/kernel/smpboot.c      |   98 
++++++++++++++++++++++++++++++--
- 25-akpm/arch/i386/kernel/traps.c        |    8 ++
- 25-akpm/arch/ia64/kernel/smpboot.c      |    3 
- 25-akpm/arch/ppc64/kernel/pSeries_smp.c |    5 +
- 25-akpm/arch/s390/kernel/smp.c          |    4 -
- 25-akpm/include/asm-i386/cpu.h          |    2 
- 25-akpm/include/asm-i386/irq.h          |    4 +
- 25-akpm/include/asm-i386/smp.h          |    3 
- 25-akpm/kernel/cpu.c                    |   14 +---
- arch/ppc64/kernel/smp.c                 |    0 
- 17 files changed, 242 insertions(+), 41 deletions(-)
-
-diff -puN arch/i386/Kconfig~i386-cpu-hotplug-updated-for-mm arch/i386/Kconfig
---- 25/arch/i386/Kconfig~i386-cpu-hotplug-updated-for-mm       2005-02-23 
02:20:06.000000000 -0800
-+++ 25-akpm/arch/i386/Kconfig  2005-02-23 02:20:06.000000000 -0800
-@@ -1205,6 +1205,15 @@ config SCx200
-         This support is also available as a module.  If compiled as a
-         module, it will be called scx200.
- 
-+config HOTPLUG_CPU
-+      bool "Support for hot-pluggable CPUs (EXPERIMENTAL)"
-+      depends on SMP && HOTPLUG && EXPERIMENTAL
-+      ---help---
-+        Say Y here to experiment with turning CPUs off and on.  CPUs
-+        can be controlled through /sys/devices/system/cpu.
-+
-+        Say N.
-+
- source "drivers/pcmcia/Kconfig"
- 
- source "drivers/pci/hotplug/Kconfig"
-diff -puN arch/i386/kernel/apic.c~i386-cpu-hotplug-updated-for-mm 
arch/i386/kernel/apic.c
---- 25/arch/i386/kernel/apic.c~i386-cpu-hotplug-updated-for-mm 2005-02-23 
02:20:06.000000000 -0800
-+++ 25-akpm/arch/i386/kernel/apic.c    2005-02-23 02:20:06.000000000 -0800
-@@ -26,6 +26,7 @@
- #include <linux/mc146818rtc.h>
- #include <linux/kernel_stat.h>
- #include <linux/sysdev.h>
-+#include <linux/cpu.h>
- 
- #include <asm/atomic.h>
- #include <asm/smp.h>
-@@ -1048,7 +1049,7 @@ void __init setup_secondary_APIC_clock(v
-       setup_APIC_timer(calibration_result);
- }
- 
--void __init disable_APIC_timer(void)
-+void __devinit disable_APIC_timer(void)
- {
-       if (using_apic_timer) {
-               unsigned long v;
-diff -puN arch/i386/kernel/io_apic.c~i386-cpu-hotplug-updated-for-mm 
arch/i386/kernel/io_apic.c
---- 25/arch/i386/kernel/io_apic.c~i386-cpu-hotplug-updated-for-mm      
2005-02-23 02:20:06.000000000 -0800
-+++ 25-akpm/arch/i386/kernel/io_apic.c 2005-02-23 02:20:06.000000000 -0800
-@@ -576,9 +576,11 @@ static int balanced_irq(void *unused)
-               try_to_freeze(PF_FREEZE);
-               if (time_after(jiffies,
-                               prev_balance_time+balanced_irq_interval)) {
-+                      preempt_disable();
-                       do_irq_balance();
-                       prev_balance_time = jiffies;
-                       time_remaining = balanced_irq_interval;
-+                      preempt_enable();
-               }
-       }
-       return 0;
-diff -puN arch/i386/kernel/irq.c~i386-cpu-hotplug-updated-for-mm 
arch/i386/kernel/irq.c
---- 25/arch/i386/kernel/irq.c~i386-cpu-hotplug-updated-for-mm  2005-02-23 
02:20:06.000000000 -0800
-+++ 25-akpm/arch/i386/kernel/irq.c     2005-02-23 02:20:06.000000000 -0800
-@@ -15,6 +15,9 @@
- #include <linux/seq_file.h>
- #include <linux/interrupt.h>
- #include <linux/kernel_stat.h>
-+#include <linux/notifier.h>
-+#include <linux/cpu.h>
-+#include <linux/delay.h>
- 
- #ifndef CONFIG_X86_LOCAL_APIC
- /*
-@@ -209,9 +212,8 @@ int show_interrupts(struct seq_file *p, 
- 
-       if (i == 0) {
-               seq_printf(p, "           ");
--              for (j=0; j<NR_CPUS; j++)
--                      if (cpu_online(j))
--                              seq_printf(p, "CPU%d       ",j);
-+              for_each_cpu(j)
-+                      seq_printf(p, "CPU%d       ",j);
-               seq_putc(p, '\n');
-       }
- 
-@@ -224,9 +226,8 @@ int show_interrupts(struct seq_file *p, 
- #ifndef CONFIG_SMP
-               seq_printf(p, "%10u ", kstat_irqs(i));
- #else
--              for (j = 0; j < NR_CPUS; j++)
--                      if (cpu_online(j))
--                              seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
-+              for_each_cpu(j)
-+                      seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
- #endif
-               seq_printf(p, " %14s", irq_desc[i].handler->typename);
-               seq_printf(p, "  %s", action->name);
-@@ -239,16 +240,13 @@ skip:
-               spin_unlock_irqrestore(&irq_desc[i].lock, flags);
-       } else if (i == NR_IRQS) {
-               seq_printf(p, "NMI: ");
--              for (j = 0; j < NR_CPUS; j++)
--                      if (cpu_online(j))
--                              seq_printf(p, "%10u ", nmi_count(j));
-+              for_each_cpu(j)
-+                      seq_printf(p, "%10u ", nmi_count(j));
-               seq_putc(p, '\n');
- #ifdef CONFIG_X86_LOCAL_APIC
-               seq_printf(p, "LOC: ");
--              for (j = 0; j < NR_CPUS; j++)
--                      if (cpu_online(j))
--                              seq_printf(p, "%10u ",
--                                      irq_stat[j].apic_timer_irqs);
-+              for_each_cpu(j)
-+                      seq_printf(p, "%10u ", irq_stat[j].apic_timer_irqs);
-               seq_putc(p, '\n');
- #endif
-               seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count));
-@@ -258,3 +256,45 @@ skip:
-       }
-       return 0;
- }
-+
-+#ifdef CONFIG_HOTPLUG_CPU
-+#include <mach_apic.h>
-+
-+void fixup_irqs(cpumask_t map)
-+{
-+      unsigned int irq;
-+      static int warned;
-+
-+      for (irq = 0; irq < NR_IRQS; irq++) {
-+              cpumask_t mask;
-+              if (irq == 2)
-+                      continue;
-+
-+              cpus_and(mask, irq_affinity[irq], map);
-+              if (any_online_cpu(mask) == NR_CPUS) {
-+                      printk("Breaking affinity for irq %i\n", irq);
-+                      mask = map;
-+              }
-+              if (irq_desc[irq].handler->set_affinity)
-+                      irq_desc[irq].handler->set_affinity(irq, mask);
-+              else if (irq_desc[irq].action && !(warned++))
-+                      printk("Cannot set affinity for irq %i\n", irq);
-+      }
-+
-+#if 0
-+      barrier();
-+      /* Ingo Molnar says: "after the IO-APIC masks have been redirected
-+         [note the nop - the interrupt-enable boundary on x86 is two
-+         instructions from sti] - to flush out pending hardirqs and
-+         IPIs. After this point nothing is supposed to reach this CPU." */
-+      __asm__ __volatile__("sti; nop; cli");
-+      barrier();
-+#else
-+      /* That doesn't seem sufficient.  Give it 1ms. */
-+      local_irq_enable();
-+      mdelay(1);
-+      local_irq_disable();
-+#endif
-+}
-+#endif
-+
-diff -puN arch/i386/kernel/msr.c~i386-cpu-hotplug-updated-for-mm 
arch/i386/kernel/msr.c
---- 25/arch/i386/kernel/msr.c~i386-cpu-hotplug-updated-for-mm  2005-02-23 
02:20:06.000000000 -0800
-+++ 25-akpm/arch/i386/kernel/msr.c     2005-02-23 02:20:06.000000000 -0800
-@@ -260,7 +260,7 @@ static struct file_operations msr_fops =
-       .open = msr_open,
- };
- 
--static int msr_class_simple_device_add(int i)
-+static int __devinit msr_class_simple_device_add(int i)
- {
-       int err = 0;
-       struct class_device *class_err;
-diff -puN arch/i386/kernel/process.c~i386-cpu-hotplug-updated-for-mm 
arch/i386/kernel/process.c
---- 25/arch/i386/kernel/process.c~i386-cpu-hotplug-updated-for-mm      
2005-02-23 02:20:06.000000000 -0800
-+++ 25-akpm/arch/i386/kernel/process.c 2005-02-23 02:20:06.000000000 -0800
-@@ -13,6 +13,7 @@
- 
- #include <stdarg.h>
- 
-+#include <linux/cpu.h>
- #include <linux/errno.h>
- #include <linux/sched.h>
- #include <linux/fs.h>
-@@ -55,6 +56,9 @@
- #include <linux/irq.h>
- #include <linux/err.h>
- 
-+#include <asm/tlbflush.h>
-+#include <asm/cpu.h>
-+
- asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
- 
- int hlt_counter;
-@@ -139,6 +143,34 @@ static void poll_idle (void)
-       }
- }
- 
-+#ifdef CONFIG_HOTPLUG_CPU
-+#include <asm/nmi.h>
-+/* We don't actually take CPU down, just spin without interrupts. */
-+static inline void play_dead(void)
-+{
-+      /* Ack it */
-+      __get_cpu_var(cpu_state) = CPU_DEAD;
-+
-+      /* We shouldn't have to disable interrupts while dead, but
-+       * some interrupts just don't seem to go away, and this makes
-+       * it "work" for testing purposes. */
-+      /* Death loop */
-+      while (__get_cpu_var(cpu_state) != CPU_UP_PREPARE)
-+              cpu_relax();
-+
-+      local_irq_disable();
-+      __flush_tlb_all();
-+      cpu_set(smp_processor_id(), cpu_online_map);
-+      enable_APIC_timer();
-+      local_irq_enable();
-+}
-+#else
-+static inline void play_dead(void)
-+{
-+      BUG();
-+}
-+#endif /* CONFIG_HOTPLUG_CPU */
-+
- /*
-  * The idle thread. There's no useful work to be
-  * done, so just try to conserve power and have a
-@@ -162,6 +194,9 @@ void cpu_idle (void)
-                       if (!idle)
-                               idle = default_idle;
- 
-+                      if (cpu_is_offline(cpu))
-+                              play_dead();
-+
-                       irq_stat[cpu].idle_timestamp = jiffies;
-                       idle();
-               }
-diff -puN arch/i386/kernel/smpboot.c~i386-cpu-hotplug-updated-for-mm 
arch/i386/kernel/smpboot.c
---- 25/arch/i386/kernel/smpboot.c~i386-cpu-hotplug-updated-for-mm      
2005-02-23 02:20:06.000000000 -0800
-+++ 25-akpm/arch/i386/kernel/smpboot.c 2005-02-23 02:20:06.000000000 -0800
-@@ -44,6 +44,9 @@
- #include <linux/smp_lock.h>
- #include <linux/irq.h>
- #include <linux/bootmem.h>
-+#include <linux/notifier.h>
-+#include <linux/cpu.h>
-+#include <linux/percpu.h>
- 
- #include <linux/delay.h>
- #include <linux/mc146818rtc.h>
-@@ -89,6 +92,9 @@ extern unsigned char trampoline_end  [];
- static unsigned char *trampoline_base;
- static int trampoline_exec;
- 
-+/* State of each CPU. */
-+DEFINE_PER_CPU(int, cpu_state) = { 0 };
-+
- /*
-  * Currently trivial. Write the real->protected mode
-  * bootstrap into the page concerned. The caller
-@@ -1095,6 +1101,9 @@ static void __init smp_boot_cpus(unsigne
-    who understands all this stuff should rewrite it properly. --RR 15/Jul/02 
*/
- void __init smp_prepare_cpus(unsigned int max_cpus)
- {
-+      smp_commenced_mask = cpumask_of_cpu(0);
-+      cpu_callin_map = cpumask_of_cpu(0);
-+      mb();
-       smp_boot_cpus(max_cpus);
- }
- 
-@@ -1104,20 +1113,99 @@ void __devinit smp_prepare_boot_cpu(void
-       cpu_set(smp_processor_id(), cpu_callout_map);
- }
- 
--int __devinit __cpu_up(unsigned int cpu)
-+#ifdef CONFIG_HOTPLUG_CPU
-+
-+/* must be called with the cpucontrol mutex held */
-+static int __devinit cpu_enable(unsigned int cpu)
- {
--      /* This only works at boot for x86.  See "rewrite" above. */
--      if (cpu_isset(cpu, smp_commenced_mask)) {
--              local_irq_enable();
--              return -ENOSYS;
-+      /* get the target out of its holding state */
-+      per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;
-+      wmb();
-+
-+      /* wait for the processor to ack it. timeout? */
-+      while (!cpu_online(cpu))
-+              cpu_relax();
-+
-+      fixup_irqs(cpu_online_map);
-+      /* counter the disable in fixup_irqs() */
-+      local_irq_enable();
-+      return 0;
-+}
-+
-+int __cpu_disable(void)
-+{
-+      cpumask_t map = cpu_online_map;
-+      int cpu = smp_processor_id();
-+
-+      /*
-+       * Perhaps use cpufreq to drop frequency, but that could go
-+       * into generic code.
-+       *
-+       * We won't take down the boot processor on i386 due to some
-+       * interrupts only being able to be serviced by the BSP.
-+       * Especially so if we're not using an IOAPIC   -zwane
-+       */
-+      if (cpu == 0)
-+              return -EBUSY;
-+
-+      /* We enable the timer again on the exit path of the death loop */
-+      disable_APIC_timer();
-+      /* Allow any queued timer interrupts to get serviced */
-+      local_irq_enable();
-+      mdelay(1);
-+      local_irq_disable();
-+
-+      cpu_clear(cpu, map);
-+      fixup_irqs(map);
-+      /* It's now safe to remove this processor from the online map */
-+      cpu_clear(cpu, cpu_online_map);
-+      return 0;
-+}
-+
-+void __cpu_die(unsigned int cpu)
-+{
-+      /* We don't do anything here: idle task is faking death itself. */
-+      unsigned int i;
-+
-+      for (i = 0; i < 10; i++) {
-+              /* They ack this in play_dead by setting CPU_DEAD */
-+              if (per_cpu(cpu_state, cpu) == CPU_DEAD)
-+                      return;
-+              current->state = TASK_UNINTERRUPTIBLE;
-+              schedule_timeout(HZ/10);
-       }
-+      printk(KERN_ERR "CPU %u didn't die...\n", cpu);
-+}
-+#else /* ... !CONFIG_HOTPLUG_CPU */
-+int __cpu_disable(void)
-+{
-+      return -ENOSYS;
-+}
- 
-+void __cpu_die(unsigned int cpu)
-+{
-+      /* We said "no" in __cpu_disable */
-+      BUG();
-+}
-+#endif /* CONFIG_HOTPLUG_CPU */
-+
-+int __devinit __cpu_up(unsigned int cpu)
-+{
-       /* In case one didn't come up */
-       if (!cpu_isset(cpu, cpu_callin_map)) {
-+              printk(KERN_DEBUG "skipping cpu%d, didn't come online\n", cpu);
-               local_irq_enable();
-               return -EIO;
-       }
- 
-+#ifdef CONFIG_HOTPLUG_CPU
-+      /* Already up, and in cpu_quiescent now? */
-+      if (cpu_isset(cpu, smp_commenced_mask)) {
-+              cpu_enable(cpu);
-+              return 0;
-+      }
-+#endif
-+
-       local_irq_enable();
-       /* Unleash the CPU! */
-       cpu_set(cpu, smp_commenced_mask);
-diff -puN arch/i386/kernel/smp.c~i386-cpu-hotplug-updated-for-mm 
arch/i386/kernel/smp.c
---- 25/arch/i386/kernel/smp.c~i386-cpu-hotplug-updated-for-mm  2005-02-23 
02:20:06.000000000 -0800
-+++ 25-akpm/arch/i386/kernel/smp.c     2005-02-23 02:20:06.000000000 -0800
-@@ -19,6 +19,7 @@
- #include <linux/mc146818rtc.h>
- #include <linux/cache.h>
- #include <linux/interrupt.h>
-+#include <linux/cpu.h>
- 
- #include <asm/mtrr.h>
- #include <asm/tlbflush.h>
-@@ -163,7 +164,7 @@ void send_IPI_mask_bitmask(cpumask_t cpu
-       unsigned long flags;
- 
-       local_irq_save(flags);
--              
-+      WARN_ON(mask & ~cpus_addr(cpu_online_map)[0]);
-       /*
-        * Wait for idle.
-        */
-@@ -345,21 +346,21 @@ out:
- static void flush_tlb_others(cpumask_t cpumask, struct mm_struct *mm,
-                                               unsigned long va)
- {
--      cpumask_t tmp;
-       /*
-        * A couple of (to be removed) sanity checks:
-        *
--       * - we do not send IPIs to not-yet booted CPUs.
-        * - current CPU must not be in mask
-        * - mask must exist :)
-        */
-       BUG_ON(cpus_empty(cpumask));
--
--      cpus_and(tmp, cpumask, cpu_online_map);
--      BUG_ON(!cpus_equal(cpumask, tmp));
-       BUG_ON(cpu_isset(smp_processor_id(), cpumask));
-       BUG_ON(!mm);
- 
-+      /* If a CPU which we ran on has gone down, OK. */
-+      cpus_and(cpumask, cpumask, cpu_online_map);
-+      if (cpus_empty(cpumask))
-+              return;
-+
-       /*
-        * i'm not happy about this global shared spinlock in the
-        * MM hot path, but we'll see how contended it is.
-@@ -484,6 +485,7 @@ void smp_send_nmi_allbutself(void)
-  */
- void smp_send_reschedule(int cpu)
- {
-+      WARN_ON(cpu_is_offline(cpu));
-       send_IPI_mask(cpumask_of_cpu(cpu), RESCHEDULE_VECTOR);
- }
- 
-@@ -524,10 +526,16 @@ int smp_call_function (void (*func) (voi
-  */
- {
-       struct call_data_struct data;
--      int cpus = num_online_cpus()-1;
-+      int cpus;
- 
--      if (!cpus)
-+      /* Holding any lock stops cpus from going down. */
-+      spin_lock(&call_lock);
-+      cpus = num_online_cpus()-1;
-+
-+      if (!cpus) {
-+              spin_unlock(&call_lock);
-               return 0;
-+      }
- 
-       /* Can deadlock when called with interrupts disabled */
-       WARN_ON(irqs_disabled());
-@@ -539,7 +547,6 @@ int smp_call_function (void (*func) (voi
-       if (wait)
-               atomic_set(&data.finished, 0);
- 
--      spin_lock(&call_lock);
-       call_data = &data;
-       mb();
-       
-diff -puN arch/i386/kernel/traps.c~i386-cpu-hotplug-updated-for-mm 
arch/i386/kernel/traps.c
---- 25/arch/i386/kernel/traps.c~i386-cpu-hotplug-updated-for-mm        
2005-02-23 02:20:06.000000000 -0800
-+++ 25-akpm/arch/i386/kernel/traps.c   2005-02-23 02:20:06.000000000 -0800
-@@ -669,6 +669,14 @@ fastcall void do_nmi(struct pt_regs * re
-       nmi_enter();
- 
-       cpu = smp_processor_id();
-+
-+#ifdef CONFIG_HOTPLUG_CPU
-+      if (!cpu_online(cpu)) {
-+              nmi_exit();
-+              return;
-+      }
-+#endif
-+
-       ++nmi_count(cpu);
- 
-       if (!nmi_callback(regs, cpu))
-diff -puN arch/ia64/kernel/smpboot.c~i386-cpu-hotplug-updated-for-mm 
arch/ia64/kernel/smpboot.c
---- 25/arch/ia64/kernel/smpboot.c~i386-cpu-hotplug-updated-for-mm      
2005-02-23 02:20:06.000000000 -0800
-+++ 25-akpm/arch/ia64/kernel/smpboot.c 2005-02-23 02:20:06.000000000 -0800
-@@ -590,9 +590,10 @@ int __cpu_disable(void)
-       if (cpu == 0)
-               return -EBUSY;
- 
-+      cpu_clear(cpu, cpu_online_map);
-       fixup_irqs();
-       local_flush_tlb_all();
--      printk ("Disabled cpu %u\n", smp_processor_id());
-+      printk("Disabled cpu %u\n", cpu);
-       return 0;
- }
- 
-diff -puN arch/ppc64/kernel/smp.c~i386-cpu-hotplug-updated-for-mm 
arch/ppc64/kernel/smp.c
-diff -puN arch/s390/kernel/smp.c~i386-cpu-hotplug-updated-for-mm 
arch/s390/kernel/smp.c
---- 25/arch/s390/kernel/smp.c~i386-cpu-hotplug-updated-for-mm  2005-02-23 
02:20:06.000000000 -0800
-+++ 25-akpm/arch/s390/kernel/smp.c     2005-02-23 02:20:06.000000000 -0800
-@@ -679,12 +679,14 @@ __cpu_disable(void)
- {
-       unsigned long flags;
-       ec_creg_mask_parms cr_parms;
-+      int cpu = smp_processor_id();
- 
-       spin_lock_irqsave(&smp_reserve_lock, flags);
--      if (smp_cpu_reserved[smp_processor_id()] != 0) {
-+      if (smp_cpu_reserved[cpu] != 0) {
-               spin_unlock_irqrestore(&smp_reserve_lock, flags);
-               return -EBUSY;
-       }
-+      cpu_clear(cpu, cpu_online_map);
- 
- #ifdef CONFIG_PFAULT
-       /* Disable pfault pseudo page faults on this cpu. */
-diff -puN include/asm-i386/cpu.h~i386-cpu-hotplug-updated-for-mm 
include/asm-i386/cpu.h
---- 25/include/asm-i386/cpu.h~i386-cpu-hotplug-updated-for-mm  2005-02-23 
02:20:06.000000000 -0800
-+++ 25-akpm/include/asm-i386/cpu.h     2005-02-23 02:20:06.000000000 -0800
-@@ -5,6 +5,7 @@
- #include <linux/cpu.h>
- #include <linux/topology.h>
- #include <linux/nodemask.h>
-+#include <linux/percpu.h>
- 
- #include <asm/node.h>
- 
-@@ -17,4 +18,5 @@ extern int arch_register_cpu(int num);
- extern void arch_unregister_cpu(int);
- #endif
- 
-+DECLARE_PER_CPU(int, cpu_state);
- #endif /* _ASM_I386_CPU_H_ */
-diff -puN include/asm-i386/irq.h~i386-cpu-hotplug-updated-for-mm 
include/asm-i386/irq.h
---- 25/include/asm-i386/irq.h~i386-cpu-hotplug-updated-for-mm  2005-02-23 
02:20:06.000000000 -0800
-+++ 25-akpm/include/asm-i386/irq.h     2005-02-23 02:20:06.000000000 -0800
-@@ -38,4 +38,8 @@ extern void release_vm86_irqs(struct tas
- extern int irqbalance_disable(char *str);
- #endif
- 
-+#ifdef CONFIG_HOTPLUG_CPU
-+extern void fixup_irqs(cpumask_t map);
-+#endif
-+
- #endif /* _ASM_IRQ_H */
-diff -puN include/asm-i386/smp.h~i386-cpu-hotplug-updated-for-mm 
include/asm-i386/smp.h
---- 25/include/asm-i386/smp.h~i386-cpu-hotplug-updated-for-mm  2005-02-23 
02:20:06.000000000 -0800
-+++ 25-akpm/include/asm-i386/smp.h     2005-02-23 02:20:06.000000000 -0800
-@@ -85,6 +85,9 @@ static __inline int logical_smp_processo
- }
- 
- #endif
-+
-+extern int __cpu_disable(void);
-+extern void __cpu_die(unsigned int cpu);
- #endif /* !__ASSEMBLY__ */
- 
- #define NO_PROC_ID            0xFF            /* No processor magic marker */
-diff -puN kernel/cpu.c~i386-cpu-hotplug-updated-for-mm kernel/cpu.c
---- 25/kernel/cpu.c~i386-cpu-hotplug-updated-for-mm    2005-02-23 
02:20:06.000000000 -0800
-+++ 25-akpm/kernel/cpu.c       2005-02-23 02:20:06.000000000 -0800
-@@ -63,19 +63,15 @@ static int take_cpu_down(void *unused)
- {
-       int err;
- 
--      /* Take offline: makes arch_cpu_down somewhat easier. */
--      cpu_clear(smp_processor_id(), cpu_online_map);
--
-       /* Ensure this CPU doesn't handle any more interrupts. */
-       err = __cpu_disable();
-       if (err < 0)
--              cpu_set(smp_processor_id(), cpu_online_map);
--      else
--              /* Force idle task to run as soon as we yield: it should
--                 immediately notice cpu is offline and die quickly. */
--              sched_idle_next();
-+              return err;
- 
--      return err;
-+      /* Force idle task to run as soon as we yield: it should
-+         immediately notice cpu is offline and die quickly. */
-+      sched_idle_next();
-+      return 0;
- }
- 
- int cpu_down(unsigned int cpu)
-diff -puN arch/ppc64/kernel/pSeries_smp.c~i386-cpu-hotplug-updated-for-mm 
arch/ppc64/kernel/pSeries_smp.c
---- 25/arch/ppc64/kernel/pSeries_smp.c~i386-cpu-hotplug-updated-for-mm 
2005-02-23 02:20:08.000000000 -0800
-+++ 25-akpm/arch/ppc64/kernel/pSeries_smp.c    2005-02-23 02:20:08.000000000 
-0800
-@@ -86,10 +86,13 @@ static int query_cpu_stopped(unsigned in
- 
- int pSeries_cpu_disable(void)
- {
-+      int cpu = smp_processor_id();
-+
-+      cpu_clear(cpu, cpu_online_map);
-       systemcfg->processorCount--;
- 
-       /*fix boot_cpuid here*/
--      if (smp_processor_id() == boot_cpuid)
-+      if (cpu == boot_cpuid)
-               boot_cpuid = any_online_cpu(cpu_online_map);
- 
-       /* FIXME: abstract this to not be platform specific later on */
-_
diff -r ece694762d7a -r 60fc40a82fa9 patches/linux-2.6.11/iomap.patch
--- a/patches/linux-2.6.11/iomap.patch  Mon Jul 11 15:12:37 2005
+++ /dev/null   Mon Jul 11 15:35:33 2005
@@ -1,120 +0,0 @@
-diff -ur linux-2.6.11/drivers/char/agp/frontend.c 
linux-2.6.11-io/drivers/char/agp/frontend.c
---- linux-2.6.11/drivers/char/agp/frontend.c   2005-03-02 07:37:49.000000000 
+0000
-+++ linux-2.6.11-io/drivers/char/agp/frontend.c        2005-03-15 
17:38:30.000000000 +0000
-@@ -627,7 +627,7 @@
-               DBG("client vm_ops=%p", kerninfo.vm_ops);
-               if (kerninfo.vm_ops) {
-                       vma->vm_ops = kerninfo.vm_ops;
--              } else if (remap_pfn_range(vma, vma->vm_start,
-+              } else if (io_remap_pfn_range(vma, vma->vm_start,
-                               (kerninfo.aper_base + offset) >> PAGE_SHIFT,
-                                           size, vma->vm_page_prot)) {
-                       goto out_again;
-@@ -643,7 +643,7 @@
-               DBG("controller vm_ops=%p", kerninfo.vm_ops);
-               if (kerninfo.vm_ops) {
-                       vma->vm_ops = kerninfo.vm_ops;
--              } else if (remap_pfn_range(vma, vma->vm_start,
-+              } else if (io_remap_pfn_range(vma, vma->vm_start,
-                                           kerninfo.aper_base >> PAGE_SHIFT,
-                                           size, vma->vm_page_prot)) {
-                       goto out_again;
-diff -ur linux-2.6.11/drivers/char/drm/drm_vm.c 
linux-2.6.11-io/drivers/char/drm/drm_vm.c
---- linux-2.6.11/drivers/char/drm/drm_vm.c     2005-03-02 07:38:33.000000000 
+0000
-+++ linux-2.6.11-io/drivers/char/drm/drm_vm.c  2005-03-15 17:43:26.000000000 
+0000
-@@ -630,7 +630,7 @@
-                                       vma->vm_end - vma->vm_start,
-                                       vma->vm_page_prot, 0))
- #else
--              if (remap_pfn_range(DRM_RPR_ARG(vma) vma->vm_start,
-+              if (io_remap_pfn_range(vma, vma->vm_start,
-                                    (VM_OFFSET(vma) + offset) >> PAGE_SHIFT,
-                                    vma->vm_end - vma->vm_start,
-                                    vma->vm_page_prot))
-diff -ur linux-2.6.11/drivers/char/drm/i810_dma.c 
linux-2.6.11-io/drivers/char/drm/i810_dma.c
---- linux-2.6.11/drivers/char/drm/i810_dma.c   2005-03-02 07:37:55.000000000 
+0000
-+++ linux-2.6.11-io/drivers/char/drm/i810_dma.c        2005-03-15 
17:53:36.000000000 +0000
-@@ -139,7 +139,7 @@
-       buf_priv->currently_mapped = I810_BUF_MAPPED;
-       unlock_kernel();
- 
--      if (remap_pfn_range(DRM_RPR_ARG(vma) vma->vm_start,
-+      if (io_remap_pfn_range(vma, vma->vm_start,
-                            VM_OFFSET(vma) >> PAGE_SHIFT,
-                            vma->vm_end - vma->vm_start,
-                            vma->vm_page_prot)) return -EAGAIN;
-diff -ur linux-2.6.11/drivers/char/drm/i830_dma.c 
linux-2.6.11-io/drivers/char/drm/i830_dma.c
---- linux-2.6.11/drivers/char/drm/i830_dma.c   2005-03-02 07:37:48.000000000 
+0000
-+++ linux-2.6.11-io/drivers/char/drm/i830_dma.c        2005-03-15 
17:53:46.000000000 +0000
-@@ -157,7 +157,7 @@
-       buf_priv->currently_mapped = I830_BUF_MAPPED;
-       unlock_kernel();
- 
--      if (remap_pfn_range(DRM_RPR_ARG(vma) vma->vm_start,
-+      if (io_remap_pfn_range(vma, vma->vm_start,
-                            VM_OFFSET(vma) >> PAGE_SHIFT,
-                            vma->vm_end - vma->vm_start,
-                            vma->vm_page_prot)) return -EAGAIN;
-diff -ur linux-2.6.11/drivers/char/hpet.c linux-2.6.11-io/drivers/char/hpet.c
---- linux-2.6.11/drivers/char/hpet.c   2005-03-02 07:38:10.000000000 +0000
-+++ linux-2.6.11-io/drivers/char/hpet.c        2005-03-15 17:37:22.000000000 
+0000
-@@ -76,6 +76,7 @@
- struct hpets {
-       struct hpets *hp_next;
-       struct hpet __iomem *hp_hpet;
-+      unsigned long hp_hpet_phys;
-       struct time_interpolator *hp_interpolator;
-       unsigned long hp_period;
-       unsigned long hp_delta;
-@@ -265,7 +266,7 @@
-               return -EINVAL;
- 
-       devp = file->private_data;
--      addr = (unsigned long)devp->hd_hpet;
-+      addr = devp->hd_hpets->hp_hpet_phys;
- 
-       if (addr & (PAGE_SIZE - 1))
-               return -ENOSYS;
-@@ -274,7 +275,7 @@
-       vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
-       addr = __pa(addr);
- 
--      if (remap_pfn_range(vma, vma->vm_start, addr >> PAGE_SHIFT,
-+      if (io_remap_pfn_range(vma, vma->vm_start, addr >> PAGE_SHIFT,
-                                       PAGE_SIZE, vma->vm_page_prot)) {
-               printk(KERN_ERR "remap_pfn_range failed in hpet.c\n");
-               return -EAGAIN;
-@@ -795,6 +796,7 @@
- 
-       hpetp->hp_which = hpet_nhpet++;
-       hpetp->hp_hpet = hdp->hd_address;
-+      hpetp->hp_hpet_phys = hdp->hd_phys_address;
- 
-       hpetp->hp_ntimer = hdp->hd_nirqs;
- 
-diff -ur linux-2.6.11/drivers/sbus/char/flash.c 
linux-2.6.11-io/drivers/sbus/char/flash.c
---- linux-2.6.11/drivers/sbus/char/flash.c     2005-03-02 07:38:10.000000000 
+0000
-+++ linux-2.6.11-io/drivers/sbus/char/flash.c  2005-03-15 17:20:22.000000000 
+0000
-@@ -75,7 +75,7 @@
-       pgprot_val(vma->vm_page_prot) |= _PAGE_E;
-       vma->vm_flags |= (VM_SHM | VM_LOCKED);
- 
--      if (remap_pfn_range(vma, vma->vm_start, addr, size, vma->vm_page_prot))
-+      if (io_remap_pfn_range(vma, vma->vm_start, addr, size, 
vma->vm_page_prot))
-               return -EAGAIN;
-               
-       return 0;
-diff -ur linux-2.6.11/include/linux/mm.h linux-2.6.11-io/include/linux/mm.h
---- linux-2.6.11/include/linux/mm.h    2005-03-02 07:37:47.000000000 +0000
-+++ linux-2.6.11-io/include/linux/mm.h 2005-03-15 17:03:46.000000000 +0000
-@@ -815,6 +815,10 @@
- extern int check_user_page_readable(struct mm_struct *mm, unsigned long 
address);
- int remap_pfn_range(struct vm_area_struct *, unsigned long,
-               unsigned long, unsigned long, pgprot_t);
-+/* Allow arch override for mapping of device and I/O (non-RAM) pages. */
-+#ifndef io_remap_pfn_range
-+#define io_remap_pfn_range remap_pfn_range
-+#endif
- 
- #ifdef CONFIG_PROC_FS
- void __vm_stat_account(struct mm_struct *, unsigned long, struct file *, 
long);
diff -r ece694762d7a -r 60fc40a82fa9 patches/linux-2.6.11/linux-2.6.11.12.patch
--- a/patches/linux-2.6.11/linux-2.6.11.12.patch        Mon Jul 11 15:12:37 2005
+++ /dev/null   Mon Jul 11 15:35:33 2005
@@ -1,2579 +0,0 @@
-diff --git a/Documentation/SecurityBugs b/Documentation/SecurityBugs
-new file mode 100644
---- /dev/null
-+++ b/Documentation/SecurityBugs
-@@ -0,0 +1,38 @@
-+Linux kernel developers take security very seriously.  As such, we'd
-+like to know when a security bug is found so that it can be fixed and
-+disclosed as quickly as possible.  Please report security bugs to the
-+Linux kernel security team.
-+
-+1) Contact
-+
-+The Linux kernel security team can be contacted by email at
-+<security@xxxxxxxxxx>.  This is a private list of security officers
-+who will help verify the bug report and develop and release a fix.
-+It is possible that the security team will bring in extra help from
-+area maintainers to understand and fix the security vulnerability.
-+
-+As it is with any bug, the more information provided the easier it
-+will be to diagnose and fix.  Please review the procedure outlined in
-+REPORTING-BUGS if you are unclear about what information is helpful.
-+Any exploit code is very helpful and will not be released without
-+consent from the reporter unless it has already been made public.
-+
-+2) Disclosure
-+
-+The goal of the Linux kernel security team is to work with the
-+bug submitter to bug resolution as well as disclosure.  We prefer
-+to fully disclose the bug as soon as possible.  It is reasonable to
-+delay disclosure when the bug or the fix is not yet fully understood,
-+the solution is not well-tested or for vendor coordination.  However, we
-+expect these delays to be short, measurable in days, not weeks or months.
-+A disclosure date is negotiated by the security team working with the
-+bug submitter as well as vendors.  However, the kernel security team
-+holds the final say when setting a disclosure date.  The timeframe for
-+disclosure is from immediate (esp. if it's already publically known)
-+to a few weeks.  As a basic default policy, we expect report date to
-+disclosure date to be on the order of 7 days.
-+
-+3) Non-disclosure agreements
-+
-+The Linux kernel security team is not a formal body and therefore unable
-+to enter any non-disclosure agreements.
-diff --git a/MAINTAINERS b/MAINTAINERS
---- a/MAINTAINERS
-+++ b/MAINTAINERS
-@@ -1966,6 +1966,11 @@ M:      christer@xxxxxxxxxxx
- W:    http://www.weinigel.se
- S:    Supported
- 
-+SECURITY CONTACT
-+P:    Security Officers
-+M:    security@xxxxxxxxxx
-+S:    Supported
-+
- SELINUX SECURITY MODULE
- P:    Stephen Smalley
- M:    sds@xxxxxxxxxxxxxx
-diff --git a/Makefile b/Makefile
---- a/Makefile
-+++ b/Makefile
-@@ -1,8 +1,8 @@
- VERSION = 2
- PATCHLEVEL = 6
- SUBLEVEL = 11
--EXTRAVERSION =
--NAME=Woozy Numbat
-+EXTRAVERSION = .12
-+NAME=Woozy Beaver
- 
- # *DOCUMENTATION*
- # To see a list of typical targets execute "make help"
-diff --git a/REPORTING-BUGS b/REPORTING-BUGS
---- a/REPORTING-BUGS
-+++ b/REPORTING-BUGS
-@@ -16,6 +16,10 @@ code relevant to what you were doing. If
- describe how to recreate it. That is worth even more than the oops itself.
- The list of maintainers is in the MAINTAINERS file in this directory.
- 
-+      If it is a security bug, please copy the Security Contact listed
-+in the MAINTAINERS file.  They can help coordinate bugfix and disclosure.
-+See Documentation/SecurityBugs for more infomation.
-+
-       If you are totally stumped as to whom to send the report, send it to
- linux-kernel@xxxxxxxxxxxxxxxx (For more information on the linux-kernel
- mailing list see http://www.tux.org/lkml/).
-diff --git a/arch/ia64/kernel/fsys.S b/arch/ia64/kernel/fsys.S
---- a/arch/ia64/kernel/fsys.S
-+++ b/arch/ia64/kernel/fsys.S
-@@ -611,8 +611,10 @@ GLOBAL_ENTRY(fsys_bubble_down)
-       movl r2=ia64_ret_from_syscall
-       ;;
-       mov rp=r2                               // set the real return addr
--      tbit.z p8,p0=r3,TIF_SYSCALL_TRACE
-+      and r3=_TIF_SYSCALL_TRACEAUDIT,r3
-       ;;
-+      cmp.eq p8,p0=r3,r0
-+
- (p10) br.cond.spnt.many ia64_ret_from_syscall // p10==true means out 
registers are more than 8
- (p8)  br.call.sptk.many b6=b6         // ignore this return addr
-       br.cond.sptk ia64_trace_syscall
-diff --git a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c
---- a/arch/ia64/kernel/signal.c
-+++ b/arch/ia64/kernel/signal.c
-@@ -224,7 +224,8 @@ ia64_rt_sigreturn (struct sigscratch *sc
-        * could be corrupted.
-        */
-       retval = (long) &ia64_leave_kernel;
--      if (test_thread_flag(TIF_SYSCALL_TRACE))
-+      if (test_thread_flag(TIF_SYSCALL_TRACE)
-+          || test_thread_flag(TIF_SYSCALL_AUDIT))
-               /*
-                * strace expects to be notified after sigreturn returns even 
though the
-                * context to which we return may not be in the middle of a 
syscall.
-diff --git a/arch/ppc/oprofile/op_model_fsl_booke.c 
b/arch/ppc/oprofile/op_model_fsl_booke.c
---- a/arch/ppc/oprofile/op_model_fsl_booke.c
-+++ b/arch/ppc/oprofile/op_model_fsl_booke.c
-@@ -150,7 +150,6 @@ static void fsl_booke_handle_interrupt(s
-       int is_kernel;
-       int val;
-       int i;
--      unsigned int cpu = smp_processor_id();
- 
-       /* set the PMM bit (see comment below) */
-       mtmsr(mfmsr() | MSR_PMM);
-@@ -162,7 +161,7 @@ static void fsl_booke_handle_interrupt(s
-               val = ctr_read(i);
-               if (val < 0) {
-                       if (oprofile_running && ctr[i].enabled) {
--                              oprofile_add_sample(pc, is_kernel, i, cpu);
-+                              oprofile_add_pc(pc, is_kernel, i);
-                               ctr_write(i, reset_value[i]);
-                       } else {
-                               ctr_write(i, 0);
-diff --git a/arch/ppc/platforms/4xx/ebony.h b/arch/ppc/platforms/4xx/ebony.h
---- a/arch/ppc/platforms/4xx/ebony.h
-+++ b/arch/ppc/platforms/4xx/ebony.h
-@@ -61,8 +61,8 @@
-  */
- 
- /* OpenBIOS defined UART mappings, used before early_serial_setup */
--#define UART0_IO_BASE (u8 *) 0xE0000200
--#define UART1_IO_BASE (u8 *) 0xE0000300
-+#define UART0_IO_BASE 0xE0000200
-+#define UART1_IO_BASE 0xE0000300
- 
- /* external Epson SG-615P */
- #define BASE_BAUD     691200
-diff --git a/arch/ppc/platforms/4xx/luan.h b/arch/ppc/platforms/4xx/luan.h
---- a/arch/ppc/platforms/4xx/luan.h
-+++ b/arch/ppc/platforms/4xx/luan.h
-@@ -47,9 +47,9 @@
- #define RS_TABLE_SIZE 3
- 
- /* PIBS defined UART mappings, used before early_serial_setup */
--#define UART0_IO_BASE (u8 *) 0xa0000200
--#define UART1_IO_BASE (u8 *) 0xa0000300
--#define UART2_IO_BASE (u8 *) 0xa0000600
-+#define UART0_IO_BASE 0xa0000200
-+#define UART1_IO_BASE 0xa0000300
-+#define UART2_IO_BASE 0xa0000600
- 
- #define BASE_BAUD     11059200
- #define STD_UART_OP(num)                                      \
-diff --git a/arch/ppc/platforms/4xx/ocotea.h b/arch/ppc/platforms/4xx/ocotea.h
---- a/arch/ppc/platforms/4xx/ocotea.h
-+++ b/arch/ppc/platforms/4xx/ocotea.h
-@@ -56,8 +56,8 @@
- #define RS_TABLE_SIZE 2
- 
- /* OpenBIOS defined UART mappings, used before early_serial_setup */
--#define UART0_IO_BASE (u8 *) 0xE0000200
--#define UART1_IO_BASE (u8 *) 0xE0000300
-+#define UART0_IO_BASE 0xE0000200
-+#define UART1_IO_BASE 0xE0000300
- 
- #define BASE_BAUD     11059200/16
- #define STD_UART_OP(num)                                      \
-diff --git a/arch/ppc64/kernel/pSeries_iommu.c 
b/arch/ppc64/kernel/pSeries_iommu.c
---- a/arch/ppc64/kernel/pSeries_iommu.c
-+++ b/arch/ppc64/kernel/pSeries_iommu.c
-@@ -401,6 +401,8 @@ static void iommu_bus_setup_pSeriesLP(st
-       struct device_node *dn, *pdn;
-       unsigned int *dma_window = NULL;
- 
-+      DBG("iommu_bus_setup_pSeriesLP, bus %p, bus->self %p\n", bus, 
bus->self);
-+
-       dn = pci_bus_to_OF_node(bus);
- 
-       /* Find nearest ibm,dma-window, walking up the device tree */
-@@ -455,6 +457,56 @@ static void iommu_dev_setup_pSeries(stru
-       }
- }
- 
-+static void iommu_dev_setup_pSeriesLP(struct pci_dev *dev)
-+{
-+      struct device_node *pdn, *dn;
-+      struct iommu_table *tbl;
-+      int *dma_window = NULL;
-+
-+      DBG("iommu_dev_setup_pSeriesLP, dev %p (%s)\n", dev, dev->pretty_name);
-+
-+      /* dev setup for LPAR is a little tricky, since the device tree might
-+       * contain the dma-window properties per-device and not neccesarily
-+       * for the bus. So we need to search upwards in the tree until we
-+       * either hit a dma-window property, OR find a parent with a table
-+       * already allocated.
-+       */
-+      dn = pci_device_to_OF_node(dev);
-+
-+      for (pdn = dn; pdn && !pdn->iommu_table; pdn = pdn->parent) {
-+              dma_window = (unsigned int *)get_property(pdn, 
"ibm,dma-window", NULL);
-+              if (dma_window)
-+                      break;
-+      }
-+
-+      /* Check for parent == NULL so we don't try to setup the empty EADS
-+       * slots on POWER4 machines.
-+       */
-+      if (dma_window == NULL || pdn->parent == NULL) {
-+              /* Fall back to regular (non-LPAR) dev setup */
-+              DBG("No dma window for device, falling back to regular 
setup\n");
-+              iommu_dev_setup_pSeries(dev);
-+              return;
-+      } else {
-+              DBG("Found DMA window, allocating table\n");
-+      }
-+
-+      if (!pdn->iommu_table) {
-+              /* iommu_table_setparms_lpar needs bussubno. */
-+              pdn->bussubno = pdn->phb->bus->number;
-+
-+              tbl = (struct iommu_table *)kmalloc(sizeof(struct iommu_table),
-+                                                  GFP_KERNEL);
-+
-+              iommu_table_setparms_lpar(pdn->phb, pdn, tbl, dma_window);
-+
-+              pdn->iommu_table = iommu_init_table(tbl);
-+      }
-+
-+      if (pdn != dn)
-+              dn->iommu_table = pdn->iommu_table;
-+}
-+
- static void iommu_bus_setup_null(struct pci_bus *b) { }
- static void iommu_dev_setup_null(struct pci_dev *d) { }
- 
-@@ -479,13 +531,14 @@ void iommu_init_early_pSeries(void)
-                       ppc_md.tce_free  = tce_free_pSeriesLP;
-               }
-               ppc_md.iommu_bus_setup = iommu_bus_setup_pSeriesLP;
-+              ppc_md.iommu_dev_setup = iommu_dev_setup_pSeriesLP;
-       } else {
-               ppc_md.tce_build = tce_build_pSeries;
-               ppc_md.tce_free  = tce_free_pSeries;
-               ppc_md.iommu_bus_setup = iommu_bus_setup_pSeries;
-+              ppc_md.iommu_dev_setup = iommu_dev_setup_pSeries;
-       }
- 
--      ppc_md.iommu_dev_setup = iommu_dev_setup_pSeries;
- 
-       pci_iommu_init();
- }
-diff --git a/arch/sparc/kernel/ptrace.c b/arch/sparc/kernel/ptrace.c
---- a/arch/sparc/kernel/ptrace.c
-+++ b/arch/sparc/kernel/ptrace.c
-@@ -531,18 +531,6 @@ asmlinkage void do_ptrace(struct pt_regs
-                       pt_error_return(regs, EIO);
-                       goto out_tsk;
-               }
--              if (addr != 1) {
--                      if (addr & 3) {
--                              pt_error_return(regs, EINVAL);
--                              goto out_tsk;
--                      }
--#ifdef DEBUG_PTRACE
--                      printk ("Original: %08lx %08lx\n", 
child->thread.kregs->pc, child->thread.kregs->npc);
--                      printk ("Continuing with %08lx %08lx\n", addr, addr+4);
--#endif
--                      child->thread.kregs->pc = addr;
--                      child->thread.kregs->npc = addr + 4;
--              }
- 
-               if (request == PTRACE_SYSCALL)
-                       set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
-diff --git a/arch/sparc64/kernel/ptrace.c b/arch/sparc64/kernel/ptrace.c
---- a/arch/sparc64/kernel/ptrace.c
-+++ b/arch/sparc64/kernel/ptrace.c
-@@ -514,25 +514,6 @@ asmlinkage void do_ptrace(struct pt_regs
-                       pt_error_return(regs, EIO);
-                       goto out_tsk;
-               }
--              if (addr != 1) {
--                      unsigned long pc_mask = ~0UL;
--
--                      if ((child->thread_info->flags & _TIF_32BIT) != 0)
--                              pc_mask = 0xffffffff;
--
--                      if (addr & 3) {
--                              pt_error_return(regs, EINVAL);
--                              goto out_tsk;
--                      }
--#ifdef DEBUG_PTRACE
--                      printk ("Original: %016lx %016lx\n",
--                              child->thread_info->kregs->tpc,
--                              child->thread_info->kregs->tnpc);
--                      printk ("Continuing with %016lx %016lx\n", addr, 
addr+4);
--#endif
--                      child->thread_info->kregs->tpc = (addr & pc_mask);
--                      child->thread_info->kregs->tnpc = ((addr + 4) & 
pc_mask);
--              }
- 
-               if (request == PTRACE_SYSCALL) {
-                       set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
-diff --git a/arch/sparc64/kernel/signal32.c b/arch/sparc64/kernel/signal32.c
---- a/arch/sparc64/kernel/signal32.c
-+++ b/arch/sparc64/kernel/signal32.c
-@@ -192,10 +192,13 @@ int copy_siginfo_to_user32(compat_siginf
-                       err |= __put_user(from->si_uid, &to->si_uid);
-                       break;
-               case __SI_FAULT >> 16:
--              case __SI_POLL >> 16:
-                       err |= __put_user(from->si_trapno, &to->si_trapno);
-                       err |= __put_user((unsigned long)from->si_addr, 
&to->si_addr);
-                       break;
-+              case __SI_POLL >> 16:
-+                      err |= __put_user(from->si_band, &to->si_band);
-+                      err |= __put_user(from->si_fd, &to->si_fd);
-+                      break;
-               case __SI_RT >> 16: /* This is not generated by the kernel as 
of now.  */
-               case __SI_MESGQ >> 16:
-                       err |= __put_user(from->si_pid, &to->si_pid);
-diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S
---- a/arch/sparc64/kernel/systbls.S
-+++ b/arch/sparc64/kernel/systbls.S
-@@ -75,7 +75,7 @@ sys_call_table32:
- /*260*/       .word compat_sys_sched_getaffinity, 
compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, 
sys_timer_getoverrun
-       .word sys_timer_delete, sys32_timer_create, sys_ni_syscall, 
compat_sys_io_setup, sys_io_destroy
- /*270*/       .word sys32_io_submit, sys_io_cancel, compat_sys_io_getevents, 
sys32_mq_open, sys_mq_unlink
--      .word sys_mq_timedsend, sys_mq_timedreceive, compat_sys_mq_notify, 
compat_sys_mq_getsetattr, compat_sys_waitid
-+      .word compat_sys_mq_timedsend, compat_sys_mq_timedreceive, 
compat_sys_mq_notify, compat_sys_mq_getsetattr, compat_sys_waitid
- /*280*/       .word sys_ni_syscall, sys_add_key, sys_request_key, sys_keyctl
- 
- #endif /* CONFIG_COMPAT */
-diff --git a/arch/um/include/sysdep-i386/syscalls.h 
b/arch/um/include/sysdep-i386/syscalls.h
---- a/arch/um/include/sysdep-i386/syscalls.h
-+++ b/arch/um/include/sysdep-i386/syscalls.h
-@@ -23,6 +23,9 @@ extern long sys_mmap2(unsigned long addr
-                     unsigned long prot, unsigned long flags,
-                     unsigned long fd, unsigned long pgoff);
- 
-+/* On i386 they choose a meaningless naming.*/
-+#define __NR_kexec_load __NR_sys_kexec_load
-+
- #define ARCH_SYSCALLS \
-       [ __NR_waitpid ] = (syscall_handler_t *) sys_waitpid, \
-       [ __NR_break ] = (syscall_handler_t *) sys_ni_syscall, \
-@@ -101,15 +104,12 @@ extern long sys_mmap2(unsigned long addr
-       [ 223 ] = (syscall_handler_t *) sys_ni_syscall, \
-       [ __NR_set_thread_area ] = (syscall_handler_t *) sys_ni_syscall, \
-       [ __NR_get_thread_area ] = (syscall_handler_t *) sys_ni_syscall, \
--      [ __NR_fadvise64 ] = (syscall_handler_t *) sys_fadvise64, \
-       [ 251 ] = (syscall_handler_t *) sys_ni_syscall, \
--        [ __NR_remap_file_pages ] = (syscall_handler_t *) 
sys_remap_file_pages, \
--      [ __NR_utimes ] = (syscall_handler_t *) sys_utimes, \
--      [ __NR_vserver ] = (syscall_handler_t *) sys_ni_syscall,
--        
-+      [ 285 ] = (syscall_handler_t *) sys_ni_syscall,
-+
- /* 222 doesn't yet have a name in include/asm-i386/unistd.h */
- 
--#define LAST_ARCH_SYSCALL __NR_vserver
-+#define LAST_ARCH_SYSCALL 285
- 
- /*
-  * Overrides for Emacs so that we follow Linus's tabbing style.
-diff --git a/arch/um/include/sysdep-x86_64/syscalls.h 
b/arch/um/include/sysdep-x86_64/syscalls.h
---- a/arch/um/include/sysdep-x86_64/syscalls.h
-+++ b/arch/um/include/sysdep-x86_64/syscalls.h
-@@ -71,12 +71,7 @@ extern syscall_handler_t sys_arch_prctl;
-       [ __NR_iopl ] = (syscall_handler_t *) sys_ni_syscall, \
-       [ __NR_set_thread_area ] = (syscall_handler_t *) sys_ni_syscall, \
-       [ __NR_get_thread_area ] = (syscall_handler_t *) sys_ni_syscall, \
--        [ __NR_remap_file_pages ] = (syscall_handler_t *) 
sys_remap_file_pages, \
-       [ __NR_semtimedop ] = (syscall_handler_t *) sys_semtimedop, \
--      [ __NR_fadvise64 ] = (syscall_handler_t *) sys_fadvise64, \
--      [ 223 ] = (syscall_handler_t *) sys_ni_syscall, \
--      [ __NR_utimes ] = (syscall_handler_t *) sys_utimes, \
--      [ __NR_vserver ] = (syscall_handler_t *) sys_ni_syscall, \
-       [ 251 ] = (syscall_handler_t *) sys_ni_syscall,
- 
- #define LAST_ARCH_SYSCALL 251
-diff --git a/arch/um/kernel/skas/uaccess.c b/arch/um/kernel/skas/uaccess.c
---- a/arch/um/kernel/skas/uaccess.c
-+++ b/arch/um/kernel/skas/uaccess.c
-@@ -61,7 +61,8 @@ static void do_buffer_op(void *jmpbuf, v
-       void *arg;
-       int *res;
- 
--      va_copy(args, *(va_list *)arg_ptr);
-+      /* Some old gccs recognize __va_copy, but not va_copy */
-+      __va_copy(args, *(va_list *)arg_ptr);
-       addr = va_arg(args, unsigned long);
-       len = va_arg(args, int);
-       is_write = va_arg(args, int);
-diff --git a/arch/um/kernel/sys_call_table.c b/arch/um/kernel/sys_call_table.c
---- a/arch/um/kernel/sys_call_table.c
-+++ b/arch/um/kernel/sys_call_table.c
-@@ -48,7 +48,6 @@ extern syscall_handler_t sys_vfork;
- extern syscall_handler_t old_select;
- extern syscall_handler_t sys_modify_ldt;
- extern syscall_handler_t sys_rt_sigsuspend;
--extern syscall_handler_t sys_vserver;
- extern syscall_handler_t sys_mbind;
- extern syscall_handler_t sys_get_mempolicy;
- extern syscall_handler_t sys_set_mempolicy;
-@@ -242,6 +241,7 @@ syscall_handler_t *sys_call_table[] = {
-       [ __NR_epoll_create ] = (syscall_handler_t *) sys_epoll_create,
-       [ __NR_epoll_ctl ] = (syscall_handler_t *) sys_epoll_ctl,
-       [ __NR_epoll_wait ] = (syscall_handler_t *) sys_epoll_wait,
-+      [ __NR_remap_file_pages ] = (syscall_handler_t *) sys_remap_file_pages,
-         [ __NR_set_tid_address ] = (syscall_handler_t *) sys_set_tid_address,
-       [ __NR_timer_create ] = (syscall_handler_t *) sys_timer_create,
-       [ __NR_timer_settime ] = (syscall_handler_t *) sys_timer_settime,
-@@ -252,12 +252,10 @@ syscall_handler_t *sys_call_table[] = {
-       [ __NR_clock_gettime ] = (syscall_handler_t *) sys_clock_gettime,
-       [ __NR_clock_getres ] = (syscall_handler_t *) sys_clock_getres,
-       [ __NR_clock_nanosleep ] = (syscall_handler_t *) sys_clock_nanosleep,
--      [ __NR_statfs64 ] = (syscall_handler_t *) sys_statfs64,
--      [ __NR_fstatfs64 ] = (syscall_handler_t *) sys_fstatfs64,
-       [ __NR_tgkill ] = (syscall_handler_t *) sys_tgkill,
-       [ __NR_utimes ] = (syscall_handler_t *) sys_utimes,
--      [ __NR_fadvise64_64 ] = (syscall_handler_t *) sys_fadvise64_64,
--      [ __NR_vserver ] = (syscall_handler_t *) sys_vserver,
-+      [ __NR_fadvise64 ] = (syscall_handler_t *) sys_fadvise64,
-+      [ __NR_vserver ] = (syscall_handler_t *) sys_ni_syscall,
-       [ __NR_mbind ] = (syscall_handler_t *) sys_mbind,
-       [ __NR_get_mempolicy ] = (syscall_handler_t *) sys_get_mempolicy,
-       [ __NR_set_mempolicy ] = (syscall_handler_t *) sys_set_mempolicy,
-@@ -267,9 +265,8 @@ syscall_handler_t *sys_call_table[] = {
-       [ __NR_mq_timedreceive ] = (syscall_handler_t *) sys_mq_timedreceive,
-       [ __NR_mq_notify ] = (syscall_handler_t *) sys_mq_notify,
-       [ __NR_mq_getsetattr ] = (syscall_handler_t *) sys_mq_getsetattr,
--      [ __NR_sys_kexec_load ] = (syscall_handler_t *) sys_ni_syscall,
-+      [ __NR_kexec_load ] = (syscall_handler_t *) sys_ni_syscall,
-       [ __NR_waitid ] = (syscall_handler_t *) sys_waitid,
--      [ 285 ] = (syscall_handler_t *) sys_ni_syscall,
-       [ __NR_add_key ] = (syscall_handler_t *) sys_add_key,
-       [ __NR_request_key ] = (syscall_handler_t *) sys_request_key,
-       [ __NR_keyctl ] = (syscall_handler_t *) sys_keyctl,
-diff --git a/arch/x86_64/kernel/apic.c b/arch/x86_64/kernel/apic.c
---- a/arch/x86_64/kernel/apic.c
-+++ b/arch/x86_64/kernel/apic.c
-@@ -775,9 +775,7 @@ void __init setup_boot_APIC_clock (void)
- 
- void __init setup_secondary_APIC_clock(void)
- {
--      local_irq_disable(); /* FIXME: Do we need this? --RR */
-       setup_APIC_timer(calibration_result);
--      local_irq_enable();
- }
- 
- void __init disable_APIC_timer(void)
-diff --git a/arch/x86_64/kernel/ptrace.c b/arch/x86_64/kernel/ptrace.c
---- a/arch/x86_64/kernel/ptrace.c
-+++ b/arch/x86_64/kernel/ptrace.c
-@@ -129,13 +129,13 @@ static int putreg(struct task_struct *ch
-                       value &= 0xffff;
-                       return 0;
-               case offsetof(struct user_regs_struct,fs_base):
--                      if (!((value >> 48) == 0 || (value >> 48) == 0xffff))
--                              return -EIO; 
-+                      if (value >= TASK_SIZE)
-+                              return -EIO;
-                       child->thread.fs = value;
-                       return 0;
-               case offsetof(struct user_regs_struct,gs_base):
--                      if (!((value >> 48) == 0 || (value >> 48) == 0xffff))
--                              return -EIO; 
-+                      if (value >= TASK_SIZE)
-+                              return -EIO;
-                       child->thread.gs = value;
-                       return 0;
-               case offsetof(struct user_regs_struct, eflags):
-@@ -149,6 +149,11 @@ static int putreg(struct task_struct *ch
-                               return -EIO;
-                       value &= 0xffff;
-                       break;
-+              case offsetof(struct user_regs_struct, rip):
-+                      /* Check if the new RIP address is canonical */
-+                      if (value >= TASK_SIZE)
-+                              return -EIO;
-+                      break;
-       }
-       put_stack_long(child, regno - sizeof(struct pt_regs), value);
-       return 0;
-@@ -247,7 +252,7 @@ asmlinkage long sys_ptrace(long request,
-                       break;
- 
-               switch (addr) { 
--              case 0 ... sizeof(struct user_regs_struct):
-+              case 0 ... sizeof(struct user_regs_struct) - sizeof(long):
-                       tmp = getreg(child, addr);
-                       break;
-               case offsetof(struct user, u_debugreg[0]):
-@@ -292,7 +297,7 @@ asmlinkage long sys_ptrace(long request,
-                       break;
- 
-               switch (addr) { 
--              case 0 ... sizeof(struct user_regs_struct): 
-+              case 0 ... sizeof(struct user_regs_struct) - sizeof(long):
-                       ret = putreg(child, addr, data);
-                       break;
-               /* Disallows to set a breakpoint into the vsyscall */
-diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c
---- a/arch/x86_64/kernel/smpboot.c
-+++ b/arch/x86_64/kernel/smpboot.c
-@@ -309,8 +309,6 @@ void __init smp_callin(void)
-       Dprintk("CALLIN, before setup_local_APIC().\n");
-       setup_local_APIC();
- 
--      local_irq_enable();
--
-       /*
-        * Get our bogomips.
-        */
-@@ -324,8 +322,6 @@ void __init smp_callin(void)
-        */
-       smp_store_cpu_info(cpuid);
- 
--      local_irq_disable();
--
-       /*
-        * Allow the master to continue.
-        */
-diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c
---- a/arch/x86_64/mm/fault.c
-+++ b/arch/x86_64/mm/fault.c
-@@ -236,6 +236,8 @@ static noinline void pgtable_bad(unsigne
- 
- /*
-  * Handle a fault on the vmalloc or module mapping area
-+ *
-+ * This assumes no large pages in there.
-  */
- static int vmalloc_fault(unsigned long address)
- {
-@@ -274,7 +276,10 @@ static int vmalloc_fault(unsigned long a
-       if (!pte_present(*pte_ref))
-               return -1;
-       pte = pte_offset_kernel(pmd, address);
--      if (!pte_present(*pte) || pte_page(*pte) != pte_page(*pte_ref))
-+      /* Don't use pte_page here, because the mappings can point
-+         outside mem_map, and the NUMA hash lookup cannot handle
-+         that. */
-+      if (!pte_present(*pte) || pte_pfn(*pte) != pte_pfn(*pte_ref))
-               BUG();
-       __flush_tlb_all();
-       return 0;
-@@ -348,7 +353,9 @@ asmlinkage void do_page_fault(struct pt_
-        * protection error (error_code & 1) == 0.
-        */
-       if (unlikely(address >= TASK_SIZE)) {
--              if (!(error_code & 5)) {
-+              if (!(error_code & 5) &&
-+                    ((address >= VMALLOC_START && address < VMALLOC_END) ||
-+                     (address >= MODULES_VADDR && address < MODULES_END))) {
-                       if (vmalloc_fault(address) < 0)
-                               goto bad_area_nosemaphore;
-                       return;
-diff --git a/arch/x86_64/mm/ioremap.c b/arch/x86_64/mm/ioremap.c
---- a/arch/x86_64/mm/ioremap.c
-+++ b/arch/x86_64/mm/ioremap.c
-@@ -266,7 +266,7 @@ void iounmap(volatile void __iomem *addr
-       if ((p->flags >> 20) &&
-               p->phys_addr + p->size - 1 < virt_to_phys(high_memory)) {
-               /* p->size includes the guard page, but cpa doesn't like that */
--              change_page_attr(virt_to_page(__va(p->phys_addr)),
-+              change_page_attr_addr((unsigned long)(__va(p->phys_addr)),
-                                (p->size - PAGE_SIZE) >> PAGE_SHIFT,
-                                PAGE_KERNEL);                           
-               global_flush_tlb();
-diff --git a/drivers/block/ioctl.c b/drivers/block/ioctl.c
---- a/drivers/block/ioctl.c
-+++ b/drivers/block/ioctl.c
-@@ -237,3 +237,5 @@ long compat_blkdev_ioctl(struct file *fi
-       }
-       return ret;
- }
-+
-+EXPORT_SYMBOL_GPL(blkdev_ioctl);
-diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
---- a/drivers/block/pktcdvd.c
-+++ b/drivers/block/pktcdvd.c
-@@ -2400,7 +2400,7 @@ static int pkt_ioctl(struct inode *inode
-       case CDROM_LAST_WRITTEN:
-       case CDROM_SEND_PACKET:
-       case SCSI_IOCTL_SEND_COMMAND:
--              return ioctl_by_bdev(pd->bdev, cmd, arg);
-+              return blkdev_ioctl(pd->bdev->bd_inode, file, cmd, arg);
- 
-       case CDROMEJECT:
-               /*
-@@ -2408,7 +2408,7 @@ static int pkt_ioctl(struct inode *inode
-                * have to unlock it or else the eject command fails.
-                */
-               pkt_lock_door(pd, 0);
--              return ioctl_by_bdev(pd->bdev, cmd, arg);
-+              return blkdev_ioctl(pd->bdev->bd_inode, file, cmd, arg);
- 
-       default:
-               printk("pktcdvd: Unknown ioctl for %s (%x)\n", pd->name, cmd);
-diff --git a/drivers/char/drm/drm_ioctl.c b/drivers/char/drm/drm_ioctl.c
---- a/drivers/char/drm/drm_ioctl.c
-+++ b/drivers/char/drm/drm_ioctl.c
-@@ -326,6 +326,8 @@ int drm_setversion(DRM_IOCTL_ARGS)
- 
-       DRM_COPY_FROM_USER_IOCTL(sv, argp, sizeof(sv));
- 
-+      memset(&version, 0, sizeof(version));
-+
-       dev->driver->version(&version);
-       retv.drm_di_major = DRM_IF_MAJOR;
-       retv.drm_di_minor = DRM_IF_MINOR;
-diff --git a/drivers/char/raw.c b/drivers/char/raw.c
---- a/drivers/char/raw.c
-+++ b/drivers/char/raw.c
-@@ -122,7 +122,7 @@ raw_ioctl(struct inode *inode, struct fi
- {
-       struct block_device *bdev = filp->private_data;
- 
--      return ioctl_by_bdev(bdev, command, arg);
-+      return blkdev_ioctl(bdev->bd_inode, filp, command, arg);
- }
- 
- static void bind_device(struct raw_config_request *rq)
-diff --git a/drivers/i2c/chips/eeprom.c b/drivers/i2c/chips/eeprom.c
---- a/drivers/i2c/chips/eeprom.c
-+++ b/drivers/i2c/chips/eeprom.c
-@@ -130,7 +130,8 @@ static ssize_t eeprom_read(struct kobjec
- 
-       /* Hide Vaio security settings to regular users (16 first bytes) */
-       if (data->nature == VAIO && off < 16 && !capable(CAP_SYS_ADMIN)) {
--              int in_row1 = 16 - off;
-+              size_t in_row1 = 16 - off;
-+              in_row1 = min(in_row1, count);
-               memset(buf, 0, in_row1);
-               if (count - in_row1 > 0)
-                       memcpy(buf + in_row1, &data->data[16], count - in_row1);
-diff --git a/drivers/i2c/chips/it87.c b/drivers/i2c/chips/it87.c
---- a/drivers/i2c/chips/it87.c
-+++ b/drivers/i2c/chips/it87.c
-@@ -631,7 +631,7 @@ static ssize_t show_alarms(struct device
-       struct it87_data *data = it87_update_device(dev);
-       return sprintf(buf,"%d\n", ALARMS_FROM_REG(data->alarms));
- }
--static DEVICE_ATTR(alarms, S_IRUGO | S_IWUSR, show_alarms, NULL);
-+static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
- 
- static ssize_t
- show_vrm_reg(struct device *dev, char *buf)
-diff --git a/drivers/i2c/chips/via686a.c b/drivers/i2c/chips/via686a.c
---- a/drivers/i2c/chips/via686a.c
-+++ b/drivers/i2c/chips/via686a.c
-@@ -554,7 +554,7 @@ static ssize_t show_alarms(struct device
-       struct via686a_data *data = via686a_update_device(dev);
-       return sprintf(buf,"%d\n", ALARMS_FROM_REG(data->alarms));
- }
--static DEVICE_ATTR(alarms, S_IRUGO | S_IWUSR, show_alarms, NULL);
-+static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
- 
- /* The driver. I choose to use type i2c_driver, as at is identical to both
-    smbus_driver and isa_driver, and clients could be of either kind */
-diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
---- a/drivers/ide/ide-disk.c
-+++ b/drivers/ide/ide-disk.c
-@@ -133,6 +133,8 @@ static ide_startstop_t __ide_do_rw_disk(
-       if (hwif->no_lba48_dma && lba48 && dma) {
-               if (block + rq->nr_sectors > 1ULL << 28)
-                       dma = 0;
-+              else
-+                      lba48 = 0;
-       }
- 
-       if (!dma) {
-@@ -146,7 +148,7 @@ static ide_startstop_t __ide_do_rw_disk(
-       /* FIXME: SELECT_MASK(drive, 0) ? */
- 
-       if (drive->select.b.lba) {
--              if (drive->addressing == 1) {
-+              if (lba48) {
-                       task_ioreg_t tasklets[10];
- 
-                       pr_debug("%s: LBA=0x%012llx\n", drive->name, block);
-diff --git a/drivers/input/serio/i8042-x86ia64io.h 
b/drivers/input/serio/i8042-x86ia64io.h
---- a/drivers/input/serio/i8042-x86ia64io.h
-+++ b/drivers/input/serio/i8042-x86ia64io.h
-@@ -88,7 +88,7 @@ static struct dmi_system_id __initdata i
- };
- #endif
- 
--#ifdef CONFIG_ACPI
-+#if defined(__ia64__) && defined(CONFIG_ACPI)
- #include <linux/acpi.h>
- #include <acpi/acpi_bus.h>
- 
-@@ -281,7 +281,7 @@ static inline int i8042_platform_init(vo
-       i8042_kbd_irq = I8042_MAP_IRQ(1);
-       i8042_aux_irq = I8042_MAP_IRQ(12);
- 
--#ifdef CONFIG_ACPI
-+#if defined(__ia64__) && defined(CONFIG_ACPI)
-       if (i8042_acpi_init())
-               return -1;
- #endif
-@@ -300,7 +300,7 @@ static inline int i8042_platform_init(vo
- 
- static inline void i8042_platform_exit(void)
- {
--#ifdef CONFIG_ACPI
-+#if defined(__ia64__) && defined(CONFIG_ACPI)
-       i8042_acpi_exit();
- #endif
- }
-diff --git a/drivers/md/raid6altivec.uc b/drivers/md/raid6altivec.uc
---- a/drivers/md/raid6altivec.uc
-+++ b/drivers/md/raid6altivec.uc
-@@ -108,7 +108,11 @@ int raid6_have_altivec(void);
- int raid6_have_altivec(void)
- {
-       /* This assumes either all CPUs have Altivec or none does */
-+#ifdef CONFIG_PPC64
-       return cur_cpu_spec->cpu_features & CPU_FTR_ALTIVEC;
-+#else
-+      return cur_cpu_spec[0]->cpu_features & CPU_FTR_ALTIVEC;
-+#endif
- }
- #endif
- 
-diff --git a/drivers/media/video/adv7170.c b/drivers/media/video/adv7170.c
---- a/drivers/media/video/adv7170.c
-+++ b/drivers/media/video/adv7170.c
-@@ -130,7 +130,7 @@ adv7170_write_block (struct i2c_client *
-               u8 block_data[32];
- 
-               msg.addr = client->addr;
--              msg.flags = client->flags;
-+              msg.flags = 0;
-               while (len >= 2) {
-                       msg.buf = (char *) block_data;
-                       msg.len = 0;
-diff --git a/drivers/media/video/adv7175.c b/drivers/media/video/adv7175.c
---- a/drivers/media/video/adv7175.c
-+++ b/drivers/media/video/adv7175.c
-@@ -126,7 +126,7 @@ adv7175_write_block (struct i2c_client *
-               u8 block_data[32];
- 
-               msg.addr = client->addr;
--              msg.flags = client->flags;
-+              msg.flags = 0;
-               while (len >= 2) {
-                       msg.buf = (char *) block_data;
-                       msg.len = 0;
-diff --git a/drivers/media/video/bt819.c b/drivers/media/video/bt819.c
---- a/drivers/media/video/bt819.c
-+++ b/drivers/media/video/bt819.c
-@@ -146,7 +146,7 @@ bt819_write_block (struct i2c_client *cl
-               u8 block_data[32];
- 
-               msg.addr = client->addr;
--              msg.flags = client->flags;
-+              msg.flags = 0;
-               while (len >= 2) {
-                       msg.buf = (char *) block_data;
-                       msg.len = 0;
-diff --git a/drivers/media/video/bttv-cards.c 
b/drivers/media/video/bttv-cards.c
---- a/drivers/media/video/bttv-cards.c
-+++ b/drivers/media/video/bttv-cards.c
-@@ -1939,7 +1939,6 @@ struct tvcard bttv_tvcards[] = {
-         .no_tda9875     = 1,
-         .no_tda7432     = 1,
-         .tuner_type     = TUNER_ABSENT,
--        .no_video       = 1,
-       .pll            = PLL_28,
- },{
-       .name           = "Teppro TEV-560/InterVision IV-560",
-@@ -2718,8 +2717,6 @@ void __devinit bttv_init_card2(struct bt
-         }
-       btv->pll.pll_current = -1;
- 
--      bttv_reset_audio(btv);
--
-       /* tuner configuration (from card list / autodetect / insmod option) */
-       if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
-               if(UNSET == btv->tuner_type)
-diff --git a/drivers/media/video/saa7110.c b/drivers/media/video/saa7110.c
---- a/drivers/media/video/saa7110.c
-+++ b/drivers/media/video/saa7110.c
-@@ -60,8 +60,10 @@ MODULE_PARM_DESC(debug, "Debug level (0-
- 
- #define       I2C_SAA7110             0x9C    /* or 0x9E */
- 
-+#define SAA7110_NR_REG                0x35
-+
- struct saa7110 {
--      unsigned char reg[54];
-+      u8 reg[SAA7110_NR_REG];
- 
-       int norm;
-       int input;
-@@ -95,31 +97,28 @@ saa7110_write_block (struct i2c_client *
-                    unsigned int       len)
- {
-       int ret = -1;
--      u8 reg = *data++;
-+      u8 reg = *data;         /* first register to write to */
- 
--      len--;
-+      /* Sanity check */
-+      if (reg + (len - 1) > SAA7110_NR_REG)
-+              return ret;
- 
-       /* the saa7110 has an autoincrement function, use it if
-        * the adapter understands raw I2C */
-       if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
-               struct saa7110 *decoder = i2c_get_clientdata(client);
-               struct i2c_msg msg;
--              u8 block_data[54];
- 
--              msg.len = 0;
--              msg.buf = (char *) block_data;
-+              msg.len = len;
-+              msg.buf = (char *) data;
-               msg.addr = client->addr;
--              msg.flags = client->flags;
--              while (len >= 1) {
--                      msg.len = 0;
--                      block_data[msg.len++] = reg;
--                      while (len-- >= 1 && msg.len < 54)
--                              block_data[msg.len++] =
--                                  decoder->reg[reg++] = *data++;
--                      ret = i2c_transfer(client->adapter, &msg, 1);
--              }
-+              msg.flags = 0;
-+              ret = i2c_transfer(client->adapter, &msg, 1);
-+
-+              /* Cache the written data */
-+              memcpy(decoder->reg + reg, data + 1, len - 1);
-       } else {
--              while (len-- >= 1) {
-+              for (++data, --len; len; len--) {
-                       if ((ret = saa7110_write(client, reg++,
-                                                *data++)) < 0)
-                               break;
-@@ -192,7 +191,7 @@ saa7110_selmux (struct i2c_client *clien
-       return 0;
- }
- 
--static const unsigned char initseq[] = {
-+static const unsigned char initseq[1 + SAA7110_NR_REG] = {
-       0, 0x4C, 0x3C, 0x0D, 0xEF, 0xBD, 0xF2, 0x03, 0x00,
-       /* 0x08 */ 0xF8, 0xF8, 0x60, 0x60, 0x00, 0x86, 0x18, 0x90,
-       /* 0x10 */ 0x00, 0x59, 0x40, 0x46, 0x42, 0x1A, 0xFF, 0xDA,
-diff --git a/drivers/media/video/saa7114.c b/drivers/media/video/saa7114.c
---- a/drivers/media/video/saa7114.c
-+++ b/drivers/media/video/saa7114.c
-@@ -163,7 +163,7 @@ saa7114_write_block (struct i2c_client *
-               u8 block_data[32];
- 
-               msg.addr = client->addr;
--              msg.flags = client->flags;
-+              msg.flags = 0;
-               while (len >= 2) {
-                       msg.buf = (char *) block_data;
-                       msg.len = 0;
-diff --git a/drivers/media/video/saa7185.c b/drivers/media/video/saa7185.c
---- a/drivers/media/video/saa7185.c
-+++ b/drivers/media/video/saa7185.c
-@@ -118,7 +118,7 @@ saa7185_write_block (struct i2c_client *
-               u8 block_data[32];
- 
-               msg.addr = client->addr;
--              msg.flags = client->flags;
-+              msg.flags = 0;
-               while (len >= 2) {
-                       msg.buf = (char *) block_data;
-                       msg.len = 0;
-diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
---- a/drivers/net/3c59x.c
-+++ b/drivers/net/3c59x.c
-@@ -1581,7 +1581,8 @@ vortex_up(struct net_device *dev)
- 
-       if (VORTEX_PCI(vp)) {
-               pci_set_power_state(VORTEX_PCI(vp), PCI_D0);    /* Go active */
--              pci_restore_state(VORTEX_PCI(vp));
-+              if (vp->pm_state_valid)
-+                      pci_restore_state(VORTEX_PCI(vp));
-               pci_enable_device(VORTEX_PCI(vp));
-       }
- 
-@@ -2741,6 +2742,7 @@ vortex_down(struct net_device *dev, int 
-               outl(0, ioaddr + DownListPtr);
- 
-       if (final_down && VORTEX_PCI(vp)) {
-+              vp->pm_state_valid = 1;
-               pci_save_state(VORTEX_PCI(vp));
-               acpi_set_WOL(dev);
-       }
-@@ -3243,9 +3245,10 @@ static void acpi_set_WOL(struct net_devi
-               outw(RxEnable, ioaddr + EL3_CMD);
- 
-               pci_enable_wake(VORTEX_PCI(vp), 0, 1);
-+
-+              /* Change the power state to D3; RxEnable doesn't take effect. 
*/
-+              pci_set_power_state(VORTEX_PCI(vp), PCI_D3hot);
-       }
--      /* Change the power state to D3; RxEnable doesn't take effect. */
--      pci_set_power_state(VORTEX_PCI(vp), PCI_D3hot);
- }
- 
- 
-diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c
---- a/drivers/net/amd8111e.c
-+++ b/drivers/net/amd8111e.c
-@@ -1381,6 +1381,8 @@ static int amd8111e_open(struct net_devi
- 
-       if(amd8111e_restart(dev)){
-               spin_unlock_irq(&lp->lock);
-+              if (dev->irq)
-+                      free_irq(dev->irq, dev);
-               return -ENOMEM;
-       }
-       /* Start ipg timer */
-diff --git a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c
---- a/drivers/net/ppp_async.c
-+++ b/drivers/net/ppp_async.c
-@@ -1000,7 +1000,7 @@ static void async_lcp_peek(struct asyncp
-       data += 4;
-       dlen -= 4;
-       /* data[0] is code, data[1] is length */
--      while (dlen >= 2 && dlen >= data[1]) {
-+      while (dlen >= 2 && dlen >= data[1] && data[1] >= 2) {
-               switch (data[0]) {
-               case LCP_MRU:
-                       val = (data[2] << 8) + data[3];
-diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
---- a/drivers/net/r8169.c
-+++ b/drivers/net/r8169.c
-@@ -1683,16 +1683,19 @@ static void rtl8169_free_rx_skb(struct r
-       rtl8169_make_unusable_by_asic(desc);
- }
- 
--static inline void rtl8169_return_to_asic(struct RxDesc *desc, int rx_buf_sz)
-+static inline void rtl8169_mark_to_asic(struct RxDesc *desc, u32 rx_buf_sz)
- {
--      desc->opts1 |= cpu_to_le32(DescOwn + rx_buf_sz);
-+      u32 eor = le32_to_cpu(desc->opts1) & RingEnd;
-+
-+      desc->opts1 = cpu_to_le32(DescOwn | eor | rx_buf_sz);
- }
- 
--static inline void rtl8169_give_to_asic(struct RxDesc *desc, dma_addr_t 
mapping,
--                                      int rx_buf_sz)
-+static inline void rtl8169_map_to_asic(struct RxDesc *desc, dma_addr_t 
mapping,
-+                                     u32 rx_buf_sz)
- {
-       desc->addr = cpu_to_le64(mapping);
--      desc->opts1 |= cpu_to_le32(DescOwn + rx_buf_sz);
-+      wmb();
-+      rtl8169_mark_to_asic(desc, rx_buf_sz);
- }
- 
- static int rtl8169_alloc_rx_skb(struct pci_dev *pdev, struct sk_buff 
**sk_buff,
-@@ -1712,7 +1715,7 @@ static int rtl8169_alloc_rx_skb(struct p
-       mapping = pci_map_single(pdev, skb->tail, rx_buf_sz,
-                                PCI_DMA_FROMDEVICE);
- 
--      rtl8169_give_to_asic(desc, mapping, rx_buf_sz);
-+      rtl8169_map_to_asic(desc, mapping, rx_buf_sz);
- 
- out:
-       return ret;
-@@ -2150,7 +2153,7 @@ static inline int rtl8169_try_rx_copy(st
-                       skb_reserve(skb, NET_IP_ALIGN);
-                       eth_copy_and_sum(skb, sk_buff[0]->tail, pkt_size, 0);
-                       *sk_buff = skb;
--                      rtl8169_return_to_asic(desc, rx_buf_sz);
-+                      rtl8169_mark_to_asic(desc, rx_buf_sz);
-                       ret = 0;
-               }
-       }
-diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c
---- a/drivers/net/sis900.c
-+++ b/drivers/net/sis900.c
-@@ -236,7 +236,7 @@ static int __devinit sis900_get_mac_addr
-       signature = (u16) read_eeprom(ioaddr, EEPROMSignature);    
-       if (signature == 0xffff || signature == 0x0000) {
-               printk (KERN_INFO "%s: Error EERPOM read %x\n", 
--                      net_dev->name, signature);
-+                      pci_name(pci_dev), signature);
-               return 0;
-       }
- 
-@@ -268,7 +268,7 @@ static int __devinit sis630e_get_mac_add
-       if (!isa_bridge)
-               isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0018, 
isa_bridge);
-       if (!isa_bridge) {
--              printk("%s: Can not find ISA bridge\n", net_dev->name);
-+              printk("%s: Can not find ISA bridge\n", pci_name(pci_dev));
-               return 0;
-       }
-       pci_read_config_byte(isa_bridge, 0x48, &reg);
-@@ -456,10 +456,6 @@ static int __devinit sis900_probe(struct
-       net_dev->tx_timeout = sis900_tx_timeout;
-       net_dev->watchdog_timeo = TX_TIMEOUT;
-       net_dev->ethtool_ops = &sis900_ethtool_ops;
--      
--      ret = register_netdev(net_dev);
--      if (ret)
--              goto err_unmap_rx;
-               
-       /* Get Mac address according to the chip revision */
-       pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &revision);
-@@ -476,7 +472,7 @@ static int __devinit sis900_probe(struct
- 
-       if (ret == 0) {
-               ret = -ENODEV;
--              goto err_out_unregister;
-+              goto err_unmap_rx;
-       }
-       
-       /* 630ET : set the mii access mode as software-mode */
-@@ -486,7 +482,7 @@ static int __devinit sis900_probe(struct
-       /* probe for mii transceiver */
-       if (sis900_mii_probe(net_dev) == 0) {
-               ret = -ENODEV;
--              goto err_out_unregister;
-+              goto err_unmap_rx;
-       }
- 
-       /* save our host bridge revision */
-@@ -496,6 +492,10 @@ static int __devinit sis900_probe(struct
-               pci_dev_put(dev);
-       }
- 
-+      ret = register_netdev(net_dev);
-+      if (ret)
-+              goto err_unmap_rx;
-+
-       /* print some information about our NIC */
-       printk(KERN_INFO "%s: %s at %#lx, IRQ %d, ", net_dev->name,
-              card_name, ioaddr, net_dev->irq);
-@@ -505,8 +505,6 @@ static int __devinit sis900_probe(struct
- 
-       return 0;
- 
-- err_out_unregister:
--      unregister_netdev(net_dev);
-  err_unmap_rx:
-       pci_free_consistent(pci_dev, RX_TOTAL_SIZE, sis_priv->rx_ring,
-               sis_priv->rx_ring_dma);
-@@ -533,6 +531,7 @@ static int __devinit sis900_probe(struct
- static int __init sis900_mii_probe(struct net_device * net_dev)
- {
-       struct sis900_private * sis_priv = net_dev->priv;
-+      const char *dev_name = pci_name(sis_priv->pci_dev);
-       u16 poll_bit = MII_STAT_LINK, status = 0;
-       unsigned long timeout = jiffies + 5 * HZ;
-       int phy_addr;
-@@ -582,21 +581,20 @@ static int __init sis900_mii_probe(struc
-                                       mii_phy->phy_types =
-                                           (mii_status & (MII_STAT_CAN_TX_FDX 
| MII_STAT_CAN_TX)) ? LAN : HOME;
-                               printk(KERN_INFO "%s: %s transceiver found at 
address %d.\n",
--                                     net_dev->name, mii_chip_table[i].name,
-+                                     dev_name, mii_chip_table[i].name,
-                                      phy_addr);
-                               break;
-                       }
-                       
-               if( !mii_chip_table[i].phy_id1 ) {
-                       printk(KERN_INFO "%s: Unknown PHY transceiver found at 
address %d.\n",
--                             net_dev->name, phy_addr);
-+                             dev_name, phy_addr);
-                       mii_phy->phy_types = UNKNOWN;
-               }
-       }
-       
-       if (sis_priv->mii == NULL) {
--              printk(KERN_INFO "%s: No MII transceivers found!\n",
--                      net_dev->name);
-+              printk(KERN_INFO "%s: No MII transceivers found!\n", dev_name);
-               return 0;
-       }
- 
-@@ -621,7 +619,7 @@ static int __init sis900_mii_probe(struc
-                       poll_bit ^= (mdio_read(net_dev, sis_priv->cur_phy, 
MII_STATUS) & poll_bit);
-                       if (time_after_eq(jiffies, timeout)) {
-                               printk(KERN_WARNING "%s: reset phy and link 
down now\n",
--                                      net_dev->name);
-+                                     dev_name);
-                               return -ETIME;
-                       }
-               }
-@@ -691,7 +689,7 @@ static u16 sis900_default_phy(struct net
-               sis_priv->mii = default_phy;
-               sis_priv->cur_phy = default_phy->phy_addr;
-               printk(KERN_INFO "%s: Using transceiver found at address %d as 
default\n",
--                                      net_dev->name,sis_priv->cur_phy);
-+                     pci_name(sis_priv->pci_dev), sis_priv->cur_phy);
-       }
-       
-       status = mdio_read(net_dev, sis_priv->cur_phy, MII_CONTROL);
-diff --git a/drivers/net/tun.c b/drivers/net/tun.c
---- a/drivers/net/tun.c
-+++ b/drivers/net/tun.c
-@@ -229,7 +229,7 @@ static __inline__ ssize_t tun_get_user(s
-       size_t len = count;
- 
-       if (!(tun->flags & TUN_NO_PI)) {
--              if ((len -= sizeof(pi)) > len)
-+              if ((len -= sizeof(pi)) > count)
-                       return -EINVAL;
- 
-               if(memcpy_fromiovec((void *)&pi, iv, sizeof(pi)))
-diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
---- a/drivers/net/via-rhine.c
-+++ b/drivers/net/via-rhine.c
-@@ -1197,8 +1197,10 @@ static int rhine_open(struct net_device 
-                      dev->name, rp->pdev->irq);
- 
-       rc = alloc_ring(dev);
--      if (rc)
-+      if (rc) {
-+              free_irq(rp->pdev->irq, dev);
-               return rc;
-+      }
-       alloc_rbufs(dev);
-       alloc_tbufs(dev);
-       rhine_chip_reset(dev);
-@@ -1899,6 +1901,9 @@ static void rhine_shutdown (struct devic
-       struct rhine_private *rp = netdev_priv(dev);
-       void __iomem *ioaddr = rp->base;
- 
-+      if (!(rp->quirks & rqWOL))
-+              return; /* Nothing to do for non-WOL adapters */
-+
-       rhine_power_init(dev);
- 
-       /* Make sure we use pattern 0, 1 and not 4, 5 */
-diff --git a/drivers/net/wan/hd6457x.c b/drivers/net/wan/hd6457x.c
---- a/drivers/net/wan/hd6457x.c
-+++ b/drivers/net/wan/hd6457x.c
-@@ -315,7 +315,7 @@ static inline void sca_rx(card_t *card, 
- #endif
-       stats->rx_packets++;
-       stats->rx_bytes += skb->len;
--      skb->dev->last_rx = jiffies;
-+      dev->last_rx = jiffies;
-       skb->protocol = hdlc_type_trans(skb, dev);
-       netif_rx(skb);
- }
-diff --git a/drivers/pci/hotplug/pciehp_ctrl.c 
b/drivers/pci/hotplug/pciehp_ctrl.c
---- a/drivers/pci/hotplug/pciehp_ctrl.c
-+++ b/drivers/pci/hotplug/pciehp_ctrl.c
-@@ -1354,10 +1354,11 @@ static u32 remove_board(struct pci_func 
-                               dbg("PCI Bridge Hot-Remove 
s:b:d:f(%02x:%02x:%02x:%02x)\n", 
-                                       ctrl->seg, func->bus, func->device, 
func->function);
-                               bridge_slot_remove(func);
--                      } else
-+                      } else {
-                               dbg("PCI Function Hot-Remove 
s:b:d:f(%02x:%02x:%02x:%02x)\n", 
-                                       ctrl->seg, func->bus, func->device, 
func->function);
-                               slot_remove(func);
-+                      }
- 
-                       func = pciehp_slot_find(ctrl->slot_bus, device, 0);
-               }
-diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
---- a/drivers/usb/serial/visor.c
-+++ b/drivers/usb/serial/visor.c
-@@ -386,6 +386,7 @@ struct visor_private {
-       int bytes_in;
-       int bytes_out;
-       int outstanding_urbs;
-+      int throttled;
- };
- 
- /* number of outstanding urbs to prevent userspace DoS from happening */
-@@ -415,6 +416,7 @@ static int visor_open (struct usb_serial
-       priv->bytes_in = 0;
-       priv->bytes_out = 0;
-       priv->outstanding_urbs = 0;
-+      priv->throttled = 0;
-       spin_unlock_irqrestore(&priv->lock, flags);
- 
-       /*
-@@ -602,6 +604,7 @@ static void visor_read_bulk_callback (st
-       struct tty_struct *tty;
-       unsigned long flags;
-       int i;
-+      int throttled;
-       int result;
- 
-       dbg("%s - port %d", __FUNCTION__, port->number);
-@@ -627,18 +630,21 @@ static void visor_read_bulk_callback (st
-       }
-       spin_lock_irqsave(&priv->lock, flags);
-       priv->bytes_in += urb->actual_length;
-+      throttled = priv->throttled;
-       spin_unlock_irqrestore(&priv->lock, flags);
- 
--      /* Continue trying to always read  */
--      usb_fill_bulk_urb (port->read_urb, port->serial->dev,
--                         usb_rcvbulkpipe(port->serial->dev,
--                                         port->bulk_in_endpointAddress),
--                         port->read_urb->transfer_buffer,
--                         port->read_urb->transfer_buffer_length,
--                         visor_read_bulk_callback, port);
--      result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
--      if (result)
--              dev_err(&port->dev, "%s - failed resubmitting read urb, error 
%d\n", __FUNCTION__, result);
-+      /* Continue trying to always read if we should */
-+      if (!throttled) {
-+              usb_fill_bulk_urb (port->read_urb, port->serial->dev,
-+                                 usb_rcvbulkpipe(port->serial->dev,
-+                                                 
port->bulk_in_endpointAddress),
-+                                 port->read_urb->transfer_buffer,
-+                                 port->read_urb->transfer_buffer_length,
-+                                 visor_read_bulk_callback, port);
-+              result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
-+              if (result)
-+                      dev_err(&port->dev, "%s - failed resubmitting read urb, 
error %d\n", __FUNCTION__, result);
-+      }
-       return;
- }
- 
-@@ -683,16 +689,26 @@ exit:
- 
- static void visor_throttle (struct usb_serial_port *port)
- {
-+      struct visor_private *priv = usb_get_serial_port_data(port);
-+      unsigned long flags;
-+
-       dbg("%s - port %d", __FUNCTION__, port->number);
--      usb_kill_urb(port->read_urb);
-+      spin_lock_irqsave(&priv->lock, flags);
-+      priv->throttled = 1;
-+      spin_unlock_irqrestore(&priv->lock, flags);
- }
- 
- 
- static void visor_unthrottle (struct usb_serial_port *port)
- {
-+      struct visor_private *priv = usb_get_serial_port_data(port);
-+      unsigned long flags;
-       int result;
- 
-       dbg("%s - port %d", __FUNCTION__, port->number);
-+      spin_lock_irqsave(&priv->lock, flags);
-+      priv->throttled = 0;
-+      spin_unlock_irqrestore(&priv->lock, flags);
- 
-       port->read_urb->dev = port->serial->dev;
-       result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
-diff --git a/drivers/video/matrox/matroxfb_accel.c 
b/drivers/video/matrox/matroxfb_accel.c
---- a/drivers/video/matrox/matroxfb_accel.c
-+++ b/drivers/video/matrox/matroxfb_accel.c
-@@ -438,13 +438,21 @@ static void matroxfb_1bpp_imageblit(WPMI
-               } else if (step == 1) {
-                       /* Special case for 1..8bit widths */
-                       while (height--) {
--                              mga_writel(mmio, 0, *chardata);
-+#if defined(__BIG_ENDIAN)
-+                              fb_writel((*chardata) << 24, mmio.vaddr);
-+#else
-+                              fb_writel(*chardata, mmio.vaddr);
-+#endif
-                               chardata++;
-                       }
-               } else if (step == 2) {
-                       /* Special case for 9..15bit widths */
-                       while (height--) {
--                              mga_writel(mmio, 0, *(u_int16_t*)chardata);
-+#if defined(__BIG_ENDIAN)
-+                              fb_writel((*(u_int16_t*)chardata) << 16, 
mmio.vaddr);
-+#else
-+                              fb_writel(*(u_int16_t*)chardata, mmio.vaddr);
-+#endif
-                               chardata += 2;
-                       }
-               } else {
-@@ -454,7 +462,7 @@ static void matroxfb_1bpp_imageblit(WPMI
-                               
-                               for (i = 0; i < step; i += 4) {
-                                       /* Hope that there are at least three 
readable bytes beyond the end of bitmap */
--                                      mga_writel(mmio, 0, 
get_unaligned((u_int32_t*)(chardata + i)));
-+                                      
fb_writel(get_unaligned((u_int32_t*)(chardata + i)),mmio.vaddr);
-                               }
-                               chardata += step;
-                       }
-diff --git a/drivers/video/matrox/matroxfb_base.h 
b/drivers/video/matrox/matroxfb_base.h
---- a/drivers/video/matrox/matroxfb_base.h
-+++ b/drivers/video/matrox/matroxfb_base.h
-@@ -170,14 +170,14 @@ static inline void mga_memcpy_toio(vaddr
- 
-       if ((unsigned long)src & 3) {
-               while (len >= 4) {
--                      writel(get_unaligned((u32 *)src), addr);
-+                      fb_writel(get_unaligned((u32 *)src), addr);
-                       addr++;
-                       len -= 4;
-                       src += 4;
-               }
-       } else {
-               while (len >= 4) {
--                      writel(*(u32 *)src, addr);
-+                      fb_writel(*(u32 *)src, addr);
-                       addr++;
-                       len -= 4;
-                       src += 4;
-diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
---- a/fs/binfmt_elf.c
-+++ b/fs/binfmt_elf.c
-@@ -257,7 +257,7 @@ create_elf_tables(struct linux_binprm *b
-       }
- 
-       /* Populate argv and envp */
--      p = current->mm->arg_start;
-+      p = current->mm->arg_end = current->mm->arg_start;
-       while (argc-- > 0) {
-               size_t len;
-               __put_user((elf_addr_t)p, argv++);
-@@ -1008,6 +1008,7 @@ out_free_ph:
- static int load_elf_library(struct file *file)
- {
-       struct elf_phdr *elf_phdata;
-+      struct elf_phdr *eppnt;
-       unsigned long elf_bss, bss, len;
-       int retval, error, i, j;
-       struct elfhdr elf_ex;
-@@ -1031,44 +1032,47 @@ static int load_elf_library(struct file 
-       /* j < ELF_MIN_ALIGN because elf_ex.e_phnum <= 2 */
- 
-       error = -ENOMEM;
--      elf_phdata = (struct elf_phdr *) kmalloc(j, GFP_KERNEL);
-+      elf_phdata = kmalloc(j, GFP_KERNEL);
-       if (!elf_phdata)
-               goto out;
- 
-+      eppnt = elf_phdata;
-       error = -ENOEXEC;
--      retval = kernel_read(file, elf_ex.e_phoff, (char *) elf_phdata, j);
-+      retval = kernel_read(file, elf_ex.e_phoff, (char *)eppnt, j);
-       if (retval != j)
-               goto out_free_ph;
- 
-       for (j = 0, i = 0; i<elf_ex.e_phnum; i++)
--              if ((elf_phdata + i)->p_type == PT_LOAD) j++;
-+              if ((eppnt + i)->p_type == PT_LOAD)
-+                      j++;
-       if (j != 1)
-               goto out_free_ph;
- 
--      while (elf_phdata->p_type != PT_LOAD) elf_phdata++;
-+      while (eppnt->p_type != PT_LOAD)
-+              eppnt++;
- 
-       /* Now use mmap to map the library into memory. */
-       down_write(&current->mm->mmap_sem);
-       error = do_mmap(file,
--                      ELF_PAGESTART(elf_phdata->p_vaddr),
--                      (elf_phdata->p_filesz +
--                       ELF_PAGEOFFSET(elf_phdata->p_vaddr)),
-+                      ELF_PAGESTART(eppnt->p_vaddr),
-+                      (eppnt->p_filesz +
-+                       ELF_PAGEOFFSET(eppnt->p_vaddr)),
-                       PROT_READ | PROT_WRITE | PROT_EXEC,
-                       MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE,
--                      (elf_phdata->p_offset -
--                       ELF_PAGEOFFSET(elf_phdata->p_vaddr)));
-+                      (eppnt->p_offset -
-+                       ELF_PAGEOFFSET(eppnt->p_vaddr)));
-       up_write(&current->mm->mmap_sem);
--      if (error != ELF_PAGESTART(elf_phdata->p_vaddr))
-+      if (error != ELF_PAGESTART(eppnt->p_vaddr))
-               goto out_free_ph;
- 
--      elf_bss = elf_phdata->p_vaddr + elf_phdata->p_filesz;
-+      elf_bss = eppnt->p_vaddr + eppnt->p_filesz;
-       if (padzero(elf_bss)) {
-               error = -EFAULT;
-               goto out_free_ph;
-       }
- 
--      len = ELF_PAGESTART(elf_phdata->p_filesz + elf_phdata->p_vaddr + 
ELF_MIN_ALIGN - 1);
--      bss = elf_phdata->p_memsz + elf_phdata->p_vaddr;
-+      len = ELF_PAGESTART(eppnt->p_filesz + eppnt->p_vaddr + ELF_MIN_ALIGN - 
1);
-+      bss = eppnt->p_memsz + eppnt->p_vaddr;
-       if (bss > len) {
-               down_write(&current->mm->mmap_sem);
-               do_brk(len, bss - len);
-@@ -1275,7 +1279,7 @@ static void fill_prstatus(struct elf_prs
- static int fill_psinfo(struct elf_prpsinfo *psinfo, struct task_struct *p,
-                      struct mm_struct *mm)
- {
--      int i, len;
-+      unsigned int i, len;
-       
-       /* first copy the parameters from user space */
-       memset(psinfo, 0, sizeof(struct elf_prpsinfo));
-diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c
---- a/fs/cramfs/inode.c
-+++ b/fs/cramfs/inode.c
-@@ -70,6 +70,7 @@ static struct inode *get_cramfs_inode(st
-                       inode->i_data.a_ops = &cramfs_aops;
-               } else {
-                       inode->i_size = 0;
-+                      inode->i_blocks = 0;
-                       init_special_inode(inode, inode->i_mode,
-                               old_decode_dev(cramfs_inode->size));
-               }
-diff --git a/fs/eventpoll.c b/fs/eventpoll.c
---- a/fs/eventpoll.c
-+++ b/fs/eventpoll.c
-@@ -619,6 +619,7 @@ eexit_1:
-       return error;
- }
- 
-+#define MAX_EVENTS (INT_MAX / sizeof(struct epoll_event))
- 
- /*
-  * Implement the event wait interface for the eventpoll file. It is the kernel
-@@ -635,7 +636,7 @@ asmlinkage long sys_epoll_wait(int epfd,
-                    current, epfd, events, maxevents, timeout));
- 
-       /* The maximum number of event must be greater than zero */
--      if (maxevents <= 0)
-+      if (maxevents <= 0 || maxevents > MAX_EVENTS)
-               return -EINVAL;
- 
-       /* Verify that the area passed by the user is writeable */
-diff --git a/fs/exec.c b/fs/exec.c
---- a/fs/exec.c
-+++ b/fs/exec.c
-@@ -814,7 +814,7 @@ void get_task_comm(char *buf, struct tas
- {
-       /* buf must be at least sizeof(tsk->comm) in size */
-       task_lock(tsk);
--      memcpy(buf, tsk->comm, sizeof(tsk->comm));
-+      strncpy(buf, tsk->comm, sizeof(tsk->comm));
-       task_unlock(tsk);
- }
- 
-diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c
---- a/fs/ext2/dir.c
-+++ b/fs/ext2/dir.c
-@@ -592,6 +592,7 @@ int ext2_make_empty(struct inode *inode,
-               goto fail;
-       }
-       kaddr = kmap_atomic(page, KM_USER0);
-+       memset(kaddr, 0, chunk_size);
-       de = (struct ext2_dir_entry_2 *)kaddr;
-       de->name_len = 1;
-       de->rec_len = cpu_to_le16(EXT2_DIR_REC_LEN(1));
-diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c
---- a/fs/ext3/balloc.c
-+++ b/fs/ext3/balloc.c
-@@ -268,7 +268,8 @@ void ext3_discard_reservation(struct ino
- 
-       if (!rsv_is_empty(&rsv->rsv_window)) {
-               spin_lock(rsv_lock);
--              rsv_window_remove(inode->i_sb, rsv);
-+              if (!rsv_is_empty(&rsv->rsv_window))
-+                      rsv_window_remove(inode->i_sb, rsv);
-               spin_unlock(rsv_lock);
-       }
- }
-diff --git a/fs/hfs/mdb.c b/fs/hfs/mdb.c
---- a/fs/hfs/mdb.c
-+++ b/fs/hfs/mdb.c
-@@ -333,6 +333,8 @@ void hfs_mdb_close(struct super_block *s
-  * Release the resources associated with the in-core MDB.  */
- void hfs_mdb_put(struct super_block *sb)
- {
-+      if (!HFS_SB(sb))
-+              return;
-       /* free the B-trees */
-       hfs_btree_close(HFS_SB(sb)->ext_tree);
-       hfs_btree_close(HFS_SB(sb)->cat_tree);
-@@ -340,4 +342,7 @@ void hfs_mdb_put(struct super_block *sb)
-       /* free the buffers holding the primary and alternate MDBs */
-       brelse(HFS_SB(sb)->mdb_bh);
-       brelse(HFS_SB(sb)->alt_mdb_bh);
-+
-+      kfree(HFS_SB(sb));
-+      sb->s_fs_info = NULL;
- }
-diff --git a/fs/hfs/super.c b/fs/hfs/super.c
---- a/fs/hfs/super.c
-+++ b/fs/hfs/super.c
-@@ -263,7 +263,7 @@ static int hfs_fill_super(struct super_b
-       res = -EINVAL;
-       if (!parse_options((char *)data, sbi)) {
-               hfs_warn("hfs_fs: unable to parse mount options.\n");
--              goto bail3;
-+              goto bail;
-       }
- 
-       sb->s_op = &hfs_super_operations;
-@@ -276,7 +276,7 @@ static int hfs_fill_super(struct super_b
-                       hfs_warn("VFS: Can't find a HFS filesystem on dev 
%s.\n",
-                               hfs_mdb_name(sb));
-               res = -EINVAL;
--              goto bail2;
-+              goto bail;
-       }
- 
-       /* try to get the root inode */
-@@ -306,10 +306,8 @@ bail_iput:
-       iput(root_inode);
- bail_no_root:
-       hfs_warn("hfs_fs: get root inode failed.\n");
-+bail:
-       hfs_mdb_put(sb);
--bail2:
--bail3:
--      kfree(sbi);
-       return res;
- }
- 
-diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
---- a/fs/hfsplus/super.c
-+++ b/fs/hfsplus/super.c
-@@ -207,7 +207,9 @@ static void hfsplus_write_super(struct s
- static void hfsplus_put_super(struct super_block *sb)
- {
-       dprint(DBG_SUPER, "hfsplus_put_super\n");
--      if (!(sb->s_flags & MS_RDONLY)) {
-+      if (!sb->s_fs_info)
-+              return;
-+      if (!(sb->s_flags & MS_RDONLY) && HFSPLUS_SB(sb).s_vhdr) {
-               struct hfsplus_vh *vhdr = HFSPLUS_SB(sb).s_vhdr;
- 
-               vhdr->modify_date = hfsp_now2mt();
-@@ -223,6 +225,8 @@ static void hfsplus_put_super(struct sup
-       iput(HFSPLUS_SB(sb).alloc_file);
-       iput(HFSPLUS_SB(sb).hidden_dir);
-       brelse(HFSPLUS_SB(sb).s_vhbh);
-+      kfree(sb->s_fs_info);
-+      sb->s_fs_info = NULL;
- }
- 
- static int hfsplus_statfs(struct super_block *sb, struct kstatfs *buf)
-diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
---- a/fs/isofs/inode.c
-+++ b/fs/isofs/inode.c
-@@ -685,6 +685,8 @@ root_found:
-         sbi->s_log_zone_size = isonum_723 (h_pri->logical_block_size);
-         sbi->s_max_size = isonum_733(h_pri->volume_space_size);
-       } else {
-+        if (!pri)
-+          goto out_freebh;
-         rootp = (struct iso_directory_record *) pri->root_directory_record;
-         sbi->s_nzones = isonum_733 (pri->volume_space_size);
-         sbi->s_log_zone_size = isonum_723 (pri->logical_block_size);
-@@ -1395,6 +1397,9 @@ struct inode *isofs_iget(struct super_bl
-       struct inode *inode;
-       struct isofs_iget5_callback_data data;
- 
-+      if (offset >= 1ul << sb->s_blocksize_bits)
-+              return NULL;
-+
-       data.block = block;
-       data.offset = offset;
- 
-diff --git a/fs/isofs/rock.c b/fs/isofs/rock.c
---- a/fs/isofs/rock.c
-+++ b/fs/isofs/rock.c
-@@ -53,6 +53,7 @@
-   if(LEN & 1) LEN++;                                          \
-   CHR = ((unsigned char *) DE) + LEN;                         \
-   LEN = *((unsigned char *) DE) - LEN;                          \
-+  if (LEN<0) LEN=0;                                             \
-   if (ISOFS_SB(inode->i_sb)->s_rock_offset!=-1)                \
-   {                                                             \
-      LEN-=ISOFS_SB(inode->i_sb)->s_rock_offset;                \
-@@ -73,6 +74,10 @@
-     offset1 = 0; \
-     pbh = sb_bread(DEV->i_sb, block); \
-     if(pbh){       \
-+      if (offset > pbh->b_size || offset + cont_size > pbh->b_size){  \
-+      brelse(pbh); \
-+      goto out; \
-+      } \
-       memcpy(buffer + offset1, pbh->b_data + offset, cont_size - offset1); \
-       brelse(pbh); \
-       chr = (unsigned char *) buffer; \
-@@ -103,12 +108,13 @@ int get_rock_ridge_filename(struct iso_d
-     struct rock_ridge * rr;
-     int sig;
-     
--    while (len > 1){ /* There may be one byte for padding somewhere */
-+    while (len > 2){ /* There may be one byte for padding somewhere */
-       rr = (struct rock_ridge *) chr;
--      if (rr->len == 0) goto out; /* Something got screwed up here */
-+      if (rr->len < 3) goto out; /* Something got screwed up here */
-       sig = isonum_721(chr);
-       chr += rr->len; 
-       len -= rr->len;
-+      if (len < 0) goto out;  /* corrupted isofs */
- 
-       switch(sig){
-       case SIG('R','R'):
-@@ -122,6 +128,7 @@ int get_rock_ridge_filename(struct iso_d
-       break;
-       case SIG('N','M'):
-       if (truncate) break;
-+      if (rr->len < 5) break;
-         /*
-        * If the flags are 2 or 4, this indicates '.' or '..'.
-        * We don't want to do anything with this, because it
-@@ -186,12 +193,13 @@ parse_rock_ridge_inode_internal(struct i
-     struct rock_ridge * rr;
-     int rootflag;
-     
--    while (len > 1){ /* There may be one byte for padding somewhere */
-+    while (len > 2){ /* There may be one byte for padding somewhere */
-       rr = (struct rock_ridge *) chr;
--      if (rr->len == 0) goto out; /* Something got screwed up here */
-+      if (rr->len < 3) goto out; /* Something got screwed up here */
-       sig = isonum_721(chr);
-       chr += rr->len; 
-       len -= rr->len;
-+      if (len < 0) goto out;  /* corrupted isofs */
-       
-       switch(sig){
- #ifndef CONFIG_ZISOFS         /* No flag for SF or ZF */
-@@ -462,7 +470,7 @@ static int rock_ridge_symlink_readpage(s
-       struct rock_ridge *rr;
- 
-       if (!ISOFS_SB(inode->i_sb)->s_rock)
--              panic ("Cannot have symlink with high sierra variant of iso 
filesystem\n");
-+              goto error;
- 
-       block = ei->i_iget5_block;
-       lock_kernel();
-@@ -487,13 +495,15 @@ static int rock_ridge_symlink_readpage(s
-       SETUP_ROCK_RIDGE(raw_inode, chr, len);
- 
-       repeat:
--      while (len > 1) { /* There may be one byte for padding somewhere */
-+      while (len > 2) { /* There may be one byte for padding somewhere */
-               rr = (struct rock_ridge *) chr;
--              if (rr->len == 0)
-+              if (rr->len < 3)
-                       goto out;       /* Something got screwed up here */
-               sig = isonum_721(chr);
-               chr += rr->len;
-               len -= rr->len;
-+              if (len < 0)
-+                      goto out;       /* corrupted isofs */
- 
-               switch (sig) {
-               case SIG('R', 'R'):
-@@ -543,6 +553,7 @@ static int rock_ridge_symlink_readpage(s
-       fail:
-       brelse(bh);
-       unlock_kernel();
-+      error:
-       SetPageError(page);
-       kunmap(page);
-       unlock_page(page);
-diff --git a/fs/jbd/checkpoint.c b/fs/jbd/checkpoint.c
---- a/fs/jbd/checkpoint.c
-+++ b/fs/jbd/checkpoint.c
-@@ -339,8 +339,10 @@ int log_do_checkpoint(journal_t *journal
-                       }
-               } while (jh != last_jh && !retry);
- 
--              if (batch_count)
-+              if (batch_count) {
-                       __flush_batch(journal, bhs, &batch_count);
-+                      retry = 1;
-+              }
- 
-               /*
-                * If someone cleaned up this transaction while we slept, we're
-diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c
---- a/fs/jbd/transaction.c
-+++ b/fs/jbd/transaction.c
-@@ -1775,10 +1775,10 @@ static int journal_unmap_buffer(journal_
-                       JBUFFER_TRACE(jh, "checkpointed: add to BJ_Forget");
-                       ret = __dispose_buffer(jh,
-                                       journal->j_running_transaction);
-+                      journal_put_journal_head(jh);
-                       spin_unlock(&journal->j_list_lock);
-                       jbd_unlock_bh_state(bh);
-                       spin_unlock(&journal->j_state_lock);
--                      journal_put_journal_head(jh);
-                       return ret;
-               } else {
-                       /* There is no currently-running transaction. So the
-@@ -1789,10 +1789,10 @@ static int journal_unmap_buffer(journal_
-                               JBUFFER_TRACE(jh, "give to committing trans");
-                               ret = __dispose_buffer(jh,
-                                       journal->j_committing_transaction);
-+                              journal_put_journal_head(jh);
-                               spin_unlock(&journal->j_list_lock);
-                               jbd_unlock_bh_state(bh);
-                               spin_unlock(&journal->j_state_lock);
--                              journal_put_journal_head(jh);
-                               return ret;
-                       } else {
-                               /* The orphan record's transaction has
-@@ -1813,10 +1813,10 @@ static int journal_unmap_buffer(journal_
-                                       journal->j_running_transaction);
-                       jh->b_next_transaction = NULL;
-               }
-+              journal_put_journal_head(jh);
-               spin_unlock(&journal->j_list_lock);
-               jbd_unlock_bh_state(bh);
-               spin_unlock(&journal->j_state_lock);
--              journal_put_journal_head(jh);
-               return 0;
-       } else {
-               /* Good, the buffer belongs to the running transaction.
-diff --git a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h
---- a/include/asm-x86_64/processor.h
-+++ b/include/asm-x86_64/processor.h
-@@ -160,9 +160,9 @@ static inline void clear_in_cr4 (unsigne
- 
- 
- /*
-- * User space process size. 47bits.
-+ * User space process size. 47bits minus one guard page.
-  */
--#define TASK_SIZE     (0x800000000000UL)
-+#define TASK_SIZE     (0x800000000000UL - 4096)
- 
- /* This decides where the kernel will search for a free chunk of vm
-  * space during mmap's.
-diff --git a/include/linux/err.h b/include/linux/err.h
---- a/include/linux/err.h
-+++ b/include/linux/err.h
-@@ -13,6 +13,8 @@
-  * This should be a per-architecture thing, to allow different
-  * error and pointer decisions.
-  */
-+#define IS_ERR_VALUE(x) unlikely((x) > (unsigned long)-1000L)
-+
- static inline void *ERR_PTR(long error)
- {
-       return (void *) error;
-@@ -25,7 +27,7 @@ static inline long PTR_ERR(const void *p
- 
- static inline long IS_ERR(const void *ptr)
- {
--      return unlikely((unsigned long)ptr > (unsigned long)-1000L);
-+      return IS_ERR_VALUE((unsigned long)ptr);
- }
- 
- #endif /* _LINUX_ERR_H */
-diff --git a/kernel/exit.c b/kernel/exit.c
---- a/kernel/exit.c
-+++ b/kernel/exit.c
-@@ -516,8 +516,6 @@ static inline void choose_new_parent(tas
-        */
-       BUG_ON(p == reaper || reaper->exit_state >= EXIT_ZOMBIE);
-       p->real_parent = reaper;
--      if (p->parent == p->real_parent)
--              BUG();
- }
- 
- static inline void reparent_thread(task_t *p, task_t *father, int traced)
-diff --git a/kernel/signal.c b/kernel/signal.c
---- a/kernel/signal.c
-+++ b/kernel/signal.c
-@@ -1728,6 +1728,7 @@ do_signal_stop(int signr)
-                        * with another processor delivering a stop signal,
-                        * then the SIGCONT that wakes us up should clear it.
-                        */
-+                      read_unlock(&tasklist_lock);
-                       return 0;
-               }
- 
-diff --git a/lib/rwsem-spinlock.c b/lib/rwsem-spinlock.c
---- a/lib/rwsem-spinlock.c
-+++ b/lib/rwsem-spinlock.c
-@@ -140,12 +140,12 @@ void fastcall __sched __down_read(struct
- 
-       rwsemtrace(sem, "Entering __down_read");
- 
--      spin_lock(&sem->wait_lock);
-+      spin_lock_irq(&sem->wait_lock);
- 
-       if (sem->activity >= 0 && list_empty(&sem->wait_list)) {
-               /* granted */
-               sem->activity++;
--              spin_unlock(&sem->wait_lock);
-+              spin_unlock_irq(&sem->wait_lock);
-               goto out;
-       }
- 
-@@ -160,7 +160,7 @@ void fastcall __sched __down_read(struct
-       list_add_tail(&waiter.list, &sem->wait_list);
- 
-       /* we don't need to touch the semaphore struct anymore */
--      spin_unlock(&sem->wait_lock);
-+      spin_unlock_irq(&sem->wait_lock);
- 
-       /* wait to be given the lock */
-       for (;;) {
-@@ -181,10 +181,12 @@ void fastcall __sched __down_read(struct
-  */
- int fastcall __down_read_trylock(struct rw_semaphore *sem)
- {
-+      unsigned long flags;
-       int ret = 0;
-+
-       rwsemtrace(sem, "Entering __down_read_trylock");
- 
--      spin_lock(&sem->wait_lock);
-+      spin_lock_irqsave(&sem->wait_lock, flags);
- 
-       if (sem->activity >= 0 && list_empty(&sem->wait_list)) {
-               /* granted */
-@@ -192,7 +194,7 @@ int fastcall __down_read_trylock(struct 
-               ret = 1;
-       }
- 
--      spin_unlock(&sem->wait_lock);
-+      spin_unlock_irqrestore(&sem->wait_lock, flags);
- 
-       rwsemtrace(sem, "Leaving __down_read_trylock");
-       return ret;
-@@ -209,12 +211,12 @@ void fastcall __sched __down_write(struc
- 
-       rwsemtrace(sem, "Entering __down_write");
- 
--      spin_lock(&sem->wait_lock);
-+      spin_lock_irq(&sem->wait_lock);
- 
-       if (sem->activity == 0 && list_empty(&sem->wait_list)) {
-               /* granted */
-               sem->activity = -1;
--              spin_unlock(&sem->wait_lock);
-+              spin_unlock_irq(&sem->wait_lock);
-               goto out;
-       }
- 
-@@ -229,7 +231,7 @@ void fastcall __sched __down_write(struc
-       list_add_tail(&waiter.list, &sem->wait_list);
- 
-       /* we don't need to touch the semaphore struct anymore */
--      spin_unlock(&sem->wait_lock);
-+      spin_unlock_irq(&sem->wait_lock);
- 
-       /* wait to be given the lock */
-       for (;;) {
-@@ -250,10 +252,12 @@ void fastcall __sched __down_write(struc
-  */
- int fastcall __down_write_trylock(struct rw_semaphore *sem)
- {
-+      unsigned long flags;
-       int ret = 0;
-+
-       rwsemtrace(sem, "Entering __down_write_trylock");
- 
--      spin_lock(&sem->wait_lock);
-+      spin_lock_irqsave(&sem->wait_lock, flags);
- 
-       if (sem->activity == 0 && list_empty(&sem->wait_list)) {
-               /* granted */
-@@ -261,7 +265,7 @@ int fastcall __down_write_trylock(struct
-               ret = 1;
-       }
- 
--      spin_unlock(&sem->wait_lock);
-+      spin_unlock_irqrestore(&sem->wait_lock, flags);
- 
-       rwsemtrace(sem, "Leaving __down_write_trylock");
-       return ret;
-@@ -272,14 +276,16 @@ int fastcall __down_write_trylock(struct
-  */
- void fastcall __up_read(struct rw_semaphore *sem)
- {
-+      unsigned long flags;
-+
-       rwsemtrace(sem, "Entering __up_read");
- 
--      spin_lock(&sem->wait_lock);
-+      spin_lock_irqsave(&sem->wait_lock, flags);
- 
-       if (--sem->activity == 0 && !list_empty(&sem->wait_list))
-               sem = __rwsem_wake_one_writer(sem);
- 
--      spin_unlock(&sem->wait_lock);
-+      spin_unlock_irqrestore(&sem->wait_lock, flags);
- 
-       rwsemtrace(sem, "Leaving __up_read");
- }
-@@ -289,15 +295,17 @@ void fastcall __up_read(struct rw_semaph
-  */
- void fastcall __up_write(struct rw_semaphore *sem)
- {
-+      unsigned long flags;
-+
-       rwsemtrace(sem, "Entering __up_write");
- 
--      spin_lock(&sem->wait_lock);
-+      spin_lock_irqsave(&sem->wait_lock, flags);
- 
-       sem->activity = 0;
-       if (!list_empty(&sem->wait_list))
-               sem = __rwsem_do_wake(sem, 1);
- 
--      spin_unlock(&sem->wait_lock);
-+      spin_unlock_irqrestore(&sem->wait_lock, flags);
- 
-       rwsemtrace(sem, "Leaving __up_write");
- }
-@@ -308,15 +316,17 @@ void fastcall __up_write(struct rw_semap
-  */
- void fastcall __downgrade_write(struct rw_semaphore *sem)
- {
-+      unsigned long flags;
-+
-       rwsemtrace(sem, "Entering __downgrade_write");
- 
--      spin_lock(&sem->wait_lock);
-+      spin_lock_irqsave(&sem->wait_lock, flags);
- 
-       sem->activity = 1;
-       if (!list_empty(&sem->wait_list))
-               sem = __rwsem_do_wake(sem, 0);
- 
--      spin_unlock(&sem->wait_lock);
-+      spin_unlock_irqrestore(&sem->wait_lock, flags);
- 
-       rwsemtrace(sem, "Leaving __downgrade_write");
- }
-diff --git a/lib/rwsem.c b/lib/rwsem.c
---- a/lib/rwsem.c
-+++ b/lib/rwsem.c
-@@ -150,7 +150,7 @@ rwsem_down_failed_common(struct rw_semap
-       set_task_state(tsk, TASK_UNINTERRUPTIBLE);
- 
-       /* set up my own style of waitqueue */
--      spin_lock(&sem->wait_lock);
-+      spin_lock_irq(&sem->wait_lock);
-       waiter->task = tsk;
-       get_task_struct(tsk);
- 
-@@ -163,7 +163,7 @@ rwsem_down_failed_common(struct rw_semap
-       if (!(count & RWSEM_ACTIVE_MASK))
-               sem = __rwsem_do_wake(sem, 0);
- 
--      spin_unlock(&sem->wait_lock);
-+      spin_unlock_irq(&sem->wait_lock);
- 
-       /* wait to be given the lock */
-       for (;;) {
-@@ -219,15 +219,17 @@ rwsem_down_write_failed(struct rw_semaph
-  */
- struct rw_semaphore fastcall *rwsem_wake(struct rw_semaphore *sem)
- {
-+      unsigned long flags;
-+
-       rwsemtrace(sem, "Entering rwsem_wake");
- 
--      spin_lock(&sem->wait_lock);
-+      spin_lock_irqsave(&sem->wait_lock, flags);
- 
-       /* do nothing if list empty */
-       if (!list_empty(&sem->wait_list))
-               sem = __rwsem_do_wake(sem, 0);
- 
--      spin_unlock(&sem->wait_lock);
-+      spin_unlock_irqrestore(&sem->wait_lock, flags);
- 
-       rwsemtrace(sem, "Leaving rwsem_wake");
- 
-@@ -241,15 +243,17 @@ struct rw_semaphore fastcall *rwsem_wake
-  */
- struct rw_semaphore fastcall *rwsem_downgrade_wake(struct rw_semaphore *sem)
- {
-+      unsigned long flags;
-+
-       rwsemtrace(sem, "Entering rwsem_downgrade_wake");
- 
--      spin_lock(&sem->wait_lock);
-+      spin_lock_irqsave(&sem->wait_lock, flags);
- 
-       /* do nothing if list empty */
-       if (!list_empty(&sem->wait_list))
-               sem = __rwsem_do_wake(sem, 1);
- 
--      spin_unlock(&sem->wait_lock);
-+      spin_unlock_irqrestore(&sem->wait_lock, flags);
- 
-       rwsemtrace(sem, "Leaving rwsem_downgrade_wake");
-       return sem;
-diff --git a/mm/mmap.c b/mm/mmap.c
---- a/mm/mmap.c
-+++ b/mm/mmap.c
-@@ -1315,37 +1315,40 @@ unsigned long
- get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
-               unsigned long pgoff, unsigned long flags)
- {
--      if (flags & MAP_FIXED) {
--              unsigned long ret;
-+      unsigned long ret;
- 
--              if (addr > TASK_SIZE - len)
--                      return -ENOMEM;
--              if (addr & ~PAGE_MASK)
--                      return -EINVAL;
--              if (file && is_file_hugepages(file))  {
--                      /*
--                       * Check if the given range is hugepage aligned, and
--                       * can be made suitable for hugepages.
--                       */
--                      ret = prepare_hugepage_range(addr, len);
--              } else {
--                      /*
--                       * Ensure that a normal request is not falling in a
--                       * reserved hugepage range.  For some archs like IA-64,
--                       * there is a separate region for hugepages.
--                       */
--                      ret = is_hugepage_only_range(addr, len);
--              }
--              if (ret)
--                      return -EINVAL;
--              return addr;
--      }
-+      if (!(flags & MAP_FIXED)) {
-+              unsigned long (*get_area)(struct file *, unsigned long, 
unsigned long, unsigned long, unsigned long);
- 
--      if (file && file->f_op && file->f_op->get_unmapped_area)
--              return file->f_op->get_unmapped_area(file, addr, len,
--                                              pgoff, flags);
-+              get_area = current->mm->get_unmapped_area;
-+              if (file && file->f_op && file->f_op->get_unmapped_area)
-+                      get_area = file->f_op->get_unmapped_area;
-+              addr = get_area(file, addr, len, pgoff, flags);
-+              if (IS_ERR_VALUE(addr))
-+                      return addr;
-+      }
- 
--      return current->mm->get_unmapped_area(file, addr, len, pgoff, flags);
-+      if (addr > TASK_SIZE - len)
-+              return -ENOMEM;
-+      if (addr & ~PAGE_MASK)
-+              return -EINVAL;
-+      if (file && is_file_hugepages(file))  {
-+              /*
-+               * Check if the given range is hugepage aligned, and
-+               * can be made suitable for hugepages.
-+               */
-+              ret = prepare_hugepage_range(addr, len);
-+      } else {
-+              /*
-+               * Ensure that a normal request is not falling in a
-+               * reserved hugepage range.  For some archs like IA-64,
-+               * there is a separate region for hugepages.
-+               */
-+              ret = is_hugepage_only_range(addr, len);
-+      }
-+      if (ret)
-+              return -EINVAL;
-+      return addr;
- }
- 
- EXPORT_SYMBOL(get_unmapped_area);
-diff --git a/mm/rmap.c b/mm/rmap.c
---- a/mm/rmap.c
-+++ b/mm/rmap.c
-@@ -641,7 +641,7 @@ static void try_to_unmap_cluster(unsigne
-       pgd_t *pgd;
-       pud_t *pud;
-       pmd_t *pmd;
--      pte_t *pte;
-+      pte_t *pte, *original_pte;
-       pte_t pteval;
-       struct page *page;
-       unsigned long address;
-@@ -673,7 +673,7 @@ static void try_to_unmap_cluster(unsigne
-       if (!pmd_present(*pmd))
-               goto out_unlock;
- 
--      for (pte = pte_offset_map(pmd, address);
-+      for (original_pte = pte = pte_offset_map(pmd, address);
-                       address < end; pte++, address += PAGE_SIZE) {
- 
-               if (!pte_present(*pte))
-@@ -710,7 +710,7 @@ static void try_to_unmap_cluster(unsigne
-               (*mapcount)--;
-       }
- 
--      pte_unmap(pte);
-+      pte_unmap(original_pte);
- 
- out_unlock:
-       spin_unlock(&mm->page_table_lock);
-diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
---- a/net/bluetooth/af_bluetooth.c
-+++ b/net/bluetooth/af_bluetooth.c
-@@ -64,7 +64,7 @@ static kmem_cache_t *bt_sock_cache;
- 
- int bt_sock_register(int proto, struct net_proto_family *ops)
- {
--      if (proto >= BT_MAX_PROTO)
-+      if (proto < 0 || proto >= BT_MAX_PROTO)
-               return -EINVAL;
- 
-       if (bt_proto[proto])
-@@ -77,7 +77,7 @@ EXPORT_SYMBOL(bt_sock_register);
- 
- int bt_sock_unregister(int proto)
- {
--      if (proto >= BT_MAX_PROTO)
-+      if (proto < 0 || proto >= BT_MAX_PROTO)
-               return -EINVAL;
- 
-       if (!bt_proto[proto])
-@@ -92,7 +92,7 @@ static int bt_sock_create(struct socket 
- {
-       int err = 0;
- 
--      if (proto >= BT_MAX_PROTO)
-+      if (proto < 0 || proto >= BT_MAX_PROTO)
-               return -EINVAL;
- 
- #if defined(CONFIG_KMOD)
-diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
---- a/net/bridge/br_input.c
-+++ b/net/bridge/br_input.c
-@@ -54,6 +54,9 @@ int br_handle_frame_finish(struct sk_buf
-       struct net_bridge_fdb_entry *dst;
-       int passedup = 0;
- 
-+      /* insert into forwarding database after filtering to avoid spoofing */
-+      br_fdb_insert(p->br, p, eth_hdr(skb)->h_source, 0);
-+
-       if (br->dev->flags & IFF_PROMISC) {
-               struct sk_buff *skb2;
- 
-@@ -108,8 +111,7 @@ int br_handle_frame(struct net_bridge_po
-       if (eth_hdr(skb)->h_source[0] & 1)
-               goto err;
- 
--      if (p->state == BR_STATE_LEARNING ||
--          p->state == BR_STATE_FORWARDING)
-+      if (p->state == BR_STATE_LEARNING)
-               br_fdb_insert(p->br, p, eth_hdr(skb)->h_source, 0);
- 
-       if (p->br->stp_enabled &&
-diff --git a/net/bridge/br_stp_bpdu.c b/net/bridge/br_stp_bpdu.c
---- a/net/bridge/br_stp_bpdu.c
-+++ b/net/bridge/br_stp_bpdu.c
-@@ -140,6 +140,9 @@ int br_stp_handle_bpdu(struct sk_buff *s
-       struct net_bridge *br = p->br;
-       unsigned char *buf;
- 
-+      /* insert into forwarding database after filtering to avoid spoofing */
-+      br_fdb_insert(p->br, p, eth_hdr(skb)->h_source, 0);
-+
-       /* need at least the 802 and STP headers */
-       if (!pskb_may_pull(skb, sizeof(header)+1) ||
-           memcmp(skb->data, header, sizeof(header)))
-diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
---- a/net/bridge/netfilter/ebtables.c
-+++ b/net/bridge/netfilter/ebtables.c
-@@ -179,9 +179,10 @@ unsigned int ebt_do_table (unsigned int 
-       struct ebt_chainstack *cs;
-       struct ebt_entries *chaininfo;
-       char *base;
--      struct ebt_table_info *private = table->private;
-+      struct ebt_table_info *private;
- 
-       read_lock_bh(&table->lock);
-+      private = table->private;
-       cb_base = COUNTER_BASE(private->counters, private->nentries,
-          smp_processor_id());
-       if (private->chainstack)
-diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c
---- a/net/ipv4/fib_hash.c
-+++ b/net/ipv4/fib_hash.c
-@@ -919,13 +919,23 @@ out:
-       return fa;
- }
- 
-+static struct fib_alias *fib_get_idx(struct seq_file *seq, loff_t pos)
-+{
-+      struct fib_alias *fa = fib_get_first(seq);
-+
-+      if (fa)
-+              while (pos && (fa = fib_get_next(seq)))
-+                      --pos;
-+      return pos ? NULL : fa;
-+}
-+
- static void *fib_seq_start(struct seq_file *seq, loff_t *pos)
- {
-       void *v = NULL;
- 
-       read_lock(&fib_hash_lock);
-       if (ip_fib_main_table)
--              v = *pos ? fib_get_next(seq) : SEQ_START_TOKEN;
-+              v = *pos ? fib_get_idx(seq, *pos - 1) : SEQ_START_TOKEN;
-       return v;
- }
- 
-diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c
---- a/net/ipv4/netfilter/ip_queue.c
-+++ b/net/ipv4/netfilter/ip_queue.c
-@@ -3,6 +3,7 @@
-  * communicating with userspace via netlink.
-  *
-  * (C) 2000-2002 James Morris <jmorris@xxxxxxxxxxxxxxxx>
-+ * (C) 2003-2005 Netfilter Core Team <coreteam@xxxxxxxxxxxxx>
-  *
-  * This program is free software; you can redistribute it and/or modify
-  * it under the terms of the GNU General Public License version 2 as
-@@ -14,6 +15,7 @@
-  *             Zander).
-  * 2000-08-01: Added Nick Williams' MAC support.
-  * 2002-06-25: Code cleanup.
-+ * 2005-05-26: local_bh_{disable,enable} around nf_reinject (Harald Welte)
-  *
-  */
- #include <linux/module.h>
-@@ -66,7 +68,15 @@ static DECLARE_MUTEX(ipqnl_sem);
- static void
- ipq_issue_verdict(struct ipq_queue_entry *entry, int verdict)
- {
-+      /* TCP input path (and probably other bits) assume to be called
-+       * from softirq context, not from syscall, like ipq_issue_verdict is
-+       * called.  TCP input path deadlocks with locks taken from timer
-+       * softirq, e.g.  We therefore emulate this by local_bh_disable() */
-+
-+      local_bh_disable();
-       nf_reinject(entry->skb, entry->info, verdict);
-+      local_bh_enable();
-+
-       kfree(entry);
- }
- 
-diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
---- a/net/ipv4/tcp_input.c
-+++ b/net/ipv4/tcp_input.c
-@@ -1653,7 +1653,10 @@ static void DBGUNDO(struct sock *sk, str
- static void tcp_undo_cwr(struct tcp_sock *tp, int undo)
- {
-       if (tp->prior_ssthresh) {
--              tp->snd_cwnd = max(tp->snd_cwnd, tp->snd_ssthresh<<1);
-+              if (tcp_is_bic(tp))
-+                      tp->snd_cwnd = max(tp->snd_cwnd, 
tp->bictcp.last_max_cwnd);
-+              else
-+                      tp->snd_cwnd = max(tp->snd_cwnd, tp->snd_ssthresh<<1);
- 
-               if (undo && tp->prior_ssthresh > tp->snd_ssthresh) {
-                       tp->snd_ssthresh = tp->prior_ssthresh;
-diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
---- a/net/ipv4/tcp_timer.c
-+++ b/net/ipv4/tcp_timer.c
-@@ -38,6 +38,7 @@ static void tcp_keepalive_timer (unsigne
- 
- #ifdef TCP_DEBUG
- const char tcp_timer_bug_msg[] = KERN_DEBUG "tcpbug: unknown timer value\n";
-+EXPORT_SYMBOL(tcp_timer_bug_msg);
- #endif
- 
- /*
-diff --git a/net/ipv4/xfrm4_output.c b/net/ipv4/xfrm4_output.c
---- a/net/ipv4/xfrm4_output.c
-+++ b/net/ipv4/xfrm4_output.c
-@@ -103,17 +103,17 @@ int xfrm4_output(struct sk_buff *skb)
-                       goto error_nolock;
-       }
- 
--      spin_lock_bh(&x->lock);
--      err = xfrm_state_check(x, skb);
--      if (err)
--              goto error;
--
-       if (x->props.mode) {
-               err = xfrm4_tunnel_check_size(skb);
-               if (err)
--                      goto error;
-+                      goto error_nolock;
-       }
- 
-+      spin_lock_bh(&x->lock);
-+      err = xfrm_state_check(x, skb);
-+      if (err)
-+              goto error;
-+
-       xfrm4_encap(skb);
- 
-       err = x->type->output(skb);
-diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c
---- a/net/ipv6/xfrm6_output.c
-+++ b/net/ipv6/xfrm6_output.c
-@@ -103,17 +103,17 @@ int xfrm6_output(struct sk_buff *skb)
-                       goto error_nolock;
-       }
- 
--      spin_lock_bh(&x->lock);
--      err = xfrm_state_check(x, skb);
--      if (err)
--              goto error;
--
-       if (x->props.mode) {
-               err = xfrm6_tunnel_check_size(skb);
-               if (err)
--                      goto error;
-+                      goto error_nolock;
-       }
- 
-+      spin_lock_bh(&x->lock);
-+      err = xfrm_state_check(x, skb);
-+      if (err)
-+              goto error;
-+
-       xfrm6_encap(skb);
- 
-       err = x->type->output(skb);
-diff --git a/net/netrom/nr_in.c b/net/netrom/nr_in.c
---- a/net/netrom/nr_in.c
-+++ b/net/netrom/nr_in.c
-@@ -74,7 +74,6 @@ static int nr_queue_rx_frame(struct sock
- static int nr_state1_machine(struct sock *sk, struct sk_buff *skb,
-       int frametype)
- {
--      bh_lock_sock(sk);
-       switch (frametype) {
-       case NR_CONNACK: {
-               nr_cb *nr = nr_sk(sk);
-@@ -103,8 +102,6 @@ static int nr_state1_machine(struct sock
-       default:
-               break;
-       }
--      bh_unlock_sock(sk);
--
-       return 0;
- }
- 
-@@ -116,7 +113,6 @@ static int nr_state1_machine(struct sock
- static int nr_state2_machine(struct sock *sk, struct sk_buff *skb,
-       int frametype)
- {
--      bh_lock_sock(sk);
-       switch (frametype) {
-       case NR_CONNACK | NR_CHOKE_FLAG:
-               nr_disconnect(sk, ECONNRESET);
-@@ -132,8 +128,6 @@ static int nr_state2_machine(struct sock
-       default:
-               break;
-       }
--      bh_unlock_sock(sk);
--
-       return 0;
- }
- 
-@@ -154,7 +148,6 @@ static int nr_state3_machine(struct sock
-       nr = skb->data[18];
-       ns = skb->data[17];
- 
--      bh_lock_sock(sk);
-       switch (frametype) {
-       case NR_CONNREQ:
-               nr_write_internal(sk, NR_CONNACK);
-@@ -265,8 +258,6 @@ static int nr_state3_machine(struct sock
-       default:
-               break;
-       }
--      bh_unlock_sock(sk);
--
-       return queued;
- }
- 
-diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c
---- a/net/rose/rose_route.c
-+++ b/net/rose/rose_route.c
-@@ -727,7 +727,8 @@ int rose_rt_ioctl(unsigned int cmd, void
-               }
-               if (rose_route.mask > 10) /* Mask can't be more than 10 digits 
*/
-                       return -EINVAL;
--
-+              if (rose_route.ndigis > 8) /* No more than 8 digipeats */
-+                      return -EINVAL;
-               err = rose_add_node(&rose_route, dev);
-               dev_put(dev);
-               return err;
-diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
---- a/net/sched/sch_netem.c
-+++ b/net/sched/sch_netem.c
-@@ -184,10 +184,15 @@ static int netem_enqueue(struct sk_buff 
-       /* Random duplication */
-       if (q->duplicate && q->duplicate >= get_crandom(&q->dup_cor)) {
-               struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC);
--
--              pr_debug("netem_enqueue: dup %p\n", skb2);
--              if (skb2)
--                      delay_skb(sch, skb2);
-+              if (skb2) {
-+                      struct Qdisc *rootq = sch->dev->qdisc;
-+                      u32 dupsave = q->duplicate;
-+
-+                      /* prevent duplicating a dup... */
-+                      q->duplicate = 0;
-+                      rootq->enqueue(skb2, rootq);
-+                      q->duplicate = dupsave;
-+              }
-       }
- 
-       /* If doing simple delay then gap == 0 so all packets
-diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
---- a/net/xfrm/xfrm_state.c
-+++ b/net/xfrm/xfrm_state.c
-@@ -609,7 +609,7 @@ static struct xfrm_state *__xfrm_find_ac
- 
-       for (i = 0; i < XFRM_DST_HSIZE; i++) {
-               list_for_each_entry(x, xfrm_state_bydst+i, bydst) {
--                      if (x->km.seq == seq) {
-+                      if (x->km.seq == seq && x->km.state == XFRM_STATE_ACQ) {
-                               xfrm_state_hold(x);
-                               return x;
-                       }
-diff --git a/security/keys/key.c b/security/keys/key.c
---- a/security/keys/key.c
-+++ b/security/keys/key.c
-@@ -57,9 +57,10 @@ struct key_user *key_user_lookup(uid_t u
- {
-       struct key_user *candidate = NULL, *user;
-       struct rb_node *parent = NULL;
--      struct rb_node **p = &key_user_tree.rb_node;
-+      struct rb_node **p;
- 
-  try_again:
-+      p = &key_user_tree.rb_node;
-       spin_lock(&key_user_lock);
- 
-       /* search the tree for a user record with a matching UID */
-diff --git a/sound/core/timer.c b/sound/core/timer.c
---- a/sound/core/timer.c
-+++ b/sound/core/timer.c
-@@ -1117,7 +1117,8 @@ static void snd_timer_user_append_to_tqu
-       if (tu->qused >= tu->queue_size) {
-               tu->overrun++;
-       } else {
--              memcpy(&tu->queue[tu->qtail++], tread, sizeof(*tread));
-+              memcpy(&tu->tqueue[tu->qtail++], tread, sizeof(*tread));
-+              tu->qtail %= tu->queue_size;
-               tu->qused++;
-       }
- }
-@@ -1140,6 +1141,8 @@ static void snd_timer_user_ccallback(snd
-       spin_lock(&tu->qlock);
-       snd_timer_user_append_to_tqueue(tu, &r1);
-       spin_unlock(&tu->qlock);
-+      kill_fasync(&tu->fasync, SIGIO, POLL_IN);
-+      wake_up(&tu->qchange_sleep);
- }
- 
- static void snd_timer_user_tinterrupt(snd_timer_instance_t *timeri,
-diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
---- a/sound/pci/ac97/ac97_codec.c
-+++ b/sound/pci/ac97/ac97_codec.c
-@@ -1185,7 +1185,7 @@ snd_kcontrol_t *snd_ac97_cnew(const snd_
- /*
-  * create mute switch(es) for normal stereo controls
-  */
--static int snd_ac97_cmute_new(snd_card_t *card, char *name, int reg, ac97_t 
*ac97)
-+static int snd_ac97_cmute_new_stereo(snd_card_t *card, char *name, int reg, 
int check_stereo, ac97_t *ac97)
- {
-       snd_kcontrol_t *kctl;
-       int err;
-@@ -1196,7 +1196,7 @@ static int snd_ac97_cmute_new(snd_card_t
- 
-       mute_mask = 0x8000;
-       val = snd_ac97_read(ac97, reg);
--      if (ac97->flags & AC97_STEREO_MUTES) {
-+      if (check_stereo || (ac97->flags & AC97_STEREO_MUTES)) {
-               /* check whether both mute bits work */
-               val1 = val | 0x8080;
-               snd_ac97_write(ac97, reg, val1);
-@@ -1254,7 +1254,7 @@ static int snd_ac97_cvol_new(snd_card_t 
- /*
-  * create a mute-switch and a volume for normal stereo/mono controls
-  */
--static int snd_ac97_cmix_new(snd_card_t *card, const char *pfx, int reg, 
ac97_t *ac97)
-+static int snd_ac97_cmix_new_stereo(snd_card_t *card, const char *pfx, int 
reg, int check_stereo, ac97_t *ac97)
- {
-       int err;
-       char name[44];
-@@ -1265,7 +1265,7 @@ static int snd_ac97_cmix_new(snd_card_t 
- 
-       if (snd_ac97_try_bit(ac97, reg, 15)) {
-               sprintf(name, "%s Switch", pfx);
--              if ((err = snd_ac97_cmute_new(card, name, reg, ac97)) < 0)
-+              if ((err = snd_ac97_cmute_new_stereo(card, name, reg, 
check_stereo, ac97)) < 0)
-                       return err;
-       }
-       check_volume_resolution(ac97, reg, &lo_max, &hi_max);
-@@ -1277,6 +1277,8 @@ static int snd_ac97_cmix_new(snd_card_t 
-       return 0;
- }
- 
-+#define snd_ac97_cmix_new(card, pfx, reg, ac97)       
snd_ac97_cmix_new_stereo(card, pfx, reg, 0, ac97)
-+#define snd_ac97_cmute_new(card, name, reg, ac97)     
snd_ac97_cmute_new_stereo(card, name, reg, 0, ac97)
- 
- static unsigned int snd_ac97_determine_spdif_rates(ac97_t *ac97);
- 
-@@ -1327,7 +1329,8 @@ static int snd_ac97_mixer_build(ac97_t *
- 
-       /* build surround controls */
-       if (snd_ac97_try_volume_mix(ac97, AC97_SURROUND_MASTER)) {
--              if ((err = snd_ac97_cmix_new(card, "Surround Playback", 
AC97_SURROUND_MASTER, ac97)) < 0)
-+              /* Surround Master (0x38) is with stereo mutes */
-+              if ((err = snd_ac97_cmix_new_stereo(card, "Surround Playback", 
AC97_SURROUND_MASTER, 1, ac97)) < 0)
-                       return err;
-       }
- 
-diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
---- a/sound/usb/usbaudio.c
-+++ b/sound/usb/usbaudio.c
-@@ -3276,7 +3276,7 @@ static void snd_usb_audio_disconnect(str
-               }
-               usb_chip[chip->index] = NULL;
-               up(&register_mutex);
--              snd_card_free_in_thread(card);
-+              snd_card_free(card);
-       } else {
-               up(&register_mutex);
-       }
-diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c
---- a/sound/usb/usx2y/usbusx2y.c
-+++ b/sound/usb/usx2y/usbusx2y.c
-@@ -1,6 +1,11 @@
- /*
-  * usbusy2y.c - ALSA USB US-428 Driver
-  *
-+2005-04-14 Karsten Wiese
-+      Version 0.8.7.2:
-+      Call snd_card_free() instead of snd_card_free_in_thread() to prevent 
oops with dead keyboard symptom.
-+      Tested ok with kernel 2.6.12-rc2.
-+
- 2004-12-14 Karsten Wiese
-       Version 0.8.7.1:
-       snd_pcm_open for rawusb pcm-devices now returns -EBUSY if called 
without rawusb's hwdep device being open.
-@@ -143,7 +148,7 @@
- 
- 
- MODULE_AUTHOR("Karsten Wiese <annabellesgarden@xxxxxxxx>");
--MODULE_DESCRIPTION("TASCAM "NAME_ALLCAPS" Version 0.8.7.1");
-+MODULE_DESCRIPTION("TASCAM "NAME_ALLCAPS" Version 0.8.7.2");
- MODULE_LICENSE("GPL");
- MODULE_SUPPORTED_DEVICE("{{TASCAM(0x1604), 
"NAME_ALLCAPS"(0x8001)(0x8005)(0x8007) }}");
- 
-@@ -430,8 +435,6 @@ static void usX2Y_usb_disconnect(struct 
-       if (ptr) {
-               usX2Ydev_t* usX2Y = usX2Y((snd_card_t*)ptr);
-               struct list_head* p;
--              if (usX2Y->chip_status == USX2Y_STAT_CHIP_HUP)  // on 2.6.1 
kernel snd_usbmidi_disconnect()
--                      return;                                 // calls us 
back. better leave :-) .
-               usX2Y->chip.shutdown = 1;
-               usX2Y->chip_status = USX2Y_STAT_CHIP_HUP;
-               usX2Y_unlinkSeq(&usX2Y->AS04);
-@@ -443,7 +446,7 @@ static void usX2Y_usb_disconnect(struct 
-               }
-               if (usX2Y->us428ctls_sharedmem) 
-                       wake_up(&usX2Y->us428ctls_wait_queue_head);
--              snd_card_free_in_thread((snd_card_t*)ptr);
-+              snd_card_free((snd_card_t*)ptr);
-       }
- }
- 
diff -r ece694762d7a -r 60fc40a82fa9 patches/linux-2.6.11/net-csum.patch
--- a/patches/linux-2.6.11/net-csum.patch       Mon Jul 11 15:12:37 2005
+++ /dev/null   Mon Jul 11 15:35:33 2005
@@ -1,22 +0,0 @@
-diff -ur linux-2.6.11/net/ipv4/netfilter/ip_conntrack_proto_tcp.c 
linux-2.6.11-csum/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
---- linux-2.6.11/net/ipv4/netfilter/ip_conntrack_proto_tcp.c   2005-05-27 
11:47:48 +01:00
-+++ linux-2.6.11-csum/net/ipv4/netfilter/ip_conntrack_proto_tcp.c      
2005-05-27 11:48:07 +01:00
-@@ -803,6 +803,7 @@
-        */
-       /* FIXME: Source route IP option packets --RR */
-       if (hooknum == NF_IP_PRE_ROUTING
-+          && skb->ip_summed != CHECKSUM_UNNECESSARY
-           && csum_tcpudp_magic(iph->saddr, iph->daddr, tcplen, IPPROTO_TCP,
-                                skb->ip_summed == CHECKSUM_HW ? skb->csum
-                                : skb_checksum(skb, iph->ihl*4, tcplen, 0))) {
-diff -ur linux-2.6.11/net/ipv4/netfilter/ip_conntrack_proto_udp.c 
linux-2.6.11-csum/net/ipv4/netfilter/ip_conntrack_proto_udp.c
---- linux-2.6.11/net/ipv4/netfilter/ip_conntrack_proto_udp.c   2005-05-27 
11:47:48 +01:00
-+++ linux-2.6.11-csum/net/ipv4/netfilter/ip_conntrack_proto_udp.c      
2005-05-27 11:48:07 +01:00
-@@ -120,6 +120,7 @@
-        * and moreover root might send raw packets.
-        * FIXME: Source route IP option packets --RR */
-       if (hooknum == NF_IP_PRE_ROUTING
-+          && skb->ip_summed != CHECKSUM_UNNECESSARY
-           && csum_tcpudp_magic(iph->saddr, iph->daddr, udplen, IPPROTO_UDP,
-                                skb->ip_summed == CHECKSUM_HW ? skb->csum
-                                : skb_checksum(skb, iph->ihl*4, udplen, 0))) {
diff -r ece694762d7a -r 60fc40a82fa9 patches/linux-2.6.11/rcu-nohz.patch
--- a/patches/linux-2.6.11/rcu-nohz.patch       Mon Jul 11 15:12:37 2005
+++ /dev/null   Mon Jul 11 15:35:33 2005
@@ -1,16 +0,0 @@
-diff -ur linux-2.6.11/kernel/rcupdate.c linux-2.6.11-rcu/kernel/rcupdate.c
---- linux-2.6.11/kernel/rcupdate.c     2005-05-30 10:51:41 +01:00
-+++ linux-2.6.11-rcu/kernel/rcupdate.c 2005-05-30 10:53:53 +01:00
-@@ -202,8 +202,11 @@
-  */
- static void cpu_quiet(int cpu, struct rcu_ctrlblk *rcp, struct rcu_state *rsp)
- {
-+      cpumask_t mask;
-+
-       cpu_clear(cpu, rsp->cpumask);
--      if (cpus_empty(rsp->cpumask)) {
-+      cpus_andnot(mask, rsp->cpumask, nohz_cpu_mask);
-+      if (cpus_empty(mask)) {
-               /* batch completed ! */
-               rcp->completed = rcp->cur;
-               rcu_start_batch(rcp, rsp, 0);
diff -r ece694762d7a -r 60fc40a82fa9 patches/linux-2.6.11/smp-alts.patch
--- a/patches/linux-2.6.11/smp-alts.patch       Mon Jul 11 15:12:37 2005
+++ /dev/null   Mon Jul 11 15:35:33 2005
@@ -1,563 +0,0 @@
-diff -Naur linux-2.6.11/arch/i386/Kconfig linux-2.6.11.post/arch/i386/Kconfig
---- linux-2.6.11/arch/i386/Kconfig     2005-03-02 07:37:49.000000000 +0000
-+++ linux-2.6.11.post/arch/i386/Kconfig        2005-06-10 13:42:35.000000000 
+0100
-@@ -481,6 +481,19 @@
- 
-         If you don't know what to do here, say N.
- 
-+config SMP_ALTERNATIVES
-+      bool "SMP alternatives support (EXPERIMENTAL)"
-+      depends on SMP && EXPERIMENTAL
-+      help
-+        Try to reduce the overhead of running an SMP kernel on a uniprocessor
-+        host slightly by replacing certain key instruction sequences
-+        according to whether we currently have more than one CPU available.
-+        This should provide a noticeable boost to performance when
-+        running SMP kernels on UP machines, and have negligible impact
-+        when running on an true SMP host.
-+
-+          If unsure, say N.
-+        
- config NR_CPUS
-       int "Maximum number of CPUs (2-255)"
-       range 2 255
-diff -Naur linux-2.6.11/arch/i386/kernel/Makefile 
linux-2.6.11.post/arch/i386/kernel/Makefile
---- linux-2.6.11/arch/i386/kernel/Makefile     2005-03-02 07:37:49.000000000 
+0000
-+++ linux-2.6.11.post/arch/i386/kernel/Makefile        2005-06-16 
11:16:18.555332435 +0100
-@@ -32,6 +32,7 @@
- obj-$(CONFIG_HPET_TIMER)      += time_hpet.o
- obj-$(CONFIG_EFI)             += efi.o efi_stub.o
- obj-$(CONFIG_EARLY_PRINTK)    += early_printk.o
-+obj-$(CONFIG_SMP_ALTERNATIVES)  += smpalts.o
- 
- EXTRA_AFLAGS   := -traditional
- 
-diff -Naur linux-2.6.11/arch/i386/kernel/smpalts.c 
linux-2.6.11.post/arch/i386/kernel/smpalts.c
---- linux-2.6.11/arch/i386/kernel/smpalts.c    1970-01-01 01:00:00.000000000 
+0100
-+++ linux-2.6.11.post/arch/i386/kernel/smpalts.c       2005-06-16 
11:23:39.300902424 +0100
-@@ -0,0 +1,85 @@
-+#include <linux/kernel.h>
-+#include <asm/system.h>
-+#include <asm/smp_alt.h>
-+#include <asm/processor.h>
-+#include <asm/string.h>
-+
-+struct smp_replacement_record {
-+      unsigned char targ_size;
-+      unsigned char smp1_size;
-+      unsigned char smp2_size;
-+      unsigned char up_size;
-+      unsigned char feature;
-+      unsigned char data[0];
-+};
-+
-+struct smp_alternative_record {
-+      void *targ_start;
-+      struct smp_replacement_record *repl;
-+};
-+
-+extern struct smp_alternative_record __start_smp_alternatives_table,
-+  __stop_smp_alternatives_table;
-+extern unsigned long __init_begin, __init_end;
-+
-+void prepare_for_smp(void)
-+{
-+      struct smp_alternative_record *r;
-+      printk(KERN_INFO "Enabling SMP...\n");
-+      for (r = &__start_smp_alternatives_table;
-+           r != &__stop_smp_alternatives_table;
-+           r++) {
-+              BUG_ON(r->repl->targ_size < r->repl->smp1_size);
-+              BUG_ON(r->repl->targ_size < r->repl->smp2_size);
-+              BUG_ON(r->repl->targ_size < r->repl->up_size);
-+               if (system_state == SYSTEM_RUNNING &&
-+                   r->targ_start >= (void *)&__init_begin &&
-+                   r->targ_start < (void *)&__init_end)
-+                       continue;
-+              if (r->repl->feature != (unsigned char)-1 &&
-+                  boot_cpu_has(r->repl->feature)) {
-+                      memcpy(r->targ_start,
-+                             r->repl->data + r->repl->smp1_size,
-+                             r->repl->smp2_size);
-+                      memset(r->targ_start + r->repl->smp2_size,
-+                             0x90,
-+                             r->repl->targ_size - r->repl->smp2_size);
-+              } else {
-+                      memcpy(r->targ_start,
-+                             r->repl->data,
-+                             r->repl->smp1_size);
-+                      memset(r->targ_start + r->repl->smp1_size,
-+                             0x90,
-+                             r->repl->targ_size - r->repl->smp1_size);
-+              }
-+      }
-+      /* Paranoia */
-+      asm volatile ("jmp 1f\n1:");
-+      mb();
-+}
-+
-+void unprepare_for_smp(void)
-+{
-+      struct smp_alternative_record *r;
-+      printk(KERN_INFO "Disabling SMP...\n");
-+      for (r = &__start_smp_alternatives_table;
-+           r != &__stop_smp_alternatives_table;
-+           r++) {
-+              BUG_ON(r->repl->targ_size < r->repl->smp1_size);
-+              BUG_ON(r->repl->targ_size < r->repl->smp2_size);
-+              BUG_ON(r->repl->targ_size < r->repl->up_size);
-+               if (system_state == SYSTEM_RUNNING &&
-+                   r->targ_start >= (void *)&__init_begin &&
-+                   r->targ_start < (void *)&__init_end)
-+                       continue;
-+              memcpy(r->targ_start,
-+                     r->repl->data + r->repl->smp1_size + r->repl->smp2_size,
-+                     r->repl->up_size);
-+              memset(r->targ_start + r->repl->up_size,
-+                     0x90,
-+                     r->repl->targ_size - r->repl->up_size);
-+      }
-+      /* Paranoia */
-+      asm volatile ("jmp 1f\n1:");
-+      mb();
-+}
-diff -Naur linux-2.6.11/arch/i386/kernel/smpboot.c 
linux-2.6.11.post/arch/i386/kernel/smpboot.c
---- linux-2.6.11/arch/i386/kernel/smpboot.c    2005-03-02 07:38:09.000000000 
+0000
-+++ linux-2.6.11.post/arch/i386/kernel/smpboot.c       2005-06-16 
11:17:09.287064617 +0100
-@@ -1003,6 +1003,11 @@
-               if (max_cpus <= cpucount+1)
-                       continue;
- 
-+#ifdef CONFIG_SMP_ALTERNATIVES
-+              if (kicked == 1)
-+                      prepare_for_smp();
-+#endif
-+
-               if (do_boot_cpu(apicid))
-                       printk("CPU #%d not responding - cannot use it.\n",
-                                                               apicid);
-@@ -1118,6 +1123,11 @@
-               return -EIO;
-       }
- 
-+#ifdef CONFIG_SMP_ALTERNATIVES
-+      if (num_online_cpus() == 1)
-+              prepare_for_smp();
-+#endif
-+
-       local_irq_enable();
-       /* Unleash the CPU! */
-       cpu_set(cpu, smp_commenced_mask);
-diff -Naur linux-2.6.11/arch/i386/kernel/vmlinux.lds.S 
linux-2.6.11.post/arch/i386/kernel/vmlinux.lds.S
---- linux-2.6.11/arch/i386/kernel/vmlinux.lds.S        2005-03-02 
07:38:37.000000000 +0000
-+++ linux-2.6.11.post/arch/i386/kernel/vmlinux.lds.S   2005-06-10 
11:14:14.000000000 +0100
-@@ -30,6 +30,13 @@
-   __ex_table : { *(__ex_table) }
-   __stop___ex_table = .;
- 
-+  . = ALIGN(16);
-+  __start_smp_alternatives_table = .;
-+  __smp_alternatives : { *(__smp_alternatives) }
-+  __stop_smp_alternatives_table = .;
-+
-+  __smp_replacements : { *(__smp_replacements) }
-+
-   RODATA
- 
-   /* writeable */
-diff -Naur linux-2.6.11/include/asm-i386/atomic.h 
linux-2.6.11.post/include/asm-i386/atomic.h
---- linux-2.6.11/include/asm-i386/atomic.h     2005-03-02 07:37:51.000000000 
+0000
-+++ linux-2.6.11.post/include/asm-i386/atomic.h        2005-06-13 
10:10:39.000000000 +0100
-@@ -4,18 +4,13 @@
- #include <linux/config.h>
- #include <linux/compiler.h>
- #include <asm/processor.h>
-+#include <asm/smp_alt.h>
- 
- /*
-  * Atomic operations that C can't guarantee us.  Useful for
-  * resource counting etc..
-  */
- 
--#ifdef CONFIG_SMP
--#define LOCK "lock ; "
--#else
--#define LOCK ""
--#endif
--
- /*
-  * Make sure gcc doesn't try to be clever and move things around
-  * on us. We need to use _exactly_ the address the user gave us,
-diff -Naur linux-2.6.11/include/asm-i386/bitops.h 
linux-2.6.11.post/include/asm-i386/bitops.h
---- linux-2.6.11/include/asm-i386/bitops.h     2005-03-02 07:38:12.000000000 
+0000
-+++ linux-2.6.11.post/include/asm-i386/bitops.h        2005-06-13 
10:11:54.000000000 +0100
-@@ -7,6 +7,7 @@
- 
- #include <linux/config.h>
- #include <linux/compiler.h>
-+#include <asm/smp_alt.h>
- 
- /*
-  * These have to be done with inline assembly: that way the bit-setting
-@@ -16,12 +17,6 @@
-  * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
-  */
- 
--#ifdef CONFIG_SMP
--#define LOCK_PREFIX "lock ; "
--#else
--#define LOCK_PREFIX ""
--#endif
--
- #define ADDR (*(volatile long *) addr)
- 
- /**
-@@ -41,7 +36,7 @@
-  */
- static inline void set_bit(int nr, volatile unsigned long * addr)
- {
--      __asm__ __volatile__( LOCK_PREFIX
-+      __asm__ __volatile__( LOCK
-               "btsl %1,%0"
-               :"=m" (ADDR)
-               :"Ir" (nr));
-@@ -76,7 +71,7 @@
-  */
- static inline void clear_bit(int nr, volatile unsigned long * addr)
- {
--      __asm__ __volatile__( LOCK_PREFIX
-+      __asm__ __volatile__( LOCK
-               "btrl %1,%0"
-               :"=m" (ADDR)
-               :"Ir" (nr));
-@@ -121,7 +116,7 @@
-  */
- static inline void change_bit(int nr, volatile unsigned long * addr)
- {
--      __asm__ __volatile__( LOCK_PREFIX
-+      __asm__ __volatile__( LOCK
-               "btcl %1,%0"
-               :"=m" (ADDR)
-               :"Ir" (nr));
-@@ -140,7 +135,7 @@
- {
-       int oldbit;
- 
--      __asm__ __volatile__( LOCK_PREFIX
-+      __asm__ __volatile__( LOCK
-               "btsl %2,%1\n\tsbbl %0,%0"
-               :"=r" (oldbit),"=m" (ADDR)
-               :"Ir" (nr) : "memory");
-@@ -180,7 +175,7 @@
- {
-       int oldbit;
- 
--      __asm__ __volatile__( LOCK_PREFIX
-+      __asm__ __volatile__( LOCK
-               "btrl %2,%1\n\tsbbl %0,%0"
-               :"=r" (oldbit),"=m" (ADDR)
-               :"Ir" (nr) : "memory");
-@@ -231,7 +226,7 @@
- {
-       int oldbit;
- 
--      __asm__ __volatile__( LOCK_PREFIX
-+      __asm__ __volatile__( LOCK
-               "btcl %2,%1\n\tsbbl %0,%0"
-               :"=r" (oldbit),"=m" (ADDR)
-               :"Ir" (nr) : "memory");
-diff -Naur linux-2.6.11/include/asm-i386/rwsem.h 
linux-2.6.11.post/include/asm-i386/rwsem.h
---- linux-2.6.11/include/asm-i386/rwsem.h      2005-03-02 07:38:08.000000000 
+0000
-+++ linux-2.6.11.post/include/asm-i386/rwsem.h 2005-06-13 10:13:06.000000000 
+0100
-@@ -40,6 +40,7 @@
- 
- #include <linux/list.h>
- #include <linux/spinlock.h>
-+#include <asm/smp_alt.h>
- 
- struct rwsem_waiter;
- 
-@@ -99,7 +100,7 @@
- {
-       __asm__ __volatile__(
-               "# beginning down_read\n\t"
--LOCK_PREFIX   "  incl      (%%eax)\n\t" /* adds 0x00000001, returns the old 
value */
-+LOCK          "  incl      (%%eax)\n\t" /* adds 0x00000001, returns the old 
value */
-               "  js        2f\n\t" /* jump if we weren't granted the lock */
-               "1:\n\t"
-               LOCK_SECTION_START("")
-@@ -130,7 +131,7 @@
-               "  movl      %1,%2\n\t"
-               "  addl      %3,%2\n\t"
-               "  jle       2f\n\t"
--LOCK_PREFIX   "  cmpxchgl  %2,%0\n\t"
-+LOCK          "  cmpxchgl  %2,%0\n\t"
-               "  jnz       1b\n\t"
-               "2:\n\t"
-               "# ending __down_read_trylock\n\t"
-@@ -150,7 +151,7 @@
-       tmp = RWSEM_ACTIVE_WRITE_BIAS;
-       __asm__ __volatile__(
-               "# beginning down_write\n\t"
--LOCK_PREFIX   "  xadd      %%edx,(%%eax)\n\t" /* subtract 0x0000ffff, returns 
the old value */
-+LOCK          "  xadd      %%edx,(%%eax)\n\t" /* subtract 0x0000ffff, returns 
the old value */
-               "  testl     %%edx,%%edx\n\t" /* was the count 0 before? */
-               "  jnz       2f\n\t" /* jump if we weren't granted the lock */
-               "1:\n\t"
-@@ -188,7 +189,7 @@
-       __s32 tmp = -RWSEM_ACTIVE_READ_BIAS;
-       __asm__ __volatile__(
-               "# beginning __up_read\n\t"
--LOCK_PREFIX   "  xadd      %%edx,(%%eax)\n\t" /* subtracts 1, returns the old 
value */
-+LOCK          "  xadd      %%edx,(%%eax)\n\t" /* subtracts 1, returns the old 
value */
-               "  js        2f\n\t" /* jump if the lock is being waited upon */
-               "1:\n\t"
-               LOCK_SECTION_START("")
-@@ -214,7 +215,7 @@
-       __asm__ __volatile__(
-               "# beginning __up_write\n\t"
-               "  movl      %2,%%edx\n\t"
--LOCK_PREFIX   "  xaddl     %%edx,(%%eax)\n\t" /* tries to transition 
0xffff0001 -> 0x00000000 */
-+LOCK          "  xaddl     %%edx,(%%eax)\n\t" /* tries to transition 
0xffff0001 -> 0x00000000 */
-               "  jnz       2f\n\t" /* jump if the lock is being waited upon */
-               "1:\n\t"
-               LOCK_SECTION_START("")
-@@ -239,7 +240,7 @@
- {
-       __asm__ __volatile__(
-               "# beginning __downgrade_write\n\t"
--LOCK_PREFIX   "  addl      %2,(%%eax)\n\t" /* transitions 0xZZZZ0001 -> 
0xYYYY0001 */
-+LOCK          "  addl      %2,(%%eax)\n\t" /* transitions 0xZZZZ0001 -> 
0xYYYY0001 */
-               "  js        2f\n\t" /* jump if the lock is being waited upon */
-               "1:\n\t"
-               LOCK_SECTION_START("")
-@@ -263,7 +264,7 @@
- static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem)
- {
-       __asm__ __volatile__(
--LOCK_PREFIX   "addl %1,%0"
-+LOCK            "addl %1,%0"
-               : "=m"(sem->count)
-               : "ir"(delta), "m"(sem->count));
- }
-@@ -276,7 +277,7 @@
-       int tmp = delta;
- 
-       __asm__ __volatile__(
--LOCK_PREFIX   "xadd %0,(%2)"
-+LOCK                    "xadd %0,(%2)"
-               : "+r"(tmp), "=m"(sem->count)
-               : "r"(sem), "m"(sem->count)
-               : "memory");
-diff -Naur linux-2.6.11/include/asm-i386/smp_alt.h 
linux-2.6.11.post/include/asm-i386/smp_alt.h
---- linux-2.6.11/include/asm-i386/smp_alt.h    1970-01-01 01:00:00.000000000 
+0100
-+++ linux-2.6.11.post/include/asm-i386/smp_alt.h       2005-06-16 
11:16:50.109433206 +0100
-@@ -0,0 +1,32 @@
-+#ifndef __ASM_SMP_ALT_H__
-+#define __ASM_SMP_ALT_H__
-+
-+#include <linux/config.h>
-+
-+#ifdef CONFIG_SMP
-+#if defined(CONFIG_SMP_ALTERNATIVES) && !defined(MODULE)
-+#define LOCK \
-+        "6677: nop\n" \
-+      ".section __smp_alternatives,\"a\"\n" \
-+      ".long 6677b\n" \
-+      ".long 6678f\n" \
-+      ".previous\n" \
-+      ".section __smp_replacements,\"a\"\n" \
-+      "6678: .byte 1\n" \
-+      ".byte 1\n" \
-+      ".byte 0\n" \
-+        ".byte 1\n" \
-+      ".byte -1\n" \
-+      "lock\n" \
-+      "nop\n" \
-+      ".previous\n"
-+void prepare_for_smp(void);
-+void unprepare_for_smp(void);
-+#else
-+#define LOCK "lock ; "
-+#endif
-+#else
-+#define LOCK ""
-+#endif
-+
-+#endif /* __ASM_SMP_ALT_H__ */
-diff -Naur linux-2.6.11/include/asm-i386/spinlock.h 
linux-2.6.11.post/include/asm-i386/spinlock.h
---- linux-2.6.11/include/asm-i386/spinlock.h   2005-03-02 07:37:50.000000000 
+0000
-+++ linux-2.6.11.post/include/asm-i386/spinlock.h      2005-06-13 
14:13:52.000000000 +0100
-@@ -6,6 +6,7 @@
- #include <asm/page.h>
- #include <linux/config.h>
- #include <linux/compiler.h>
-+#include <asm/smp_alt.h>
- 
- asmlinkage int printk(const char * fmt, ...)
-       __attribute__ ((format (printf, 1, 2)));
-@@ -47,8 +48,9 @@
- #define spin_unlock_wait(x)   do { barrier(); } while(spin_is_locked(x))
- 
- #define spin_lock_string \
--      "\n1:\t" \
--      "lock ; decb %0\n\t" \
-+        "1:\n" \
-+      LOCK \
-+      "decb %0\n\t" \
-       "jns 3f\n" \
-       "2:\t" \
-       "rep;nop\n\t" \
-@@ -58,8 +60,9 @@
-       "3:\n\t"
- 
- #define spin_lock_string_flags \
--      "\n1:\t" \
--      "lock ; decb %0\n\t" \
-+        "1:\n" \
-+      LOCK \
-+      "decb %0\n\t" \
-       "jns 4f\n\t" \
-       "2:\t" \
-       "testl $0x200, %1\n\t" \
-@@ -121,10 +124,34 @@
- static inline int _raw_spin_trylock(spinlock_t *lock)
- {
-       char oldval;
-+#ifdef CONFIG_SMP_ALTERNATIVES
-       __asm__ __volatile__(
--              "xchgb %b0,%1"
-+              "1:movb %1,%b0\n"
-+              "movb $0,%1\n"
-+              "2:"
-+              ".section __smp_alternatives,\"a\"\n"
-+              ".long 1b\n"
-+              ".long 3f\n"
-+              ".previous\n"
-+              ".section __smp_replacements,\"a\"\n"
-+              "3: .byte 2b - 1b\n"
-+              ".byte 5f-4f\n"
-+              ".byte 0\n"
-+              ".byte 6f-5f\n"
-+              ".byte -1\n"
-+              "4: xchgb %b0,%1\n"
-+              "5: movb %1,%b0\n"
-+              "movb $0,%1\n"
-+              "6:\n"
-+              ".previous\n"
-               :"=q" (oldval), "=m" (lock->slock)
-               :"0" (0) : "memory");
-+#else
-+      __asm__ __volatile__(
-+              "xchgb %b0,%1\n"
-+              :"=q" (oldval), "=m" (lock->slock)
-+              :"0" (0) : "memory");
-+#endif
-       return oldval > 0;
- }
- 
-@@ -225,8 +252,8 @@
-       __build_write_lock(rw, "__write_lock_failed");
- }
- 
--#define _raw_read_unlock(rw)          asm volatile("lock ; incl %0" :"=m" 
((rw)->lock) : : "memory")
--#define _raw_write_unlock(rw) asm volatile("lock ; addl $" RW_LOCK_BIAS_STR 
",%0":"=m" ((rw)->lock) : : "memory")
-+#define _raw_read_unlock(rw)  asm volatile(LOCK "incl %0" :"=m" ((rw)->lock) 
: : "memory")
-+#define _raw_write_unlock(rw) asm volatile(LOCK "addl $" RW_LOCK_BIAS_STR 
",%0":"=m" ((rw)->lock) : : "memory")
- 
- static inline int _raw_read_trylock(rwlock_t *lock)
- {
-diff -Naur linux-2.6.11/include/asm-i386/system.h 
linux-2.6.11.post/include/asm-i386/system.h
---- linux-2.6.11/include/asm-i386/system.h     2005-03-02 07:37:30.000000000 
+0000
-+++ linux-2.6.11.post/include/asm-i386/system.h        2005-06-15 
13:21:40.000000000 +0100
-@@ -5,7 +5,7 @@
- #include <linux/kernel.h>
- #include <asm/segment.h>
- #include <asm/cpufeature.h>
--#include <linux/bitops.h> /* for LOCK_PREFIX */
-+#include <asm/smp_alt.h>
- 
- #ifdef __KERNEL__
- 
-@@ -249,19 +249,19 @@
-       unsigned long prev;
-       switch (size) {
-       case 1:
--              __asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2"
-+              __asm__ __volatile__(LOCK "cmpxchgb %b1,%2"
-                                    : "=a"(prev)
-                                    : "q"(new), "m"(*__xg(ptr)), "0"(old)
-                                    : "memory");
-               return prev;
-       case 2:
--              __asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2"
-+              __asm__ __volatile__(LOCK "cmpxchgw %w1,%2"
-                                    : "=a"(prev)
-                                    : "q"(new), "m"(*__xg(ptr)), "0"(old)
-                                    : "memory");
-               return prev;
-       case 4:
--              __asm__ __volatile__(LOCK_PREFIX "cmpxchgl %1,%2"
-+              __asm__ __volatile__(LOCK "cmpxchgl %1,%2"
-                                    : "=a"(prev)
-                                    : "q"(new), "m"(*__xg(ptr)), "0"(old)
-                                    : "memory");
-@@ -425,11 +425,55 @@
- #endif
- 
- #ifdef CONFIG_SMP
--#define smp_mb()      mb()
--#define smp_rmb()     rmb()
- #define smp_wmb()     wmb()
--#define smp_read_barrier_depends()    read_barrier_depends()
-+#if defined(CONFIG_SMP_ALTERNATIVES) && !defined(MODULE)
-+#define smp_alt_mb(instr)                                           \
-+__asm__ __volatile__("6667:\nnop\nnop\nnop\nnop\nnop\nnop\n6668:\n" \
-+                   ".section __smp_alternatives,\"a\"\n"          \
-+                   ".long 6667b\n"                                \
-+                     ".long 6673f\n"                                \
-+                   ".previous\n"                                  \
-+                   ".section __smp_replacements,\"a\"\n"          \
-+                   "6673:.byte 6668b-6667b\n"                     \
-+                   ".byte 6670f-6669f\n"                          \
-+                   ".byte 6671f-6670f\n"                          \
-+                     ".byte 0\n"                                    \
-+                   ".byte %c0\n"                                  \
-+                   "6669:lock;addl $0,0(%%esp)\n"                 \
-+                   "6670:" instr "\n"                             \
-+                   "6671:\n"                                      \
-+                   ".previous\n"                                  \
-+                   :                                              \
-+                   : "i" (X86_FEATURE_XMM2)                       \
-+                   : "memory")
-+#define smp_rmb() smp_alt_mb("lfence")
-+#define smp_mb()  smp_alt_mb("mfence")
-+#define set_mb(var, value) do {                                     \
-+unsigned long __set_mb_temp;                                        \
-+__asm__ __volatile__("6667:movl %1, %0\n6668:\n"                    \
-+                   ".section __smp_alternatives,\"a\"\n"          \
-+                   ".long 6667b\n"                                \
-+                   ".long 6673f\n"                                \
-+                   ".previous\n"                                  \
-+                   ".section __smp_replacements,\"a\"\n"          \
-+                   "6673: .byte 6668b-6667b\n"                    \
-+                   ".byte 6670f-6669f\n"                          \
-+                   ".byte 0\n"                                    \
-+                   ".byte 6671f-6670f\n"                          \
-+                   ".byte -1\n"                                   \
-+                   "6669: xchg %1, %0\n"                          \
-+                   "6670:movl %1, %0\n"                           \
-+                   "6671:\n"                                      \
-+                   ".previous\n"                                  \
-+                   : "=m" (var), "=r" (__set_mb_temp)             \
-+                   : "1" (value)                                  \
-+                   : "memory"); } while (0)
-+#else
-+#define smp_rmb()     rmb()
-+#define smp_mb()      mb()
- #define set_mb(var, value) do { xchg(&var, value); } while (0)
-+#endif
-+#define smp_read_barrier_depends()    read_barrier_depends()
- #else
- #define smp_mb()      barrier()
- #define smp_rmb()     barrier()
diff -r ece694762d7a -r 60fc40a82fa9 patches/linux-2.6.11/udp-frag.patch
--- a/patches/linux-2.6.11/udp-frag.patch       Mon Jul 11 15:12:37 2005
+++ /dev/null   Mon Jul 11 15:35:33 2005
@@ -1,55 +0,0 @@
-diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
---- a/net/ipv4/udp.c
-+++ b/net/ipv4/udp.c
-@@ -738,7 +738,7 @@ int udp_ioctl(struct sock *sk, int cmd, 
-                       unsigned long amount;
- 
-                       amount = 0;
--                      spin_lock_irq(&sk->sk_receive_queue.lock);
-+                      spin_lock_bh(&sk->sk_receive_queue.lock);
-                       skb = skb_peek(&sk->sk_receive_queue);
-                       if (skb != NULL) {
-                               /*
-@@ -748,7 +748,7 @@ int udp_ioctl(struct sock *sk, int cmd, 
-                                */
-                               amount = skb->len - sizeof(struct udphdr);
-                       }
--                      spin_unlock_irq(&sk->sk_receive_queue.lock);
-+                      spin_unlock_bh(&sk->sk_receive_queue.lock);
-                       return put_user(amount, (int __user *)arg);
-               }
- 
-@@ -848,12 +848,12 @@ csum_copy_err:
-       /* Clear queue. */
-       if (flags&MSG_PEEK) {
-               int clear = 0;
--              spin_lock_irq(&sk->sk_receive_queue.lock);
-+              spin_lock_bh(&sk->sk_receive_queue.lock);
-               if (skb == skb_peek(&sk->sk_receive_queue)) {
-                       __skb_unlink(skb, &sk->sk_receive_queue);
-                       clear = 1;
-               }
--              spin_unlock_irq(&sk->sk_receive_queue.lock);
-+              spin_unlock_bh(&sk->sk_receive_queue.lock);
-               if (clear)
-                       kfree_skb(skb);
-       }
-@@ -1334,7 +1334,7 @@ unsigned int udp_poll(struct file *file,
-               struct sk_buff_head *rcvq = &sk->sk_receive_queue;
-               struct sk_buff *skb;
- 
--              spin_lock_irq(&rcvq->lock);
-+              spin_lock_bh(&rcvq->lock);
-               while ((skb = skb_peek(rcvq)) != NULL) {
-                       if (udp_checksum_complete(skb)) {
-                               UDP_INC_STATS_BH(UDP_MIB_INERRORS);
-@@ -1345,7 +1345,7 @@ unsigned int udp_poll(struct file *file,
-                               break;
-                       }
-               }
--              spin_unlock_irq(&rcvq->lock);
-+              spin_unlock_bh(&rcvq->lock);
- 
-               /* nothing to see, move along */
-               if (skb == NULL)
-
diff -r ece694762d7a -r 60fc40a82fa9 patches/linux-2.6.11/x86_64-linux.patch
--- a/patches/linux-2.6.11/x86_64-linux.patch   Mon Jul 11 15:12:37 2005
+++ /dev/null   Mon Jul 11 15:35:33 2005
@@ -1,68 +0,0 @@
-diff -urN linux-2.6.10-orig/include/asm-x86_64/hw_irq.h 
linux-2.6.10/include/asm-x86_64/hw_irq.h
---- linux-2.6.10-orig/include/asm-x86_64/hw_irq.h      2005-01-06 
00:34:38.000000000 -0500
-+++ linux-2.6.10/include/asm-x86_64/hw_irq.h   2005-02-25 17:45:37.181518088 
-0500
-@@ -48,6 +48,7 @@
-  *
-  *  Vectors 0xf0-0xf9 are free (reserved for future Linux use).
-  */
-+#ifndef CONFIG_XEN
- #define SPURIOUS_APIC_VECTOR  0xff
- #define ERROR_APIC_VECTOR     0xfe
- #define INVALIDATE_TLB_VECTOR 0xfd
-@@ -57,7 +58,7 @@
- #define KDB_VECTOR    0xf9
- 
- #define THERMAL_APIC_VECTOR   0xf0
--
-+#endif
- 
- /*
-  * Local APIC timer IRQ vector is on a different priority level,
-diff -urN linux-2.6.10-orig/include/asm-x86_64/irq.h 
linux-2.6.10/include/asm-x86_64/irq.h
---- linux-2.6.10-orig/include/asm-x86_64/irq.h 2005-01-06 00:34:38.000000000 
-0500
-+++ linux-2.6.10/include/asm-x86_64/irq.h      2005-02-25 17:45:37.181518088 
-0500
-@@ -10,6 +10,9 @@
-  *    <tomsoft@xxxxxxxxxxxxxxxxxxxxxxxxx>
-  */
- 
-+#ifdef CONFIG_XEN
-+#include "irq_vectors.h"
-+#endif
- #define TIMER_IRQ 0
- 
- /*
-@@ -22,6 +25,7 @@
-  * the usable vector space is 0x20-0xff (224 vectors)
-  */
- 
-+#ifndef CONFIG_XEN
- /*
-  * The maximum number of vectors supported by x86_64 processors
-  * is limited to 256. For processors other than x86_64, NR_VECTORS
-@@ -38,6 +42,7 @@
- #define NR_IRQS 224
- #define NR_IRQ_VECTORS 1024
- #endif
-+#endif
- 
- static __inline__ int irq_canonicalize(int irq)
- {
-diff -urN linux-2.6.10-orig/include/asm-x86_64/posix_types.h 
linux-2.6.10/include/asm-x86_64/posix_types.h
---- linux-2.6.10-orig/include/asm-x86_64/posix_types.h 2004-10-18 
17:55:29.000000000 -0400
-+++ linux-2.6.10/include/asm-x86_64/posix_types.h      2005-02-25 
17:45:37.183517784 -0500
-@@ -6,7 +6,7 @@
-  * be a little careful about namespace pollution etc.  Also, we cannot
-  * assume GCC is being used.
-  */
--
-+#ifndef __ASSEMBLY__
- typedef unsigned long __kernel_ino_t;
- typedef unsigned int  __kernel_mode_t;
- typedef unsigned long __kernel_nlink_t;
-@@ -115,5 +115,5 @@
- }
- 
- #endif /* defined(__KERNEL__) */
--
-+#endif
- #endif

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Remove 2.6.11 patches directory., Xen patchbot -unstable <=