Re: [PATCH v2 1/2] x86/sgx: Resolve EAUG race where losing thread returns SIGBUS

2024-05-15 Thread Reinette Chatre
t; happy path of sgx_encl_eaug_page(). Therefore, in the particular code > path affected in this commit, the "page reclaimer tracked" condition is > always false and the warning is never printed. Thus, it is safe to > replace sgx_encl_free_epc_page() with sgx_free_epc_page(). >

Re: [PATCH v2 2/2] x86/sgx: Resolve EREMOVE page vs EAUG page data race

2024-05-15 Thread Reinette Chatre
/ioctl.c > +++ b/arch/x86/kernel/cpu/sgx/ioctl.c > @@ -1142,6 +1142,7 @@ static long sgx_encl_remove_pages(struct sgx_encl *encl, >* Do not keep encl->lock because of dependency on >* mmap_lock acquired in sgx_zap_enclave_ptes(). >*/ > + entry->desc |= SGX_ENCL_PAGE_BEING_REMOVED; > mutex_unlock(>lock); > > sgx_zap_enclave_ptes(encl, addr); Thank you very much for tracking down and fixing this issue. Acked-by: Reinette Chatre Reinette

Re: [PATCH 2/2] x86/sgx: Resolve EREMOVE page vs EAUG page data race

2024-05-10 Thread Reinette Chatre
Hi Dmitrii, Thank you very much for uncovering and fixing this issue. On 4/30/2024 7:38 AM, Dmitrii Kuvaiskii wrote: > On Mon, Apr 29, 2024 at 04:11:03PM +0300, Jarkko Sakkinen wrote: >> On Mon Apr 29, 2024 at 1:43 PM EEST, Dmitrii Kuvaiskii wrote: >>> Two enclave threads may try to add and

Re: [PATCH 1/2] x86/sgx: Resolve EAUG race where losing thread returns SIGBUS

2024-05-10 Thread Reinette Chatre
winning thread) from the enclave. >>> >>> Fix these two bugs (1) by returning VM_FAULT_NOPAGE to the generic Linux >>> fault handler so that no signal is sent to userspace, and (2) by >>> replacing sgx_encl_free_epc_page() with sgx_free_epc_page() so that no >&

Re: [RFC PATCH 1/1] x86/sgx: Explicitly give up the CPU in EDMM's ioctl() to avoid softlockup

2024-04-23 Thread Reinette Chatre
Hi Kai, On 4/23/2024 4:50 AM, Huang, Kai wrote: >> diff --git a/arch/x86/kernel/cpu/sgx/ioctl.c >> b/arch/x86/kernel/cpu/sgx/ioctl.c >> index b65ab214bdf5..2340a82fa796 100644 >> --- a/arch/x86/kernel/cpu/sgx/ioctl.c >> +++ b/arch/x86/kernel/cpu/sgx/ioctl.c >> @@ -806,6 +806,9 @@

Re: [PATCH v6] x86/sgx: Resolves SECS reclaim vs. page fault for EAUG race

2023-09-28 Thread Reinette Chatre
Hi Dave, On 9/28/2023 5:11 PM, Dave Hansen wrote: > On 9/28/23 16:08, Reinette Chatre wrote: >> I'd like to check in on the status of this patch. This two month old >> patch looks to be a needed fix and has Jarkko and Kai's review tags, >> but I am not able to find it qu

Re: [PATCH v6] x86/sgx: Resolves SECS reclaim vs. page fault for EAUG race

2023-09-28 Thread Reinette Chatre
pport adding of pages to an initialized > enclave") > Cc: sta...@vger.kernel.org # v6.0+ > Signed-off-by: Haitao Huang > Reviewed-by: Jarkko Sakkinen > Reviewed-by: Kai Huang > Acked-by: Reinette Chatre > --- > v6: > - Removed 'Under heavy load' as it is not the

Re: [PATCH RESEND v3 1/2] selftests/resctrl: Fix schemata write error check

2023-09-11 Thread Reinette Chatre
Hi Maciej, On 9/1/2023 6:42 AM, Wieczor-Retman Maciej wrote: > Writing bitmasks to the schemata can fail when the bitmask doesn't > adhere to constraints defined by what a particular CPU supports. > Some example of constraints are max length or having contiguous bits. > The driver should properly

Re: [PATCH v2 02/24] x86/resctrl: Split struct rdt_domain

2021-04-08 Thread Reinette Chatre
Hi James, On 4/8/2021 10:20 AM, James Morse wrote: On 31/03/2021 22:36, Reinette Chatre wrote: On 3/12/2021 9:58 AM, James Morse wrote: resctrl is the defacto Linux ABI for SoC resource partitioning features. To support it on another architecture, it needs to be abstracted from the features

Re: [PATCH v2 01/24] x86/resctrl: Split struct rdt_resource

2021-04-08 Thread Reinette Chatre
Hi James, On 4/8/2021 10:20 AM, James Morse wrote: On 07/04/2021 00:42, Reinette Chatre wrote: On 4/6/2021 10:13 AM, James Morse wrote: On 31/03/2021 22:35, Reinette Chatre wrote: On 3/12/2021 9:58 AM, James Morse wrote: resctrl is the defacto Linux ABI for SoC resource partitioning

Re: [PATCH v2 01/24] x86/resctrl: Split struct rdt_resource

2021-04-06 Thread Reinette Chatre
Hi James, On 4/6/2021 10:13 AM, James Morse wrote: On 31/03/2021 22:35, Reinette Chatre wrote: On 3/12/2021 9:58 AM, James Morse wrote: resctrl is the defacto Linux ABI for SoC resource partitioning features. To support it on another architecture, it needs to be abstracted from the features

Re: [PATCH v2 10/24] x86/resctrl: Swizzle rdt_resource and resctrl_schema in pseudo_lock_region

2021-03-31 Thread Reinette Chatre
Hi James, On 3/12/2021 9:58 AM, James Morse wrote: struct pseudo_lock_region points to the rdt_resource. Once the resources are merged, this won't be unique. The resource name is moving into the scheam, so that eventually resctrl can generate s/scheam/schema/? Reinette

Re: [PATCH v2 07/24] x86/resctrl: Store the effective num_closid in the schema

2021-03-31 Thread Reinette Chatre
Hi James, On 3/12/2021 9:58 AM, James Morse wrote: The resctrl_schema struct holds properties that vary with the style of configuration that resctrl applies to a resource. There are already two values for the hardware's num_closid, depending on whether the architecture presents the L3 or

Re: [PATCH v2 06/24] x86/resctrl: Walk the resctrl schema list instead of an arch list

2021-03-31 Thread Reinette Chatre
Hi James, On 3/12/2021 9:58 AM, James Morse wrote: Once the arch code is abstracted from the resctrl filesystem code the separate schema for CDP are created by the filesystem code. This means the same resource is used for different schema, or types of configuration. Helpers like

Re: [PATCH v2 05/24] x86/resctrl: Label the resources with their configuration type

2021-03-31 Thread Reinette Chatre
Hi James, On 3/12/2021 9:58 AM, James Morse wrote: diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h index 8a9da490134b..57484d2f6214 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -361,12 +361,14

Re: [PATCH v2 03/24] x86/resctrl: Add a separate schema list for resctrl

2021-03-31 Thread Reinette Chatre
Hi James, On 3/12/2021 9:58 AM, James Morse wrote: To support multiple architectures, the resctrl code needs to be split into a 'fs' specific part in core code, and an arch-specific backend. It should be difficult for the arch-specific backends to diverge, supporting slightly different ABIs

Re: [PATCH v2 02/24] x86/resctrl: Split struct rdt_domain

2021-03-31 Thread Reinette Chatre
Hi James, On 3/12/2021 9:58 AM, James Morse wrote: resctrl is the defacto Linux ABI for SoC resource partitioning features. To support it on another architecture, it needs to be abstracted from the features provided by Intel RDT and AMD PQoS, and moved to /fs/. Split struct rdt_domain up too.

Re: [PATCH v2 01/24] x86/resctrl: Split struct rdt_resource

2021-03-31 Thread Reinette Chatre
Hi James, A significant time has passed since the first version and with that a lot of my context lost. On 3/12/2021 9:58 AM, James Morse wrote: resctrl is the defacto Linux ABI for SoC resource partitioning features. To support it on another architecture, it needs to be abstracted from the

Re: [PATCH] kernel: cpu: resctrl: Minor typo fix in the file pseudo_lock.c

2021-03-17 Thread Reinette Chatre
Hi Bhaskar, On 3/17/2021 12:33 PM, Bhaskar Chowdhury wrote: On 10:54 Wed 17 Mar 2021, Reinette Chatre wrote: Thank you very much for catching this typo. My feedback [1] to a previous patch from you applies here also. The prefix should be "x86/resctrl:" for contributions to this area

Re: [PATCH] kernel: cpu: resctrl: Minor typo fix in the file pseudo_lock.c

2021-03-17 Thread Reinette Chatre
Hi Bhaskar, Thank you very much for catching this typo. My feedback [1] to a previous patch from you applies here also. The prefix should be "x86/resctrl:" for contributions to this area. [1] https://lore.kernel.org/lkml/7e3a5c13-db5c-7399-2b80-f1284786e...@intel.com/ On 3/17/2021 1:40

Re: [PATCH V4] arch: kernel: cpu: x86/resctrl: Takes a letter away and append a colon to match below struct member

2021-01-13 Thread Reinette Chatre
Hi Bhaskar, The prefix in the subject line should be "x86/resctrl:" only. The subject line could be (also taking liberty to shorten it here): x86/resctrl: Fix typo and append a colon to match struct member I would like to repeat my suggestion made in response to your previous version,

Re: [PATCH V3] arch: x86: kernel: cpu: Takes a letter away and append a colon to match below stuc member

2021-01-12 Thread Reinette Chatre
Hi Bhaskar, Thank you for fixing this. Could you please fix the subject line to: 1) have correct prefix of "x86/resctrl:". You can see the custom by running "git log arch/x86/kernel/cpu/resctrl". 2) fix the typo: stuc -> struct On 1/12/2021 3:01 AM, Bhaskar Chowdhury wrote:

[tip: x86/cache] x86/resctrl: Use task_curr() instead of task_struct->on_cpu to prevent unnecessary IPI

2021-01-11 Thread tip-bot2 for Reinette Chatre
The following commit has been merged into the x86/cache branch of tip: Commit-ID: e0ad6dc8969f790f14bddcfd7ea284b7e5f88a16 Gitweb: https://git.kernel.org/tip/e0ad6dc8969f790f14bddcfd7ea284b7e5f88a16 Author:Reinette Chatre AuthorDate:Thu, 17 Dec 2020 14:31:20 -08:00

Re: [PATCH] x86/kernel/cpu/resctrl: replace 'of->kn->priv' with of_rft()

2021-01-07 Thread Reinette Chatre
Hi, On 1/4/2021 3:08 AM, zhouchuangao wrote: The use of 'of->kn->priv' to get rftype can be found in several places in arch/x86/kernel/cpu/resctrl/rdtgroup.c, which may reduce readability. So replace the direct use 'of->kn->priv' with inline function of_rft(), which is more readable.

