Skip to content

Commit 647128f

Browse files
mike-travissuryasaimadhu
authored andcommitted
x86/platform/uv: Update UV MMRs for UV5
Update UV MMRs in uv_mmrs.h for UV5 based on Verilog output from the UV Hub hardware design files. This is the next UV architecture with a new class (UVY) being defined for 52 bit physical address masks. Uses a bitmask for UV arch identification so a single test can cover multiple versions. Includes other adjustments to match the uv_mmrs.h file to keep from encountering compile errors. New UV5 functionality is added in the patches that follow. [ Fix W=1 build warnings. ] Reported-by: kernel test robot <[email protected]> Signed-off-by: Mike Travis <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Steve Wahl <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 788b66e commit 647128f

File tree

5 files changed

+4278
-3707
lines changed

5 files changed

+4278
-3707
lines changed

arch/x86/include/asm/uv/uv_hub.h

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ struct uv_gam_range_s {
144144
* available in the L3 cache on the cpu socket for the node.
145145
*/
146146
struct uv_hub_info_s {
147+
unsigned int hub_type;
148+
unsigned char hub_revision;
147149
unsigned long global_mmr_base;
148150
unsigned long global_mmr_shift;
149151
unsigned long gpa_mask;
@@ -156,7 +158,6 @@ struct uv_hub_info_s {
156158
unsigned char m_val;
157159
unsigned char n_val;
158160
unsigned char gr_table_len;
159-
unsigned char hub_revision;
160161
unsigned char apic_pnode_shift;
161162
unsigned char gpa_shift;
162163
unsigned char m_shift;
@@ -205,6 +206,17 @@ static inline struct uv_hub_info_s *uv_cpu_hub_info(int cpu)
205206
return (struct uv_hub_info_s *)uv_cpu_info_per(cpu)->p_uv_hub_info;
206207
}
207208

209+
static inline int uv_hub_type(void)
210+
{
211+
return uv_hub_info->hub_type;
212+
}
213+
214+
static inline __init void uv_hub_type_set(int uvmask)
215+
{
216+
uv_hub_info->hub_type = uvmask;
217+
}
218+
219+
208220
/*
209221
* HUB revision ranges for each UV HUB architecture.
210222
* This is a software convention - NOT the hardware revision numbers in
@@ -215,38 +227,29 @@ static inline struct uv_hub_info_s *uv_cpu_hub_info(int cpu)
215227
#define UV4_HUB_REVISION_BASE 7
216228
#define UV4A_HUB_REVISION_BASE 8 /* UV4 (fixed) rev 2 */
217229

218-
static inline int is_uv2_hub(void)
219-
{
220-
return is_uv_hubbed(uv(2));
221-
}
222-
223-
static inline int is_uv3_hub(void)
224-
{
225-
return is_uv_hubbed(uv(3));
226-
}
230+
static inline int is_uv(int uvmask) { return uv_hub_type() & uvmask; }
231+
static inline int is_uv1_hub(void) { return 0; }
232+
static inline int is_uv2_hub(void) { return is_uv(UV2); }
233+
static inline int is_uv3_hub(void) { return is_uv(UV3); }
234+
static inline int is_uv4a_hub(void) { return is_uv(UV4A); }
235+
static inline int is_uv4_hub(void) { return is_uv(UV4); }
236+
static inline int is_uv5_hub(void) { return 0; }
227237

228-
/* First test "is UV4A", then "is UV4" */
229-
static inline int is_uv4a_hub(void)
230-
{
231-
if (is_uv_hubbed(uv(4)))
232-
return (uv_hub_info->hub_revision == UV4A_HUB_REVISION_BASE);
233-
return 0;
234-
}
238+
/*
239+
* UV4A is a revision of UV4. So on UV4A, both is_uv4_hub() and
240+
* is_uv4a_hub() return true, While on UV4, only is_uv4_hub()
241+
* returns true. So to get true results, first test if is UV4A,
242+
* then test if is UV4.
243+
*/
235244

236-
static inline int is_uv4_hub(void)
237-
{
238-
return is_uv_hubbed(uv(4));
239-
}
245+
/* UVX class: UV2,3,4 */
246+
static inline int is_uvx_hub(void) { return is_uv(UVX); }
240247

241-
static inline int is_uvx_hub(void)
242-
{
243-
return (is_uv_hubbed(-2) >= uv(2));
244-
}
248+
/* UVY class: UV5,..? */
249+
static inline int is_uvy_hub(void) { return 0; }
245250

246-
static inline int is_uv_hub(void)
247-
{
248-
return is_uvx_hub();
249-
}
251+
/* Any UV Hubbed System */
252+
static inline int is_uv_hub(void) { return is_uv(UV_ANY); }
250253

251254
union uvh_apicid {
252255
unsigned long v;

0 commit comments

Comments
 (0)