--- /dev/null
+From stable-bounces@linux.kernel.org Tue Oct 30 03:21:13 2007
+From: Jens Axboe <jens.axboe@oracle.com>
+Date: Tue, 30 Oct 2007 11:18:15 +0100
+Subject: BLOCK: Fix bad sharing of tag busy list on queues with shared tag maps
+To: stable@kernel.org
+Message-ID: <20071030101815.GO4993@kernel.dk>
+Content-Disposition: inline
+
+From: Jens Axboe <jens.axboe@oracle.com>
+
+patch 6eca9004dfcb274a502438a591df5b197690afb1 in mainline.
+
+For the locking to work, only the tag map and tag bit map may be shared
+(incidentally, I was just explaining this to Nick yesterday, but I
+apparently didn't review the code well enough myself). But we also share
+the busy list! The busy_list must be queue private, or we need a
+block_queue_tag covering lock as well.
+
+So we have to move the busy_list to the queue. This'll work fine, and
+it'll actually also fix a problem with blk_queue_invalidate_tags() which
+will invalidate tags across all shared queues. This is a bit confusing,
+the low level driver should call it for each queue seperately since
+otherwise you cannot kill tags on just a single queue for eg a hard
+drive that stops responding. Since the function has no callers
+currently, it's not an issue.
+
+This is fixed with commit 6eca9004dfcb274a502438a591df5b197690afb1 in
+Linus' tree.
+
+Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ block/ll_rw_blk.c | 8 +++-----
+ include/linux/blkdev.h | 2 +-
+ 2 files changed, 4 insertions(+), 6 deletions(-)
+
+--- a/block/ll_rw_blk.c
++++ b/block/ll_rw_blk.c
+@@ -819,7 +819,6 @@ static int __blk_free_tags(struct blk_qu
+ retval = atomic_dec_and_test(&bqt->refcnt);
+ if (retval) {
+ BUG_ON(bqt->busy);
+- BUG_ON(!list_empty(&bqt->busy_list));
+
+ kfree(bqt->tag_index);
+ bqt->tag_index = NULL;
+@@ -931,7 +930,6 @@ static struct blk_queue_tag *__blk_queue
+ if (init_tag_map(q, tags, depth))
+ goto fail;
+
+- INIT_LIST_HEAD(&tags->busy_list);
+ tags->busy = 0;
+ atomic_set(&tags->refcnt, 1);
+ return tags;
+@@ -982,6 +980,7 @@ int blk_queue_init_tags(struct request_q
+ */
+ q->queue_tags = tags;
+ q->queue_flags |= (1 << QUEUE_FLAG_QUEUED);
++ INIT_LIST_HEAD(&q->tag_busy_list);
+ return 0;
+ fail:
+ kfree(tags);
+@@ -1152,7 +1151,7 @@ int blk_queue_start_tag(struct request_q
+ rq->tag = tag;
+ bqt->tag_index[tag] = rq;
+ blkdev_dequeue_request(rq);
+- list_add(&rq->queuelist, &bqt->busy_list);
++ list_add(&rq->queuelist, &q->tag_busy_list);
+ bqt->busy++;
+ return 0;
+ }
+@@ -1173,11 +1172,10 @@ EXPORT_SYMBOL(blk_queue_start_tag);
+ **/
+ void blk_queue_invalidate_tags(struct request_queue *q)
+ {
+- struct blk_queue_tag *bqt = q->queue_tags;
+ struct list_head *tmp, *n;
+ struct request *rq;
+
+- list_for_each_safe(tmp, n, &bqt->busy_list) {
++ list_for_each_safe(tmp, n, &q->tag_busy_list) {
+ rq = list_entry_rq(tmp);
+
+ if (rq->tag == -1) {
+--- a/include/linux/blkdev.h
++++ b/include/linux/blkdev.h
+@@ -356,7 +356,6 @@ enum blk_queue_state {
+ struct blk_queue_tag {
+ struct request **tag_index; /* map of busy tags */
+ unsigned long *tag_map; /* bit map of free/busy tags */
+- struct list_head busy_list; /* fifo list of busy tags */
+ int busy; /* current depth */
+ int max_depth; /* what we will send to device */
+ int real_max_depth; /* what the array can hold */
+@@ -451,6 +450,7 @@ struct request_queue
+ unsigned int dma_alignment;
+
+ struct blk_queue_tag *queue_tags;
++ struct list_head tag_busy_list;
+
+ unsigned int nr_sorted;
+ unsigned int in_flight;
--- /dev/null
+From stable-bounces@linux.kernel.org Mon Oct 29 14:38:02 2007
+From: Hugh Dickins <hugh@veritas.com>
+Date: Mon, 29 Oct 2007 14:37:20 -0700
+Subject: fix tmpfs BUG and AOP_WRITEPAGE_ACTIVATE
+To: torvalds@linux-foundation.org
+Cc: penberg@cs.helsinki.fi, hugh@veritas.com, akpm@linux-foundation.org, ezk@cs.sunysb.edu, stable@kernel.org
+Message-ID: <200710292137.l9TLbK6t024569@imap1.linux-foundation.org>
+
+
+From: Hugh Dickins <hugh@veritas.com>
+
+patch 487e9bf25cbae11b131d6a14bdbb3a6a77380837 in mainline.
+
+It's possible to provoke unionfs (not yet in mainline, though in mm and
+some distros) to hit shmem_writepage's BUG_ON(page_mapped(page)). I expect
+it's possible to provoke the 2.6.23 ecryptfs in the same way (but the
+2.6.24 ecryptfs no longer calls lower level's ->writepage).
+
+This came to light with the recent find that AOP_WRITEPAGE_ACTIVATE could
+leak from tmpfs via write_cache_pages and unionfs to userspace. There's
+already a fix (e423003028183df54f039dfda8b58c49e78c89d7 - writeback: don't
+propagate AOP_WRITEPAGE_ACTIVATE) in the tree for that, and it's okay so
+far as it goes; but insufficient because it doesn't address the underlying
+issue, that shmem_writepage expects to be called only by vmscan (relying on
+backing_dev_info capabilities to prevent the normal writeback path from
+ever approaching it).
+
+That's an increasingly fragile assumption, and ramdisk_writepage (the other
+source of AOP_WRITEPAGE_ACTIVATEs) is already careful to check
+wbc->for_reclaim before returning it. Make the same check in
+shmem_writepage, thereby sidestepping the page_mapped BUG also.
+
+Signed-off-by: Hugh Dickins <hugh@veritas.com>
+Cc: Erez Zadok <ezk@cs.sunysb.edu>
+Reviewed-by: Pekka Enberg <penberg@cs.helsinki.fi>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ mm/shmem.c | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+--- a/mm/shmem.c
++++ b/mm/shmem.c
+@@ -916,6 +916,21 @@ static int shmem_writepage(struct page *
+ struct inode *inode;
+
+ BUG_ON(!PageLocked(page));
++ /*
++ * shmem_backing_dev_info's capabilities prevent regular writeback or
++ * sync from ever calling shmem_writepage; but a stacking filesystem
++ * may use the ->writepage of its underlying filesystem, in which case
++ * we want to do nothing when that underlying filesystem is tmpfs
++ * (writing out to swap is useful as a response to memory pressure, but
++ * of no use to stabilize the data) - just redirty the page, unlock it
++ * and claim success in this case. AOP_WRITEPAGE_ACTIVATE, and the
++ * page_mapped check below, must be avoided unless we're in reclaim.
++ */
++ if (!wbc->for_reclaim) {
++ set_page_dirty(page);
++ unlock_page(page);
++ return 0;
++ }
+ BUG_ON(page_mapped(page));
+
+ mapping = page->mapping;
--- /dev/null
+From 96fd4cd3e40e240f0c385af87f58e74da8b7099a Mon Sep 17 00:00:00 2001
+From: Ayaz Abdulla <aabdulla@nvidia.com>
+Date: Thu, 25 Oct 2007 03:36:42 -0400
+Subject: [PATCH] [netdrvr] forcedeth: add MCP77 device IDs
+Message-ID: <471E62F8.60707@nvidia.com>
+
+From: Ayaz Abdulla <aabdulla@nvidia.com>
+
+patch 96fd4cd3e40e240f0c385af87f58e74da8b7099a in mainline.
+
+Signed-off-by: Ayaz Abdulla <aabdulla@nvidia.com>
+Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/net/forcedeth.c | 16 ++++++++++++++++
+ include/linux/pci_ids.h | 4 ++++
+ 2 files changed, 20 insertions(+)
+
+--- a/drivers/net/forcedeth.c
++++ b/drivers/net/forcedeth.c
+@@ -5566,6 +5566,22 @@ static struct pci_device_id pci_tbl[] =
+ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_31),
+ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL|DEV_HAS_MSI|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
+ },
++ { /* MCP77 Ethernet Controller */
++ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_32),
++ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
++ },
++ { /* MCP77 Ethernet Controller */
++ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_33),
++ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
++ },
++ { /* MCP77 Ethernet Controller */
++ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_34),
++ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
++ },
++ { /* MCP77 Ethernet Controller */
++ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_35),
++ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
++ },
+ {0,},
+ };
+
+--- a/include/linux/pci_ids.h
++++ b/include/linux/pci_ids.h
+@@ -1233,6 +1233,10 @@
+ #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE 0x0560
+ #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE 0x056C
+ #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE 0x0759
++#define PCI_DEVICE_ID_NVIDIA_NVENET_32 0x0760
++#define PCI_DEVICE_ID_NVIDIA_NVENET_33 0x0761
++#define PCI_DEVICE_ID_NVIDIA_NVENET_34 0x0762
++#define PCI_DEVICE_ID_NVIDIA_NVENET_35 0x0763
+
+ #define PCI_VENDOR_ID_IMS 0x10e0
+ #define PCI_DEVICE_ID_IMS_TT128 0x9128
--- /dev/null
+From stable-bounces@linux.kernel.org Tue Oct 23 19:48:20 2007
+From: Tejun Heo <htejun@gmail.com>
+Date: Wed, 24 Oct 2007 11:47:45 +0900
+Subject: libata: add HTS542525K9SA00 to NCQ blacklist
+To: stable@kernel.org
+Cc: Luca Tettamanti <kronos.it@gmail.com>
+Message-ID: <471EB251.5040307@gmail.com>
+
+From: Tejun Heo <htejun@gmail.com>
+
+patch e14cbfa630cd3ab2631ee21b718b290928f47868 in mainline.
+
+Another one doing spurious NCQ completions. Blacklist it.
+
+Signed-off-by: Tejun Heo <htejun@gmail.com>
+Cc: Luca Tettamanti <kronos.it@gmail.com>
+Signed-off-by: Jeff Garzik <jeff@garzik.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/ata/libata-core.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/ata/libata-core.c
++++ b/drivers/ata/libata-core.c
+@@ -3795,6 +3795,7 @@ static const struct ata_blacklist_entry
+ { "HTS541612J9SA00", "SBDIC7JP", ATA_HORKAGE_NONCQ, },
+ { "HDT722516DLA380", "V43OA96A", ATA_HORKAGE_NONCQ, },
+ { "Hitachi HTS541616J9SA00", "SB4OC70P", ATA_HORKAGE_NONCQ, },
++ { "Hitachi HTS542525K9SA00", "BBFOC31P", ATA_HORKAGE_NONCQ, },
+ { "WDC WD740ADFD-00NLR1", NULL, ATA_HORKAGE_NONCQ, },
+ { "WDC WD3200AAJS-00RYA0", "12.01B01", ATA_HORKAGE_NONCQ, },
+ { "FUJITSU MHV2080BH", "00840028", ATA_HORKAGE_NONCQ, },
--- /dev/null
+From stable-bounces@linux.kernel.org Thu Oct 25 01:01:07 2007
+From: Tejun Heo <htejun@gmail.com>
+Date: Thu, 25 Oct 2007 15:53:19 +0900
+Subject: libata: backport ATA_FLAG_NO_SRST and ATA_FLAG_ASSUME_ATA, part 2
+To: stable@kernel.org, linux-ide@vger.kernel.org, Jeff Garzik <jeff@garzik.org>
+Message-ID: <20071025065319.GI11853@htj.dyndns.org>
+Content-Disposition: inline
+
+From: Tejun Heo <htejun@gmail.com>
+
+Differs from mainline, but the functionality is already there.
+
+P5W-DH Deluxe has ICH7R which doesn't have PMP support but SIMG 4726
+hardwired to the second port of AHCI controller at PCI device 1f.2.
+The 4726 doesn't work as PMP but as a storage processor which can do
+hardware RAID on downstream ports.
+
+When no device is attached to the downstream port of the 4726, pseudo
+ATA device for configuration appears. Unfortunately, ATA emulation on
+the device is very lousy and causes long hang during boot.
+
+This patch implements workaround for the board. If the mainboard is
+P5W-DH Deluxe (matched using DMI), only hardreset is used on the
+second port of AHCI controller @ 1f.2 and the hardreset doesn't depend
+on receiving the first FIS and just proceed to IDENTIFY.
+
+This workaround fixes bugzilla #8923.
+
+ http://bugzilla.kernel.org/show_bug.cgi?id=8923
+
+Signed-off-by: Tejun Heo <htejun@gmail.com>
+Cc: Jeff Garzik <jeff@garzik.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/ata/ahci.c | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 143 insertions(+)
+
+--- a/drivers/ata/ahci.c
++++ b/drivers/ata/ahci.c
+@@ -41,6 +41,7 @@
+ #include <linux/interrupt.h>
+ #include <linux/dma-mapping.h>
+ #include <linux/device.h>
++#include <linux/dmi.h>
+ #include <scsi/scsi_host.h>
+ #include <scsi/scsi_cmnd.h>
+ #include <linux/libata.h>
+@@ -231,6 +232,7 @@ static void ahci_freeze(struct ata_port
+ static void ahci_thaw(struct ata_port *ap);
+ static void ahci_error_handler(struct ata_port *ap);
+ static void ahci_vt8251_error_handler(struct ata_port *ap);
++static void ahci_p5wdh_error_handler(struct ata_port *ap);
+ static void ahci_post_internal_cmd(struct ata_queued_cmd *qc);
+ static int ahci_port_resume(struct ata_port *ap);
+ static unsigned int ahci_fill_sg(struct ata_queued_cmd *qc, void *cmd_tbl);
+@@ -329,6 +331,40 @@ static const struct ata_port_operations
+ .port_stop = ahci_port_stop,
+ };
+
++static const struct ata_port_operations ahci_p5wdh_ops = {
++ .port_disable = ata_port_disable,
++
++ .check_status = ahci_check_status,
++ .check_altstatus = ahci_check_status,
++ .dev_select = ata_noop_dev_select,
++
++ .tf_read = ahci_tf_read,
++
++ .qc_prep = ahci_qc_prep,
++ .qc_issue = ahci_qc_issue,
++
++ .irq_clear = ahci_irq_clear,
++ .irq_on = ata_dummy_irq_on,
++ .irq_ack = ata_dummy_irq_ack,
++
++ .scr_read = ahci_scr_read,
++ .scr_write = ahci_scr_write,
++
++ .freeze = ahci_freeze,
++ .thaw = ahci_thaw,
++
++ .error_handler = ahci_p5wdh_error_handler,
++ .post_internal_cmd = ahci_post_internal_cmd,
++
++#ifdef CONFIG_PM
++ .port_suspend = ahci_port_suspend,
++ .port_resume = ahci_port_resume,
++#endif
++
++ .port_start = ahci_port_start,
++ .port_stop = ahci_port_stop,
++};
++
+ static const struct ata_port_info ahci_port_info[] = {
+ /* board_ahci */
+ {
+@@ -1176,6 +1212,52 @@ static int ahci_vt8251_hardreset(struct
+ return rc ?: -EAGAIN;
+ }
+
++static int ahci_p5wdh_hardreset(struct ata_port *ap, unsigned int *class,
++ unsigned long deadline)
++{
++ struct ahci_port_priv *pp = ap->private_data;
++ u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG;
++ struct ata_taskfile tf;
++ int rc;
++
++ ahci_stop_engine(ap);
++
++ /* clear D2H reception area to properly wait for D2H FIS */
++ ata_tf_init(ap->device, &tf);
++ tf.command = 0x80;
++ ata_tf_to_fis(&tf, 0, 0, d2h_fis);
++
++ rc = sata_port_hardreset(ap, sata_ehc_deb_timing(&ap->eh_context),
++ deadline);
++
++ ahci_start_engine(ap);
++
++ if (rc || ata_port_offline(ap))
++ return rc;
++
++ /* spec mandates ">= 2ms" before checking status */
++ msleep(150);
++
++ /* The pseudo configuration device on SIMG4726 attached to
++ * ASUS P5W-DH Deluxe doesn't send signature FIS after
++ * hardreset if no device is attached to the first downstream
++ * port && the pseudo device locks up on SRST w/ PMP==0. To
++ * work around this, wait for !BSY only briefly. If BSY isn't
++ * cleared, perform CLO and proceed to IDENTIFY (achieved by
++ * ATA_LFLAG_NO_SRST and ATA_LFLAG_ASSUME_ATA).
++ *
++ * Wait for two seconds. Devices attached to downstream port
++ * which can't process the following IDENTIFY after this will
++ * have to be reset again. For most cases, this should
++ * suffice while making probing snappish enough.
++ */
++ rc = ata_wait_ready(ap, jiffies + 2 * HZ);
++ if (rc)
++ ahci_kick_engine(ap, 0);
++
++ return 0;
++}
++
+ static void ahci_postreset(struct ata_port *ap, unsigned int *class)
+ {
+ void __iomem *port_mmio = ahci_port_base(ap);
+@@ -1556,6 +1638,19 @@ static void ahci_vt8251_error_handler(st
+ ahci_postreset);
+ }
+
++static void ahci_p5wdh_error_handler(struct ata_port *ap)
++{
++ if (!(ap->pflags & ATA_PFLAG_FROZEN)) {
++ /* restart engine */
++ ahci_stop_engine(ap);
++ ahci_start_engine(ap);
++ }
++
++ /* perform recovery */
++ ata_do_eh(ap, ata_std_prereset, ahci_softreset, ahci_p5wdh_hardreset,
++ ahci_postreset);
++}
++
+ static void ahci_post_internal_cmd(struct ata_queued_cmd *qc)
+ {
+ struct ata_port *ap = qc->ap;
+@@ -1802,6 +1897,51 @@ static void ahci_print_info(struct ata_h
+ );
+ }
+
++/* On ASUS P5W DH Deluxe, the second port of PCI device 00:1f.2 is
++ * hardwired to on-board SIMG 4726. The chipset is ICH8 and doesn't
++ * support PMP and the 4726 either directly exports the device
++ * attached to the first downstream port or acts as a hardware storage
++ * controller and emulate a single ATA device (can be RAID 0/1 or some
++ * other configuration).
++ *
++ * When there's no device attached to the first downstream port of the
++ * 4726, "Config Disk" appears, which is a pseudo ATA device to
++ * configure the 4726. However, ATA emulation of the device is very
++ * lame. It doesn't send signature D2H Reg FIS after the initial
++ * hardreset, pukes on SRST w/ PMP==0 and has bunch of other issues.
++ *
++ * The following function works around the problem by always using
++ * hardreset on the port and not depending on receiving signature FIS
++ * afterward. If signature FIS isn't received soon, ATA class is
++ * assumed without follow-up softreset.
++ */
++static void ahci_p5wdh_workaround(struct ata_host *host)
++{
++ static struct dmi_system_id sysids[] = {
++ {
++ .ident = "P5W DH Deluxe",
++ .matches = {
++ DMI_MATCH(DMI_SYS_VENDOR,
++ "ASUSTEK COMPUTER INC"),
++ DMI_MATCH(DMI_PRODUCT_NAME, "P5W DH Deluxe"),
++ },
++ },
++ { }
++ };
++ struct pci_dev *pdev = to_pci_dev(host->dev);
++
++ if (pdev->bus->number == 0 && pdev->devfn == PCI_DEVFN(0x1f, 2) &&
++ dmi_check_system(sysids)) {
++ struct ata_port *ap = host->ports[1];
++
++ dev_printk(KERN_INFO, &pdev->dev, "enabling ASUS P5W DH "
++ "Deluxe on-board SIMG4726 workaround\n");
++
++ ap->ops = &ahci_p5wdh_ops;
++ ap->flags |= ATA_FLAG_NO_SRST | ATA_FLAG_ASSUME_ATA;
++ }
++}
++
+ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ {
+ static int printed_version;
+@@ -1863,6 +2003,9 @@ static int ahci_init_one(struct pci_dev
+ ap->ops = &ata_dummy_port_ops;
+ }
+
++ /* apply workaround for ASUS P5W DH Deluxe mainboard */
++ ahci_p5wdh_workaround(host);
++
+ /* initialize adapter */
+ rc = ahci_configure_dma_masks(pdev, hpriv->cap & HOST_CAP_64);
+ if (rc)
--- /dev/null
+From stable-bounces@linux.kernel.org Wed Oct 24 23:52:47 2007
+From: Tejun Heo <htejun@gmail.com>
+Date: Thu, 25 Oct 2007 15:51:57 +0900
+Subject: libata: backport ATA_FLAG_NO_SRST and ATA_FLAG_ASSUME_ATA
+To: stable@kernel.org, linux-ide@vger.kernel.org, Jeff Garzik <jeff@garzik.org>
+Message-ID: <20071025065157.GH11853@htj.dyndns.org>
+Content-Disposition: inline
+
+From: Tejun Heo <htejun@gmail.com>
+
+Differs from mainline, but the functionality is already there.
+
+Backport ATA_FLAG_NO_SRST and ATA_FLAG_ASSUME_ATA. These are
+originally link flags (ATA_LFLAG_*) but link abstraction doesn't exist
+on 2.6.23, so make it port flags.
+
+This is for the following workaround for ASUS P5W DH Deluxe.
+
+These new flags don't introduce any behavior change unless set and
+nobody sets them yet.
+
+Signed-off-by: Tejun Heo <htejun@gmail.com>
+Cc: Jeff Garzik <jeff@garzik.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/ata/libata-eh.c | 32 ++++++++++++++++++++++++--------
+ include/linux/libata.h | 2 ++
+ 2 files changed, 26 insertions(+), 8 deletions(-)
+
+--- a/drivers/ata/libata-eh.c
++++ b/drivers/ata/libata-eh.c
+@@ -1759,9 +1759,11 @@ static int ata_do_reset(struct ata_port
+ return 0;
+ }
+
+-static int ata_eh_followup_srst_needed(int rc, int classify,
+- const unsigned int *classes)
++static int ata_eh_followup_srst_needed(struct ata_port *ap, int rc,
++ int classify, const unsigned int *classes)
+ {
++ if (ap->flags & ATA_FLAG_NO_SRST)
++ return 0;
+ if (rc == -EAGAIN)
+ return 1;
+ if (rc != 0)
+@@ -1792,7 +1794,8 @@ static int ata_eh_reset(struct ata_port
+ */
+ action = ehc->i.action;
+ ehc->i.action &= ~ATA_EH_RESET_MASK;
+- if (softreset && (!hardreset || (!sata_set_spd_needed(ap) &&
++ if (softreset && (!hardreset || (!(ap->flags & ATA_FLAG_NO_SRST) &&
++ !sata_set_spd_needed(ap) &&
+ !(action & ATA_EH_HARDRESET))))
+ ehc->i.action |= ATA_EH_SOFTRESET;
+ else
+@@ -1855,7 +1858,7 @@ static int ata_eh_reset(struct ata_port
+ rc = ata_do_reset(ap, reset, classes, deadline);
+
+ if (reset == hardreset &&
+- ata_eh_followup_srst_needed(rc, classify, classes)) {
++ ata_eh_followup_srst_needed(ap, rc, classify, classes)) {
+ /* okay, let's do follow-up softreset */
+ reset = softreset;
+
+@@ -1870,8 +1873,8 @@ static int ata_eh_reset(struct ata_port
+ ata_eh_about_to_do(ap, NULL, ATA_EH_RESET_MASK);
+ rc = ata_do_reset(ap, reset, classes, deadline);
+
+- if (rc == 0 && classify &&
+- classes[0] == ATA_DEV_UNKNOWN) {
++ if (rc == 0 && classify && classes[0] == ATA_DEV_UNKNOWN &&
++ !(ap->flags & ATA_FLAG_ASSUME_ATA)) {
+ ata_port_printk(ap, KERN_ERR,
+ "classification failed\n");
+ rc = -EINVAL;
+@@ -1879,6 +1882,10 @@ static int ata_eh_reset(struct ata_port
+ }
+ }
+
++ /* if we skipped follow-up srst, clear rc */
++ if (rc == -EAGAIN)
++ rc = 0;
++
+ if (rc && try < ARRAY_SIZE(ata_eh_reset_timeouts)) {
+ unsigned long now = jiffies;
+
+@@ -1906,8 +1913,17 @@ static int ata_eh_reset(struct ata_port
+ /* After the reset, the device state is PIO 0 and the
+ * controller state is undefined. Record the mode.
+ */
+- for (i = 0; i < ATA_MAX_DEVICES; i++)
+- ap->device[i].pio_mode = XFER_PIO_0;
++ for (i = 0; i < ata_port_max_devices(ap); i++) {
++ struct ata_device *dev = &ap->device[i];
++
++ dev->pio_mode = XFER_PIO_0;
++
++ if (ata_port_offline(ap))
++ continue;
++
++ if (ap->flags & ATA_FLAG_ASSUME_ATA)
++ classes[dev->devno] = ATA_DEV_ATA;
++ }
+
+ /* record current link speed */
+ if (sata_scr_read(ap, SCR_STATUS, &sstatus) == 0)
+--- a/include/linux/libata.h
++++ b/include/linux/libata.h
+@@ -177,6 +177,8 @@ enum {
+ ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */
+ ATA_FLAG_NO_IORDY = (1 << 16), /* controller lacks iordy */
+ ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */
++ ATA_FLAG_NO_SRST = (1 << 18),
++ ATA_FLAG_ASSUME_ATA = (1 << 19),
+
+ /* The following flag belongs to ap->pflags but is kept in
+ * ap->flags because it's referenced in many LLDs and will be
--- /dev/null
+From stable-bounces@linux.kernel.org Tue Oct 30 08:20:43 2007
+From: "J. Bruce Fields" <bfields@fieldses.org>
+Date: Tue, 30 Oct 2007 11:20:02 -0400
+Subject: locks: fix possible infinite loop in posix deadlock detection
+To: Linus Torvalds <torvalds@linux-foundation.org>, stable@kernel.org
+Cc: "George G. Davis" <gdavis@mvista.com>, linux-fsdevel@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org
+Message-ID: <20071030152002.GA21595@fieldses.org>
+Content-Disposition: inline
+
+
+From: J. Bruce Fields <bfields@citi.umich.edu>
+
+patch 97855b49b6bac0bd25f16b017883634d13591d00 in mainline.
+
+It's currently possible to send posix_locks_deadlock() into an infinite
+loop (under the BKL).
+
+For now, fix this just by bailing out after a few iterations. We may
+want to fix this in a way that better clarifies the semantics of
+deadlock detection. But that will take more time, and this minimal fix
+is probably adequate for any realistic scenario, and is simple enough to
+be appropriate for applying to stable kernels now.
+
+Thanks to George Davis for reporting the problem.
+
+Cc: "George G. Davis" <gdavis@mvista.com>
+Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
+Acked-by: Alan Cox <alan@redhat.com>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/locks.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+--- a/fs/locks.c
++++ b/fs/locks.c
+@@ -694,11 +694,20 @@ EXPORT_SYMBOL(posix_test_lock);
+ * Note: the above assumption may not be true when handling lock requests
+ * from a broken NFS client. But broken NFS clients have a lot more to
+ * worry about than proper deadlock detection anyway... --okir
++ *
++ * However, the failure of this assumption (also possible in the case of
++ * multiple tasks sharing the same open file table) also means there's no
++ * guarantee that the loop below will terminate. As a hack, we give up
++ * after a few iterations.
+ */
++
++#define MAX_DEADLK_ITERATIONS 10
++
+ static int posix_locks_deadlock(struct file_lock *caller_fl,
+ struct file_lock *block_fl)
+ {
+ struct list_head *tmp;
++ int i = 0;
+
+ next_task:
+ if (posix_same_owner(caller_fl, block_fl))
+@@ -706,6 +715,8 @@ next_task:
+ list_for_each(tmp, &blocked_list) {
+ struct file_lock *fl = list_entry(tmp, struct file_lock, fl_link);
+ if (posix_same_owner(fl, block_fl)) {
++ if (i++ > MAX_DEADLK_ITERATIONS)
++ return 0;
+ fl = fl->fl_next;
+ block_fl = fl;
+ goto next_task;
--- /dev/null
+From stable-bounces@linux.kernel.org Mon Nov 5 16:33:47 2007
+From: Dave Airlie <airlied@linux.ie>
+Date: Tue, 6 Nov 2007 00:33:10 +0000 (GMT)
+Subject: radeon: set the address to access the GART table on the CPU side correctly
+To: stable@kernel.org
+Message-ID: <alpine.DEB.0.82.0711060031420.13794@skynet.skynet.ie>
+
+From: Dave Airlie <airlied@linux.ie>
+
+Upstream as 7fc86860cf73e060ab8ed9763010dfe5b5389b1c
+
+This code relied on the CPU and GPU address for the aperture being the same,
+On some r5xx hardware I was playing with I noticed that this isn't always true.
+This fixes issues seen on some r400 cards. (bugs.freedesktop.org 9957)
+
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/char/drm/radeon_cp.c | 5 +++--
+ drivers/char/drm/radeon_drv.h | 1 +
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+--- a/drivers/char/drm/radeon_cp.c
++++ b/drivers/char/drm/radeon_cp.c
+@@ -1679,7 +1679,7 @@ static int radeon_do_init_cp(struct drm_
+ dev_priv->gart_info.bus_addr =
+ dev_priv->pcigart_offset + dev_priv->fb_location;
+ dev_priv->gart_info.mapping.offset =
+- dev_priv->gart_info.bus_addr;
++ dev_priv->pcigart_offset + dev_priv->fb_aper_offset;
+ dev_priv->gart_info.mapping.size =
+ dev_priv->gart_info.table_size;
+
+@@ -2291,7 +2291,8 @@ int radeon_driver_firstopen(struct drm_d
+ if (ret != 0)
+ return ret;
+
+- ret = drm_addmap(dev, drm_get_resource_start(dev, 0),
++ dev_priv->fb_aper_offset = drm_get_resource_start(dev, 0);
++ ret = drm_addmap(dev, dev_priv->fb_aper_offset,
+ drm_get_resource_len(dev, 0), _DRM_FRAME_BUFFER,
+ _DRM_WRITE_COMBINING, &map);
+ if (ret != 0)
+--- a/drivers/char/drm/radeon_drv.h
++++ b/drivers/char/drm/radeon_drv.h
+@@ -293,6 +293,7 @@ typedef struct drm_radeon_private {
+
+ /* starting from here on, data is preserved accross an open */
+ uint32_t flags; /* see radeon_chip_flags */
++ unsigned long fb_aper_offset;
+ } drm_radeon_private_t;
+
+ typedef struct drm_radeon_buf_priv {
fix-sparc64-niagara-optimized-raid-xor-asm.patch
powerpc-make-sure-to-of_node_get-the-result-of-pci_device_to_of_node.patch
fix-sparc64-map_fixed-handling-of-framebuffer-mmaps.patch
+fix-tmpfs-bug-and-aop_writepage_activate.patch
+softmac-fix-wext-mlme-request-reason-code-endianness.patch
+libata-add-hts542525k9sa00-to-ncq-blacklist.patch
+libata-backport-ata_flag_no_srst-and-ata_flag_assume_ata.patch
+libata-backport-ata_flag_no_srst-and-ata_flag_assume_ata-part-2.patch
+forcedeth-add-mcp77-device-ids.patch
+locks-fix-possible-infinite-loop-in-posix-deadlock-detection.patch
+block-fix-bad-sharing-of-tag-busy-list-on-queues-with-shared-tag-maps.patch
+radeon-set-the-address-to-access-the-gart-table-on-the-cpu-side-correctly.patch
+uml-stop-using-libc-asm-page.h.patch
+uml-fix-kernel-vs-libc-symbols-clash.patch
+uml-stop-using-libc-asm-user.h.patch
+uml-kill-subprocesses-on-exit.patch
--- /dev/null
+From stable-bounces@linux.kernel.org Fri Oct 26 03:36:47 2007
+From: Johannes Berg <johannes@sipsolutions.net>
+Date: Thu, 25 Oct 2007 22:16:23 +0200
+Subject: softmac: fix wext MLME request reason code endianness
+To: "John W. Linville" <linville@tuxdriver.com>
+Cc: linux-wireless <linux-wireless@vger.kernel.org>, stable <stable@kernel.org>
+Message-ID: <1193343383.4406.30.camel@johannes.berg>
+
+From: Johannes Berg <johannes@sipsolutions.net>
+
+patch 94e10bfb8a7372df3ef2759c9ec2a37de2f24aca in mainline.
+
+The MLME request reason code is host-endian and our passing
+it to the low level functions is host-endian as well since
+they do the swapping. I noticed that the reason code 768 was
+sent (0x300) rather than 3 when wpa_supplicant terminates.
+This removes the superfluous cpu_to_le16() call.
+
+Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ net/ieee80211/softmac/ieee80211softmac_wx.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/net/ieee80211/softmac/ieee80211softmac_wx.c
++++ b/net/ieee80211/softmac/ieee80211softmac_wx.c
+@@ -469,7 +469,7 @@ ieee80211softmac_wx_set_mlme(struct net_
+ {
+ struct ieee80211softmac_device *mac = ieee80211_priv(dev);
+ struct iw_mlme *mlme = (struct iw_mlme *)extra;
+- u16 reason = cpu_to_le16(mlme->reason_code);
++ u16 reason = mlme->reason_code;
+ struct ieee80211softmac_network *net;
+ int err = -EINVAL;
+
--- /dev/null
+From stable-bounces@linux.kernel.org Thu Nov 1 12:54:06 2007
+From: Jeff Dike <jdike@addtoit.com>
+Date: Thu, 1 Nov 2007 15:53:26 -0400
+Subject: UML - Fix kernel vs libc symbols clash
+To: stable@kernel.org
+Cc: LKML <linux-kernel@vger.kernel.org>, uml-devel <user-mode-linux-devel@lists.sourceforge.net>
+Message-ID: <20071101195326.GA8888@c2.user-mode-linux.org>
+Content-Disposition: inline
+
+
+From: Jeff Dike <jdike@addtoit.com>
+
+commit 818f6ef407b448cef63294b9d0f6f8a2af9cb817 in mainline.
+
+uml: fix an IPV6 libc vs kernel symbol clash
+
+On some systems, with IPV6 configured, there is a clash between the kernel's
+in6addr_any and the one in libc.
+
+This is handled in the usual (gross) way of defining the kernel symbol out of
+the way on the gcc command line.
+
+Signed-off-by: Jeff Dike <jdike@linux.intel.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/um/Makefile | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/arch/um/Makefile
++++ b/arch/um/Makefile
+@@ -60,7 +60,8 @@ SYS_DIR := $(ARCH_DIR)/include/sysdep-$
+
+ CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \
+ $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap \
+- -Din6addr_loopback=kernel_in6addr_loopback
++ -Din6addr_loopback=kernel_in6addr_loopback \
++ -Din6addr_any=kernel_in6addr_any
+
+ AFLAGS += $(ARCH_INCLUDE)
+
--- /dev/null
+From stable-bounces@linux.kernel.org Thu Nov 1 12:54:06 2007
+From: Lepton Wu <ytht.net@gmail.com>
+Date: Thu, 1 Nov 2007 15:53:27 -0400
+Subject: UML - kill subprocesses on exit
+To: stable@kernel.org
+Cc: LKML <linux-kernel@vger.kernel.org>, uml-devel <user-mode-linux-devel@lists.sourceforge.net>, Lepton Wu <ytht.net@gmail.com>
+Message-ID: <20071101195327.GA8882@c2.user-mode-linux.org>
+Content-Disposition: inline
+
+From: Lepton Wu <ytht.net@gmail.com>
+
+commit a24864a1d52a97e345a6bd4862a057f98364d098
+
+uml: definitively kill subprocesses on panic
+
+In a stock 2.6.22.6 kernel, poweroff a user mode linux guest (2.6.22.6 running
+in skas0 mode) will halt the host linux. I think the reason is the kernel
+thread abort because of a bug. Then the sys_reboot in process of user mode
+linux guest is not trapped by the user mode linux kernel and is executed by
+host. I think it is better to make sure all of our children process to quit
+when user mode linux kernel abort.
+
+[ jdike - the kernel process needs to ignore SIGTERM, plus the waitpid/kill
+loop is needed to make sure that all of our children are dead before the
+kernel exits ]
+
+Signed-off-by: Lepton Wu <ytht.net@gmail.com>
+Signed-off-by: Jeff Dike <jdike@linux.intel.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/um/os-Linux/skas/process.c | 2 +-
+ arch/um/os-Linux/util.c | 38 ++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 39 insertions(+), 1 deletion(-)
+
+--- a/arch/um/os-Linux/skas/process.c
++++ b/arch/um/os-Linux/skas/process.c
+@@ -182,7 +182,7 @@ static int userspace_tramp(void *stack)
+
+ ptrace(PTRACE_TRACEME, 0, 0, 0);
+
+- init_new_thread_signals();
++ signal(SIGTERM, SIG_DFL);
+ err = set_interval(1);
+ if(err)
+ panic("userspace_tramp - setting timer failed, errno = %d\n",
+--- a/arch/um/os-Linux/util.c
++++ b/arch/um/os-Linux/util.c
+@@ -105,6 +105,44 @@ int setjmp_wrapper(void (*proc)(void *,
+
+ void os_dump_core(void)
+ {
++ int pid;
++
+ signal(SIGSEGV, SIG_DFL);
++
++ /*
++ * We are about to SIGTERM this entire process group to ensure that
++ * nothing is around to run after the kernel exits. The
++ * kernel wants to abort, not die through SIGTERM, so we
++ * ignore it here.
++ */
++
++ signal(SIGTERM, SIG_IGN);
++ kill(0, SIGTERM);
++ /*
++ * Most of the other processes associated with this UML are
++ * likely sTopped, so give them a SIGCONT so they see the
++ * SIGTERM.
++ */
++ kill(0, SIGCONT);
++
++ /*
++ * Now, having sent signals to everyone but us, make sure they
++ * die by ptrace. Processes can survive what's been done to
++ * them so far - the mechanism I understand is receiving a
++ * SIGSEGV and segfaulting immediately upon return. There is
++ * always a SIGSEGV pending, and (I'm guessing) signals are
++ * processed in numeric order so the SIGTERM (signal 15 vs
++ * SIGSEGV being signal 11) is never handled.
++ *
++ * Run a waitpid loop until we get some kind of error.
++ * Hopefully, it's ECHILD, but there's not a lot we can do if
++ * it's something else. Tell os_kill_ptraced_process not to
++ * wait for the child to report its death because there's
++ * nothing reasonable to do if that fails.
++ */
++
++ while ((pid = waitpid(-1, NULL, WNOHANG)) > 0)
++ os_kill_ptraced_process(pid, 0);
++
+ abort();
+ }
--- /dev/null
+From stable-bounces@linux.kernel.org Thu Nov 1 12:53:55 2007
+From: Jeff Dike <jdike@addtoit.com>
+Date: Thu, 1 Nov 2007 15:53:25 -0400
+Subject: UML - Stop using libc asm/page.h
+To: stable@kernel.org
+Cc: LKML <linux-kernel@vger.kernel.org>, uml-devel <user-mode-linux-devel@lists.sourceforge.net>
+Message-ID: <20071101195325.GA8871@c2.user-mode-linux.org>
+Content-Disposition: inline
+
+From: Jeff Dike <jdike@addtoit.com>
+
+commit 71f926f2ea61994470a53c9e11d3ef993197cada in mainline.
+
+uml: stop using libc asm/page.h
+
+Remove includes of asm/page.h from libc code. This header seems to be
+disappearing, and UML doesn't make much use of it anyway.
+
+The one use, PAGE_SHIFT in stub.h, is handled by copying the constant from the
+kernel side of the house in common_offsets.h.
+
+[ jdike - added arch/um/kernel/skas/clone.c for -stable ]
+
+Signed-off-by: Jeff Dike <jdike@linux.intel.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/um/include/common-offsets.h | 1 +
+ arch/um/include/sysdep-i386/stub.h | 3 +--
+ arch/um/kernel/skas/clone.c | 1 -
+ arch/um/os-Linux/main.c | 1 -
+ arch/um/os-Linux/skas/mem.c | 1 -
+ arch/um/os-Linux/start_up.c | 1 -
+ arch/um/os-Linux/tt.c | 1 -
+ 7 files changed, 2 insertions(+), 7 deletions(-)
+
+--- a/arch/um/include/common-offsets.h
++++ b/arch/um/include/common-offsets.h
+@@ -10,6 +10,7 @@ OFFSET(HOST_TASK_PID, task_struct, pid);
+
+ DEFINE(UM_KERN_PAGE_SIZE, PAGE_SIZE);
+ DEFINE(UM_KERN_PAGE_MASK, PAGE_MASK);
++DEFINE(UM_KERN_PAGE_SHIFT, PAGE_SHIFT);
+ DEFINE(UM_NSEC_PER_SEC, NSEC_PER_SEC);
+
+ DEFINE_STR(UM_KERN_EMERG, KERN_EMERG);
+--- a/arch/um/include/sysdep-i386/stub.h
++++ b/arch/um/include/sysdep-i386/stub.h
+@@ -9,7 +9,6 @@
+ #include <sys/mman.h>
+ #include <asm/ptrace.h>
+ #include <asm/unistd.h>
+-#include <asm/page.h>
+ #include "stub-data.h"
+ #include "kern_constants.h"
+ #include "uml-config.h"
+@@ -19,7 +18,7 @@ extern void stub_clone_handler(void);
+
+ #define STUB_SYSCALL_RET EAX
+ #define STUB_MMAP_NR __NR_mmap2
+-#define MMAP_OFFSET(o) ((o) >> PAGE_SHIFT)
++#define MMAP_OFFSET(o) ((o) >> UM_KERN_PAGE_SHIFT)
+
+ static inline long stub_syscall0(long syscall)
+ {
+--- a/arch/um/kernel/skas/clone.c
++++ b/arch/um/kernel/skas/clone.c
+@@ -3,7 +3,6 @@
+ #include <sys/mman.h>
+ #include <sys/time.h>
+ #include <asm/unistd.h>
+-#include <asm/page.h>
+ #include "ptrace_user.h"
+ #include "skas.h"
+ #include "stub-data.h"
+--- a/arch/um/os-Linux/main.c
++++ b/arch/um/os-Linux/main.c
+@@ -12,7 +12,6 @@
+ #include <sys/resource.h>
+ #include <sys/mman.h>
+ #include <sys/user.h>
+-#include <asm/page.h>
+ #include "kern_util.h"
+ #include "as-layout.h"
+ #include "mem_user.h"
+--- a/arch/um/os-Linux/skas/mem.c
++++ b/arch/um/os-Linux/skas/mem.c
+@@ -9,7 +9,6 @@
+ #include <unistd.h>
+ #include <sys/mman.h>
+ #include <sys/wait.h>
+-#include <asm/page.h>
+ #include <asm/unistd.h>
+ #include "mem_user.h"
+ #include "mem.h"
+--- a/arch/um/os-Linux/start_up.c
++++ b/arch/um/os-Linux/start_up.c
+@@ -19,7 +19,6 @@
+ #include <sys/mman.h>
+ #include <sys/resource.h>
+ #include <asm/unistd.h>
+-#include <asm/page.h>
+ #include <sys/types.h>
+ #include "kern_util.h"
+ #include "user.h"
+--- a/arch/um/os-Linux/tt.c
++++ b/arch/um/os-Linux/tt.c
+@@ -17,7 +17,6 @@
+ #include <sys/mman.h>
+ #include <asm/ptrace.h>
+ #include <asm/unistd.h>
+-#include <asm/page.h>
+ #include "kern_util.h"
+ #include "user.h"
+ #include "signal_kern.h"
--- /dev/null
+From stable-bounces@linux.kernel.org Thu Nov 1 12:54:17 2007
+From: Jeff Dike <jdike@addtoit.com>
+Date: Thu, 1 Nov 2007 15:53:26 -0400
+Subject: UML - stop using libc asm/user.h
+To: stable@kernel.org
+Cc: LKML <linux-kernel@vger.kernel.org>, uml-devel <user-mode-linux-devel@lists.sourceforge.net>
+Message-ID: <20071101195326.GA8877@c2.user-mode-linux.org>
+Content-Disposition: inline
+
+From: Jeff Dike <jdike@addtoit.com>
+
+commit 189872f968def833727b6bfef83ebd7440c538e6 in mainline.
+
+uml: don't use glibc asm/user.h
+
+Stop including asm/user.h from libc - it seems to be disappearing from
+distros. It's replaced with sys/user.h which defines user_fpregs_struct and
+user_fpxregs_struct instead of user_i387_struct and struct user_fxsr_struct on
+i386.
+
+As a bonus, on x86_64, I get to dump some stupid typedefs which were needed in
+order to get asm/user.h to compile.
+
+Signed-off-by: Jeff Dike <jdike@linux.intel.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/um/sys-i386/user-offsets.c | 6 +++---
+ arch/um/sys-x86_64/user-offsets.c | 9 +--------
+ 2 files changed, 4 insertions(+), 11 deletions(-)
+
+--- a/arch/um/sys-i386/user-offsets.c
++++ b/arch/um/sys-i386/user-offsets.c
+@@ -2,9 +2,9 @@
+ #include <stddef.h>
+ #include <signal.h>
+ #include <sys/poll.h>
++#include <sys/user.h>
+ #include <sys/mman.h>
+ #include <asm/ptrace.h>
+-#include <asm/user.h>
+
+ #define DEFINE(sym, val) \
+ asm volatile("\n->" #sym " %0 " #val : : "i" (val))
+@@ -48,8 +48,8 @@ void foo(void)
+ OFFSET(HOST_SC_FP_ST, _fpstate, _st);
+ OFFSET(HOST_SC_FXSR_ENV, _fpstate, _fxsr_env);
+
+- DEFINE_LONGS(HOST_FP_SIZE, sizeof(struct user_i387_struct));
+- DEFINE_LONGS(HOST_XFP_SIZE, sizeof(struct user_fxsr_struct));
++ DEFINE_LONGS(HOST_FP_SIZE, sizeof(struct user_fpregs_struct));
++ DEFINE_LONGS(HOST_XFP_SIZE, sizeof(struct user_fpxregs_struct));
+
+ DEFINE(HOST_IP, EIP);
+ DEFINE(HOST_SP, UESP);
+--- a/arch/um/sys-x86_64/user-offsets.c
++++ b/arch/um/sys-x86_64/user-offsets.c
+@@ -3,17 +3,10 @@
+ #include <signal.h>
+ #include <sys/poll.h>
+ #include <sys/mman.h>
++#include <sys/user.h>
+ #define __FRAME_OFFSETS
+ #include <asm/ptrace.h>
+ #include <asm/types.h>
+-/* For some reason, x86_64 defines u64 and u32 only in <pci/types.h>, which I
+- * refuse to include here, even though they're used throughout the headers.
+- * These are used in asm/user.h, and that include can't be avoided because of
+- * the sizeof(struct user_regs_struct) below.
+- */
+-typedef __u64 u64;
+-typedef __u32 u32;
+-#include <asm/user.h>
+
+ #define DEFINE(sym, val) \
+ asm volatile("\n->" #sym " %0 " #val : : "i" (val))