Skip to content

Commit cf524e6

Browse files
taoyuhongEddie Dong
authored andcommitted
HV: CAT: add platform specified info for CLOS
IF CAT is supported, and we want setup initial values to IA32_Type_MASK_n MSRs, We can define a global structure platform_clos_array[PLATFORM_CLOS_NUM], it has 2 members: 1.msr_index, the MSR address of IA32_Type_MASK_n 2.clos_masky, the initial valuses Global varible platform_clos_num is the number of IA32_Type_MASK_n, from IA32_Type_MASK_0 to IA32_Type_MASK_<CLOS_MAX_NUM - 1> Tracked-On: #2462 Signed-off-by: Tao Yuhong <yuhong.tao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent ae34fdd commit cf524e6

File tree

8 files changed

+93
-0
lines changed

8 files changed

+93
-0
lines changed

hypervisor/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ C_SRCS += arch/x86/configs/$(CONFIG_BOARD)/ve820.c
140140
C_SRCS += arch/x86/configs/$(CONFIG_BOARD)/pt_dev.c
141141
endif
142142

143+
C_SRCS += arch/x86/configs/$(CONFIG_BOARD)/board.c
144+
143145
C_SRCS += boot/acpi.c
144146
C_SRCS += boot/dmar_parse.c
145147
S_SRCS += arch/x86/idt.S
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
* Copyright (C) 2019 Intel Corporation. All rights reserved.
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
#include <board.h>
8+
9+
struct platform_clos_info platform_clos_array[0];
10+
uint16_t platform_clos_num = 0;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright (C) 2019 Intel Corporation. All rights reserved.
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
#include <board.h>
8+
#include <msr.h>
9+
10+
struct platform_clos_info platform_clos_array[4] = {
11+
{
12+
.clos_mask = 0xff,
13+
.msr_index = MSR_IA32_L2_MASK_0,
14+
},
15+
{
16+
.clos_mask = 0xff,
17+
.msr_index = MSR_IA32_L2_MASK_1,
18+
},
19+
{
20+
.clos_mask = 0xff,
21+
.msr_index = MSR_IA32_L2_MASK_2,
22+
},
23+
{
24+
.clos_mask = 0xff,
25+
.msr_index = MSR_IA32_L2_MASK_3,
26+
},
27+
};
28+
29+
uint16_t platform_clos_num = (uint16_t)(sizeof(platform_clos_array)/sizeof(struct platform_clos_info));
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
* Copyright (C) 2019 Intel Corporation. All rights reserved.
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
#include <board.h>
8+
9+
struct platform_clos_info platform_clos_array[0];
10+
uint16_t platform_clos_num = 0;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
* Copyright (C) 2019 Intel Corporation. All rights reserved.
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
#include <board.h>
8+
9+
struct platform_clos_info platform_clos_array[0];
10+
uint16_t platform_clos_num = 0;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
* Copyright (C) 2019 Intel Corporation. All rights reserved.
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
#include <board.h>
8+
9+
struct platform_clos_info platform_clos_array[0];
10+
uint16_t platform_clos_num = 0;

hypervisor/include/arch/x86/board.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright (C) 2019 Intel Corporation. All rights reserved.
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
#ifndef BOARD_H
7+
#define BOARD_H
8+
9+
#include <types.h>
10+
11+
struct platform_clos_info {
12+
uint32_t clos_mask;
13+
uint32_t msr_index;
14+
};
15+
16+
extern struct platform_clos_info platform_clos_array[];
17+
extern uint16_t platform_clos_num;
18+
19+
#endif /* BOARD_H */

hypervisor/include/arch/x86/msr.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,9 @@
341341
#define MSR_IA32_PM_CTL1 0x00000DB1U
342342
#define MSR_IA32_THREAD_STALL 0x00000DB2U
343343
#define MSR_IA32_L2_MASK_0 0x00000D10U
344+
#define MSR_IA32_L2_MASK_1 0x00000D11U
345+
#define MSR_IA32_L2_MASK_2 0x00000D12U
346+
#define MSR_IA32_L2_MASK_3 0x00000D13U
344347
#define MSR_IA32_BNDCFGS 0x00000D90U
345348
#define MSR_IA32_EFER 0xC0000080U
346349
#define MSR_IA32_STAR 0xC0000081U

0 commit comments

Comments
 (0)