lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <15824c9d-b39a-43f8-b33c-787053061d70@amd.com>
Date: Wed, 18 Sep 2024 15:19:33 -0500
From: "Moger, Babu" <babu.moger@....com>
To: Reinette Chatre <reinette.chatre@...el.com>, corbet@....net,
 tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
 dave.hansen@...ux.intel.com, x86@...nel.org
Cc: fenghua.yu@...el.com, hpa@...or.com, paulmck@...nel.org,
 thuth@...hat.com, xiongwei.song@...driver.com, ardb@...nel.org,
 pawan.kumar.gupta@...ux.intel.com, daniel.sneddon@...ux.intel.com,
 sandipan.das@....com, kai.huang@...el.com, peterz@...radead.org,
 kan.liang@...ux.intel.com, pbonzini@...hat.com, xin3.li@...el.com,
 ebiggers@...gle.com, alexandre.chartre@...cle.com, perry.yuan@....com,
 tan.shaopeng@...itsu.com, james.morse@....com, tony.luck@...el.com,
 maciej.wieczor-retman@...el.com, linux-doc@...r.kernel.org,
 linux-kernel@...r.kernel.org, peternewman@...gle.com, eranian@...gle.com
Subject: Re: [PATCH 6/7] x86/resctrl: Introduce interface to display SDCIAE
 Capacity Bit Masks

Hi Reinette,

On 9/13/24 15:52, Reinette Chatre wrote:
> Hi Babu,
> 
> On 8/16/24 9:16 AM, Babu Moger wrote:
>> When enabled, SDCIAE forces all SDCI lines to be placed into the L3 cache
>> partitions identified by the highest-supported L3_MASK_n register where
>> n is the maximum CLOSID supported.
>>
>> Add the interface to display CBMs (Capacity Bit Mask) of the SDCIAE.
>>
>> Signed-off-by: Babu Moger <babu.moger@....com>
>> ---
>>   arch/x86/kernel/cpu/resctrl/ctrlmondata.c |  2 +-
>>   arch/x86/kernel/cpu/resctrl/internal.h    |  1 +
>>   arch/x86/kernel/cpu/resctrl/rdtgroup.c    | 29 +++++++++++++++++++++++
>>   3 files changed, 31 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
>> b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
>> index 50fa1fe9a073..fc99f4d17e6c 100644
>> --- a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
>> +++ b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
>> @@ -439,7 +439,7 @@ u32 resctrl_arch_get_config(struct rdt_resource *r,
>> struct rdt_ctrl_domain *d,
>>       return hw_dom->ctrl_val[idx];
>>   }
>>   -static void show_doms(struct seq_file *s, struct resctrl_schema
>> *schema, int closid)
>> +void show_doms(struct seq_file *s, struct resctrl_schema *schema, int
>> closid)
>>   {
>>       struct rdt_resource *r = schema->res;
>>       struct rdt_ctrl_domain *dom;
>> diff --git a/arch/x86/kernel/cpu/resctrl/internal.h
>> b/arch/x86/kernel/cpu/resctrl/internal.h
>> index 9a3da6d49144..f2c87ca37b13 100644
>> --- a/arch/x86/kernel/cpu/resctrl/internal.h
>> +++ b/arch/x86/kernel/cpu/resctrl/internal.h
>> @@ -663,6 +663,7 @@ void __init thread_throttle_mode_init(void);
>>   void __init mbm_config_rftype_init(const char *config);
>>   void rdt_staged_configs_clear(void);
>>   void __init resctrl_sdciae_rftype_init(void);
>> +void show_doms(struct seq_file *s, struct resctrl_schema *schema, int
>> closid);
>>   bool closid_allocated(unsigned int closid);
>>   int resctrl_find_cleanest_closid(void);
>>   diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
>> b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
>> index 58e4df195207..51bc715bb6ae 100644
>> --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
>> +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
>> @@ -1922,6 +1922,25 @@ static ssize_t resctrl_sdciae_write(struct
>> kernfs_open_file *of, char *buf,
>>       return ret ?: nbytes;
>>   }
>>   +static int resctrl_sdciae_cbm_show(struct kernfs_open_file *of,
>> +                   struct seq_file *seq, void *v)
>> +{
>> +    struct resctrl_schema *s = of->kn->parent->priv;
>> +    struct rdt_resource *r = s->res;
>> +    u32 sdciae_closid;
>> +
>> +    if (!resctrl_arch_get_sdciae_enabled(RDT_RESOURCE_L3)) {
> 
> (same issue with this file appearing in all cache resources, eg. L2)

Sure. Will address it.

> 
>> +        rdt_last_cmd_puts("SDCIAE is not enabled\n");
>> +        return -EINVAL;
>> +    }
>> +
>> +    sdciae_closid = get_sdciae_closid(r);
>> +
>> +    show_doms(seq, s, sdciae_closid);
>> +
>> +    return 0;
>> +}
> 
> This really needs protection. (You should have encountered warnings
> via lockdep_assert_held(&rdtgroup_mutex) and lockdep_assert_cpus_held()
> found in the functions called.)


Sure. Will fix it.

>> +
>>   /* rdtgroup information files for one cache resource. */
>>   static struct rftype res_common_files[] = {
>>       {
>> @@ -2081,6 +2100,12 @@ static struct rftype res_common_files[] = {
>>           .seq_show    = resctrl_sdciae_show,
>>           .write        = resctrl_sdciae_write,
>>       },
>> +    {
>> +        .name        = "sdciae_cbm",
>> +        .mode        = 0444,
>> +        .kf_ops        = &rdtgroup_kf_single_ops,
>> +        .seq_show    = resctrl_sdciae_cbm_show,
>> +    },
>>       {
>>           .name        = "mode",
>>           .mode        = 0644,
>> @@ -2187,6 +2212,10 @@ void __init resctrl_sdciae_rftype_init(void)
>>       rft = rdtgroup_get_rftype_by_name("sdciae");
>>       if (rft)
>>           rft->fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_CACHE;
>> +
>> +    rft = rdtgroup_get_rftype_by_name("sdciae_cbm");
>> +    if (rft)
>> +        rft->fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_CACHE;
>>   }
>>     /**
> 
> Reinette
> 

-- 
Thanks
Babu Moger

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