public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: venkatesh.pallipadi@intel.com
To: mingo@elte.hu, tglx@linutronix.de, hpa@zytor.com
Cc: linux-kernel@vger.kernel.org, suresh.b.siddha@intel.com,
	Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Subject: [patch 1/4] x86: PAT proper tracking of set_memory_uc and friends
Date: Wed, 20 Aug 2008 16:45:51 -0700	[thread overview]
Message-ID: <20080820234604.316127000@intel.com> (raw)
In-Reply-To: 20080820234550.923970000@intel.com

[-- Attachment #1: set_memory_pa.patch --]
[-- Type: text/plain, Size: 1476 bytes --]

Big thinko in pat memtype tracking code. reserve_memtype should be called
with physical address and not virtual address. 

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>

---
 arch/x86/mm/pageattr.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: tip/arch/x86/mm/pageattr.c
===================================================================
--- tip.orig/arch/x86/mm/pageattr.c	2008-08-20 14:25:18.000000000 -0700
+++ tip/arch/x86/mm/pageattr.c	2008-08-20 14:26:15.000000000 -0700
@@ -862,7 +862,7 @@ int set_memory_uc(unsigned long addr, in
 	/*
 	 * for now UC MINUS. see comments in ioremap_nocache()
 	 */
-	if (reserve_memtype(addr, addr + numpages * PAGE_SIZE,
+	if (reserve_memtype(__pa(addr), __pa(addr) + numpages * PAGE_SIZE,
 			    _PAGE_CACHE_UC_MINUS, NULL))
 		return -EINVAL;
 
@@ -905,7 +905,7 @@ int set_memory_wc(unsigned long addr, in
 	if (!pat_enabled)
 		return set_memory_uc(addr, numpages);
 
-	if (reserve_memtype(addr, addr + numpages * PAGE_SIZE,
+	if (reserve_memtype(__pa(addr), __pa(addr) + numpages * PAGE_SIZE,
 		_PAGE_CACHE_WC, NULL))
 		return -EINVAL;
 
@@ -921,7 +921,7 @@ int _set_memory_wb(unsigned long addr, i
 
 int set_memory_wb(unsigned long addr, int numpages)
 {
-	free_memtype(addr, addr + numpages * PAGE_SIZE);
+	free_memtype(__pa(addr), __pa(addr) + numpages * PAGE_SIZE);
 
 	return _set_memory_wb(addr, numpages);
 }

-- 


  reply	other threads:[~2008-08-21  0:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-20 23:45 [patch 0/4] PAT Misc updates venkatesh.pallipadi
2008-08-20 23:45 ` venkatesh.pallipadi [this message]
2008-08-20 23:45 ` [patch 2/4] x86: PAT Change /dev/mem mmap with O_SYNC to use UC_MINUS venkatesh.pallipadi
2008-08-20 23:45 ` [patch 3/4] x86: PAT Update validate_pat_support for intel CPUs venkatesh.pallipadi
2008-08-26  7:05   ` Dave Airlie
2008-08-26 23:03     ` Pallipadi, Venkatesh
2008-08-27  5:30       ` Brice Goglin
2008-08-29 22:59         ` Pallipadi, Venkatesh
2008-08-20 23:45 ` [patch 4/4] x86: PAT documentation updates with debug info venkatesh.pallipadi
2008-08-21 11:30 ` [patch 0/4] PAT Misc updates Ingo Molnar

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=20080820234604.316127000@intel.com \
    --to=venkatesh.pallipadi@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    /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