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: <9dd487d7-9414-4aa6-be21-692dda655553@nvidia.com>
Date: Mon, 14 Apr 2025 17:27:41 -0700
From: Fenghua Yu <fenghuay@...dia.com>
To: James Morse <james.morse@....com>, x86@...nel.org,
 linux-kernel@...r.kernel.org
Cc: Reinette Chatre <reinette.chatre@...el.com>,
 Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
 Borislav Petkov <bp@...en8.de>, H Peter Anvin <hpa@...or.com>,
 Babu Moger <Babu.Moger@....com>, shameerali.kolothum.thodi@...wei.com,
 D Scott Phillips OS <scott@...amperecomputing.com>,
 carl@...amperecomputing.com, lcherian@...vell.com,
 bobo.shaobowang@...wei.com, tan.shaopeng@...itsu.com,
 baolin.wang@...ux.alibaba.com, Jamie Iles <quic_jiles@...cinc.com>,
 Xin Hao <xhao@...ux.alibaba.com>, peternewman@...gle.com,
 dfustini@...libre.com, amitsinght@...vell.com,
 David Hildenbrand <david@...hat.com>, Rex Nie <rex.nie@...uarmicro.com>,
 Dave Martin <dave.martin@....com>, Koba Ko <kobak@...dia.com>,
 Shanker Donthineni <sdonthineni@...dia.com>
Subject: Re: [PATCH v8 17/21] x86,fs/resctrl: Move the resctrl filesystem code
 to live in /fs/resctrl

Hi, James,

On 4/11/25 09:42, James Morse wrote:
> Resctrl is a filesystem interface to hardware that provides cache
> allocation policy and bandwidth control for groups of tasks or CPUs.
>
> To support more than one architecture, resctrl needs to live in /fs/.
>
> Move the code that is concerned with the filesystem interface to
> /fs/resctrl.
>
> Signed-off-by: James Morse <james.morse@....com>
> ---
> Changes since *:
>   * This patch is generated by a script.
> ---
>   arch/x86/kernel/cpu/resctrl/ctrlmondata.c     |  636 ---
>   arch/x86/kernel/cpu/resctrl/internal.h        |  380 +-
>   arch/x86/kernel/cpu/resctrl/monitor.c         |  902 +---
>   arch/x86/kernel/cpu/resctrl/monitor_trace.h   |   18 +-
>   arch/x86/kernel/cpu/resctrl/pseudo_lock.c     | 1080 +---
>   .../kernel/cpu/resctrl/pseudo_lock_trace.h    |    2 +
>   arch/x86/kernel/cpu/resctrl/rdtgroup.c        | 4556 +----------------
>   fs/resctrl/ctrlmondata.c                      |  660 +++
>   fs/resctrl/internal.h                         |  442 ++
>   fs/resctrl/monitor.c                          |  932 ++++
>   fs/resctrl/monitor_trace.h                    |   33 +
>   fs/resctrl/pseudo_lock.c                      | 1115 ++++
>   fs/resctrl/pseudo_lock_trace.h                |   17 +
>   fs/resctrl/rdtgroup.c                         | 4313 ++++++++++++++++
>   14 files changed, 7668 insertions(+), 7418 deletions(-)

[SNIP]

> diff --git a/fs/resctrl/pseudo_lock.c b/fs/resctrl/pseudo_lock.c
> index e69de29bb2d1..29682dd46871 100644
> --- a/fs/resctrl/pseudo_lock.c
> +++ b/fs/resctrl/pseudo_lock.c
> @@ -0,0 +1,1115 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Resource Director Technology (RDT)
> + *
> + * Pseudo-locking support built on top of Cache Allocation Technology (CAT)
> + *
> + * Copyright (C) 2018 Intel Corporation
> + *
> + * Author: Reinette Chatre <reinette.chatre@...el.com>
> + */
> +
> +#define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
> +
> +#include <linux/cacheflush.h>
> +#include <linux/cacheinfo.h>
> +#include <linux/cpu.h>
> +#include <linux/cpumask.h>
> +#include <linux/debugfs.h>
> +#include <linux/kthread.h>
> +#include <linux/mman.h>
> +#include <linux/perf_event.h>
> +#include <linux/pm_qos.h>
> +#include <linux/resctrl.h>
> +#include <linux/slab.h>
> +#include <linux/uaccess.h>
> +
> +#include <asm/cpu_device_id.h>
> +#include <asm/perf_event.h>
> +
> +#include "../../events/perf_event.h" /* For X86_CONFIG() */
> +#include "internal.h"
> +
> +#define CREATE_TRACE_POINTS
> +
> +#include "pseudo_lock_trace.h"

[SNIP]

> +}
> diff --git a/fs/resctrl/pseudo_lock_trace.h b/fs/resctrl/pseudo_lock_trace.h
> index e69de29bb2d1..7a6a1983953a 100644
> --- a/fs/resctrl/pseudo_lock_trace.h
> +++ b/fs/resctrl/pseudo_lock_trace.h
> @@ -0,0 +1,17 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#undef TRACE_SYSTEM
> +#define TRACE_SYSTEM resctrl
> +
> +#if !defined(_X86_RESCTRL_PSEUDO_LOCK_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
> +#define _X86_RESCTRL_PSEUDO_LOCK_TRACE_H
> +
> +#include <linux/tracepoint.h>
> +
> +#endif /* _X86_RESCTRL_PSEUDO_LOCK_TRACE_H */
> +
> +#undef TRACE_INCLUDE_PATH
> +#define TRACE_INCLUDE_PATH .
> +
> +#define TRACE_INCLUDE_FILE pseudo_lock_trace
> +
> +#include <trace/define_trace.h>

If applying patch 1-17, building the kernel reports this error, which 
will cause bisect failure:

   CC      fs/resctrl/pseudo_lock.o
In file included from fs/resctrl/pseudo_lock_trace.h:17,
                  from fs/resctrl/pseudo_lock.c:35:
./include/trace/define_trace.h:110:42: fatal error: 
./pseudo_lock_trace.h: No such file or directory
   110 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
       |                                          ^
compilation terminated.
make[4]: *** [scripts/Makefile.build:203: fs/resctrl/pseudo_lock.o] Error 1

Again combining patch 18 with this patch together makes the error go away.

But you said combining them together may cause the conversion python 
tool complex: 
https://lore.kernel.org/lkml/97aeaf87-b2db-4efb-9d81-43769c6f27b0@arm.com/

Is there a better way to resolve this error? Maybe update the tool not 
to generate or include fs/resctrl/pseudo_lock_trace.h at all?

[SNIP]

Thanks.

-Fenghua


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