File tree 4 files changed +43
-0
lines changed
4 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -6138,6 +6138,15 @@ static int CoreFreqK_Scale_And_Compute_Level_Up(INIT_ARG *pArg)
6138
6138
COREFREQ_REV );
6139
6139
6140
6140
PUBLIC (RO (Proc ))-> CPU .Count = pArg -> SMT_Count ;
6141
+
6142
+ if (PUBLIC (RO (Proc ))-> CPU .Count > CORE_COUNT ) {
6143
+ pr_warn ("CoreFreq: Detected %u CPUs, but built with CORE_COUNT=%u\n" ,
6144
+ PUBLIC (RO (Proc ))-> CPU .Count , CORE_COUNT );
6145
+ pr_warn ("CoreFreq: Run 'make help' for instructions " \
6146
+ "on setting CORE_COUNT.\n" );
6147
+
6148
+ return - ENOMEM ;
6149
+ } else {
6141
6150
/* PreCompute SysGate memory allocation. */
6142
6151
PUBLIC (RO (Proc ))-> Gate .ReqMem .Size = sizeof (SYSGATE_RO );
6143
6152
@@ -6159,7 +6168,9 @@ static int CoreFreqK_Scale_And_Compute_Level_Up(INIT_ARG *pArg)
6159
6168
PUBLIC (RO (Proc ))-> Features .Info .Vendor .ID ;
6160
6169
/* Initialize with any hypervisor found so far. */
6161
6170
PUBLIC (RO (Proc ))-> HypervisorID = pArg -> HypervisorID ;
6171
+
6162
6172
return 0 ;
6173
+ }
6163
6174
}
6164
6175
6165
6176
static void CoreFreqK_Alloc_Public_Cache_Level_Down (void )
Original file line number Diff line number Diff line change @@ -4491,6 +4491,15 @@ static int CoreFreqK_Scale_And_Compute_Level_Up(INIT_ARG *pArg)
4491
4491
COREFREQ_REV );
4492
4492
4493
4493
PUBLIC (RO (Proc ))-> CPU .Count = pArg -> SMT_Count ;
4494
+
4495
+ if (PUBLIC (RO (Proc ))-> CPU .Count > CORE_COUNT ) {
4496
+ pr_warn ("CoreFreq: Detected %u CPUs, but built with CORE_COUNT=%u\n" ,
4497
+ PUBLIC (RO (Proc ))-> CPU .Count , CORE_COUNT );
4498
+ pr_warn ("CoreFreq: Run 'make help' for instructions " \
4499
+ "on setting CORE_COUNT.\n" );
4500
+
4501
+ return - ENOMEM ;
4502
+ } else {
4494
4503
/* PreCompute SysGate memory allocation. */
4495
4504
PUBLIC (RO (Proc ))-> Gate .ReqMem .Size = sizeof (SYSGATE_RO );
4496
4505
@@ -4509,7 +4518,9 @@ static int CoreFreqK_Scale_And_Compute_Level_Up(INIT_ARG *pArg)
4509
4518
4510
4519
/* Initialize with any hypervisor found so far. */
4511
4520
PUBLIC (RO (Proc ))-> HypervisorID = pArg -> HypervisorID ;
4521
+
4512
4522
return 0 ;
4523
+ }
4513
4524
}
4514
4525
4515
4526
static void CoreFreqK_Alloc_Public_Cache_Level_Down (void )
Original file line number Diff line number Diff line change @@ -4482,6 +4482,15 @@ static int CoreFreqK_Scale_And_Compute_Level_Up(INIT_ARG *pArg)
4482
4482
COREFREQ_REV );
4483
4483
4484
4484
PUBLIC (RO (Proc ))-> CPU .Count = pArg -> SMT_Count ;
4485
+
4486
+ if (PUBLIC (RO (Proc ))-> CPU .Count > CORE_COUNT ) {
4487
+ pr_warn ("CoreFreq: Detected %u CPUs, but built with CORE_COUNT=%u\n" ,
4488
+ PUBLIC (RO (Proc ))-> CPU .Count , CORE_COUNT );
4489
+ pr_warn ("CoreFreq: Run 'make help' for instructions " \
4490
+ "on setting CORE_COUNT.\n" );
4491
+
4492
+ return - ENOMEM ;
4493
+ } else {
4485
4494
/* PreCompute SysGate memory allocation. */
4486
4495
PUBLIC (RO (Proc ))-> Gate .ReqMem .Size = sizeof (SYSGATE_RO );
4487
4496
@@ -4500,7 +4509,9 @@ static int CoreFreqK_Scale_And_Compute_Level_Up(INIT_ARG *pArg)
4500
4509
4501
4510
/* Initialize with any hypervisor found so far. */
4502
4511
PUBLIC (RO (Proc ))-> HypervisorID = pArg -> HypervisorID ;
4512
+
4503
4513
return 0 ;
4514
+ }
4504
4515
}
4505
4516
4506
4517
static void CoreFreqK_Alloc_Public_Cache_Level_Down (void )
Original file line number Diff line number Diff line change @@ -24639,6 +24639,15 @@ static int CoreFreqK_Scale_And_Compute_Level_Up(INIT_ARG *pArg)
24639
24639
COREFREQ_REV );
24640
24640
24641
24641
PUBLIC(RO(Proc))->CPU.Count = pArg->SMT_Count;
24642
+
24643
+ if (PUBLIC(RO(Proc))->CPU.Count > CORE_COUNT) {
24644
+ pr_warn("CoreFreq: Detected %u CPUs, but built with CORE_COUNT=%u\n",
24645
+ PUBLIC(RO(Proc))->CPU.Count, CORE_COUNT);
24646
+ pr_warn("CoreFreq: Run 'make help' for instructions " \
24647
+ "on setting CORE_COUNT.\n");
24648
+
24649
+ return -ENOMEM;
24650
+ } else {
24642
24651
/* PreCompute SysGate memory allocation. */
24643
24652
PUBLIC(RO(Proc))->Gate.ReqMem.Size = sizeof(SYSGATE_RO);
24644
24653
@@ -24659,6 +24668,7 @@ static int CoreFreqK_Scale_And_Compute_Level_Up(INIT_ARG *pArg)
24659
24668
Arch[GenuineArch].Architecture[0] = \
24660
24669
PUBLIC(RO(Proc))->Features.Info.Vendor.ID;
24661
24670
return 0;
24671
+ }
24662
24672
}
24663
24673
24664
24674
static void CoreFreqK_Alloc_Public_Cache_Level_Down(void)
You can’t perform that action at this time.
0 commit comments