Skip to contentSkip to conversation

x86/uv: Fix uv_gpa_to_soc_phys_ram shift

PATCH In review Russ Anderson 1 participant 2 messages Jan 19, 2012 – Jan 26, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/uv: Fix uv_gpa_to_soc_phys_ram shift

uv_gpa_to_soc_phys_ram() was inadvertently ignoring the shift values. This fix takes the shift into account.

---
 arch/x86/include/asm/uv/uv_hub.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/include/asm/uv/uv_hub.h +2 -2
Index: linux/arch/x86/include/asm/uv/uv_hub.h
===================================================================
@@ -318,13 +318,13 @@ uv_gpa_in_mmr_space(unsigned long gpa)
 /* UV global physical address --> socket phys RAM */
 static inline unsigned long uv_gpa_to_soc_phys_ram(unsigned long gpa)
 {
-	unsigned long paddr = gpa & uv_hub_info->gpa_mask;
+	unsigned long paddr;
 	unsigned long remap_base = uv_hub_info->lowmem_remap_base;
 	unsigned long remap_top =  uv_hub_info->lowmem_remap_top;
 
 	gpa = ((gpa << uv_hub_info->m_shift) >> uv_hub_info->m_shift) |
 		((gpa >> uv_hub_info->n_lshift) << uv_hub_info->m_val);
-	gpa = gpa & uv_hub_info->gpa_mask;
+	paddr = gpa & uv_hub_info->gpa_mask;
 	if (paddr >= remap_base && paddr < remap_base + remap_top)
 		paddr -= remap_base;
 	return paddr;
Signature · 2 lines
Russ Anderson, OS RAS/Partitioning Project Lead  
SGI - Silicon Graphics Inc          [email protected]
#1 lore raw

[tip:x86/urgent] x86/uv: Fix uv_gpa_to_soc_phys_ram() shift

Commit-ID:  5a51467b146ab7948d2f6812892eac120a30529c
Gitweb:     http://git.kernel.org/tip/5a51467b146ab7948d2f6812892eac120a30529c
Author:     Russ Anderson <[email protected]>
AuthorDate: Wed, 18 Jan 2012 20:07:54 -0600
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 26 Jan 2012 10:58:27 +0100

x86/uv: Fix uv_gpa_to_soc_phys_ram() shift

uv_gpa_to_soc_phys_ram() was inadvertently ignoring the shift values. This fix takes the shift into account.

---
 arch/x86/include/asm/uv/uv_hub.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/include/asm/uv/uv_hub.h +2 -2
index 54a13aa..21f7385 100644
@@ -318,13 +318,13 @@ uv_gpa_in_mmr_space(unsigned long gpa)
 /* UV global physical address --> socket phys RAM */
 static inline unsigned long uv_gpa_to_soc_phys_ram(unsigned long gpa)
 {
-	unsigned long paddr = gpa & uv_hub_info->gpa_mask;
+	unsigned long paddr;
 	unsigned long remap_base = uv_hub_info->lowmem_remap_base;
 	unsigned long remap_top =  uv_hub_info->lowmem_remap_top;
 
 	gpa = ((gpa << uv_hub_info->m_shift) >> uv_hub_info->m_shift) |
 		((gpa >> uv_hub_info->n_lshift) << uv_hub_info->m_val);
-	gpa = gpa & uv_hub_info->gpa_mask;
+	paddr = gpa & uv_hub_info->gpa_mask;
 	if (paddr >= remap_base && paddr < remap_base + remap_top)
 		paddr -= remap_base;
 	return paddr;