public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Yet more PCI fixes for 2.5.70
Date: Tue, 10 Jun 2003 11:49:30 -0700	[thread overview]
Message-ID: <1055270970425@kroah.com> (raw)
In-Reply-To: <10552709703999@kroah.com>

ChangeSet 1.1390, 2003/06/10 10:51:23-07:00, david-b@pacbell.net

[PATCH] PCI: pci pool, poison more like slab code

This adds a new poisoning mode, distinguishing memory
that's uninitialized from memory that's freed.  The
slab code has been doing this for a while now.


 drivers/pci/pool.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)


diff -Nru a/drivers/pci/pool.c b/drivers/pci/pool.c
--- a/drivers/pci/pool.c	Tue Jun 10 11:15:19 2003
+++ b/drivers/pci/pool.c	Tue Jun 10 11:15:19 2003
@@ -29,7 +29,8 @@
 };
 
 #define	POOL_TIMEOUT_JIFFIES	((100 /* msec */ * HZ) / 1000)
-#define	POOL_POISON_BYTE	0xa7
+#define	POOL_POISON_FREED	0xa7	/* !inuse */
+#define	POOL_POISON_ALLOCATED	0xa9	/* !initted */
 
 static DECLARE_MUTEX (pools_lock);
 
@@ -172,7 +173,7 @@
 	if (page->vaddr) {
 		memset (page->bitmap, 0xff, mapsize);	// bit set == free
 #ifdef	CONFIG_DEBUG_SLAB
-		memset (page->vaddr, POOL_POISON_BYTE, pool->allocation);
+		memset (page->vaddr, POOL_POISON_FREED, pool->allocation);
 #endif
 		list_add (&page->page_list, &pool->page_list);
 		page->in_use = 0;
@@ -201,7 +202,7 @@
 	dma_addr_t	dma = page->dma;
 
 #ifdef	CONFIG_DEBUG_SLAB
-	memset (page->vaddr, POOL_POISON_BYTE, pool->allocation);
+	memset (page->vaddr, POOL_POISON_FREED, pool->allocation);
 #endif
 	pci_free_consistent (pool->dev, pool->allocation, page->vaddr, dma);
 	list_del (&page->page_list);
@@ -309,6 +310,9 @@
 	page->in_use++;
 	retval = offset + page->vaddr;
 	*handle = offset + page->dma;
+#ifdef	CONFIG_DEBUG_SLAB
+	memset (retval, POOL_POISON_ALLOCATED, pool->size);
+#endif
 done:
 	spin_unlock_irqrestore (&pool->lock, flags);
 	return retval;
@@ -378,7 +382,7 @@
 			pool->name, (unsigned long long)dma);
 		return;
 	}
-	memset (vaddr, POOL_POISON_BYTE, pool->size);
+	memset (vaddr, POOL_POISON_FREED, pool->size);
 #endif
 
 	spin_lock_irqsave (&pool->lock, flags);


  reply	other threads:[~2003-06-10 19:40 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-10 18:49 [PATCH] Yet more PCI fixes for 2.5.70 Greg KH
2003-06-10 18:49 ` Greg KH
2003-06-10 18:49   ` Greg KH
2003-06-10 18:49     ` Greg KH
2003-06-10 18:49       ` Greg KH
2003-06-10 18:49         ` Greg KH
2003-06-10 18:49           ` Greg KH
2003-06-10 18:49             ` Greg KH
2003-06-10 18:49               ` Greg KH
2003-06-10 18:49                 ` Greg KH
2003-06-10 18:49                   ` Greg KH
2003-06-10 18:49                     ` Greg KH
2003-06-10 18:49                       ` Greg KH
2003-06-10 18:49                         ` Greg KH
2003-06-10 18:49                           ` Greg KH
2003-06-10 18:49                             ` Greg KH
2003-06-10 18:49                               ` Greg KH
2003-06-10 18:49                                 ` Greg KH
2003-06-10 18:49                                   ` Greg KH
2003-06-10 18:49                                     ` Greg KH
2003-06-10 18:49                                       ` Greg KH
2003-06-10 18:49                                         ` Greg KH
2003-06-10 18:49                                           ` Greg KH
2003-06-10 18:49                                             ` Greg KH
2003-06-10 18:49                                               ` Greg KH
2003-06-10 18:49                                                 ` Greg KH
2003-06-10 18:49                                                   ` Greg KH
2003-06-10 18:49                                                     ` Greg KH
2003-06-10 18:49                                                       ` Greg KH
2003-06-10 18:49                                                         ` Greg KH
2003-06-10 18:49                                                           ` Greg KH
2003-06-10 18:49                                                             ` Greg KH
2003-06-10 18:49                                                               ` Greg KH
2003-06-10 18:49                                                                 ` Greg KH
2003-06-10 18:49                                                                   ` Greg KH
2003-06-10 18:49                                                                     ` Greg KH
2003-06-10 18:49                                                                       ` Greg KH
2003-06-10 18:49                                                                         ` Greg KH
2003-06-10 18:49                                                                           ` Greg KH
2003-06-10 18:49                                                                             ` Greg KH
2003-06-10 18:49                                                                               ` Greg KH
2003-06-10 18:49                                                                                 ` Greg KH
2003-06-10 18:49                                                                                   ` Greg KH
2003-06-10 18:49                                                                                     ` Greg KH
2003-06-10 18:49                                                                                       ` Greg KH
2003-06-10 18:49                                                                                         ` Greg KH
2003-06-10 18:49                                                                                           ` Greg KH
2003-06-10 18:49                                                                                             ` Greg KH
2003-06-10 18:49                                                                                               ` Greg KH
2003-06-10 18:49                                                                                                 ` Greg KH
2003-06-10 18:49                                                                                                   ` Greg KH
2003-06-10 18:49                                                                                                     ` Greg KH
2003-06-10 18:49                                                                                                       ` Greg KH
2003-06-10 18:49                                                                                                         ` Greg KH
2003-06-10 18:49                                                                                                           ` Greg KH
2003-06-10 18:49                                                                                                             ` Greg KH
2003-06-10 18:49                                                                                                               ` Greg KH
2003-06-10 18:49                                                                                                                 ` Greg KH
2003-06-10 18:49                                                                                                                   ` Greg KH
2003-06-10 18:49                                                                                                                     ` Greg KH
2003-06-10 18:49                                                                                                                       ` Greg KH
2003-06-10 18:49                                                                                                                         ` Greg KH
2003-06-10 18:49                                                                                                                           ` Greg KH
2003-06-10 18:49                                                                                                                             ` Greg KH
2003-06-10 18:49                                                                                                                               ` Greg KH [this message]
2003-06-10 18:49                                                                                                                                 ` Greg KH
2003-06-10 18:49                                                                                                                                   ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2003-06-10 18:33 [BK PATCH] " Greg KH
2003-06-10 18:49 ` [PATCH] " Greg KH
2003-06-10 18:49   ` Greg KH
2003-06-10 18:49     ` Greg KH
2003-06-10 18:49       ` Greg KH
2003-06-10 18:49         ` Greg KH
2003-06-10 18:49           ` Greg KH
2003-06-10 18:49             ` Greg KH
2003-06-10 18:49               ` Greg KH
2003-06-10 18:49                 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1055270970425@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox