Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1606071

[PATCH 1/1] x86/platform/uv: Fix calculation of Global Physical Address

From Mike Travis <mike.travis@hpe.com>
Newsgroups linux.kernel
Subject [PATCH 1/1] x86/platform/uv: Fix calculation of Global Physical Address
Date 2017-03-22 00:30 +0100
Message-ID <tnBnX-1Sh-9@gated-at.bofh.it> (permalink)
References <tnBnX-1Sh-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The calculation of the global physical address (GPA) on UV4 is
incorrect.  The gnode_extra/upper global offset should only be
applied for fixed address space systems (UV1..3).

Signed-off-by: Mike Travis <mike.travis@hpe.com>
Tested-by: John Estabrook <john.estabrook@hpe.com>
---
 arch/x86/include/asm/uv/uv_hub.h   |    8 +++++---
 arch/x86/kernel/apic/x2apic_uv_x.c |    3 ++-
 2 files changed, 7 insertions(+), 4 deletions(-)

--- linux.orig/arch/x86/include/asm/uv/uv_hub.h
+++ linux/arch/x86/include/asm/uv/uv_hub.h
@@ -485,15 +485,17 @@ static inline unsigned long uv_soc_phys_
 
 	if (paddr < uv_hub_info->lowmem_remap_top)
 		paddr |= uv_hub_info->lowmem_remap_base;
-	paddr |= uv_hub_info->gnode_upper;
-	if (m_val)
+
+	if (m_val) {
+		paddr |= uv_hub_info->gnode_upper;
 		paddr = ((paddr << uv_hub_info->m_shift)
 						>> uv_hub_info->m_shift) |
 			((paddr >> uv_hub_info->m_val)
 						<< uv_hub_info->n_lshift);
-	else
+	} else {
 		paddr |= uv_soc_phys_ram_to_nasid(paddr)
 						<< uv_hub_info->gpa_shift;
+	}
 	return paddr;
 }
 
--- linux.orig/arch/x86/kernel/apic/x2apic_uv_x.c
+++ linux/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -1105,7 +1105,8 @@ void __init uv_init_hub_info(struct uv_h
 	node_id.v		= uv_read_local_mmr(UVH_NODE_ID);
 	uv_cpuid.gnode_shift	= max_t(unsigned int, uv_cpuid.gnode_shift, mn.n_val);
 	hi->gnode_extra		= (node_id.s.node_id & ~((1 << uv_cpuid.gnode_shift) - 1)) >> 1;
-	hi->gnode_upper		= (unsigned long)hi->gnode_extra << mn.m_val;
+	if (mn.m_val)
+		hi->gnode_upper	= (u64)hi->gnode_extra << mn.m_val;
 
 	if (uv_gp_table) {
 		hi->global_mmr_base	= uv_gp_table->mmr_base;

-- 

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 1/1] x86/platform/uv: Fix calculation of Global Physical Address Mike Travis <mike.travis@hpe.com> - 2017-03-22 00:30 +0100
  [tip:x86/urgent] x86/platform/uv: Fix calculation of Global  Physical Address tip-bot for Mike Travis <tipbot@zytor.com> - 2017-03-22 10:20 +0100

csiph-web