Skip to content

Commit a74a7e9

Browse files
mike-travissuryasaimadhu
authored andcommitted
x86/platform/uv: Update UV5 MMR references in UV GRU
Make modifications to the GRU mappings to accommodate changes for UV5. Signed-off-by: Mike Travis <mike.travis@hpe.com> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Dimitri Sivanich <dimitri.sivanich@hpe.com> Reviewed-by: Steve Wahl <steve.wahl@hpe.com> Link: https://lkml.kernel.org/r/20201005203929.148656-10-mike.travis@hpe.com
1 parent 8540b2c commit a74a7e9

1 file changed

Lines changed: 24 additions & 6 deletions

File tree

arch/x86/kernel/apic/x2apic_uv_x.c

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ static unsigned long __init uv_early_read_mmr(unsigned long addr)
8282

8383
static inline bool is_GRU_range(u64 start, u64 end)
8484
{
85+
if (!gru_start_paddr)
86+
return false;
87+
8588
return start >= gru_start_paddr && end <= gru_end_paddr;
8689
}
8790

@@ -909,13 +912,24 @@ static __init void map_high(char *id, unsigned long base, int pshift, int bshift
909912
static __init void map_gru_high(int max_pnode)
910913
{
911914
union uvh_rh_gam_gru_overlay_config_u gru;
912-
int shift = UVH_RH_GAM_GRU_OVERLAY_CONFIG_BASE_SHFT;
913-
unsigned long mask = UVH_RH_GAM_GRU_OVERLAY_CONFIG_BASE_MASK;
914-
unsigned long base;
915+
unsigned long mask, base;
916+
int shift;
917+
918+
if (UVH_RH_GAM_GRU_OVERLAY_CONFIG) {
919+
gru.v = uv_read_local_mmr(UVH_RH_GAM_GRU_OVERLAY_CONFIG);
920+
shift = UVH_RH_GAM_GRU_OVERLAY_CONFIG_BASE_SHFT;
921+
mask = UVH_RH_GAM_GRU_OVERLAY_CONFIG_BASE_MASK;
922+
} else if (UVH_RH10_GAM_GRU_OVERLAY_CONFIG) {
923+
gru.v = uv_read_local_mmr(UVH_RH10_GAM_GRU_OVERLAY_CONFIG);
924+
shift = UVH_RH10_GAM_GRU_OVERLAY_CONFIG_BASE_SHFT;
925+
mask = UVH_RH10_GAM_GRU_OVERLAY_CONFIG_BASE_MASK;
926+
} else {
927+
pr_err("UV: GRU unavailable (no MMR)\n");
928+
return;
929+
}
915930

916-
gru.v = uv_read_local_mmr(UVH_RH_GAM_GRU_OVERLAY_CONFIG);
917931
if (!gru.s.enable) {
918-
pr_info("UV: GRU disabled\n");
932+
pr_info("UV: GRU disabled (by BIOS)\n");
919933
return;
920934
}
921935

@@ -1288,7 +1302,11 @@ static void __init uv_init_hub_info(struct uv_hub_info_s *hi)
12881302
/* Show system specific info: */
12891303
pr_info("UV: N:%d M:%d m_shift:%d n_lshift:%d\n", hi->n_val, hi->m_val, hi->m_shift, hi->n_lshift);
12901304
pr_info("UV: gpa_mask/shift:0x%lx/%d pnode_mask:0x%x apic_pns:%d\n", hi->gpa_mask, hi->gpa_shift, hi->pnode_mask, hi->apic_pnode_shift);
1291-
pr_info("UV: mmr_base/shift:0x%lx/%ld gru_base/shift:0x%lx/%ld\n", hi->global_mmr_base, hi->global_mmr_shift, hi->global_gru_base, hi->global_gru_shift);
1305+
pr_info("UV: mmr_base/shift:0x%lx/%ld\n", hi->global_mmr_base, hi->global_mmr_shift);
1306+
if (hi->global_gru_base)
1307+
pr_info("UV: gru_base/shift:0x%lx/%ld\n",
1308+
hi->global_gru_base, hi->global_gru_shift);
1309+
12921310
pr_info("UV: gnode_upper:0x%lx gnode_extra:0x%x\n", hi->gnode_upper, hi->gnode_extra);
12931311
}
12941312

0 commit comments

Comments
 (0)