Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Babu Moger <babu.moger@amd.com>
To: Reinette Chatre <reinette.chatre@intel.com>,
	tony.luck@intel.com, bp@alien8.de, ben.horgan@arm.com
Cc: corbet@lwn.net, skhan@linuxfoundation.org, rdunlap@infradead.org,
	x86@kernel.org, Dave.Martin@arm.com, james.morse@arm.com,
	tglx@kernel.org, mingo@redhat.com, dave.hansen@linux.intel.com,
	hpa@zytor.com, fenghuay@nvidia.com, kas@kernel.org,
	rick.p.edgecombe@intel.com, akpm@linux-foundation.org,
	rppt@kernel.org, dapeng1.mi@linux.intel.com, elver@google.com,
	enelsonmoore@gmail.com, jlayton@kernel.org, kuba@kernel.org,
	ebiggers@kernel.org, seanjc@google.com, ewanhai-oc@zhaoxin.com,
	binbin.wu@linux.intel.com, peterz@infradead.org,
	ashish.kalra@amd.com, superm1@kernel.org,
	chang.seok.bae@intel.com, prathyushi.nangia@amd.com,
	kim.phillips@amd.com, ackerleytng@google.com,
	elena.reshetova@intel.com, naveen@kernel.org,
	darwi@linutronix.de, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev,
	kvm@vger.kernel.org, eranian@google.com, peternewman@google.com
Subject: Re: [PATCH v6 03/18] x86/resctrl: Add PLZA configuration definitions and data structures
Date: Thu, 15 Oct 2026 18:07:03 -0500	[thread overview]
Message-ID: <c557ea83-11aa-4747-b305-93d554d3fbc4@amd.com> (raw)
In-Reply-To: <bf4bd727-eac2-48ba-ad85-539a818524d6@intel.com>

Hi Reinette,

On 10/15/26 09:22, Reinette Chatre wrote:
> Hi Babu,
> 
> nit: subject claims multiple "definitions" while only adding one #define.
Will change it to:

x86/resctrl: Add PLZA configuration register and data structures


> 
> On 10/1/26 8:10 AM, Babu Moger wrote:
>> Privilege Level Zero Association (PLZA) enables the kernel to switch to
>> a different CLOSID and/or RMID than those used in user mode when entering
>> kernel mode. CLOSID and RMID selection are independent and can be
>> configured separately.
> 
> That CLOSID and RMID are independent on x86 is clear to me. That they can be
> configured separately is not clear to me in this context. What does this
> "separate configuration" refer to? Looking at the later patches kernel
> mode allocation and monitoring associations are always configured together
> and written to same MSR at the same time?


Good point. Its confusing.  What I meant is that allocation (CLOSID) and 
monitoring (RMID) associations are independent PLZA features and can be 
enabled independently in hardware. For example, a platform may enable 
kernel mode CLOSID association without enabling kernel mode RMID 
association, or vice versa.

Yes. The kernel interface configures both together because they are 
carried in the same IA32_PQR_ASSOC MSR update.

How about?

Privilege Level Zero Association (PLZA) enables the kernel to use a 
different CLOSID and/or RMID in kernel mode than in user mode. 
Allocation (CLOSID) and monitoring (RMID) associations are independent 
PLZA features and may be enabled independently by hardware.

> 
>>
>> PLZA associations are programmed on a per-CPU basis through
>> MSR_IA32_PQR_PLZA_ASSOC (0xc00003fc), which contains the kernel RMID and
>> CLOSID values along with their corresponding enable bits.
>>
>> Make the register and its field layout available so kernel mode allocation
>> and monitoring associations can be configured independently.
> 
> Could you please also elaborate what "configured independently" refers to?
> At this point it specifically refers to kernel mode and from what I understand
> kernel mode of allocation and monitoring are configured together.

Yea. it is not clear. Let me change. Remove the text "independently"(Its 
already in the earlier text).

Make the register and its field layout available so kernel mode 
allocation and monitoring associations can be configured.