Re: [PATCH V2 1/4] x86/resctrl: Use IPI instead of task_work_add() to update PQR_ASSOC MSR

2021-01-07 Thread Reinette Chatre
Hi Borislav, On 1/6/2021 3:19 AM, Borislav Petkov wrote: On Thu, Dec 17, 2020 at 02:31:18PM -0800, Reinette Chatre wrote: +#ifdef CONFIG_SMP +static void update_task_closid_rmid(struct task_struct *t) +{ + if (task_curr(t)) + smp_call_function_single(task_cpu(t

Re: [PATCH] x86/resctrl: add printf attribute to log function

2021-01-07 Thread Reinette Chatre
rdt_last_cmd_clear(void); void rdt_last_cmd_puts(const char *s); +__printf(1, 2) void rdt_last_cmd_printf(const char *fmt, ...); void rdt_ctrl_update(void *arg); This is a valuable addition, thank you. Acked-by: Reinette Chatre Reinette

[PATCH V2 4/4] x86/resctrl: Apply READ_ONCE/WRITE_ONCE to task_struct .rmid & .closid

2020-12-17 Thread Reinette Chatre
tearing for those accesses by giving them the READ_ONCE() / WRITE_ONCE() treatment. Signed-off-by: Valentin Schneider Signed-off-by: Reinette Chatre --- V1->V2: * Subject line prefix x86/intel_rdt -> x86/resctrl. (Reinette) arch/x86/include/asm/resctrl.h | 11 +++ arch/x86/

[PATCH V2 3/4] x86/resctrl: Use task_curr() instead of task_struct->on_cpu to prevent unnecessary IPI

2020-12-17 Thread Reinette Chatre
rm.com Reported-by: James Morse Signed-off-by: Reinette Chatre --- V1->V2: * New patch in series arch/x86/kernel/cpu/resctrl/rdtgroup.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgrou

[PATCH V2 0/4] x86/resctrl: Fix a few issues in moving a task to a resource group

2020-12-17 Thread Reinette Chatre
ed to stable. [1]: https://lore.kernel.org/lkml/calvzod7e9zzhwenzf7objzgksdbmvwtgej0npgs0lufu3sn...@mail.gmail.com/ [2]: https://lore.kernel.org/lkml/20201123022433.17905-1-valentin.schnei...@arm.com Fenghua Yu (2): x86/resctrl: Use IPI instead of task_work_add() to update PQR_ASSOC MSR

[PATCH V2 1/4] x86/resctrl: Use IPI instead of task_work_add() to update PQR_ASSOC MSR

2020-12-17 Thread Reinette Chatre
mail.com/ [2] https://lore.kernel.org/lkml/20201123022433.17905-1-valentin.schnei...@arm.com Fixes: e02737d5b826 ("x86/intel_rdt: Add tasks files") Reported-by: Shakeel Butt Reported-by: Valentin Schneider Signed-off-by: Fenghua Yu Signed-off-by: Reinette Chatre Reviewed-by: Tony Luck Revi

[PATCH V2 2/4] x86/resctrl: Don't move a task to the same resource group

2020-12-17 Thread Reinette Chatre
Signed-off-by: Reinette Chatre Reviewed-by: Tony Luck Cc: sta...@vger.kernel.org --- V1->V2: * No changes arch/x86/kernel/cpu/resctrl/rdtgroup.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index

Re: [PATCH 0/3] x86/resctrl: Fix a few issues in moving a task to a resource group

2020-12-16 Thread Reinette Chatre
Hi Valentin, On 12/16/2020 9:41 AM, Valentin Schneider wrote: On 14/12/20 18:38, Reinette Chatre wrote: Thinking a bit more (too much?) about it, we could limit ourselves to wrapping only reads not protected by the rdtgroup_mutex: the only two task_struct {closid, rmid} writers

Re: [PATCH 2/3] x86/resctrl: Update PQR_ASSOC MSR synchronously when moving task to resource group

