Re: [PATCH v3 10/10] perf/x86/rapl: Add per-core energy counter support for AMD CPUs

2024-06-26 Thread Zhang, Rui
Hi, Dhananjay > > > > > [...] > > > > > @@ -685,6 +774,13 @@ static void __init rapl_advertise(void) > > > rapl_pkg_domain_names[i], > > > rapl_hw_unit[i]); > > > } > > > } > > > + > > > +   for (i = 0; i < NR_RAPL_CORE_DOMAINS; i++) {

Re: [PATCH] randomize_kstack: Remove non-functional per-arch entropy filtering

2024-06-26 Thread Kees Cook
On Fri, Jun 21, 2024 at 12:08:42PM +0100, Mark Rutland wrote: > On Thu, Jun 20, 2024 at 11:34:22AM -0700, Kees Cook wrote: > > On Thu, Jun 20, 2024 at 11:47:58AM +0800, liuyuntao (F) wrote: > > > > > > > > > On 2024/6/20 5:47, Kees Cook wrote: > > > > An unintended consequence of commit 9c573cd31

[PATCH v2] mfd: omap-usb-tll: use struct_size to allocate tll

2024-06-26 Thread Javier Carrasco
Commit 16c2004d9e4d ("mfd: omap-usb-tll: Allocate driver data at once") changed the memory allocation of 'tll' to consolidate it into a single allocation, introducing an incorrect size calculation. In particular, the allocation for the array of pointers was converted into a single-pointer allocati

Re: [PATCH v3] x86/traps: Enable UBSAN traps on x86

2024-06-26 Thread Kees Cook
On Tue, Jun 25, 2024 at 11:37:19AM +0200, Peter Zijlstra wrote: > Also, wouldn't it be saner to write this something like: > > __always_inline int decode_bug(unsigned long addr, u32 *imm) > { > u8 v; > > if (addr < TASK_SIZE) > return BUG_NONE; > > v = *(u8 *)(add

Re: [PATCH 2/2] mfd: omap-usb-tll: use struct_size to allocate tll

2024-06-26 Thread Javier Carrasco
On 26/06/2024 20:43, Kees Cook wrote: > On Thu, Jun 20, 2024 at 11:22:34PM +0200, Javier Carrasco wrote: >> Use the struct_size macro to calculate the size of the tll, which >> includes a trailing flexible array. >> >> Signed-off-by: Javier Carrasco >> >> --- > > I would actually include this ent

Re: [PATCH 2/2] mfd: omap-usb-tll: use struct_size to allocate tll

2024-06-26 Thread Kees Cook
On Thu, Jun 20, 2024 at 11:22:34PM +0200, Javier Carrasco wrote: > Use the struct_size macro to calculate the size of the tll, which > includes a trailing flexible array. > > Signed-off-by: Javier Carrasco > > --- I would actually include this entire bit below in the main commit log. It's the c

Re: [PATCH 2/2] mfd: omap-usb-tll: use struct_size to allocate tll

2024-06-26 Thread Jann Horn
On Thu, Jun 20, 2024 at 11:23 PM Javier Carrasco wrote: > > Use the struct_size macro to calculate the size of the tll, which > includes a trailing flexible array. > > Signed-off-by: Javier Carrasco > > --- > The memory allocation used to be carried out in two steps: > > tll = devm_kzalloc(dev, s

Re: [PATCH 2/2] mfd: omap-usb-tll: use struct_size to allocate tll

2024-06-26 Thread Javier Carrasco
On 26/06/2024 17:26, Lee Jones wrote: > On Thu, 20 Jun 2024, Javier Carrasco wrote: > >> Use the struct_size macro to calculate the size of the tll, which >> includes a trailing flexible array. >> >> Signed-off-by: Javier Carrasco >> >> --- >> The memory allocation used to be carried out in two s

Re: [PATCH] nvmet-fc: Remove __counted_by from nvmet_fc_tgt_queue.fod[]

2024-06-26 Thread Nathan Chancellor
On Wed, Jun 26, 2024 at 11:19:24AM -0600, Keith Busch wrote: > On Wed, Jun 26, 2024 at 10:06:05AM -0700, Nathan Chancellor wrote: > > Ping? This is still relevant and I don't think this is a compiler bug > > that would justify withholding this change. > > Sorry, I misunderstood the discussion to "

Re: [PATCH] nvmet-fc: Remove __counted_by from nvmet_fc_tgt_queue.fod[]

2024-06-26 Thread Keith Busch
On Wed, Jun 26, 2024 at 10:06:05AM -0700, Nathan Chancellor wrote: > Ping? This is still relevant and I don't think this is a compiler bug > that would justify withholding this change. Sorry, I misunderstood the discussion to "wait" on this. Queued up in nvme-6.10 now.

Re: [PATCH] nvmet-fc: Remove __counted_by from nvmet_fc_tgt_queue.fod[]

2024-06-26 Thread Nathan Chancellor
Ping? This is still relevant and I don't think this is a compiler bug that would justify withholding this change. On Wed, May 29, 2024 at 02:42:40PM -0700, Nathan Chancellor wrote: > Work for __counted_by on generic pointers in structures (not just > flexible array members) has started landing in

Re: [PATCH v3 10/10] perf/x86/rapl: Add per-core energy counter support for AMD CPUs

2024-06-26 Thread Dhananjay Ugwekar
Hello Rui, On 6/26/2024 8:48 PM, Zhang, Rui wrote: > >> @@ -131,8 +146,10 @@ enum rapl_unit_quirk { >>  }; >>   >>  struct rapl_model { >> -   struct perf_msr *rapl_msrs; >> +   struct perf_msr *rapl_pkg_msrs; > > IMO, this should be part of patch 8/10. Makes sense, better to move all t

Re: (subset) [PATCH v5 0/3] Add sy7802 flash led driver

2024-06-26 Thread Lee Jones
On Mon, 24 Jun 2024 23:25:11 +0200, André Apitzsch wrote: > This series introduces a driver for the Silergy SY7802 charge pump used > in the BQ Aquaris M5 and X5 smartphones. > > The implementation is based on information extracted from downstream as > the datasheet provided by a distributor of th

Re: [PATCH 0/3] parport: Cleanup some pre-devmodel code

2024-06-26 Thread Dr. David Alan Gilbert
* Dr. David Alan Gilbert (li...@treblig.org) wrote: > * Dr. David Alan Gilbert (d...@treblig.org) wrote: > > * li...@treblig.org (li...@treblig.org) wrote: > > > From: "Dr. David Alan Gilbert" > > > > > > There are some remenants of the pre-devmodel code > > > still in the parport drivers; try an

Re: [PATCH v3 02/10] perf/x86/rapl: Fix the energy-pkg event for AMD CPUs

2024-06-26 Thread Dhananjay Ugwekar
Hi Rui, On 6/26/2024 7:48 PM, Zhang, Rui wrote: > On Mon, 2024-06-24 at 05:58 +, Dhananjay Ugwekar wrote: >> After commit ("x86/cpu/topology: Add support for the AMD 0x8026 >> leaf"), >> on AMD processors that support extended CPUID leaf 0x8026, the >> topology_die_cpumask() and topolo

Re: (subset) [PATCH 1/2] mfd: omap-usb-tll: annotate struct usbtll_omap with __counted_by

2024-06-26 Thread Lee Jones
On Thu, 20 Jun 2024 23:22:33 +0200, Javier Carrasco wrote: > Use the __counted_by compiler attribute for the "struct clk *ch_clk[]" > flexible array member to improve the results of array bound sanitizers. > > The comments for the variables are no longer needed as it is now clear > what is what. >

Re: [PATCH 2/2] mfd: omap-usb-tll: use struct_size to allocate tll

2024-06-26 Thread Lee Jones
On Thu, 20 Jun 2024, Javier Carrasco wrote: > Use the struct_size macro to calculate the size of the tll, which > includes a trailing flexible array. > > Signed-off-by: Javier Carrasco > > --- > The memory allocation used to be carried out in two steps: > > tll = devm_kzalloc(dev, sizeof(struc

Re: [PATCH v3 10/10] perf/x86/rapl: Add per-core energy counter support for AMD CPUs

2024-06-26 Thread Zhang, Rui
> @@ -131,8 +146,10 @@ enum rapl_unit_quirk { >  }; >   >  struct rapl_model { > -   struct perf_msr *rapl_msrs; > +   struct perf_msr *rapl_pkg_msrs; IMO, this should be part of patch 8/10. [...] > @@ -685,6 +774,13 @@ static void __init rapl_advertise(void) >  

Re: [PATCH v3 01/10] x86/topology: Introduce topology_logical_core_id()

2024-06-26 Thread Zhang, Rui
> For use cases such as the per-core RAPL PMU, > there exists a need for a unique core ID across the entire system > with > multiple PKG domains. Agreed. And there are other cases that a system unique core ID is needed, like in drivers/hwmon/coretemp.c, where per-core temperature info is saved in

Re: [PATCH v3 02/10] perf/x86/rapl: Fix the energy-pkg event for AMD CPUs

2024-06-26 Thread Zhang, Rui
On Mon, 2024-06-24 at 05:58 +, Dhananjay Ugwekar wrote: > After commit ("x86/cpu/topology: Add support for the AMD 0x8026 > leaf"), > on AMD processors that support extended CPUID leaf 0x8026, the > topology_die_cpumask() and topology_logical_die_id() macros, no > longer > return the pa