> 
>>
>> Signed-off-by: Babu Moger <babu.moger@amd.com>
>> ---
> 
> ...
> 
>> ---
>>   arch/x86/include/asm/msr-index.h       |  1 +
>>   arch/x86/kernel/cpu/resctrl/internal.h | 49 ++++++++++++++++++++++++++
>>   2 files changed, 50 insertions(+)
>>
>> diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
>> index 82ca6356dc62..1331291f7a36 100644
>> --- a/arch/x86/include/asm/msr-index.h
>> +++ b/arch/x86/include/asm/msr-index.h
>> @@ -1304,6 +1304,7 @@
>>   /* - AMD: */
>>   #define MSR_IA32_MBA_BW_BASE		0xc0000200
>>   #define MSR_IA32_SMBA_BW_BASE		0xc0000280
>> +#define MSR_IA32_PQR_PLZA_ASSOC		0xc00003fc
>>   #define MSR_IA32_L3_QOS_ABMC_CFG	0xc00003fd
>>   #define MSR_IA32_L3_QOS_EXT_CFG		0xc00003ff
>>   #define MSR_IA32_EVT_CFG_BASE		0xc0000400
>> diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h
>> index e3cfa0c10e92..44ecde20b1b4 100644
>> --- a/arch/x86/kernel/cpu/resctrl/internal.h
>> +++ b/arch/x86/kernel/cpu/resctrl/internal.h
>> @@ -222,6 +222,55 @@ union l3_qos_abmc_cfg {
>>   	unsigned long full;
>>   };
>>   
>> +/*
>> + * Privilege Level Zero Association (PLZA) is configured via
>> + * MSR_IA32_PQR_PLZA_ASSOC.
>> + *
>> + * @rmid		: RMID programmed for PLZA.
>> + * @reserved1		: Reserved.
>> + * @rmid_en		: Enable RMID for PLZA.
>> + * @closid		: CLOSID programmed for PLZA.
>> + * @reserved2		: Reserved.
>> + * @closid_en		: Enable CLOSID for PLZA.
>> + * @reserved3		: Reserved.
>> + * @plza_en		: Enable PLZA. When enabled, PLZA applies to the
>> + *			  given CPU.
>> + *
>> + * The MSR_IA32_PQR_PLZA_ASSOC must be programmed on every CPU in a QoS
>> + * domain. Each domain supports a single PLZA CLOSID and/or RMID
>> + * association, and all fields except @plza_en must be programmed
>> + * identically across the domain to ensure consistent behavior.
>> + *
>> + * CLOSID and RMID selections are controlled independently. When PLZA is
>> + * enabled (@plza_en = 1), CPL0 uses CLOSID and RMID values from
>> + * MSR_IA32_PQR_PLZA_ASSOC depending on the corresponding enable bits. When
>> + * PLZA is disabled (@plza_en = 0), the CLOSID and RMID are always taken
>> + * from MSR_IA32_PQR_ASSOC regardless of privilege level.
>> + *
>> + * - @rmid_en = 1: use the RMID from MSR_IA32_PQR_PLZA_ASSOC if @plza_en = 1.
>> + * - @rmid_en = 0: use the RMID from MSR_IA32_PQR_ASSOC.
>> + * - @closid_en = 1: use the CLOSID from MSR_IA32_PQR_PLZA_ASSOC if @plza_en = 1.
>> + * - @closid_en = 0: use the CLOSID from MSR_IA32_PQR_ASSOC.
>> + *
>> + * This allows PLZA to override only RMID, only CLOSID, or both. If both
>> + * rmid_en and closid_en are clear, the effective behavior is the same as
> 
> nit: rmid_en -> @rmid_en, closid_en -> @closid_en

Sure.

Thanks
Babu

  reply	other threads:[~2026-10-15 23:07 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-01 15:10 [PATCH v6 00/18] x86,fs/resctrl: Add kernel-mode (e.g., PLZA) support to the resctrl subsystem Babu Moger
2026-10-01 15:10 ` [PATCH v6 01/18] x86/cpufeatures: Support Privilege Level Zero Association (PLZA) Babu Moger
2026-10-01 15:22   ` sashiko-bot
2026-10-15 14:16   ` Reinette Chatre
2026-10-15 23:02     ` Babu Moger
2026-10-01 15:10 ` [PATCH v6 02/18] x86/resctrl: Add PLZA support to command-line options Babu Moger
2026-10-15 14:17   ` Reinette Chatre
2026-10-15 23:03     ` Babu Moger
2026-10-01 15:10 ` [PATCH v6 03/18] x86/resctrl: Add PLZA configuration definitions and data structures Babu Moger
2026-10-01 15:30   ` sashiko-bot
2026-10-15 14:22   ` Reinette Chatre
2026-10-15 23:07     ` Babu Moger [this message]
2026-10-01 15:10 ` [PATCH v6 04/18] fs/resctrl: Introduce kernel mode enum Babu Moger
2026-10-15 14:44   ` Reinette Chatre
2026-10-15 23:09     ` Babu Moger
2026-10-01 15:10 ` [PATCH v6 05/18] x86,arm,fs/resctrl: Introduce architecture hook to program global kernel mode Babu Moger
2026-10-01 15:35   ` sashiko-bot
2026-10-15 14:30   ` Reinette Chatre
2026-10-15 23:12     ` Moger, Babu
2026-10-01 15:10 ` [PATCH v6 06/18] fs/resctrl: Introduce kernel mode states for resctrl Babu Moger
2026-10-15 14:37   ` Reinette Chatre
2026-10-01 15:10 ` [PATCH v6 07/18] fs/resctrl: Introduce resctrl_set_kmode_support() to register supported modes Babu Moger
2026-10-15 14:40   ` Reinette Chatre
2026-10-01 15:10 ` [PATCH v6 08/18] x86/resctrl: Register RESCTRL_GLOBAL_ENABLE_PER_CPU when PLZA is available Babu Moger
2026-10-15 14:46   ` Reinette Chatre
2026-10-01 15:10 ` [PATCH v6 09/18] fs/resctrl: Add interface to display kernel mode status Babu Moger
2026-10-15 15:16   ` Reinette Chatre
2026-10-01 15:10 ` [PATCH v6 10/18] fs/resctrl: Add support for hidden resource group files Babu Moger
2026-10-15 15:27   ` Reinette Chatre
2026-10-01 15:10 ` [PATCH v6 11/18] fs/resctrl: Introduce kmode_cpus/kmode_cpus_list per rdtgroup Babu Moger
2026-10-15 15:31   ` Reinette Chatre
2026-10-01 15:10 ` [PATCH v6 12/18] fs/resctrl: Add CPU hotplug support for kernel mode associations Babu Moger
2026-10-15 15:33   ` Reinette Chatre
2026-10-01 15:10 ` [PATCH v6 13/18] fs/resctrl: Deactivate kernel mode associations when a group is removed Babu Moger
2026-10-15 15:43   ` Reinette Chatre
2026-10-01 15:10 ` [PATCH v6 14/18] fs/resctrl: Control visibility of global per-CPU kernel mode group files Babu Moger
2026-10-15 15:46   ` Reinette Chatre
2026-10-01 15:10 ` [PATCH v6 15/18] fs/resctrl: Reject mode changes for groups backing kernel mode Babu Moger
2026-10-15 15:49   ` Reinette Chatre
2026-10-01 15:10 ` [PATCH v6 16/18] fs/resctrl: Add interface to modify kernel mode via info/kernel_mode Babu Moger
2026-10-15 16:07   ` Reinette Chatre
2026-10-01 15:10 ` [PATCH v6 17/18] fs/resctrl: Allow user space to write kmode_cpus/kmode_cpus_list Babu Moger
2026-10-01 15:10 ` [PATCH v6 18/18] fs/resctrl: Add kernel mode documentation and examples Babu Moger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c557ea83-11aa-4747-b305-93d554d3fbc4@amd.com \
    --to=babu.moger@amd.com \
    --cc=Dave.Martin@arm.com \
    --cc=ackerleytng@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=ashish.kalra@amd.com \
    --cc=ben.horgan@arm.com \
    --cc=binbin.wu@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=chang.seok.bae@intel.com \
    --cc=corbet@lwn.net \
    --cc=dapeng1.mi@linux.intel.com \
    --cc=darwi@linutronix.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=ebiggers@kernel.org \
    --cc=elena.reshetova@intel.com \
    --cc=elver@google.com \
    --cc=enelsonmoore@gmail.com \
    --cc=eranian@google.com \
    --cc=ewanhai-oc@zhaoxin.com \
    --cc=fenghuay@nvidia.com \
    --cc=hpa@zytor.com \
    --cc=james.morse@arm.com \
    --cc=jlayton@kernel.org \
    --cc=kas@kernel.org \
    --cc=kim.phillips@amd.com \
    --cc=kuba@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=naveen@kernel.org \
    --cc=peternewman@google.com \
    --cc=peterz@infradead.org \
    --cc=prathyushi.nangia@amd.com \
    --cc=rdunlap@infradead.org \
    --cc=reinette.chatre@intel.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=rppt@kernel.org \
    --cc=seanjc@google.com \
    --cc=skhan@linuxfoundation.org \
    --cc=superm1@kernel.org \
    --cc=tglx@kernel.org \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox