Commit 5a51467b authored by Russ Anderson's avatar Russ Anderson Committed by Ingo Molnar

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.
Signed-off-by: default avatarRuss Anderson <rja@sgi.com>
Cc: <stable@kernel.org>
Link: http://lkml.kernel.org/r/20120119020753.GA7228@sgi.comSigned-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 87f71ae2
...@@ -318,13 +318,13 @@ uv_gpa_in_mmr_space(unsigned long gpa) ...@@ -318,13 +318,13 @@ uv_gpa_in_mmr_space(unsigned long gpa)
/* UV global physical address --> socket phys RAM */ /* UV global physical address --> socket phys RAM */
static inline unsigned long uv_gpa_to_soc_phys_ram(unsigned long gpa) 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_base = uv_hub_info->lowmem_remap_base;
unsigned long remap_top = uv_hub_info->lowmem_remap_top; unsigned long remap_top = uv_hub_info->lowmem_remap_top;
gpa = ((gpa << uv_hub_info->m_shift) >> uv_hub_info->m_shift) | gpa = ((gpa << uv_hub_info->m_shift) >> uv_hub_info->m_shift) |
((gpa >> uv_hub_info->n_lshift) << uv_hub_info->m_val); ((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) if (paddr >= remap_base && paddr < remap_base + remap_top)
paddr -= remap_base; paddr -= remap_base;
return paddr; return paddr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment