All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] intel_rapl: exposing PL3 / PsysPL3 (MSR 0x615) through powercap?
@ 2026-11-17 10:27 Lars Schellhas van Kisfeld
  2026-11-17 15:59 ` srinivas pandruvada
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Schellhas van Kisfeld @ 2026-11-17 10:27 UTC (permalink / raw)
  To: linux-pm@vger.kernel.org
  Cc: Rafael J. Wysocki, Srinivas Pandruvada, Zhang Rui

Hi,
before writing a patch I'd like to ask whether this would be welcome.

Background: I'm working on a user-space daemon that applies the Windows
power configuration of Microsoft Surface devices on Linux [1]. On Windows,
Intel DTT writes MSR 0x615 dynamically as a platform peak limit. On a
Surface Book 3 (Ice Lake) the firmware sets it to 65 W (enabled); Windows
raises it to 100 W on AC. powercap has no constraint for it, so the daemon
writes 0x615 through /dev/cpu//msr, which needs CAP_SYS_RAWIO, fails under
lockdown and triggers the "unrecognized MSR" warning.

What I measured: on the SB3, 0x615 binds on platform (psys) power, not on
package power. With 20 W in bits 14:0 and the enable bit as found, psys
power under all-core load drops from ~35 W to ~18 W. Restoring the original
value works. A tester saw the same write, bind and restore on an Alder Lake
Surface Pro 9. coreboot also treats 0x615 as PsysPL3, next to 0x65C.

Questions:
1. Is 0x615 PsysPL3 (platform domain) on all client parts that have it, and
    is its layout documented publicly (time window, duty cycle in bits
    30:24, lock bit 31)? I couldn't find 615H in the public SDM.
2. Would you accept a third constraint on the psys domain for it, opt-in
    per CPU model like msr_pl4_support? Duty cycle would stay untouched.
3. Any preference for the constraint name? "peak_power" is taken by PL4.

If this sounds reasonable, I'd send a patch for the models I can verify,
and only those.
Thanks,
Lars

[1] https://github.com/larsschellhas/linux-surface-power

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] intel_rapl: exposing PL3 / PsysPL3 (MSR 0x615) through powercap?
  2026-11-17 10:27 [RFC] intel_rapl: exposing PL3 / PsysPL3 (MSR 0x615) through powercap? Lars Schellhas van Kisfeld
@ 2026-11-17 15:59 ` srinivas pandruvada
  2026-11-17 16:26   ` AW: " Lars Schellhas van Kisfeld
  0 siblings, 1 reply; 4+ messages in thread
From: srinivas pandruvada @ 2026-11-17 15:59 UTC (permalink / raw)
  To: Lars Schellhas van Kisfeld, linux-pm@vger.kernel.org
  Cc: Rafael J. Wysocki, Zhang Rui

Hi Lars,
On Tue, 2026-11-17 at 10:27 +0000, Lars Schellhas van Kisfeld wrote:
> Hi,
> before writing a patch I'd like to ask whether this would be welcome.
> 
> Background: I'm working on a user-space daemon that applies the
> Windows
> power configuration of Microsoft Surface devices on Linux [1]. On
> Windows,
> Intel DTT writes MSR 0x615 dynamically as a platform peak limit. On a
> Surface Book 3 (Ice Lake) the firmware sets it to 65 W (enabled);
> Windows
> raises it to 100 W on AC. powercap has no constraint for it, so the
> daemon
> writes 0x615 through /dev/cpu//msr, which needs CAP_SYS_RAWIO, fails
> under
> lockdown and triggers the "unrecognized MSR" warning.
> 
> What I measured: on the SB3, 0x615 binds on platform (psys) power,
> not on
> package power. With 20 W in bits 14:0 and the enable bit as found,
> psys
> power under all-core load drops from ~35 W to ~18 W. Restoring the
> original
> value works. A tester saw the same write, bind and restore on an
> Alder Lake
> Surface Pro 9. coreboot also treats 0x615 as PsysPL3, next to 0x65C.
> 
> Questions:
> 1. Is 0x615 PsysPL3 (platform domain) on all client parts that have
> it, and
>     is its layout documented publicly (time window, duty cycle in
> bits
>     30:24, lock bit 31)? I couldn't find 615H in the public SDM.

This is not documented in SDM. So, will be difficult to add to Linux
kernel. When not documented, it is difficult to what each fields mean
and can change gen to gen.

Thanks,
Srinivas


> 2. Would you accept a third constraint on the psys domain for it,
> opt-in
>     per CPU model like msr_pl4_support? Duty cycle would stay
> untouched.
> 3. Any preference for the constraint name? "peak_power" is taken by
> PL4.
> 
> If this sounds reasonable, I'd send a patch for the models I can
> verify,
> and only those.
> Thanks,
> Lars
> 
> [1] https://github.com/larsschellhas/linux-surface-power

^ permalink raw reply	[flat|nested] 4+ messages in thread

* AW: [RFC] intel_rapl: exposing PL3 / PsysPL3 (MSR 0x615) through powercap?
  2026-11-17 15:59 ` srinivas pandruvada
@ 2026-11-17 16:26   ` Lars Schellhas van Kisfeld
  2026-11-17 17:47     ` srinivas pandruvada
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Schellhas van Kisfeld @ 2026-11-17 16:26 UTC (permalink / raw)
  To: srinivas pandruvada, linux-pm@vger.kernel.org
  Cc: Rafael J. Wysocki, Zhang Rui

Hi Srinivas,

thanks for the quick and clear answer. That makes sense: without public documentation the field meanings can’t be verified, and I don’t want to push an interface upstream that might behave differently on other generations. I won’t send a patch.

For now I’ll keep the access in user space, restricted to the models I have measured, and I’ll leave all bits except the power limit field untouched.

If Intel ever documents 0x615 (or can tell me that it is stable across client generations), I’d be glad to revisit this.

Best regards,
Lars

________________________________________
Von: srinivas pandruvada <srinivas.pandruvada@linux.intel.com>
Gesendet: Dienstag, 17. November 2026 16:59
An: Lars Schellhas van Kisfeld <lars.schellhas-van-kisfeld@schellhasconsulting.de>; linux-pm@vger.kernel.org <linux-pm@vger.kernel.org>
Cc: Rafael J. Wysocki <rafael@kernel.org>; Zhang Rui <rui.zhang@intel.com>
Betreff: Re: [RFC] intel_rapl: exposing PL3 / PsysPL3 (MSR 0x615) through powercap?
 
Hi Lars,
On Tue, 2026-11-17 at 10:27 +0000, Lars Schellhas van Kisfeld wrote:
> Hi,
> before writing a patch I'd like to ask whether this would be welcome.
>
> Background: I'm working on a user-space daemon that applies the
> Windows
> power configuration of Microsoft Surface devices on Linux [1]. On
> Windows,
> Intel DTT writes MSR 0x615 dynamically as a platform peak limit. On a
> Surface Book 3 (Ice Lake) the firmware sets it to 65 W (enabled);
> Windows
> raises it to 100 W on AC. powercap has no constraint for it, so the
> daemon
> writes 0x615 through /dev/cpu//msr, which needs CAP_SYS_RAWIO, fails
> under
> lockdown and triggers the "unrecognized MSR" warning.
>
> What I measured: on the SB3, 0x615 binds on platform (psys) power,
> not on
> package power. With 20 W in bits 14:0 and the enable bit as found,
> psys
> power under all-core load drops from ~35 W to ~18 W. Restoring the
> original
> value works. A tester saw the same write, bind and restore on an
> Alder Lake
> Surface Pro 9. coreboot also treats 0x615 as PsysPL3, next to 0x65C.
>
> Questions:
> 1. Is 0x615 PsysPL3 (platform domain) on all client parts that have
> it, and
>     is its layout documented publicly (time window, duty cycle in
> bits
>     30:24, lock bit 31)? I couldn't find 615H in the public SDM.

This is not documented in SDM. So, will be difficult to add to Linux
kernel. When not documented, it is difficult to what each fields mean
and can change gen to gen.

Thanks,
Srinivas


> 2. Would you accept a third constraint on the psys domain for it,
> opt-in
>     per CPU model like msr_pl4_support? Duty cycle would stay
> untouched.
> 3. Any preference for the constraint name? "peak_power" is taken by
> PL4.
>
> If this sounds reasonable, I'd send a patch for the models I can
> verify,
> and only those.
> Thanks,
> Lars
>
> [1] https://github.com/larsschellhas/linux-surface-power

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: AW: [RFC] intel_rapl: exposing PL3 / PsysPL3 (MSR 0x615) through powercap?
  2026-11-17 16:26   ` AW: " Lars Schellhas van Kisfeld
@ 2026-11-17 17:47     ` srinivas pandruvada
  0 siblings, 0 replies; 4+ messages in thread
From: srinivas pandruvada @ 2026-11-17 17:47 UTC (permalink / raw)
  To: Lars Schellhas van Kisfeld, linux-pm@vger.kernel.org
  Cc: Rafael J. Wysocki, Zhang Rui

Hi Lars,

On Tue, 2026-11-17 at 16:26 +0000, Lars Schellhas van Kisfeld wrote:
> Hi Srinivas,
> 
> thanks for the quick and clear answer. That makes sense: without
> public documentation the field meanings can’t be verified, and I
> don’t want to push an interface upstream that might behave
> differently on other generations. I won’t send a patch.
> 
> For now I’ll keep the access in user space, restricted to the models
> I have measured, and I’ll leave all bits except the power limit field
> untouched.
> 
> If Intel ever documents 0x615 (or can tell me that it is stable
> across client generations), I’d be glad to revisit this.
> 
We continually monitor for stable interfaces. If it ever becomes
stable, will be glad to revisit.

Thanks,
Srinivas


> Best regards,
> Lars
> 
> ________________________________________
> Von: srinivas pandruvada <srinivas.pandruvada@linux.intel.com>
> Gesendet: Dienstag, 17. November 2026 16:59
> An: Lars Schellhas van Kisfeld
> <lars.schellhas-van-kisfeld@schellhasconsulting.de>;
> linux-pm@vger.kernel.org <linux-pm@vger.kernel.org>
> Cc: Rafael J. Wysocki <rafael@kernel.org>; Zhang Rui
> <rui.zhang@intel.com>
> Betreff: Re: [RFC] intel_rapl: exposing PL3 / PsysPL3 (MSR 0x615)
> through powercap?
>  
> Hi Lars,
> On Tue, 2026-11-17 at 10:27 +0000, Lars Schellhas van Kisfeld wrote:
> > Hi,
> > before writing a patch I'd like to ask whether this would be
> > welcome.
> > 
> > Background: I'm working on a user-space daemon that applies the
> > Windows
> > power configuration of Microsoft Surface devices on Linux [1]. On
> > Windows,
> > Intel DTT writes MSR 0x615 dynamically as a platform peak limit. On
> > a
> > Surface Book 3 (Ice Lake) the firmware sets it to 65 W (enabled);
> > Windows
> > raises it to 100 W on AC. powercap has no constraint for it, so the
> > daemon
> > writes 0x615 through /dev/cpu//msr, which needs CAP_SYS_RAWIO,
> > fails
> > under
> > lockdown and triggers the "unrecognized MSR" warning.
> > 
> > What I measured: on the SB3, 0x615 binds on platform (psys) power,
> > not on
> > package power. With 20 W in bits 14:0 and the enable bit as found,
> > psys
> > power under all-core load drops from ~35 W to ~18 W. Restoring the
> > original
> > value works. A tester saw the same write, bind and restore on an
> > Alder Lake
> > Surface Pro 9. coreboot also treats 0x615 as PsysPL3, next to
> > 0x65C.
> > 
> > Questions:
> > 1. Is 0x615 PsysPL3 (platform domain) on all client parts that have
> > it, and
> >     is its layout documented publicly (time window, duty cycle in
> > bits
> >     30:24, lock bit 31)? I couldn't find 615H in the public SDM.
> 
> This is not documented in SDM. So, will be difficult to add to Linux
> kernel. When not documented, it is difficult to what each fields mean
> and can change gen to gen.
> 
> Thanks,
> Srinivas
> 
> 
> > 2. Would you accept a third constraint on the psys domain for it,
> > opt-in
> >     per CPU model like msr_pl4_support? Duty cycle would stay
> > untouched.
> > 3. Any preference for the constraint name? "peak_power" is taken by
> > PL4.
> > 
> > If this sounds reasonable, I'd send a patch for the models I can
> > verify,
> > and only those.
> > Thanks,
> > Lars
> > 
> > [1] https://github.com/larsschellhas/linux-surface-power

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-17 17:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-17 10:27 [RFC] intel_rapl: exposing PL3 / PsysPL3 (MSR 0x615) through powercap? Lars Schellhas van Kisfeld
2026-11-17 15:59 ` srinivas pandruvada
2026-11-17 16:26   ` AW: " Lars Schellhas van Kisfeld
2026-11-17 17:47     ` srinivas pandruvada

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.