Skip to content

Commit 1b730d5

Browse files
committed
Merge: update cpufreq to match upstream v6.15
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/6598 Reesolves: 83803 JIRA: https://issues.redhat.com/browse/RHEL-83803 Adds bugfixes and regular updates to match upstream v6.15. Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com> Approved-by: Eric Chanudet <echanude@redhat.com> Approved-by: David Arcari <darcari@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Augusto Caringi <acaringi@redhat.com>
2 parents 1fd7372 + bcd131a commit 1b730d5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1318
-1275
lines changed

arch/powerpc/include/asm/reg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@
618618
#define HID1_ABE (1<<10) /* 7450 Address Broadcast Enable */
619619
#define HID1_PS (1<<16) /* 750FX PLL selection */
620620
#endif
621-
#define SPRN_HID2 0x3F8 /* Hardware Implementation Register 2 */
621+
#define SPRN_HID2_750FX 0x3F8 /* IBM 750FX HID2 Register */
622622
#define SPRN_HID2_GEKKO 0x398 /* Gekko HID2 Register */
623623
#define SPRN_IABR 0x3F2 /* Instruction Address Breakpoint Register */
624624
#define SPRN_IABR2 0x3FA /* 83xx */

arch/powerpc/kernel/cpu_setup_6xx.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ _GLOBAL(__save_cpu_setup)
372372
andi. r3,r3,0xff00
373373
cmpwi cr0,r3,0x0200
374374
bne 1f
375-
mfspr r4,SPRN_HID2
375+
mfspr r4,SPRN_HID2_750FX
376376
stw r4,CS_HID2(r5)
377377
1:
378378
mtcr r7
@@ -467,7 +467,7 @@ _GLOBAL(__restore_cpu_setup)
467467
bne 4f
468468
lwz r4,CS_HID2(r5)
469469
rlwinm r4,r4,0,19,17
470-
mtspr SPRN_HID2,r4
470+
mtspr SPRN_HID2_750FX,r4
471471
sync
472472
4:
473473
lwz r4,CS_HID1(r5)