2020-12-16 Thread Reinette Chatre
Hi Valentin, On 12/16/2020 9:41 AM, Valentin Schneider wrote: On 14/12/20 18:41, Reinette Chatre wrote: - return ret; + + /* +* By now, the task's closid and rmid are set. If the task is current +* on a CPU, the PQR_ASSOC MSR needs to be updated to make

Re: [PATCH 2/3] x86/resctrl: Update PQR_ASSOC MSR synchronously when moving task to resource group

2020-12-14 Thread Reinette Chatre
Hi Valentin, On 12/11/2020 12:46 PM, Valentin Schneider wrote: On 03/12/20 23:25, Reinette Chatre wrote: Fixes: e02737d5b826 ("x86/intel_rdt: Add tasks files") Reported-by: Shakeel Butt Reported-by: Valentin Schneider Signed-off-by: Fenghua Yu Signed-off-by: Reinette Chatre

Re: [PATCH 0/3] x86/resctrl: Fix a few issues in moving a task to a resource group

2020-12-14 Thread Reinette Chatre
Hi Valentin, On 12/11/2020 12:46 PM, Valentin Schneider wrote: On 03/12/20 23:25, Reinette Chatre wrote: Valentin's series in [2] ends by adding memory barriers to support the updating of the task_struct from one CPU and the usage of the task_struct data from another CPU. This work is still

Re: [PATCH 2/3] x86/resctrl: Update PQR_ASSOC MSR synchronously when moving task to resource group

2020-12-09 Thread Reinette Chatre
to closer match the name. On 03/12/2020 23:25, Reinette Chatre wrote: From: Fenghua Yu Currently when moving a task to a resource group the PQR_ASSOC MSR is updated with the new closid and rmid in an added task callback. If the task is running the work is run as soon as possible. I

Re: [PATCH 1/3] x86/resctrl: Move setting task's active CPU in a mask into helpers

2020-12-09 Thread Reinette Chatre
Hi James, Thank you very much for your review. On 12/9/2020 8:47 AM, James Morse wrote: Hi Reinette, Fenghua, On 03/12/2020 23:25, Reinette Chatre wrote: From: Fenghua Yu The code of setting the CPU on which a task is running in a CPU mask is moved into a couple of helpers. The new helper

Re: [PATCH 1/3] x86/resctrl: Move setting task's active CPU in a mask into helpers

2020-12-08 Thread Reinette Chatre
Hi Borislav, On 12/8/2020 1:49 AM, Borislav Petkov wrote: On Mon, Dec 07, 2020 at 01:24:51PM -0800, Reinette Chatre wrote: How about: "Move the setting of the CPU on which a task is running in a CPU mask into a couple of helpers. There is no functional change. This is a preparatory c

Re: [PATCH 1/3] x86/resctrl: Move setting task's active CPU in a mask into helpers

2020-12-07 Thread Reinette Chatre
Hi Borislav, Thank you very much for your review. On 12/7/2020 10:29 AM, Borislav Petkov wrote: On Thu, Dec 03, 2020 at 03:25:48PM -0800, Reinette Chatre wrote: From: Fenghua Yu The code of setting the CPU on which a task is running in a CPU mask is moved into a couple of helpers. Pls

[PATCH 1/3] x86/resctrl: Move setting task's active CPU in a mask into helpers

2020-12-03 Thread Reinette Chatre
From: Fenghua Yu The code of setting the CPU on which a task is running in a CPU mask is moved into a couple of helpers. The new helper task_on_cpu() will be reused shortly. Signed-off-by: Fenghua Yu Signed-off-by: Reinette Chatre Reviewed-by: Tony Luck Cc: sta...@vger.kernel.org --- arch

[PATCH 3/3] x86/resctrl: Don't move a task to the same resource group

2020-12-03 Thread Reinette Chatre
Signed-off-by: Reinette Chatre Reviewed-by: Tony Luck Cc: sta...@vger.kernel.org --- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 9d62f1fadcc3..d35230322

[PATCH 2/3] x86/resctrl: Update PQR_ASSOC MSR synchronously when moving task to resource group

2020-12-03 Thread Reinette Chatre
ps://lore.kernel.org/lkml/20201123022433.17905-1-valentin.schnei...@arm.com Fixes: e02737d5b826 ("x86/intel_rdt: Add tasks files") Reported-by: Shakeel Butt Reported-by: Valentin Schneider Signed-off-by: Fenghua Yu Signed-off-by: Reinette Chatre Reviewed-by: Tony Luck Cc: sta...

[PATCH 0/3] x86/resctrl: Fix a few issues in moving a task to a resource group

2020-12-03 Thread Reinette Chatre
When a user writes a task id to the resctrl "tasks" file the task will be moved to the resource group to which the destination "tasks" file belongs. Primarily this includes updating the task's closid and rmid in its task_struct and, for a running task, setting these new values in the PQR_ASSOC

Re: [PATCH v2 0/3] x86/intel_rdt: task_work vs task_struct rmid/closid write race

2020-11-25 Thread Reinette Chatre
Hi Valentin, On 11/25/2020 10:39 AM, Valentin Schneider wrote: On 25/11/20 17:20, Reinette Chatre wrote: Until the queued work is run, the moved task runs with old (and even invalid in the case when its original resource group has been removed) closid and rmid. For a userspace task

Re: [PATCH v2 0/3] x86/intel_rdt: task_work vs task_struct rmid/closid write race

2020-11-25 Thread Reinette Chatre
Hi Valentin, On 11/25/2020 7:01 AM, Valentin Schneider wrote: On 24/11/20 21:37, Reinette Chatre wrote: On 11/22/2020 6:24 PM, Valentin Schneider wrote: This is a small cleanup + a fix for a race I stumbled upon while staring at resctrl stuff. Briefly tested on a Xeon Gold 5120 (m2

Re: [PATCH v2 0/3] x86/intel_rdt: task_work vs task_struct rmid/closid write race

2020-11-24 Thread Reinette Chatre
Hi Valentin, On 11/22/2020 6:24 PM, Valentin Schneider wrote: This is a small cleanup + a fix for a race I stumbled upon while staring at resctrl stuff. Briefly tested on a Xeon Gold 5120 (m2.xlarge.x86 on Equinix) by bouncing a few tasks around control groups. ... Thank you very much for

Re: [PATCH v2] x86/resctrl: Fix AMD L3 QOS CDP enable/disable

2020-11-24 Thread Reinette Chatre
itmaps; boolarch_has_empty_bitmaps; + boolarch_has_per_cpu_cfg; }; /** ... This patch looks good to me. With the one style comment addressed you can add: Reviewed-by: Reinette Chatre Thank you very much Reinette

Re: [PATCH] x86/resctrl: Constify kernfs_ops

2020-11-18 Thread Reinette Chatre
, which allows the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn Thank you very much Rikard. Acked-by: Reinette Chatre Reinette

Re: [PATCH] x86/resctrl: Fix AMD L3 QOS CDP enable/disable

2020-11-18 Thread Reinette Chatre
Hi Babu, On 11/6/2020 12:14 PM, Babu Moger wrote: When the AMD QoS feature CDP(code and data prioritization) is enabled or disabled, the CDP bit in MSR _0C81 is written on one of the cpus in L3 domain(core complex). That is not correct. The CDP bit needs to be updated all the logical cpus

Re: [PATCH 13/24] x86/resctrl: Allow different CODE/DATA configurations to be staged

2020-11-17 Thread Reinette Chatre
Hi James, On 10/30/2020 9:11 AM, James Morse wrote: Now that the configuration is staged via an array, allow resctrl to stage more than configuration at a time for a single resource and s/more than/more than one/ ? closid. To detect that the same schema is being specified twice when the

Re: [PATCH 12/24] x86/resctrl: Add closid to the staged config

2020-11-17 Thread Reinette Chatre
Hi James, On 10/30/2020 9:11 AM, James Morse wrote: Once the L2/L2CODE/L2DATA resources are merged, there may be two configurations staged for one resource when CDP is enabled. The closid should always be passed with the type of configuration to the arch code. Because update_domains() will

Re: [PATCH 11/24] x86/resctrl: Group staged configuration into a separate struct

2020-11-17 Thread Reinette Chatre
Hi James, On 10/30/2020 9:11 AM, James Morse wrote: Arm's MPAM may have surprisingly large bitmaps for its cache portions as the architecture allows up to 4K portions. The size exposed via resctrl may not be the same, some scaling may occur. The values written to hardware may be unlike the

Re: [PATCH 10/24] x86/resctrl: Move the schema names into struct resctrl_schema

2020-11-17 Thread Reinette Chatre
Hi James, On 10/30/2020 9:11 AM, James Morse wrote: Move the names used for the schemata file out of the resource and into struct resctrl_schema. This allows one resource to have two different names, based on the other schema properties. This patch copies the names, eventually resctrl will

Re: [PATCH 08/24] x86/resctrl: Walk the resctrl schema list instead of an arch list

2020-11-17 Thread Reinette Chatre
Hi James, On 10/30/2020 9:11 AM, James Morse wrote: Now that resctrl has its own list of resources it is using, walk that list instead of the architectures list. This means resctrl has somewhere to keep schema properties with the resource that is using them. Most users of

Re: [PATCH 07/24] x86/resctrl: Label the resources with their configuration type

2020-11-17 Thread Reinette Chatre
Hi James, On 10/30/2020 9:11 AM, James Morse wrote: Before the name for the schema can be generated, the type of the configuration being applied to the resource needs to be known. Label all the entries in rdt_resources_all[], and copy that value in to struct s/in to/into/ or s/in to/to/ ?

Re: [PATCH 06/24] x86/resctrl: Store the effective num_closid in the schema

2020-11-17 Thread Reinette Chatre
Hi James, On 10/30/2020 9:11 AM, James Morse wrote: resctrl_schema holds properties that vary with the style of configuration that resctrl applies to a resource. Once the arch code has a single resource per cache that can be configured, resctrl will need to keep track of the num_closid itself.

Re: [PATCH 05/24] x86/resctrl: Pass the schema in resdir's private pointer

2020-11-17 Thread Reinette Chatre
Hi James, It is not clear what "resdir" mentioned in subject line refers to. Could it be changed to "info dir"? On 10/30/2020 9:11 AM, James Morse wrote: Moving properties that resctrl exposes to user-space into the core 'fs' code, (e.g. the name of the schema), means some of the functions

Re: [PATCH 04/24] x86/resctrl: Add a separate schema list for resctrl

2020-11-17 Thread Reinette Chatre
Hi James, On 10/30/2020 9:11 AM, James Morse wrote: To support multiple architectures, the resctrl code needs to be split into a 'fs' specific part in core code, and an arch-specific backend. It should be difficult for the arch-specific backends to diverge, supporting slightly different ABIs

Re: [PATCH 03/24] x86/resctrl: Add resctrl_arch_get_num_closid()

2020-11-17 Thread Reinette Chatre
Hi James, On 10/30/2020 9:10 AM, James Morse wrote: resctrl chooses whether to enable CDP, once it does, half the number of closid are available. MPAM doesn't behave like this, an in-kernel user of MPAM could be 'using CDP' while resctrl is not. To move the 'half the closids' behaviour to be

Re: [PATCH 02/24] x86/resctrl: Split struct rdt_domain

2020-11-17 Thread Reinette Chatre
Hi James, On 10/30/2020 9:10 AM, James Morse wrote: resctrl is the defacto Linux ABI for SoC resource partitioning features. To support it on another architecture, it needs to be abstracted from Intel RDT, and moved it to /fs/. Same comments as previous patch regarding "Intel RDT" and "moved

Re: [PATCH 01/24] x86/resctrl: Split struct rdt_resource

2020-11-17 Thread Reinette Chatre
Hi James, On 10/30/2020 9:10 AM, James Morse wrote: resctrl is the defacto Linux ABI for SoC resource partitioning features. To support it on another architecture, it needs to be abstracted from Intel RDT, and moved it to /fs/. Current support for AMD PQoS should also be considered. s/and

Re: [PATCH 00/24] x86/resctrl: Merge the CDP resources

2020-11-16 Thread Reinette Chatre
Hi James, On 10/30/2020 9:10 AM, James Morse wrote: MPAM has an equivalent feature to CDP, but its a property of the CPU, not the cache. Resctrl needs to have x86's odd/even behaviour, as that its the ABI, but this isn't how the MPAM hardware works. It is entirely possible that an in-kernel

Re: [PATCH 0/3] Fix kernfs node reference count leak issues

2020-10-30 Thread Reinette Chatre
Apologies, the Subject intended to have a "x86/resctrl:" prefix. On 10/30/2020 12:02 PM, Xiaochen Shen wrote: Fix several kernfs node reference count leak issues: (1) Remove superfluous kernfs_get() calls to prevent refcount leak (2) Add necessary kernfs_put() calls to prevent refcount leak (3)

Re: [PATCH] x86/resctrl: Fix memory leak on kernfs dir removal

2020-10-26 Thread Reinette Chatre
+Xiaochen Hi Willem, As you described in the report you sent directly to us there are indeed more issues than the one described here surrounding the kernfs node reference counting in resctrl. Xiaochen is actively working on patch(es) for all the issues and you could continue working with him

Re: [PATCH v3 06/17] virt: acrn: Introduce VM management interfaces

2020-09-10 Thread Reinette Chatre
Hi Shuo and Greg, On 9/10/2020 9:28 AM, Greg Kroah-Hartman wrote: > On Thu, Sep 10, 2020 at 02:19:00PM +0800, Shuo A Liu wrote: >> On Wed 9.Sep'20 at 11:45:16 +0200, Greg Kroah-Hartman wrote: >>> On Wed, Sep 09, 2020 at 05:08:25PM +0800, shuo.a@intel.com wrote: ... /** *

Re: [PATCH v5 00/10] x86/resctrl: Misc cleanup

2020-07-23 Thread Reinette Chatre
Hi James, Borislav, and Thomas, On 7/23/2020 11:31 AM, James Morse wrote: > Hi Reinette, > > On 08/07/2020 17:39, James Morse wrote: >> These are the miscellaneous cleanup patches that floated to the top of >> the MPAM tree. > > Is there anything else I should do with this series? > (Does patch

[PATCH V7 1/4] x86/resctrl: Enable user to view and select thread throttling mode

2020-06-22 Thread Reinette Chatre
any confusion the thread throttling mode would be UNDEFINED on AMD systems and the "thread_throttle_mode" file will not be visible. Cc: Babu Moger Signed-off-by: Reinette Chatre --- No changes since V6 Documentation/x86/resctrl_ui.rst | 19 ++- arch/x86/kernel/cpu/resctrl/cor

[PATCH V7 3/4] x86/resctrl: Enable per-thread MBA

2020-06-22 Thread Reinette Chatre
e "info/MB/thread_throttle_mode" to let user applications know memory bandwidth is allocated per thread and help them fine tune MBA on thread level. Signed-off-by: Fenghua Yu [reinette: transition patch to use membw_throttle_mode enum] Signed-off-by: Reinette Chatre Reviewed-by: Babu M

[PATCH V7 4/4] x86/resctrl: Use appropriate API for strings terminated by newline

2020-06-22 Thread Reinette Chatre
the sysfs_match_string() API that can perform the match across the different mode strings that are already maintained in an array. Suggested-by: Andy Shevchenko Signed-off-by: Reinette Chatre Reviewed-by: Andy Shevchenko --- Changes since V6: - Add Andy's Reviewed-by tag arch/x86/kernel/cpu

[PATCH V7 0/4] x86/resctrl: Enable user to view and select thread throttling mode

2020-06-22 Thread Reinette Chatre
eanup that switches existing resctrl string parsing code to also use this appropriate API. Fenghua Yu (2): x86/resctrl: Enumerate per-thread MBA x86/resctrl: Enable per-thread MBA Reinette Chatre (2): x86/resctrl: Enable user to view and select thread throttling mode x86/resctrl: Use appr

[PATCH V7 2/4] x86/resctrl: Enumerate per-thread MBA

2020-06-22 Thread Reinette Chatre
throttling mode info file to know if the feature is supported. Signed-off-by: Fenghua Yu Signed-off-by: Reinette Chatre Reviewed-by: Babu Moger --- No changes since V6 arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/kernel/cpu/cpuid-deps.c | 1 + arch/x86/kernel/cpu/scattered.c| 1 + 3

Re: [PATCH] x86/resctrl: Fix memory bandwidth counter width for AMD

2020-06-02 Thread Reinette Chatre
Hi Babu, On 6/2/2020 3:12 PM, Babu Moger wrote: > > >> -Original Message----- >> From: Reinette Chatre >> Sent: Tuesday, June 2, 2020 4:51 PM >> To: Moger, Babu ; fenghua...@intel.com; >> t...@linutronix.de; mi...@redhat.com; b...@alien8.de; x...@kernel.

Re: [PATCH] x86/resctrl: Fix memory bandwidth counter width for AMD

2020-06-02 Thread Reinette Chatre
Hi Babu, On 6/2/2020 10:33 AM, Babu Moger wrote: > > > On 6/2/20 12:13 PM, Reinette Chatre wrote: >> On 6/1/2020 4:00 PM, Babu Moger wrote: >>> Memory bandwidth is calculated reading the monitoring counter >>> at two intervals and calculating the delta. It is

Re: [PATCH] x86/resctrl: Fix memory bandwidth counter width for AMD

2020-06-02 Thread Reinette Chatre
Hi Babu, On 6/1/2020 4:00 PM, Babu Moger wrote: > Memory bandwidth is calculated reading the monitoring counter > at two intervals and calculating the delta. It is the software’s > responsibility to read the count often enough to avoid having > the count roll over _twice_ between reads. > > The

Re: [PATCH] x86/resctrl: Fix memory bandwidth counter width for AMD

2020-06-02 Thread Reinette Chatre
Hi Babu, On 6/1/2020 4:00 PM, Babu Moger wrote: > Memory bandwidth is calculated reading the monitoring counter > at two intervals and calculating the delta. It is the software’s > responsibility to read the count often enough to avoid having > the count roll over _twice_ between reads. > > The

Re: [PATCH] x86/resctrl: fix a NULL vs IS_ERR() static checker warning

2020-05-29 Thread Reinette Chatre
ULL; > + _d_cdp = NULL; > ret = -EINVAL; > } > > The below fixes tag may be helpful: Fixes: 52eb74339a62 ("x86/resctrl: Fix rdt_find_domain() return value and checks") Thank you very much for catching this and sending a fix. I just have the commit message comments, apart from that the your fix looks good to me. Acked-by: Reinette Chatre Reinette

Re: [PATCH v4 10/10] cacheinfo: Move resctrl's get_cache_id() to the cacheinfo header file

2020-05-28 Thread Reinette Chatre
en set. > > Signed-off-by: James Morse > Reviewed-by: Babu Moger > --- Moving this out of resctrl seems appropriate, thank you. For the resctrl portions: Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v4 09/10] x86/resctrl: Add arch_has_{sparse,empty}_bitmaps to explain CAT differences

2020-05-28 Thread Reinette Chatre
he relevant parts of cbm_validate(). > > Merging the validate calls causes AMD to gain the min_cbm_bits test > needed for Haswell, but as it always sets this value to 1, it will > never match. > > CC: Reinette Chatre > Signed-off-by: James Morse > Reviewed-by: Babu Moger

Re: [PATCH V2 15/19] selftests/resctrl: Change return type of umount_resctrlfs() to void

2020-05-21 Thread Reinette Chatre
Hi Sai, On 5/21/2020 10:19 AM, Prakhya, Sai Praneeth wrote: > Hi Reinette, > >> -Original Message----- >> From: Reinette Chatre >> Sent: Wednesday, May 20, 2020 4:52 PM >> To: Prakhya, Sai Praneeth ; >> sh...@kernel.org; sk...@linuxfoundation.org; linu

Re: [PATCH V2 00/19] Miscellaneous fixes for resctrl selftests

2020-05-21 Thread Reinette Chatre
Hi Sai, On 5/18/2020 3:08 PM, Sai Praneeth Prakhya wrote: > Fenghua Yu (1): > selftests/resctrl: Fix missing options "-n" and "-p" > > Reinette Chatre (3): > selftests/resctrl: Fix typo > selftests/resctrl: Fix typo in help text > selftest

Re: [PATCH V6 0/4] x86/resctrl: Enable user to view and select thread throttling mode

2020-05-20 Thread Reinette Chatre
Hi Borislav, On 5/20/2020 11:35 AM, Borislav Petkov wrote: > On Wed, May 20, 2020 at 10:32:02AM -0700, Reinette Chatre wrote: > >> It seems inappropriate that I have the title of maintainer and not be >> able to have patches considered for inclusion during an entire release &

Re: [PATCH V6 0/4] x86/resctrl: Enable user to view and select thread throttling mode

2020-05-20 Thread Reinette Chatre
Hi Borislav, On 5/20/2020 12:11 AM, Borislav Petkov wrote: > On Tue, May 19, 2020 at 03:13:59PM -0700, Reinette Chatre wrote: >> I am very sorry. I was hoping that this series could be considered for >> inclusion into v5.8 and submitted it seven weeks ago because of that. >>

Re: [PATCH V6 0/4] x86/resctrl: Enable user to view and select thread throttling mode

2020-05-19 Thread Reinette Chatre
Hi Borislav, On 5/19/2020 2:35 PM, Borislav Petkov wrote: > On Tue, May 19, 2020 at 02:28:27PM -0700, Reinette Chatre wrote: >> V5 upstream submission available from: >> https://lore.kernel.org/lkml/cover.1589844108.git.reinette.cha...@intel.com > > Is there any chanc

[PATCH V6 1/4] x86/resctrl: Enable user to view and select thread throttling mode

2020-05-19 Thread Reinette Chatre
any confusion the thread throttling mode would be UNDEFINED on AMD systems and the "thread_throttle_mode" file will not be visible. Cc: Babu Moger Signed-off-by: Reinette Chatre --- No changes since V5 Documentation/x86/resctrl_ui.rst | 19 ++- arch/x86/kernel/cpu/resctrl/cor

[PATCH V6 4/4] x86/resctrl: Use appropriate API for strings terminated by newline

2020-05-19 Thread Reinette Chatre
the sysfs_match_string() API that can perform the match across the different mode strings that are already maintained in an array. Suggested-by: Andy Shevchenko Signed-off-by: Reinette Chatre --- Changes since V5: - Remove the early check of the sysfs_match_string() return code. (Andy) arch/x86

[PATCH V6 3/4] x86/resctrl: Enable per-thread MBA

2020-05-19 Thread Reinette Chatre
e "info/MB/thread_throttle_mode" to let user applications know memory bandwidth is allocated per thread and help them fine tune MBA on thread level. Signed-off-by: Fenghua Yu [reinette: transition patch to use membw_throttle_mode enum] Signed-off-by: Reinette Chatre Reviewed-by: Babu M

[PATCH V6 0/4] x86/resctrl: Enable user to view and select thread throttling mode

2020-05-19 Thread Reinette Chatre
s a subsequent cleanup that switches existing resctrl string parsing code to also use this appropriate API. Fenghua Yu (2): x86/resctrl: Enumerate per-thread MBA x86/resctrl: Enable per-thread MBA Reinette Chatre (2): x86/resctrl: Enable user to view and select thread throttling mode x86/res

[PATCH V6 2/4] x86/resctrl: Enumerate per-thread MBA

2020-05-19 Thread Reinette Chatre
throttling mode info file to know if the feature is supported. Signed-off-by: Fenghua Yu Signed-off-by: Reinette Chatre Reviewed-by: Babu Moger --- No changes since V5 arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/kernel/cpu/cpuid-deps.c | 1 + arch/x86/kernel/cpu/scattered.c| 1 + 3

Re: [PATCH v3 09/10] x86/resctrl: Add arch_has_{sparse,empty}_bitmaps to explain CAT differences

2020-05-19 Thread Reinette Chatre
Hi James, Thank you very much for adding the handling of empty bitmaps. This looks good to me, just one comment ... On 5/18/2020 6:19 AM, James Morse wrote: > -bool cbm_validate_intel(char *buf, u32 *data, struct rdt_resource *r) > +static bool cbm_validate(char *buf, u32 *data, struct

Re: [PATCH v3 07/10] x86/resctrl: Add arch_needs_linear to explain AMD/Intel MBA difference

2020-05-19 Thread Reinette Chatre
Hi James, On 5/18/2020 6:19 AM, James Morse wrote: > diff --git a/arch/x86/kernel/cpu/resctrl/internal.h > b/arch/x86/kernel/cpu/resctrl/internal.h > index dd51e23e346b..0b288b6fefd9 100644 > --- a/arch/x86/kernel/cpu/resctrl/internal.h > +++ b/arch/x86/kernel/cpu/resctrl/internal.h > @@ -370,6

Re: [PATCH V5 4/4] x86/resctrl: Use appropriate API for strings terminated by newline

2020-05-19 Thread Reinette Chatre
Hi Andy, On 5/19/2020 9:07 AM, Andy Shevchenko wrote: > On Tue, May 19, 2020 at 08:50:22AM -0700, Reinette Chatre wrote: >> On 5/19/2020 1:28 AM, Andy Shevchenko wrote: >>> On Tue, May 19, 2020 at 2:50 AM Reinette Chatre >>> wrote: > > ... > >>>&g

Re: [PATCH V5 4/4] x86/resctrl: Use appropriate API for strings terminated by newline

2020-05-19 Thread Reinette Chatre
Hi Andy, On a high level the changes from v4 to v5 aimed to address your feedback and also ensure that original user interface behavior is maintained. On 5/19/2020 1:28 AM, Andy Shevchenko wrote: > On Tue, May 19, 2020 at 2:50 AM Reinette Chatre > wrote: > > ... >

[PATCH V5 4/4] x86/resctrl: Use appropriate API for strings terminated by newline

2020-05-18 Thread Reinette Chatre
the sysfs_match_string() API that can perform the match across the different mode strings that are already maintained in an array. Suggested-by: Andy Shevchenko Signed-off-by: Reinette Chatre --- Changes since V4: - Remove "mode" local variable from rdtgroup_mode_write(). Thi

[PATCH V5 3/4] x86/resctrl: Enable per-thread MBA

2020-05-18 Thread Reinette Chatre
e "info/MB/thread_throttle_mode" to let user applications know memory bandwidth is allocated per thread and help them fine tune MBA on thread level. Signed-off-by: Fenghua Yu [reinette: transition patch to use membw_throttle_mode enum] Signed-off-by: Reinette Chatre Reviewed-by: Babu Moge

[PATCH V5 0/4] x86/resctrl: Enable user to view and select thread throttling mode

2020-05-18 Thread Reinette Chatre
sctrl string parsing code to also use this appropriate API. Fenghua Yu (2): x86/resctrl: Enumerate per-thread MBA x86/resctrl: Enable per-thread MBA Reinette Chatre (2): x86/resctrl: Enable user to view and select thread throttling mode x86/resctrl: Use appropriate API for strings termi

[PATCH V5 2/4] x86/resctrl: Enumerate per-thread MBA

2020-05-18 Thread Reinette Chatre
throttling mode info file to know if the feature is supported. Signed-off-by: Fenghua Yu Signed-off-by: Reinette Chatre Reviewed-by: Babu Moger --- Changes since V4: - Pick up Babu's "Reviewed-by" tag. arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/kernel/cpu/cpuid-deps.c | 1 +

[PATCH V5 1/4] x86/resctrl: Enable user to view and select thread throttling mode

2020-05-18 Thread Reinette Chatre
any confusion the thread throttling mode would be UNDEFINED on AMD systems and the "thread_throttle_mode" file will not be visible. Cc: Babu Moger Signed-off-by: Reinette Chatre --- Changes since V4: - Three checks are performed before the MBA_CFG register is updated from its cach

Re: [PATCH V4 1/4] x86/resctrl: Enable user to view and select thread throttling mode

2020-05-18 Thread Reinette Chatre
Hi Babu, On 5/18/2020 10:28 AM, Babu Moger wrote: > Hi Reinette, > Looks good most part. Few minor comments. Thank you very much for taking a look. > >> -Original Message- >> From: Reinette Chatre >> Sent: Saturday, May 16, 2020 1:29 PM >> To: t...@li

Re: [PATCH V4 4/4] x86/resctrl: Use appropriate API for strings terminated by newline

2020-05-18 Thread Reinette Chatre
Hi Andy, On 5/18/2020 9:06 AM, Reinette Chatre wrote: > On 5/18/2020 4:50 AM, Andy Shevchenko wrote: >> On Sat, May 16, 2020 at 11:28:41AM -0700, Reinette Chatre wrote: >>> The user input to files in the resctrl filesystem are expected to be >>> terminated with a newl

Re: [PATCH V4 4/4] x86/resctrl: Use appropriate API for strings terminated by newline

2020-05-18 Thread Reinette Chatre
Hi Andy, On 5/18/2020 4:50 AM, Andy Shevchenko wrote: > On Sat, May 16, 2020 at 11:28:41AM -0700, Reinette Chatre wrote: >> The user input to files in the resctrl filesystem are expected to be >> terminated with a newline. Testing the user input includes a test for >> the

  1   2   3   4   5   6   7   8   9   10   >