Re: [PATCH v2 1/6] Add AutoFDO support for Clang build

2024-10-03 Thread Mike Rapoport
On Thu, Oct 03, 2024 at 11:20:17AM -0700, Rong Xu wrote: > Writing the doc with all these code-blocks was not fun either. > We are happy to change if there is a better way for this. > > -Rong > > On Thu, Oct 3, 2024 at 9:13 AM Peter Zijlstra wrote: > > > > On Thu, Oct 03, 2024 at 09:11:34AM -070

Re: [PATCH 33/33] kselftest/riscv: kselftest for user mode cfi

2024-10-03 Thread Shuah Khan
On 10/3/24 05:03, Mark Brown wrote: On Wed, Oct 02, 2024 at 05:18:36PM -0600, Shuah Khan wrote: On 10/1/24 10:06, Deepak Gupta wrote: +#ifndef __NR_prctl +#define __NR_prctl 167 +#endif +#ifndef __NR_map_shadow_stack +#define __NR_map_shadow_stack 453 Why do we need to define these? Sho

Re: [PATCH 33/33] kselftest/riscv: kselftest for user mode cfi

2024-10-03 Thread Edgecombe, Rick P
On Thu, 2024-10-03 at 17:04 -0600, Shuah Khan wrote: > On 10/3/24 05:03, Mark Brown wrote: > > On Wed, Oct 02, 2024 at 05:18:36PM -0600, Shuah Khan wrote: > > > On 10/1/24 10:06, Deepak Gupta wrote: > > > > > > +#ifndef __NR_prctl > > > > +#define __NR_prctl 167 > > > > +#endif > > > > > > +#ifnd

Re: [PATCH 33/33] kselftest/riscv: kselftest for user mode cfi

2024-10-03 Thread Mark Brown
On Wed, Oct 02, 2024 at 05:18:36PM -0600, Shuah Khan wrote: > On 10/1/24 10:06, Deepak Gupta wrote: > > +#ifndef __NR_prctl > > +#define __NR_prctl 167 > > +#endif > > +#ifndef __NR_map_shadow_stack > > +#define __NR_map_shadow_stack 453 > Why do we need to define these? Shouldn't including > as

Re: [PATCH] docs: dev-tools: Add documentation for the device focused kselftests

2024-10-03 Thread Nícolas F . R . A . Prado
On Wed, Oct 02, 2024 at 12:00:10PM -0600, Shuah Khan wrote: > On 10/1/24 09:43, Nícolas F. R. A. Prado wrote: > > Add documentation for the kselftests focused on testing devices and > > point to it from the kselftest documentation. There are multiple tests > > in this category so the aim of this pa

Re: [PATCH v13 16/40] KVM: arm64: Manage GCS access and registers for guests

2024-10-03 Thread Mark Brown
On Wed, Oct 02, 2024 at 08:29:28PM +0100, Marc Zyngier wrote: > Mark Brown wrote: > > They are, though really they should UNDEF if GCS isn't there (which I > > had thought was what you were referencing here). Equally we only have > > traps for a subset of GCS instructions and it's not like there

Re: [PATCH v2 1/6] Add AutoFDO support for Clang build

2024-10-03 Thread Peter Zijlstra
On Wed, Oct 02, 2024 at 04:34:00PM -0700, Rong Xu wrote: > +Preparation > +=== > + > +Configure the kernel with: > + > + .. code-block:: make > + > + CONFIG_AUTOFDO_CLANG=y > + > +Customization > += > + > +You can enable or disable AutoFDO build for individual file and di

Re: [PATCH v2 3/6] Change the symbols order when --ffuntion-sections is enabled

2024-10-03 Thread Peter Zijlstra
On Wed, Oct 02, 2024 at 04:34:02PM -0700, Rong Xu wrote: > When the -ffunction-sections compiler option is enabled, each function > is placed in a separate section named .text.function_name rather than > putting all functions in a single .text section. > > However, using -function-sections can cau

Re: [PATCH v2 1/6] Add AutoFDO support for Clang build

2024-10-03 Thread Nick Desaulniers
On Thu, Oct 3, 2024 at 8:42 AM Peter Zijlstra wrote: > > On Wed, Oct 02, 2024 at 04:34:00PM -0700, Rong Xu wrote: > > +6) Rebuild the kernel using the AutoFDO profile file with the same config > > as step 1, > > +(Note CONFIG_AUTOFDO_CLANG needs to be enabled): > > + > > + .. code-block:

Re: [PATCH v2 1/6] Add AutoFDO support for Clang build

2024-10-03 Thread Peter Zijlstra
On Thu, Oct 03, 2024 at 08:51:51AM -0700, Nick Desaulniers wrote: > On Thu, Oct 3, 2024 at 8:42 AM Peter Zijlstra wrote: > > > > On Wed, Oct 02, 2024 at 04:34:00PM -0700, Rong Xu wrote: > > > +6) Rebuild the kernel using the AutoFDO profile file with the same > > > config as step 1, > > > +(N

Re: [PATCH v2 1/6] Add AutoFDO support for Clang build

2024-10-03 Thread Nick Desaulniers
On Thu, Oct 3, 2024 at 9:03 AM Peter Zijlstra wrote: > > On Thu, Oct 03, 2024 at 08:51:51AM -0700, Nick Desaulniers wrote: > > On Thu, Oct 3, 2024 at 8:42 AM Peter Zijlstra wrote: > > > > > > On Wed, Oct 02, 2024 at 04:34:00PM -0700, Rong Xu wrote: > > > > +6) Rebuild the kernel using the AutoFDO

Re: [PATCH v2 1/6] Add AutoFDO support for Clang build

2024-10-03 Thread Peter Zijlstra
On Thu, Oct 03, 2024 at 09:11:34AM -0700, Nick Desaulniers wrote: > > It makes it absolute crap for all of us who 'render' text documents > > using less or vi. > > "It hurts when I punch myself in the face." Weirdly enough I have a job that entails staring at text documents in text editors all d

Re: [PATCH v13 18/40] arm64/hwcap: Add hwcap for GCS

2024-10-03 Thread Yury Khrustalev
On Tue, Oct 01, 2024 at 11:58:57PM +0100, Mark Brown wrote: > Provide a hwcap to enable userspace to detect support for GCS. > > Signed-off-by: Mark Brown > #define HWCAP_PACA (1 << 30) > #define HWCAP_PACG (1UL << 31) > +#define HWCAP_GCS(1UL << 32) > Acked-by:

Re: [PATCH v2 3/6] Change the symbols order when --ffuntion-sections is enabled

2024-10-03 Thread Rong Xu
In principle, I don't see a problem using the new order unconditionally. This new ordering of sections (.text.unlikely, .text.hot, then .text) differs from the typical user-space ordering when no link-script is used. Usually, the order is .text, .text.hot, and then .text.unlikely (when -z keep-tex

Re: [PATCH v2 1/6] Add AutoFDO support for Clang build

2024-10-03 Thread Rong Xu
Writing the doc with all these code-blocks was not fun either. We are happy to change if there is a better way for this. -Rong On Thu, Oct 3, 2024 at 9:13 AM Peter Zijlstra wrote: > > On Thu, Oct 03, 2024 at 09:11:34AM -0700, Nick Desaulniers wrote: > > > > It makes it absolute crap for all of u