arch/powerpc/kvm/book3s_emulate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ int kvmppc_core_emulate_mtspr_pr(struct kvm_vcpu *vcpu, int sprn, ulong spr_val)
714714
case SPRN_HID1:
715715
to_book3s(vcpu)->hid[1] = spr_val;
716716
break;
717-
case SPRN_HID2:
717+
case SPRN_HID2_750FX:
718718
to_book3s(vcpu)->hid[2] = spr_val;
719719
break;
720720
case SPRN_HID2_GEKKO:
@@ -900,7 +900,7 @@ int kvmppc_core_emulate_mfspr_pr(struct kvm_vcpu *vcpu, int sprn, ulong *spr_val
900900
case SPRN_HID1:
901901
*spr_val = to_book3s(vcpu)->hid[1];
902902
break;
903-
case SPRN_HID2:
903+
case SPRN_HID2_750FX:
904904
case SPRN_HID2_GEKKO:
905905
*spr_val = to_book3s(vcpu)->hid[2];
906906
break;

arch/powerpc/platforms/52xx/lite5200_sleep.S

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ lite5200_wakeup:
199199

200200
/* HIDs, MSR */
201201
LOAD_SPRN(HID1, 0x19)
202-
LOAD_SPRN(HID2, 0x1a)
202+
/* FIXME: Should this use HID2_G2_LE? */
203+
LOAD_SPRN(HID2_750FX, 0x1a)
203204

204205

205206
/* address translation is tricky (see turn_on_mmu) */
@@ -279,7 +280,8 @@ save_regs:
279280

280281
SAVE_SPRN(HID0, 0x18)
281282
SAVE_SPRN(HID1, 0x19)
282-
SAVE_SPRN(HID2, 0x1a)
283+
/* FIXME: Should this use HID2_G2_LE? */
284+
SAVE_SPRN(HID2_750FX, 0x1a)
283285
mfmsr r10
284286
stw r10, (4*0x1b)(r4)
285287
/*SAVE_SPRN(LR, 0x1c) have to save it before the call */

arch/powerpc/platforms/83xx/suspend-asm.S

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ _GLOBAL(mpc83xx_enter_deep_sleep)
6868

6969
mfspr r5, SPRN_HID0
7070
mfspr r6, SPRN_HID1
71-
mfspr r7, SPRN_HID2
71+
/* FIXME: Should this use SPRN_HID2_G2_LE? */
72+
mfspr r7, SPRN_HID2_750FX
7273

7374
stw r5, SS_HID+0(r3)
7475
stw r6, SS_HID+4(r3)
@@ -396,7 +397,8 @@ mpc83xx_deep_resume:
396397

397398
mtspr SPRN_HID0, r5
398399
mtspr SPRN_HID1, r6
399-
mtspr SPRN_HID2, r7
400+
/* FIXME: Should this use SPRN_HID2_G2_LE? */
401+
mtspr SPRN_HID2_750FX, r7
400402

401403
lwz r4, SS_IABR+0(r3)
402404
lwz r5, SS_IABR+4(r3)

arch/x86/include/asm/msr-index.h

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -674,15 +674,17 @@
674674
#define MSR_AMD_CPPC_REQ 0xc00102b3
675675
#define MSR_AMD_CPPC_STATUS 0xc00102b4
676676

677-
#define AMD_CPPC_LOWEST_PERF(x) (((x) >> 0) & 0xff)
678-
#define AMD_CPPC_LOWNONLIN_PERF(x) (((x) >> 8) & 0xff)
679-
#define AMD_CPPC_NOMINAL_PERF(x) (((x) >> 16) & 0xff)
680-
#define AMD_CPPC_HIGHEST_PERF(x) (((x) >> 24) & 0xff)
681-
682-
#define AMD_CPPC_MAX_PERF(x) (((x) & 0xff) << 0)
683-
#define AMD_CPPC_MIN_PERF(x) (((x) & 0xff) << 8)
684-
#define AMD_CPPC_DES_PERF(x) (((x) & 0xff) << 16)
685-
#define AMD_CPPC_ENERGY_PERF_PREF(x) (((x) & 0xff) << 24)
677+
/* Masks for use with MSR_AMD_CPPC_CAP1 */
678+
#define AMD_CPPC_LOWEST_PERF_MASK GENMASK(7, 0)
679+
#define AMD_CPPC_LOWNONLIN_PERF_MASK GENMASK(15, 8)
680+
#define AMD_CPPC_NOMINAL_PERF_MASK GENMASK(23, 16)
681+
#define AMD_CPPC_HIGHEST_PERF_MASK GENMASK(31, 24)
682+
683+
/* Masks for use with MSR_AMD_CPPC_REQ */
684+
#define AMD_CPPC_MAX_PERF_MASK GENMASK(7, 0)
685+
#define AMD_CPPC_MIN_PERF_MASK GENMASK(15, 8)
686+
#define AMD_CPPC_DES_PERF_MASK GENMASK(23, 16)
687+
#define AMD_CPPC_EPP_PERF_MASK GENMASK(31, 24)
686688

687689
/* AMD Performance Counter Global Status and Control MSRs */
688690
#define MSR_AMD64_PERF_CNTR_GLOBAL_STATUS 0xc0000300

arch/x86/kernel/acpi/cppc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* Copyright (c) 2016, Intel Corporation.
55
*/
66

7+
#include <linux/bitfield.h>
8+
79
#include <acpi/cppc_acpi.h>
810
#include <asm/msr.h>
911
#include <asm/processor.h>
@@ -154,7 +156,7 @@ int amd_get_highest_perf(unsigned int cpu, u32 *highest_perf)
154156
if (ret)
155157
goto out;
156158

157-
val = AMD_CPPC_HIGHEST_PERF(val);
159+
val = FIELD_GET(AMD_CPPC_HIGHEST_PERF_MASK, val);
158160
} else {
159161
ret = cppc_get_highest_perf(cpu, &val);
160162
if (ret)

drivers/cpufreq/Kconfig

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,20 @@ config CPUFREQ_DT
217217

218218
If in doubt, say N.
219219

220+
config CPUFREQ_VIRT
221+
tristate "Virtual cpufreq driver"
222+
depends on GENERIC_ARCH_TOPOLOGY
223+
help
224+
This adds a virtualized cpufreq driver for guest kernels that
225+
read/writes to a MMIO region for a virtualized cpufreq device to
226+
communicate with the host. It sends performance requests to the host
227+
which gets used as a hint to schedule vCPU threads and select CPU
228+
frequency. If a VM does not support a virtualized FIE such as AMUs,
229+
it updates the frequency scaling factor by polling host CPU frequency
230+
to enable accurate Per-Entity Load Tracking for tasks running in the guest.
231+
232+
If in doubt, say N.
233+
220234
config CPUFREQ_DT_PLATDEV
221235
tristate "Generic DT based cpufreq platdev driver"
222236
depends on OF
@@ -231,9 +245,7 @@ if X86
231245
source "drivers/cpufreq/Kconfig.x86"
232246
endif
233247

234-
if ARM || ARM64
235248
source "drivers/cpufreq/Kconfig.arm"
236-
endif
237249

238250
if PPC32 || PPC64
239251
source "drivers/cpufreq/Kconfig.powerpc"

drivers/cpufreq/Kconfig.powerpc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@ config CPU_FREQ_CBE_PMI
1717
frequencies. Using PMI, the processor will not only be able to run at
1818
lower speed, but also at lower core voltage.
1919

20-
config CPU_FREQ_MAPLE
21-
bool "Support for Maple 970FX Evaluation Board"
22-
depends on PPC_MAPLE
23-
help
24-
This adds support for frequency switching on Maple 970FX
25-
Evaluation Board and compatible boards (IBM JS2x blades).
26-
2720
config CPU_FREQ_PMAC
2821
bool "Support for Apple PowerBooks"
2922
depends on ADB_PMU && PPC32

drivers/cpufreq/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ obj-$(CONFIG_CPU_FREQ_GOV_ATTR_SET) += cpufreq_governor_attr_set.o
1616

1717
obj-$(CONFIG_CPUFREQ_DT) += cpufreq-dt.o
1818
obj-$(CONFIG_CPUFREQ_DT_PLATDEV) += cpufreq-dt-platdev.o
19+
obj-$(CONFIG_CPUFREQ_VIRT) += virtual-cpufreq.o
1920

2021
# Traces
2122
CFLAGS_amd-pstate-trace.o := -I$(src)
@@ -90,7 +91,6 @@ obj-$(CONFIG_ARM_VEXPRESS_SPC_CPUFREQ) += vexpress-spc-cpufreq.o
9091
obj-$(CONFIG_CPU_FREQ_CBE) += ppc-cbe-cpufreq.o
9192
ppc-cbe-cpufreq-y += ppc_cbe_cpufreq_pervasive.o ppc_cbe_cpufreq.o
9293
obj-$(CONFIG_CPU_FREQ_CBE_PMI) += ppc_cbe_cpufreq_pmi.o
93-
obj-$(CONFIG_CPU_FREQ_MAPLE) += maple-cpufreq.o
9494
obj-$(CONFIG_QORIQ_CPUFREQ) += qoriq-cpufreq.o
9595
obj-$(CONFIG_CPU_FREQ_PMAC) += pmac32-cpufreq.o
9696
obj-$(CONFIG_CPU_FREQ_PMAC64) += pmac64-cpufreq.o

0 commit comments

Comments
 (0)