LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 07/14] ASoC: fsl: mpc5200_psc_i2s: avoid kernel-doc warnings
From: Randy Dunlap @ 2026-07-14  1:44 UTC (permalink / raw)
  To: linux-sound
  Cc: Randy Dunlap, Jaroslav Kysela, Takashi Iwai, Shengjiu Wang,
	Xiubo Li, Fabio Estevam, Nicolin Chen, linuxppc-dev,
	Charles Keepax, Maciej Strozek, Bard Liao, Pierre-Louis Bossart,
	patches, Srinivas Kandagatla, linux-arm-msm, Liam Girdwood,
	Mark Brown
In-Reply-To: <20260714014445.569992-1-rdunlap@infradead.org>

Add missing kernel-doc for function parameters.
Use kernel-doc format for function return value descriptions.
Use the "var" keyword to describe a data definition.

These changes avoid all kernel-doc warnings in this file:

Warning: ../sound/soc/fsl/mpc5200_psc_i2s.c:123 cannot understand function prototype: 'const struct snd_soc_dai_ops psc_i2s_dai_ops ='
Warning: sound/soc/fsl/mpc5200_psc_i2s.c:87 function parameter 'cpu_dai' not described in 'psc_i2s_set_sysclk'
Warning: sound/soc/fsl/mpc5200_psc_i2s.c:87 No description found for return value of 'psc_i2s_set_sysclk'
Warning: sound/soc/fsl/mpc5200_psc_i2s.c:106 function parameter 'cpu_dai' not described in 'psc_i2s_set_fmt'
Warning: sound/soc/fsl/mpc5200_psc_i2s.c:106 No description found for return value of 'psc_i2s_set_fmt'
Warning: sound/soc/fsl/mpc5200_psc_i2s.c:123 cannot understand function prototype: 'const struct snd_soc_dai_ops psc_i2s_dai_ops ='

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
---
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Shengjiu Wang <shengjiu.wang@gmail.com>
Cc: Xiubo Li <Xiubo.Lee@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Nicolin Chen <nicoleotsuka@gmail.com>
Cc: linuxppc-dev@lists.ozlabs.org

 sound/soc/fsl/mpc5200_psc_i2s.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

--- linext-2026-0710.orig/sound/soc/fsl/mpc5200_psc_i2s.c
+++ linext-2026-0710/sound/soc/fsl/mpc5200_psc_i2s.c
@@ -79,9 +79,12 @@ static int psc_i2s_hw_params(struct snd_
  * and we don't care about the frequency.  Return an error if the direction
  * is not SND_SOC_CLOCK_IN.
  *
+ * @cpu_dai: DAI runtime data pointer
  * @clk_id: reserved, should be zero
  * @freq: the frequency of the given clock ID, currently ignored
  * @dir: SND_SOC_CLOCK_IN (clock slave) or SND_SOC_CLOCK_OUT (clock master)
+ *
+ * Returns: %0 on success or %-EINVAL on failure.
  */
 static int psc_i2s_set_sysclk(struct snd_soc_dai *cpu_dai,
 			      int clk_id, unsigned int freq, int dir)
@@ -101,7 +104,10 @@ static int psc_i2s_set_sysclk(struct snd
  * This driver only supports I2S mode.  Return an error if the format is
  * not SND_SOC_DAIFMT_I2S.
  *
+ * @cpu_dai: DAI runtime data pointer
  * @format: one of SND_SOC_DAIFMT_xxx
+ *
+ * Returns: %0 on success or %-EINVAL on failure.
  */
 static int psc_i2s_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int format)
 {
@@ -119,7 +125,7 @@ static int psc_i2s_set_fmt(struct snd_so
  */
 
 /**
- * psc_i2s_dai_template: template CPU Digital Audio Interface
+ * var psc_i2s_dai_ops - template CPU Digital Audio Interface
  */
 static const struct snd_soc_dai_ops psc_i2s_dai_ops = {
 	.hw_params	= psc_i2s_hw_params,


^ permalink raw reply

* [PATCH 04/14] ASoC: fsl-dma: fix all kernel-doc warnings
From: Randy Dunlap @ 2026-07-14  1:44 UTC (permalink / raw)
  To: linux-sound
  Cc: Randy Dunlap, Jaroslav Kysela, Takashi Iwai, Shengjiu Wang,
	Xiubo Li, Fabio Estevam, Nicolin Chen, linuxppc-dev,
	Charles Keepax, Maciej Strozek, Bard Liao, Pierre-Louis Bossart,
	patches, Srinivas Kandagatla, linux-arm-msm, Liam Girdwood,
	Mark Brown
In-Reply-To: <20260714014445.569992-1-rdunlap@infradead.org>

Don't use "/**" for non-kernel-doc comments to avoid kernel-doc warnings:

Warning: ../sound/soc/fsl/fsl_dma.h:95 This comment starts with '/**', but isn't a kernel-doc comment.
 *  List Descriptor for extended chaining mode DMA operations.
Warning: ../sound/soc/fsl/fsl_dma.h:110 This comment starts with '/**', but isn't a kernel-doc comment.
 *  Link Descriptor for basic and extended chaining mode DMA operations.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
---
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Shengjiu Wang <shengjiu.wang@gmail.com>
Cc: Xiubo Li <Xiubo.Lee@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Nicolin Chen <nicoleotsuka@gmail.com>
Cc: linuxppc-dev@lists.ozlabs.org

 sound/soc/fsl/fsl_dma.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- linext-2026-0710.orig/sound/soc/fsl/fsl_dma.h
+++ linext-2026-0710/sound/soc/fsl/fsl_dma.h
@@ -92,7 +92,7 @@ static inline u32 CCSR_DMA_ECLNDAR_ADDR(
 #define CCSR_DMA_ATR_SNOOP      	0x00050000
 #define CCSR_DMA_ATR_ESAD_MASK  	0x0000000F
 
-/**
+/*
  *  List Descriptor for extended chaining mode DMA operations.
  *
  *  The CLSDAR register points to the first (in a linked-list) List
@@ -107,7 +107,7 @@ struct fsl_dma_list_descriptor {
 	u8 res[8];      	/* Reserved */
 } __attribute__ ((aligned(32), packed));
 
-/**
+/*
  *  Link Descriptor for basic and extended chaining mode DMA operations.
  *
  *  A Link Descriptor points to a single DMA buffer.  Each link descriptor


^ permalink raw reply

* [PATCH 09/14] ASoC: uniphier: don't use "/**" for non-kernel-doc comment
From: Randy Dunlap @ 2026-07-14  1:44 UTC (permalink / raw)
  To: linux-sound
  Cc: Randy Dunlap, Jaroslav Kysela, Takashi Iwai, Shengjiu Wang,
	Xiubo Li, Fabio Estevam, Nicolin Chen, linuxppc-dev,
	Charles Keepax, Maciej Strozek, Bard Liao, Pierre-Louis Bossart,
	patches, Srinivas Kandagatla, linux-arm-msm, Liam Girdwood,
	Mark Brown
In-Reply-To: <20260714014445.569992-1-rdunlap@infradead.org>

Use a C-style "/*" comment to avoid multiple kernel-doc warnings:

Warning: ../sound/soc/uniphier/aio.h:159 Cannot find identifier on line:
 * 'SoftWare MAPping' setting of UniPhier AIO registers.
Warning: ../sound/soc/uniphier/aio.h:160 Cannot find identifier on line: *
Warning: ../sound/soc/uniphier/aio.h:161 This comment starts with '/**', but isn't a kernel-doc comment.
 * We have to setup 'virtual' register maps to access 'real' registers of AIO.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
---
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>

 sound/soc/uniphier/aio.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linext-2026-0710.orig/sound/soc/uniphier/aio.h
+++ linext-2026-0710/sound/soc/uniphier/aio.h
@@ -156,7 +156,7 @@ struct uniphier_aio_selector {
 	int hw;
 };
 
-/**
+/*
  * 'SoftWare MAPping' setting of UniPhier AIO registers.
  *
  * We have to setup 'virtual' register maps to access 'real' registers of AIO.


^ permalink raw reply

* [PATCH 14/14] ASoC: wm8904: don't use "/**" for non-kernel-doc comments
From: Randy Dunlap @ 2026-07-14  1:44 UTC (permalink / raw)
  To: linux-sound
  Cc: Randy Dunlap, Jaroslav Kysela, Takashi Iwai, Shengjiu Wang,
	Xiubo Li, Fabio Estevam, Nicolin Chen, linuxppc-dev,
	Charles Keepax, Maciej Strozek, Bard Liao, Pierre-Louis Bossart,
	patches, Srinivas Kandagatla, linux-arm-msm, Liam Girdwood,
	Mark Brown
In-Reply-To: <20260714014445.569992-1-rdunlap@infradead.org>

Modify these errant comments to use "/*" since they are not kernel-doc
comments.

Warning: include/sound/wm8904.h:119 This comment starts with '/**', but isn't a kernel-doc comment.
 * DRC configurations are specified with a label and a set of register
Warning: ../include/sound/wm8904.h:134 This comment starts with '/**', but isn't a kernel-doc comment.
 * ReTune Mobile configurations are specified with a label, sample

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
---
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>

 include/sound/wm8904.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- linext-2026-0710.orig/include/sound/wm8904.h
+++ linext-2026-0710/include/sound/wm8904.h
@@ -116,7 +116,7 @@
 #define WM8904_DRC_REGS  4
 #define WM8904_EQ_REGS   24
 
-/**
+/*
  * DRC configurations are specified with a label and a set of register
  * values to write (the enable bits will be ignored).  At runtime an
  * enumerated control will be presented for each DRC block allowing
@@ -131,7 +131,7 @@ struct wm8904_drc_cfg {
 	u16 regs[WM8904_DRC_REGS];
 };
 
-/**
+/*
  * ReTune Mobile configurations are specified with a label, sample
  * rate and set of values to write (the enable bits will be ignored).
  *


^ permalink raw reply

* [PATCH 00/14] ASoC: clean up kernel-doc warnings
From: Randy Dunlap @ 2026-07-14  1:44 UTC (permalink / raw)
  To: linux-sound
  Cc: Randy Dunlap, Jaroslav Kysela, Takashi Iwai, Shengjiu Wang,
	Xiubo Li, Fabio Estevam, Nicolin Chen, linuxppc-dev,
	Charles Keepax, Maciej Strozek, Bard Liao, Pierre-Louis Bossart,
	patches, Srinivas Kandagatla, linux-arm-msm

Clean up a bunch of kernel-doc warnings in the ASoC code.

[PATCH 01/14] ASoC: codecs: NeoFidelity: repair the kernel-doc format
[PATCH 02/14] ASoC: fsl_asrc_common: fix all kernel-doc warnings
[PATCH 03/14] ASoC: fsl_asrc: avoid kernel-doc warnings
[PATCH 04/14] ASoC: fsl-dma: fix all kernel-doc warnings
[PATCH 05/14] ASoC: fsl_easrc: use struct keyword on structs
[PATCH 06/14] ASoC: fsl: mpc5200_dma: use the struct keyword for kernel-doc comments
[PATCH 07/14] ASoC: fsl: mpc5200_psc_i2s: avoid kernel-doc warnings
[PATCH 08/14] ASoC: fsl: p1022_ds: repair kernel-doc short descriptions
[PATCH 09/14] ASoC: uniphier: don't use "/**" for non-kernel-doc comment
[PATCH 10/14] ASoC: SDCA: correct enum names and add a missing struct field
[PATCH 11/14] ASoC: soc-acpi: fix all kernel-doc warnings
[PATCH 12/14] ASoC: Intel: Skylake: convert SKL_TKNS to kernel-doc format
[PATCH 13/14] ASoC: qcom: audioreach: use C-style "/*" comment
[PATCH 14/14] ASoC: wm8904: don't use "/**" for non-kernel-doc comments

 include/sound/sdca_function.h       |    6 
 include/sound/soc-acpi.h            |   23 +--
 include/sound/wm8904.h              |    4 
 include/uapi/sound/snd_ar_tokens.h  |    2 
 include/uapi/sound/snd_sst_tokens.h |  165 +++++++++++++-------------
 sound/soc/codecs/ntpfw.h            |   11 -
 sound/soc/fsl/fsl_asrc.h            |    6 
 sound/soc/fsl/fsl_asrc_common.h     |    8 -
 sound/soc/fsl/fsl_dma.h             |    4 
 sound/soc/fsl/fsl_easrc.h           |    4 
 sound/soc/fsl/mpc5200_dma.h         |    4 
 sound/soc/fsl/mpc5200_psc_i2s.c     |    8 +
 sound/soc/fsl/p1022_ds.c            |    4 
 sound/soc/uniphier/aio.h            |    2 
 14 files changed, 136 insertions(+), 115 deletions(-)

Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Shengjiu Wang <shengjiu.wang@gmail.com>
Cc: Xiubo Li <Xiubo.Lee@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Nicolin Chen <nicoleotsuka@gmail.com>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: Maciej Strozek <mstrozek@opensource.cirrus.com>
Cc: Bard Liao <yung-chuan.liao@linux.intel.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Cc: patches@opensource.cirrus.com
Cc: Srinivas Kandagatla <srini@kernel.org>
Cc: linux-arm-msm@vger.kernel.org


^ permalink raw reply

* [PATCH 11/14] ASoC: soc-acpi: fix all kernel-doc warnings
From: Randy Dunlap @ 2026-07-14  1:44 UTC (permalink / raw)
  To: linux-sound
  Cc: Randy Dunlap, Jaroslav Kysela, Takashi Iwai, Shengjiu Wang,
	Xiubo Li, Fabio Estevam, Nicolin Chen, linuxppc-dev,
	Charles Keepax, Maciej Strozek, Bard Liao, Pierre-Louis Bossart,
	patches, Srinivas Kandagatla, linux-arm-msm, Liam Girdwood,
	Mark Brown
In-Reply-To: <20260714014445.569992-1-rdunlap@infradead.org>

Add missing "struct" keyword to kernel-doc for structs.
Describe @mach_params in struct snd_soc_acpi_mach.
Don't document callback parameters with '@' as though they are kernel-doc.

These changes avoid all kernel-doc warnings in this header file.

Examples:
Warning: ../include/sound/soc-acpi.h:77 cannot understand function prototype: 'struct snd_soc_acpi_mach_params'
Warning: ../include/sound/soc-acpi.h:101 cannot understand function prototype: 'struct snd_soc_acpi_endpoint'
Warning: ../include/sound/soc-acpi.h:115 cannot understand function prototype: 'struct snd_soc_acpi_adr_device'
Warning: ../include/sound/soc-acpi.h:132 cannot understand function prototype: 'struct snd_soc_acpi_link_adr'
Warning: ../include/sound/soc-acpi.h:209 cannot understand function prototype: 'struct snd_soc_acpi_mach'

Warning: include/sound/soc-acpi.h:230 struct member 'mach_params' not described in 'snd_soc_acpi_mach'
Warning: include/sound/soc-acpi.h:230 Excess struct member 'card' description in 'snd_soc_acpi_mach'
Warning: include/sound/soc-acpi.h:230 Excess struct member 'mach' description in 'snd_soc_acpi_mach'

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
---
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>

 include/sound/soc-acpi.h |   23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

--- linext-2026-0710.orig/include/sound/soc-acpi.h
+++ linext-2026-0710/include/sound/soc-acpi.h
@@ -57,7 +57,7 @@ static inline struct snd_soc_acpi_mach *
 #endif
 
 /**
- * snd_soc_acpi_mach_params: interface for machine driver configuration
+ * struct snd_soc_acpi_mach_params - interface for machine driver configuration
  *
  * @acpi_ipc_irq_index: used for BYT-CR detection
  * @platform: string used for HDAudio codec support
@@ -93,7 +93,7 @@ struct snd_soc_acpi_mach_params {
 };
 
 /**
- * snd_soc_acpi_endpoint - endpoint descriptor
+ * struct snd_soc_acpi_endpoint - endpoint descriptor
  * @num: endpoint number (mandatory, unique per device)
  * @aggregated: 0 (independent) or 1 (logically grouped)
  * @group_position: zero-based order (only when @aggregated is 1)
@@ -107,7 +107,7 @@ struct snd_soc_acpi_endpoint {
 };
 
 /**
- * snd_soc_acpi_adr_device - descriptor for _ADR-enumerated device
+ * struct snd_soc_acpi_adr_device - descriptor for _ADR-enumerated device
  * @adr: 64 bit ACPI _ADR value
  * @num_endpoints: number of endpoints for this device
  * @endpoints: array of endpoints
@@ -121,7 +121,7 @@ struct snd_soc_acpi_adr_device {
 };
 
 /**
- * snd_soc_acpi_link_adr - ACPI-based list of _ADR enumerated devices
+ * struct snd_soc_acpi_link_adr - ACPI-based list of _ADR enumerated devices
  * @mask: one bit set indicates the link this list applies to
  * @num_adr: ARRAY_SIZE of devices
  * @adr_d: array of devices
@@ -167,8 +167,8 @@ struct snd_soc_acpi_link_adr {
 #define SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME BIT(4)
 
 /**
- * snd_soc_acpi_mach: ACPI-based machine descriptor. Most of the fields are
- * related to the hardware, except for the firmware and topology file names.
+ * struct snd_soc_acpi_mach - ACPI-based machine descriptor. Most of the fields
+ * are related to the hardware, except for the firmware and topology file names.
  * A platform supported by legacy and Sound Open Firmware (SOF) would expose
  * all firmware/topology related fields.
  *
@@ -192,6 +192,7 @@ struct snd_soc_acpi_link_adr {
  * the initial selection in the snd_soc_acpi_mach table.
  * @pdata: intended for platform data or machine specific-ops. This structure
  *  is not constant since this field may be updated at run-time
+ * @mach_params: machine driver configuration
  * @sof_tplg_filename: Sound Open Firmware topology file name, if enabled
  * @tplg_quirk_mask: quirks to select different topology files dynamically
  * @get_function_tplg_files: This is an optional callback, if specified then instead of
@@ -199,11 +200,11 @@ struct snd_soc_acpi_link_adr {
  *	files to be loaded.
  *	Return value: The number of the files or negative ERRNO. 0 means that the single topology
  *		      file should be used, no function topology split can be used on the machine.
- *	@card: the pointer of the card
- *	@mach: the pointer of the machine driver
- *	@prefix: the prefix of the topology file name. Typically, it is the path.
- *	@tplg_files: the pointer of the array of the topology file names.
- *	@best_effort: ignore non supported links and try to build the card in best effort
+ *	card: the pointer of the card
+ *	mach: the pointer of the machine driver
+ *	prefix: the prefix of the topology file name. Typically, it is the path.
+ *	tplg_files: the pointer of the array of the topology file names.
+ *	best_effort: ignore non supported links and try to build the card in best effort
  *		      with supported links
  */
 /* Descriptor for SST ASoC machine driver */


^ permalink raw reply

* [PATCH 10/14] ASoC: SDCA: correct enum names and add a missing struct field
From: Randy Dunlap @ 2026-07-14  1:44 UTC (permalink / raw)
  To: linux-sound
  Cc: Randy Dunlap, Jaroslav Kysela, Takashi Iwai, Shengjiu Wang,
	Xiubo Li, Fabio Estevam, Nicolin Chen, linuxppc-dev,
	Charles Keepax, Maciej Strozek, Bard Liao, Pierre-Louis Bossart,
	patches, Srinivas Kandagatla, linux-arm-msm, Liam Girdwood,
	Mark Brown
In-Reply-To: <20260714014445.569992-1-rdunlap@infradead.org>

Add a kernel-doc comment for @is_volatile in struct sdca_control.
Correct 2 malformed enum names to match the enums.
Fixes 3 warnings:

Warning: include/sound/sdca_function.h:306 expecting prototype for enum sdca_set_index_range. Prototype was for enum sdca_fdl_set_index_range instead

Warning: include/sound/sdca_function.h:829 struct member 'is_volatile' not described in 'sdca_control'

Warning: include/sound/sdca_function.h:1152 expecting prototype for enum sdca_xu_reset_machanism. Prototype was for enum sdca_xu_reset_mechanism instead

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
---
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: Maciej Strozek <mstrozek@opensource.cirrus.com>
Cc: Bard Liao <yung-chuan.liao@linux.intel.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Cc: patches@opensource.cirrus.com

 include/sound/sdca_function.h |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- linext-2026-0710.orig/include/sound/sdca_function.h
+++ linext-2026-0710/include/sound/sdca_function.h
@@ -298,7 +298,7 @@ enum sdca_xu_controls {
 };
 
 /**
- * enum sdca_set_index_range - Column definitions UMP SetIndex
+ * enum sdca_fdl_set_index_range - Column definitions UMP SetIndex
  */
 enum sdca_fdl_set_index_range {
 	SDCA_FDL_SET_INDEX_SET_NUMBER			= 0,
@@ -803,6 +803,8 @@ struct sdca_control_range {
  * @mode: Access mode of the Control.
  * @layers: Bitmask of access layers of the Control.
  * @deferrable: Indicates if the access to the Control can be deferred.
+ * @is_volatile: Indicates the Control registers are forced to be treated
+ *  as volatile.
  * @has_default: Indicates the Control has a default value to be written.
  * @has_reset: Indicates the Control has a defined reset value.
  * @has_fixed: Indicates the Control only supports a single value.
@@ -1144,7 +1146,7 @@ struct sdca_entity_hide {
 };
 
 /**
- * enum sdca_xu_reset_machanism - SDCA FDL Resets
+ * enum sdca_xu_reset_mechanism - SDCA FDL Resets
  */
 enum sdca_xu_reset_mechanism {
 	SDCA_XU_RESET_FUNCTION				= 0x0,


^ permalink raw reply

* [PATCH 12/14] ASoC: Intel: Skylake: convert SKL_TKNS to kernel-doc format
From: Randy Dunlap @ 2026-07-14  1:44 UTC (permalink / raw)
  To: linux-sound
  Cc: Randy Dunlap, Jaroslav Kysela, Takashi Iwai, Shengjiu Wang,
	Xiubo Li, Fabio Estevam, Nicolin Chen, linuxppc-dev,
	Charles Keepax, Maciej Strozek, Bard Liao, Pierre-Louis Bossart,
	patches, Srinivas Kandagatla, linux-arm-msm, Liam Girdwood,
	Mark Brown
In-Reply-To: <20260714014445.569992-1-rdunlap@infradead.org>

Convert enum SKL_TKNS to kernel-doc format:
- use '@' instead of '%' for enum items
- add missing enum values
- correct a few enum names in the comments
- remove the comment for %SKL_TKN_U16_PIN_INST_ID since it is undefined
- fix a few typos

Warning: include/uapi/sound/snd_sst_tokens.h:11 Cannot find identifier on line:
 * %SKL_TKN_UUID:               Module UUID
Warning: ../include/uapi/sound/snd_sst_tokens.h:12 Cannot find identifier on line: *
Warning: ../include/uapi/sound/snd_sst_tokens.h:13 Cannot find identifier on line:
 * %SKL_TKN_U8_BLOCK_TYPE:      Type of the private data block.Can be:
Warning: include/uapi/sound/snd_sst_tokens.h:14 This comment starts with '/**', but isn't a kernel-doc comment.
 *                              tuples, bytes, short and words

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
---
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>

 include/uapi/sound/snd_sst_tokens.h |  165 +++++++++++++-------------
 1 file changed, 87 insertions(+), 78 deletions(-)

--- linext-2026-0710.orig/include/uapi/sound/snd_sst_tokens.h
+++ linext-2026-0710/include/uapi/sound/snd_sst_tokens.h
@@ -9,43 +9,47 @@
 #define __SND_SST_TOKENS_H__
 
 /**
- * %SKL_TKN_UUID:               Module UUID
+ * enum SKL_TKNS - SST tokens definitions
  *
- * %SKL_TKN_U8_BLOCK_TYPE:      Type of the private data block.Can be:
+ * @SKL_TKN_UUID:               Module UUID
+ *
+ * @SKL_TKN_U8_BLOCK_TYPE:      Type of the private data block.Can be:
  *                              tuples, bytes, short and words
  *
- * %SKL_TKN_U8_IN_PIN_TYPE:     Input pin type,
+ * @SKL_TKN_U8_NUM_BLOCKS:      FIXME
+ *
+ * @SKL_TKN_U8_IN_PIN_TYPE:     Input pin type,
  *                              homogenous=0, heterogenous=1
  *
- * %SKL_TKN_U8_OUT_PIN_TYPE:    Output pin type,
+ * @SKL_TKN_U8_OUT_PIN_TYPE:    Output pin type,
  *                              homogenous=0, heterogenous=1
- * %SKL_TKN_U8_DYN_IN_PIN:      Configure Input pin dynamically
+ * @SKL_TKN_U8_DYN_IN_PIN:      Configure Input pin dynamically
  *                              if true
  *
- * %SKL_TKN_U8_DYN_OUT_PIN:     Configure Output pin dynamically
+ * @SKL_TKN_U8_DYN_OUT_PIN:     Configure Output pin dynamically
  *                              if true
  *
- * %SKL_TKN_U8_IN_QUEUE_COUNT:  Store the number of Input pins
+ * @SKL_TKN_U8_IN_QUEUE_COUNT:  Store the number of Input pins
  *
- * %SKL_TKN_U8_OUT_QUEUE_COUNT: Store the number of Output pins
+ * @SKL_TKN_U8_OUT_QUEUE_COUNT: Store the number of Output pins
  *
- * %SKL_TKN_U8_TIME_SLOT:       TDM slot number
+ * @SKL_TKN_U8_TIME_SLOT:       TDM slot number
  *
- * %SKL_TKN_U8_CORE_ID:         Stores module affinity value.Can take
+ * @SKL_TKN_U8_CORE_ID:         Stores module affinity value. Can take
  *                              the values:
  *                              SKL_AFFINITY_CORE_0 = 0,
  *                              SKL_AFFINITY_CORE_1,
  *                              SKL_AFFINITY_CORE_MAX
  *
- * %SKL_TKN_U8_MOD_TYPE:        Module type value.
+ * @SKL_TKN_U8_MOD_TYPE:        Module type value.
  *
- * %SKL_TKN_U8_CONN_TYPE:       Module connection type can be a FE,
+ * @SKL_TKN_U8_CONN_TYPE:       Module connection type can be a FE,
  *                              BE or NONE as defined :
  *                              SKL_PIPE_CONN_TYPE_NONE = 0,
  *                              SKL_PIPE_CONN_TYPE_FE = 1 (HOST_DMA)
  *                              SKL_PIPE_CONN_TYPE_BE = 2 (LINK_DMA)
  *
- * %SKL_TKN_U8_DEV_TYPE:        Type of device to which the module is
+ * @SKL_TKN_U8_DEV_TYPE:        Type of device to which the module is
  *                              connected
  *                              Can take the values:
  *                              SKL_DEVICE_BT = 0x0,
@@ -56,43 +60,43 @@
  *                              SKL_DEVICE_HDAHOST = 0x5,
  *                              SKL_DEVICE_NONE
  *
- * %SKL_TKN_U8_HW_CONN_TYPE:    Connection type of the HW to which the
+ * @SKL_TKN_U8_HW_CONN_TYPE:    Connection type of the HW to which the
  *                              module is connected
  *                              SKL_CONN_NONE = 0,
  *                              SKL_CONN_SOURCE = 1,
  *                              SKL_CONN_SINK = 2
  *
- * %SKL_TKN_U16_PIN_INST_ID:    Stores the pin instance id
+ * @SKL_TKN_U16_MOD_INST_ID:    Stores the module instance id
  *
- * %SKL_TKN_U16_MOD_INST_ID:    Stores the mdule instance id
+ * @SKL_TKN_U16_BLOCK_SIZE:     FIXME
  *
- * %SKL_TKN_U32_MAX_MCPS:       Module max mcps value
+ * @SKL_TKN_U32_MAX_MCPS:       Module max mcps value
  *
- * %SKL_TKN_U32_MEM_PAGES:      Module resource pages
+ * @SKL_TKN_U32_MEM_PAGES:      Module resource pages
  *
- * %SKL_TKN_U32_OBS:            Stores Output Buffer size
+ * @SKL_TKN_U32_OBS:            Stores Output Buffer size
  *
- * %SKL_TKN_U32_IBS:            Stores input buffer size
+ * @SKL_TKN_U32_IBS:            Stores input buffer size
  *
- * %SKL_TKN_U32_VBUS_ID:        Module VBUS_ID. PDM=0, SSP0=0,
+ * @SKL_TKN_U32_VBUS_ID:        Module VBUS_ID. PDM=0, SSP0=0,
  *                              SSP1=1,SSP2=2,
  *                              SSP3=3, SSP4=4,
  *                              SSP5=5, SSP6=6,INVALID
  *
- * %SKL_TKN_U32_PARAMS_FIXUP:   Module Params fixup mask
- * %SKL_TKN_U32_CONVERTER:      Module params converter mask
- * %SKL_TKN_U32_PIPE_ID:        Stores the pipe id
+ * @SKL_TKN_U32_PARAMS_FIXUP:   Module Params fixup mask
+ * @SKL_TKN_U32_CONVERTER:      Module params converter mask
+ * @SKL_TKN_U32_PIPE_ID:        Stores the pipe id
  *
- * %SKL_TKN_U32_PIPE_CONN_TYPE: Type of the token to which the pipe is
- *                              connected to. It can be
+ * @SKL_TKN_U32_PIPE_CONN_TYPE: Type of the token to which the pipe is
+ *                              connected. It can be
  *                              SKL_PIPE_CONN_TYPE_NONE = 0,
  *                              SKL_PIPE_CONN_TYPE_FE = 1 (HOST_DMA),
  *                              SKL_PIPE_CONN_TYPE_BE = 2 (LINK_DMA),
  *
- * %SKL_TKN_U32_PIPE_PRIORITY:  Pipe priority value
- * %SKL_TKN_U32_PIPE_MEM_PGS:   Pipe resource pages
+ * @SKL_TKN_U32_PIPE_PRIORITY:  Pipe priority value
+ * @SKL_TKN_U32_PIPE_MEM_PGS:   Pipe resource pages
  *
- * %SKL_TKN_U32_DIR_PIN_COUNT:  Value for the direction to set input/output
+ * @SKL_TKN_U32_DIR_PIN_COUNT:  Value for the direction to set input/output
  *                              formats and the pin count.
  *                              The first 4 bits have the direction
  *                              value and the next 4 have
@@ -104,23 +108,23 @@
  *                              and output made by reading direction
  *                              token.
  *
- * %SKL_TKN_U32_FMT_CH:         Supported channel count
+ * @SKL_TKN_U32_FMT_CH:         Supported channel count
  *
- * %SKL_TKN_U32_FMT_FREQ:       Supported frequency/sample rate
+ * @SKL_TKN_U32_FMT_FREQ:       Supported frequency/sample rate
  *
- * %SKL_TKN_U32_FMT_BIT_DEPTH:  Supported container size
+ * @SKL_TKN_U32_FMT_BIT_DEPTH:  Supported container size
  *
- * %SKL_TKN_U32_FMT_SAMPLE_SIZE:Number of samples in the container
+ * @SKL_TKN_U32_FMT_SAMPLE_SIZE:Number of samples in the container
  *
- * %SKL_TKN_U32_FMT_CH_CONFIG:  Supported channel configurations for the
+ * @SKL_TKN_U32_FMT_CH_CONFIG:  Supported channel configurations for the
  *                              input/output.
  *
- * %SKL_TKN_U32_FMT_INTERLEAVE: Interleaving style which can be per
+ * @SKL_TKN_U32_FMT_INTERLEAVE: Interleaving style which can be per
  *                              channel or per sample. The values can be :
  *                              SKL_INTERLEAVING_PER_CHANNEL = 0,
  *                              SKL_INTERLEAVING_PER_SAMPLE = 1,
  *
- * %SKL_TKN_U32_FMT_SAMPLE_TYPE:
+ * @SKL_TKN_U32_FMT_SAMPLE_TYPE:
  *                              Specifies the sample type. Can take the
  *                              values: SKL_SAMPLE_TYPE_INT_MSB = 0,
  *                              SKL_SAMPLE_TYPE_INT_LSB = 1,
@@ -128,104 +132,109 @@
  *                              SKL_SAMPLE_TYPE_INT_UNSIGNED = 3,
  *                              SKL_SAMPLE_TYPE_FLOAT = 4
  *
- * %SKL_TKN_U32_CH_MAP:         Channel map values
- * %SKL_TKN_U32_MOD_SET_PARAMS: It can take these values:
+ * @SKL_TKN_U32_FMT_CH_MAP:     Channel map values
+ * @SKL_TKN_U32_PIN_MOD_ID:     FIXME
+ * @SKL_TKN_U32_PIN_INST_ID:    FIXME
+ * @SKL_TKN_U32_MOD_SET_PARAMS: It can take these values:
  *                              SKL_PARAM_DEFAULT, SKL_PARAM_INIT,
  *                              SKL_PARAM_SET, SKL_PARAM_BIND
  *
- * %SKL_TKN_U32_MOD_PARAM_ID:   ID of the module params
+ * @SKL_TKN_U32_MOD_PARAM_ID:   ID of the module params
  *
- * %SKL_TKN_U32_CAPS_SET_PARAMS:
+ * @SKL_TKN_U32_CAPS_SET_PARAMS:
  *                              Set params value
  *
- * %SKL_TKN_U32_CAPS_PARAMS_ID: Params ID
+ * @SKL_TKN_U32_CAPS_PARAMS_ID: Params ID
  *
- * %SKL_TKN_U32_CAPS_SIZE:      Caps size
+ * @SKL_TKN_U32_CAPS_SIZE:      Caps size
  *
- * %SKL_TKN_U32_PROC_DOMAIN:    Specify processing domain
+ * @SKL_TKN_U32_PROC_DOMAIN:    Specify processing domain
  *
- * %SKL_TKN_U32_LIB_COUNT:      Specifies the number of libraries
+ * @SKL_TKN_U32_LIB_COUNT:      Specifies the number of libraries
  *
- * %SKL_TKN_STR_LIB_NAME:       Specifies the library name
+ * @SKL_TKN_STR_LIB_NAME:       Specifies the library name
  *
- * %SKL_TKN_U32_PMODE:		Specifies the power mode for pipe
+ * @SKL_TKN_U32_PMODE:		Specifies the power mode for pipe
  *
- * %SKL_TKL_U32_D0I3_CAPS:	Specifies the D0i3 capability for module
+ * @SKL_TKL_U32_D0I3_CAPS:	Specifies the D0i3 capability for module (typo)
+ * @SKL_TKN_U32_D0I3_CAPS:      Specifies the D0i3 capability for module
  *
- * %SKL_TKN_U32_DMA_BUF_SIZE:	DMA buffer size in millisec
+ * @SKL_TKN_U32_DMA_BUF_SIZE:	DMA buffer size in millisec
  *
- * %SKL_TKN_U32_PIPE_DIR:       Specifies pipe direction. Can be
+ * @SKL_TKN_U32_PIPE_DIRECTION: Specifies pipe direction. Can be
  *                              playback/capture.
  *
- * %SKL_TKN_U32_NUM_CONFIGS:    Number of pipe configs
+ * @SKL_TKN_U32_NUM_CONFIGS:    Number of pipe configs
  *
- * %SKL_TKN_U32_PATH_MEM_PGS:   Size of memory (in pages) required for pipeline
+ * @SKL_TKN_U32_PATH_MEM_PGS:   Size of memory (in pages) required for pipeline
  *                              and its data
  *
- * %SKL_TKN_U32_PIPE_CONFIG_ID: Config id for the modules in the pipe
+ * @SKL_TKN_U32_PIPE_CONFIG_ID: Config id for the modules in the pipe
  *                              and PCM params supported by that pipe
  *                              config. This is used as index to fill
  *                              up the pipe config and module config
  *                              structure.
  *
- * %SKL_TKN_U32_CFG_FREQ:
- * %SKL_TKN_U8_CFG_CHAN:
- * %SKL_TKN_U8_CFG_BPS:         PCM params (freq, channels, bits per sample)
+ * @SKL_TKN_U32_CFG_FREQ:       FIXME
+ * @SKL_TKN_U8_CFG_CHAN:        FIXME
+ * @SKL_TKN_U8_CFG_BPS:         PCM params (freq, channels, bits per sample)
  *                              supported for each of the pipe configs.
  *
- * %SKL_TKN_CFG_MOD_RES_ID:     Module's resource index for each of the
+ * @SKL_TKN_CFG_MOD_RES_ID:     Module's resource index for each of the
  *                              pipe config
  *
- * %SKL_TKN_CFG_MOD_FMT_ID:     Module's interface index for each of the
+ * @SKL_TKN_CFG_MOD_FMT_ID:     Module's interface index for each of the
  *                              pipe config
  *
- * %SKL_TKN_U8_NUM_MOD:         Number of modules in the manifest
+ * @SKL_TKN_U8_NUM_MOD:         Number of modules in the manifest
  *
- * %SKL_TKN_MM_U8_MOD_IDX:      Current index of the module in the manifest
+ * @SKL_TKN_MM_U8_MOD_IDX:      Current index of the module in the manifest
  *
- * %SKL_TKN_MM_U8_NUM_RES:      Number of resources for the module
+ * @SKL_TKN_MM_U8_NUM_RES:      Number of resources for the module
  *
- * %SKL_TKN_MM_U8_NUM_INTF:     Number of interfaces for the module
+ * @SKL_TKN_MM_U8_NUM_INTF:     Number of interfaces for the module
  *
- * %SKL_TKN_MM_U32_RES_ID:      Resource index for the resource info to
+ * @SKL_TKN_MM_U32_RES_ID:      Resource index for the resource info to
  *                              be filled into.
  *                              A module can support multiple resource
- *                              configuration and is represnted as a
+ *                              configuration and is represented as a
  *                              resource table. This index is used to
  *                              fill information into appropriate index.
  *
- * %SKL_TKN_MM_U32_CPS:         DSP cycles per second
+ * @SKL_TKN_MM_U32_CPS:         DSP cycles per second
  *
- * %SKL_TKN_MM_U32_DMA_SIZE:    Allocated buffer size for gateway DMA
+ * @SKL_TKN_MM_U32_DMA_SIZE:    Allocated buffer size for gateway DMA
  *
- * %SKL_TKN_MM_U32_CPC:         DSP cycles allocated per frame
+ * @SKL_TKN_MM_U32_CPC:         DSP cycles allocated per frame
  *
- * %SKL_TKN_MM_U32_RES_PIN_ID:  Resource pin index in the module
+ * @SKL_TKN_MM_U32_RES_PIN_ID:  Resource pin index in the module
  *
- * %SKL_TKN_MM_U32_INTF_PIN_ID: Interface index in the module
+ * @SKL_TKN_MM_U32_INTF_PIN_ID: Interface index in the module
  *
- * %SKL_TKN_MM_U32_PIN_BUF:     Buffer size of the module pin
+ * @SKL_TKN_MM_U32_PIN_BUF:     Buffer size of the module pin
  *
- * %SKL_TKN_MM_U32_FMT_ID:      Format index for each of the interface/
+ * @SKL_TKN_MM_U32_FMT_ID:      Format index for each of the interface/
  *                              format information to be filled into.
  *
- * %SKL_TKN_MM_U32_NUM_IN_FMT:  Number of input formats
- * %SKL_TKN_MM_U32_NUM_OUT_FMT: Number of output formats
+ * @SKL_TKN_MM_U32_NUM_IN_FMT:  Number of input formats
+ * @SKL_TKN_MM_U32_NUM_OUT_FMT: Number of output formats
  *
- * %SKL_TKN_U32_ASTATE_IDX:     Table Index for the A-State entry to be filled
+ * @SKL_TKN_U32_ASTATE_IDX:     Table Index for the A-State entry to be filled
  *                              with kcps and clock source
  *
- * %SKL_TKN_U32_ASTATE_COUNT:   Number of valid entries in A-State table
+ * @SKL_TKN_U32_ASTATE_COUNT:   Number of valid entries in A-State table
  *
- * %SKL_TKN_U32_ASTATE_KCPS:    Specifies the core load threshold (in kilo
+ * @SKL_TKN_U32_ASTATE_KCPS:    Specifies the core load threshold (in kilo
  *                              cycles per second) below which DSP is clocked
  *                              from source specified by clock source.
  *
- * %SKL_TKN_U32_ASTATE_CLK_SRC: Clock source for A-State entry
+ * @SKL_TKN_U32_ASTATE_CLK_SRC: Clock source for A-State entry
+ *
+ * @SKL_TKN_U32_FMT_CFG_IDX:    Format config index
  *
- * %SKL_TKN_U32_FMT_CFG_IDX:    Format config index
+ * @SKL_TKN_MAX:                Max value for enum SKL_TKNS
  *
- * module_id and loadable flags dont have tokens as these values will be
+ * module_id and loadable flags don't have tokens as these values will be
  * read from the DSP FW manifest
  *
  * Tokens defined can be used either in the manifest or widget private data.


^ permalink raw reply

* [PATCH 01/14] ASoC: codecs: NeoFidelity: repair the kernel-doc format
From: Randy Dunlap @ 2026-07-14  1:44 UTC (permalink / raw)
  To: linux-sound
  Cc: Randy Dunlap, Jaroslav Kysela, Takashi Iwai, Shengjiu Wang,
	Xiubo Li, Fabio Estevam, Nicolin Chen, linuxppc-dev,
	Charles Keepax, Maciej Strozek, Bard Liao, Pierre-Louis Bossart,
	patches, Srinivas Kandagatla, linux-arm-msm, Liam Girdwood,
	Mark Brown
In-Reply-To: <20260714014445.569992-1-rdunlap@infradead.org>

Don't use "/**" for a non-kernel-doc comment.
Use kernel-doc notation to document the parameters and return value of
ntpfw_load().

Fixes these warnings:
Warning: ../sound/soc/codecs/ntpfw.h:2 This comment starts with '/**', but isn't a kernel-doc comment.
 * ntpfw.h - Firmware helper functions for Neofidelity codecs
Warning: sound/soc/codecs/ntpfw.h:20 function parameter 'i2c' not described in 'ntpfw_load'
Warning: sound/soc/codecs/ntpfw.h:20 function parameter 'name' not described in 'ntpfw_load'
Warning: sound/soc/codecs/ntpfw.h:20 function parameter 'magic' not described in 'ntpfw_load'
Warning: sound/soc/codecs/ntpfw.h:20 No description found for return value of 'ntpfw_load'

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
---
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>

 sound/soc/codecs/ntpfw.h |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

--- linext-2026-0710.orig/sound/soc/codecs/ntpfw.h
+++ linext-2026-0710/sound/soc/codecs/ntpfw.h
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
-/**
+/*
  * ntpfw.h - Firmware helper functions for Neofidelity codecs
  *
  * Copyright (c) 2024, SaluteDevices. All Rights Reserved.
@@ -13,10 +13,11 @@
 /**
  * ntpfw_load - load firmware to amplifier over i2c interface.
  *
- * @i2c		Pointer to amplifier's I2C client.
- * @name	Firmware file name.
- * @magic	Magic number to validate firmware.
- * @return	0 or error code upon error.
+ * @i2c:	Pointer to amplifier's I2C client.
+ * @name:	Firmware file name.
+ * @magic:	Magic number to validate firmware.
+ *
+ * Returns:	0 or error code upon error.
  */
 int ntpfw_load(struct i2c_client *i2c, const char *name, const u32 magic);
 


^ permalink raw reply

* [powerpc:fixes-test] BUILD SUCCESS c14c32661406018437b37a1426139d3b2a0edcc9
From: kernel test robot @ 2026-07-14  1:51 UTC (permalink / raw)
  To: Madhavan Srinivasan; +Cc: linuxppc-dev

tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git fixes-test
branch HEAD: c14c32661406018437b37a1426139d3b2a0edcc9  powerpc: Remove dead non-preemption code

elapsed time: 725m

configs tested: 201
configs skipped: 324

The following configs have been built successfully.
More configs may be tested in the coming days.

tested configs:
alpha                             allnoconfig    gcc-16.1.0
alpha                            allyesconfig    gcc-16.1.0
alpha                               defconfig    gcc-16.1.0
arc                              alldefconfig    gcc-16.1.0
arc                              allmodconfig    clang-23
arc                               allnoconfig    gcc-16.1.0
arc                              allyesconfig    clang-23
arc                                 defconfig    gcc-16.1.0
arc                   randconfig-001-20260713    gcc-8.5.0
arc                   randconfig-001-20260714    clang-23
arc                   randconfig-002-20260713    gcc-8.5.0
arc                   randconfig-002-20260714    clang-23
arm                               allnoconfig    gcc-16.1.0
arm                              allyesconfig    clang-23
arm                                 defconfig    gcc-16.1.0
arm                          ixp4xx_defconfig    gcc-16.1.0
arm                   randconfig-001-20260713    gcc-8.5.0
arm                   randconfig-001-20260714    clang-23
arm                   randconfig-002-20260713    gcc-8.5.0
arm                   randconfig-002-20260714    clang-23
arm                   randconfig-003-20260713    gcc-8.5.0
arm                   randconfig-003-20260714    clang-23
arm                   randconfig-004-20260713    gcc-8.5.0
arm                   randconfig-004-20260714    clang-23
arm64                            allmodconfig    clang-23
arm64                             allnoconfig    gcc-16.1.0
arm64                               defconfig    gcc-16.1.0
arm64                 randconfig-001-20260713    gcc-13.4.0
arm64                 randconfig-001-20260714    gcc-16.1.0
arm64                 randconfig-002-20260713    gcc-13.4.0
arm64                 randconfig-002-20260714    gcc-16.1.0
arm64                 randconfig-003-20260713    gcc-13.4.0
arm64                 randconfig-003-20260714    gcc-16.1.0
arm64                 randconfig-004-20260713    gcc-13.4.0
arm64                 randconfig-004-20260714    gcc-16.1.0
csky                             allmodconfig    gcc-16.1.0
csky                              allnoconfig    gcc-16.1.0
csky                                defconfig    gcc-16.1.0
csky                  randconfig-001-20260713    gcc-13.4.0
csky                  randconfig-001-20260714    gcc-16.1.0
csky                  randconfig-002-20260713    gcc-13.4.0
csky                  randconfig-002-20260714    gcc-16.1.0
hexagon                          allmodconfig    gcc-16.1.0
hexagon                           allnoconfig    gcc-16.1.0
hexagon                             defconfig    gcc-16.1.0
hexagon               randconfig-001-20260714    gcc-16.1.0
hexagon               randconfig-002-20260714    gcc-16.1.0
i386                             allmodconfig    clang-22
i386                              allnoconfig    gcc-16.1.0
i386                             allyesconfig    clang-22
i386        buildonly-randconfig-001-20260714    clang-22
i386        buildonly-randconfig-002-20260714    clang-22
i386        buildonly-randconfig-003-20260714    clang-22
i386        buildonly-randconfig-004-20260714    clang-22
i386        buildonly-randconfig-005-20260714    clang-22
i386        buildonly-randconfig-006-20260714    clang-22
i386                                defconfig    gcc-16.1.0
i386                  randconfig-001-20260713    gcc-14
i386                  randconfig-001-20260714    gcc-13
i386                  randconfig-002-20260714    gcc-13
i386                  randconfig-003-20260713    gcc-14
i386                  randconfig-003-20260714    gcc-13
i386                  randconfig-004-20260713    gcc-14
i386                  randconfig-004-20260714    gcc-13
i386                  randconfig-005-20260713    gcc-14
i386                  randconfig-005-20260714    gcc-13
i386                  randconfig-006-20260713    gcc-14
i386                  randconfig-006-20260714    gcc-13
i386                  randconfig-007-20260713    gcc-14
i386                  randconfig-007-20260714    gcc-13
i386                  randconfig-011-20260714    clang-22
i386                  randconfig-012-20260714    clang-22
i386                  randconfig-013-20260714    clang-22
i386                  randconfig-014-20260714    clang-22
i386                  randconfig-015-20260714    clang-22
i386                  randconfig-016-20260714    clang-22
i386                  randconfig-017-20260714    clang-22
loongarch                        allmodconfig    clang-23
loongarch                         allnoconfig    gcc-16.1.0
loongarch                           defconfig    clang-23
loongarch             randconfig-001-20260714    gcc-16.1.0
loongarch             randconfig-002-20260714    gcc-16.1.0
m68k                             allmodconfig    gcc-16.1.0
m68k                              allnoconfig    gcc-16.1.0
m68k                             allyesconfig    clang-23
m68k                                defconfig    clang-23
microblaze                        allnoconfig    gcc-16.1.0
microblaze                       allyesconfig    gcc-16.1.0
microblaze                          defconfig    clang-23
mips                             allmodconfig    gcc-16.1.0
mips                              allnoconfig    gcc-16.1.0
mips                             allyesconfig    gcc-16.1.0
nios2                            allmodconfig    clang-20
nios2                             allnoconfig    clang-23
nios2                               defconfig    clang-23
nios2                 randconfig-001-20260714    gcc-16.1.0
nios2                 randconfig-002-20260714    gcc-16.1.0
openrisc                         allmodconfig    clang-20
openrisc                          allnoconfig    clang-23
openrisc                            defconfig    gcc-16.1.0
parisc                           allmodconfig    gcc-16.1.0
parisc                            allnoconfig    clang-23
parisc                           allyesconfig    clang-17
parisc                              defconfig    gcc-16.1.0
parisc                randconfig-001-20260713    clang-23
parisc                randconfig-001-20260714    clang-17
parisc                randconfig-002-20260713    clang-23
parisc                randconfig-002-20260714    clang-17
parisc64                            defconfig    clang-23
powerpc                          allmodconfig    gcc-16.1.0
powerpc                           allnoconfig    clang-23
powerpc                       holly_defconfig    clang-23
powerpc               randconfig-001-20260713    clang-23
powerpc               randconfig-001-20260714    clang-17
powerpc               randconfig-002-20260713    clang-23
powerpc               randconfig-002-20260714    clang-17
powerpc64             randconfig-001-20260713    clang-23
powerpc64             randconfig-001-20260714    clang-17
powerpc64             randconfig-002-20260713    clang-23
powerpc64             randconfig-002-20260714    clang-17
riscv                            allmodconfig    clang-23
riscv                             allnoconfig    clang-23
riscv                            allyesconfig    clang-23
riscv                               defconfig    gcc-16.1.0
riscv                 randconfig-001-20260714    gcc-10.5.0
riscv                 randconfig-002-20260714    gcc-10.5.0
s390                             allmodconfig    clang-17
s390                              allnoconfig    clang-23
s390                             allyesconfig    gcc-16.1.0
s390                                defconfig    gcc-16.1.0
s390                  randconfig-001-20260714    gcc-10.5.0
s390                  randconfig-002-20260714    gcc-10.5.0
sh                               allmodconfig    gcc-16.1.0
sh                                allnoconfig    clang-23
sh                               allyesconfig    clang-17
sh                                  defconfig    gcc-14
sh                             espt_defconfig    gcc-16.1.0
sh                    randconfig-001-20260714    gcc-10.5.0
sh                    randconfig-002-20260714    gcc-10.5.0
sparc                             allnoconfig    clang-23
sparc                               defconfig    gcc-16.1.0
sparc                 randconfig-001-20260714    gcc-8.5.0
sparc                 randconfig-002-20260714    gcc-8.5.0
sparc64                          allmodconfig    clang-20
sparc64                             defconfig    gcc-14
sparc64               randconfig-001-20260714    gcc-8.5.0
sparc64               randconfig-002-20260714    gcc-8.5.0
um                               allmodconfig    clang-17
um                                allnoconfig    clang-23
um                               allyesconfig    gcc-16.1.0
um                                  defconfig    gcc-14
um                             i386_defconfig    gcc-14
um                    randconfig-001-20260714    gcc-8.5.0
um                    randconfig-002-20260714    gcc-8.5.0
um                           x86_64_defconfig    gcc-14
x86_64                           allmodconfig    clang-22
x86_64                            allnoconfig    clang-23
x86_64                           allyesconfig    clang-22
x86_64      buildonly-randconfig-001-20260714    gcc-14
x86_64      buildonly-randconfig-002-20260714    gcc-14
x86_64      buildonly-randconfig-003-20260714    gcc-14
x86_64      buildonly-randconfig-004-20260714    gcc-14
x86_64      buildonly-randconfig-005-20260714    gcc-14
x86_64      buildonly-randconfig-006-20260714    gcc-14
x86_64                              defconfig    gcc-14
x86_64                                  kexec    clang-22
x86_64                randconfig-001-20260714    clang-22
x86_64                randconfig-002-20260714    clang-22
x86_64                randconfig-003-20260714    clang-22
x86_64                randconfig-004-20260714    clang-22
x86_64                randconfig-005-20260714    clang-22
x86_64                randconfig-006-20260714    clang-22
x86_64                randconfig-011-20260713    gcc-14
x86_64                randconfig-011-20260714    clang-22
x86_64                randconfig-012-20260713    gcc-14
x86_64                randconfig-012-20260714    clang-22
x86_64                randconfig-013-20260713    gcc-14
x86_64                randconfig-013-20260714    clang-22
x86_64                randconfig-014-20260713    gcc-14
x86_64                randconfig-014-20260714    clang-22
x86_64                randconfig-015-20260713    gcc-14
x86_64                randconfig-015-20260714    clang-22
x86_64                randconfig-016-20260713    gcc-14
x86_64                randconfig-016-20260714    clang-22
x86_64                randconfig-071-20260714    gcc-14
x86_64                randconfig-072-20260714    gcc-14
x86_64                randconfig-073-20260714    gcc-14
x86_64                randconfig-074-20260714    gcc-14
x86_64                randconfig-075-20260714    gcc-14
x86_64                randconfig-076-20260714    gcc-14
x86_64                               rhel-9.4    clang-22
x86_64                           rhel-9.4-bpf    gcc-14
x86_64                          rhel-9.4-func    clang-22
x86_64                    rhel-9.4-kselftests    clang-22
x86_64                         rhel-9.4-kunit    gcc-14
x86_64                           rhel-9.4-ltp    gcc-14
x86_64                          rhel-9.4-rust    clang-22
xtensa                            allnoconfig    clang-23
xtensa                           allyesconfig    clang-20
xtensa                randconfig-001-20260714    gcc-8.5.0
xtensa                randconfig-002-20260714    gcc-8.5.0

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


^ permalink raw reply

* Re: [PATCH v2 00/13] mm: convert more vm_flags_t users to vma_flags_t
From: Andrew Morton @ 2026-07-14  2:25 UTC (permalink / raw)
  To: Lorenzo Stoakes
  Cc: David Hildenbrand, Liam R. Howlett, Vlastimil Babka,
	Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
	Thomas Bogendoerfer, Benjamin LaHaise, Alexander Viro,
	Christian Brauner, Jan Kara, Hugh Dickins, Baolin Wang, Jann Horn,
	Pedro Falcato, Muchun Song, Oscar Salvador, Zi Yan, Nico Pache,
	Ryan Roberts, Dev Jain, Barry Song, Lance Yang, Usama Arif,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Lucas Stach,
	Russell King, Christian Gmeiner, Inki Dae, Seung-Woo Kim,
	Kyungmin Park, Krzysztof Kozlowski, Peter Griffin, Alim Akhtar,
	Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
	Sean Paul, Marijn Suijten, Lyude Paul, Danilo Krummrich,
	Tomi Valkeinen, Sandy Huang, Heiko Stübner, Andy Yan,
	Thierry Reding, Mikko Perttunen, Jonathan Hunter, Gerd Hoffmann,
	Dmitry Osipenko, Gurchetan Singh, Chia-I Wu, Zack Rusin,
	Broadcom internal kernel review list, Matthew Brost,
	Thomas Hellström, Oleksandr Andrushchenko, Helge Deller,
	Kees Cook, Jaroslav Kysela, Takashi Iwai, Boris Brezillon,
	Steven Price, Liviu Dudau, linux-mm, linux-kernel, linux-mips,
	linux-aio, linux-fsdevel, linuxppc-dev, dri-devel, etnaviv,
	linux-arm-kernel, linux-samsung-soc, intel-gfx, linux-arm-msm,
	freedreno, nouveau, linux-rockchip, linux-tegra, virtualization,
	intel-xe, xen-devel, linux-fbdev, linux-sound, Jani Nikula
In-Reply-To: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>

On Sat, 11 Jul 2026 19:44:57 +0100 Lorenzo Stoakes <ljs@kernel.org> wrote:

> This series makes further progress in converting usage of the deprecated
> vm_flags_t type to its replacement, vma_flags_t.
> 
> It focuses on mm, though updates some users of mm APIs also.
> 
> It updates:
> 
> * The core do_mmap() code path for VMA mapping.
> * Unmapped area logic.
> * The usage of mm->def_vma_flags.
> * VMA page protection bit logic.
> * General usage of VMA flags in core mm code, mlock, mprotect, mremap.

Added to mm-new, thanks.

And oh my, what a lot of pre-existing issues:
	https://sashiko.dev/#/patchset/20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org




^ permalink raw reply

* Re: [PATCH v7 06/10] ACPI: APEI: GHES: move CXL CPER helpers
From: Alison Schofield @ 2026-07-14  2:45 UTC (permalink / raw)
  To: Ahmed Tiba
  Cc: Rafael J. Wysocki, Tony Luck, Borislav Petkov, Hanjun Guo,
	Mauro Carvalho Chehab, Shuai Xue, Len Brown, Saket Dumbre,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Vishal Verma,
	Dan Williams, Ira Weiny, Li Ming, Mahesh J Salgaonkar,
	Oliver O'Halloran, Bjorn Helgaas, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jonathan Corbet, Shuah Khan,
	linux-kernel, linux-acpi, acpica-devel, linux-cxl, linuxppc-dev,
	linux-pci, devicetree, linux-edac, linux-doc, Dmitry.Lamerov
In-Reply-To: <20260708-topics-ahmtib01-ras_ffh_arm_internal_review-v7-6-8b3a85216cef@arm.com>

On Wed, Jul 08, 2026 at 02:59:05PM +0100, Ahmed Tiba wrote:
> Move the CXL CPER handling paths out of ghes.c and into ghes_cper.c so the
> helpers can be reused. The code is moved as-is, with the public
> prototypes updated so GHES keeps calling into the new translation unit.
> 
> While moving this code, also add CXL CPER section length checks and use
> spinlock_irqsave() in CXL register/unregister paths for locking
> consistency.

NAK on moving and changing in the same patch, and esp in a patch
whose subject only says MOVE.


> 
> Reviewed-by: Jonathan Cameron <jic23@kernel.org>
> Signed-off-by: Ahmed Tiba <ahmed.tiba@arm.com>
> ---
>  drivers/acpi/apei/ghes.c      | 180 +++++++++++-------------------------------
>  drivers/acpi/apei/ghes_cper.c | 135 +++++++++++++++++++++++++++++++
>  include/acpi/ghes_cper.h      |  11 +++
>  3 files changed, 194 insertions(+), 132 deletions(-)
> 
> diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
> index 07e4001ea8d7..2a83d326e692 100644
> --- a/drivers/acpi/apei/ghes.c
> +++ b/drivers/acpi/apei/ghes.c
> @@ -383,138 +383,6 @@ static void ghes_handle_aer(struct acpi_hest_generic_data *gdata)
>  #endif
>  }
>  
> -/* Room for 8 entries */
> -#define CXL_CPER_PROT_ERR_FIFO_DEPTH 8
> -static DEFINE_KFIFO(cxl_cper_prot_err_fifo, struct cxl_cper_prot_err_work_data,
> -		    CXL_CPER_PROT_ERR_FIFO_DEPTH);
> -
> -/* Synchronize schedule_work() with cxl_cper_prot_err_work changes */
> -static DEFINE_SPINLOCK(cxl_cper_prot_err_work_lock);
> -struct work_struct *cxl_cper_prot_err_work;
> -
> -static void cxl_cper_post_prot_err(struct cxl_cper_sec_prot_err *prot_err,
> -				   int severity)
> -{
> -#ifdef CONFIG_ACPI_APEI_PCIEAER
> -	struct cxl_cper_prot_err_work_data wd;
> -
> -	if (cxl_cper_sec_prot_err_valid(prot_err))
> -		return;
> -
> -	guard(spinlock_irqsave)(&cxl_cper_prot_err_work_lock);
> -
> -	if (!cxl_cper_prot_err_work)
> -		return;
> -
> -	if (cxl_cper_setup_prot_err_work_data(&wd, prot_err, severity))
> -		return;
> -
> -	if (!kfifo_put(&cxl_cper_prot_err_fifo, wd)) {
> -		pr_err_ratelimited("CXL CPER kfifo overflow\n");
> -		return;
> -	}
> -
> -	schedule_work(cxl_cper_prot_err_work);
> -#endif
> -}
> -
> -int cxl_cper_register_prot_err_work(struct work_struct *work)
> -{
> -	if (cxl_cper_prot_err_work)
> -		return -EINVAL;
> -
> -	guard(spinlock)(&cxl_cper_prot_err_work_lock);
> -	cxl_cper_prot_err_work = work;
> -	return 0;
> -}
> -EXPORT_SYMBOL_NS_GPL(cxl_cper_register_prot_err_work, "CXL");
> -
> -int cxl_cper_unregister_prot_err_work(struct work_struct *work)
> -{
> -	if (cxl_cper_prot_err_work != work)
> -		return -EINVAL;
> -
> -	guard(spinlock)(&cxl_cper_prot_err_work_lock);
> -	cxl_cper_prot_err_work = NULL;
> -	return 0;
> -}
> -EXPORT_SYMBOL_NS_GPL(cxl_cper_unregister_prot_err_work, "CXL");
> -
> -int cxl_cper_prot_err_kfifo_get(struct cxl_cper_prot_err_work_data *wd)
> -{
> -	return kfifo_get(&cxl_cper_prot_err_fifo, wd);
> -}
> -EXPORT_SYMBOL_NS_GPL(cxl_cper_prot_err_kfifo_get, "CXL");
> -
> -/* Room for 8 entries for each of the 4 event log queues */
> -#define CXL_CPER_FIFO_DEPTH 32
> -DEFINE_KFIFO(cxl_cper_fifo, struct cxl_cper_work_data, CXL_CPER_FIFO_DEPTH);
> -
> -/* Synchronize schedule_work() with cxl_cper_work changes */
> -static DEFINE_SPINLOCK(cxl_cper_work_lock);
> -struct work_struct *cxl_cper_work;
> -
> -static void cxl_cper_post_event(enum cxl_event_type event_type,
> -				struct cxl_cper_event_rec *rec)
> -{
> -	struct cxl_cper_work_data wd;
> -
> -	if (rec->hdr.length <= sizeof(rec->hdr) ||
> -	    rec->hdr.length > sizeof(*rec)) {
> -		pr_err(FW_WARN "CXL CPER Invalid section length (%u)\n",
> -		       rec->hdr.length);
> -		return;
> -	}
> -
> -	if (!(rec->hdr.validation_bits & CPER_CXL_COMP_EVENT_LOG_VALID)) {
> -		pr_err(FW_WARN "CXL CPER invalid event\n");
> -		return;
> -	}
> -
> -	guard(spinlock_irqsave)(&cxl_cper_work_lock);
> -
> -	if (!cxl_cper_work)
> -		return;
> -
> -	wd.event_type = event_type;
> -	memcpy(&wd.rec, rec, sizeof(wd.rec));
> -
> -	if (!kfifo_put(&cxl_cper_fifo, wd)) {
> -		pr_err_ratelimited("CXL CPER kfifo overflow\n");
> -		return;
> -	}
> -
> -	schedule_work(cxl_cper_work);
> -}
> -
> -int cxl_cper_register_work(struct work_struct *work)
> -{
> -	if (cxl_cper_work)
> -		return -EINVAL;
> -
> -	guard(spinlock)(&cxl_cper_work_lock);
> -	cxl_cper_work = work;
> -	return 0;
> -}
> -EXPORT_SYMBOL_NS_GPL(cxl_cper_register_work, "CXL");
> -
> -int cxl_cper_unregister_work(struct work_struct *work)
> -{
> -	if (cxl_cper_work != work)
> -		return -EINVAL;
> -
> -	guard(spinlock)(&cxl_cper_work_lock);
> -	cxl_cper_work = NULL;
> -	return 0;
> -}
> -EXPORT_SYMBOL_NS_GPL(cxl_cper_unregister_work, "CXL");
> -
> -int cxl_cper_kfifo_get(struct cxl_cper_work_data *wd)
> -{
> -	return kfifo_get(&cxl_cper_fifo, wd);
> -}
> -EXPORT_SYMBOL_NS_GPL(cxl_cper_kfifo_get, "CXL");
> -
>  static void ghes_log_hwerr(int sev, guid_t *sec_type)
>  {
>  	if (sev != CPER_SEV_RECOVERABLE)
> @@ -549,6 +417,42 @@ static void ghes_log_hwerr(int sev, guid_t *sec_type)
>  	hwerr_log_error_type(HWERR_RECOV_OTHERS);
>  }
>  
> +static bool ghes_cxl_event_len_valid(struct acpi_hest_generic_data *gdata,
> +				     struct cxl_cper_event_rec *rec)
> +{
> +	if (gdata->error_data_length < sizeof(*rec) ||
> +	    rec->hdr.length <= sizeof(rec->hdr) ||
> +	    rec->hdr.length > gdata->error_data_length ||
> +	    rec->hdr.length > sizeof(*rec)) {
> +		pr_err(FW_WARN "CXL CPER Invalid section length (%u)\n",
> +		       rec->hdr.length);
> +		return false;
> +	}
> +
> +	return true;
> +}
> +
> +static bool ghes_cxl_prot_err_len_valid(struct acpi_hest_generic_data *gdata,
> +					struct cxl_cper_sec_prot_err *prot_err)
> +{
> +	if (gdata->error_data_length < sizeof(*prot_err) +
> +	    sizeof(struct cxl_ras_capability_regs)) {
> +		pr_err(FW_WARN "CXL CPER Invalid protocol error length (%u)\n",
> +		       gdata->error_data_length);
> +		return false;
> +	}
> +
> +	if (prot_err->dvsec_len >
> +	    gdata->error_data_length - sizeof(*prot_err) -
> +	    sizeof(struct cxl_ras_capability_regs)) {
> +		pr_err(FW_WARN "CXL CPER invalid DVSEC length (%u)\n",
> +		       prot_err->dvsec_len);
> +		return false;
> +	}
> +
> +	return true;
> +}
> +
>  static void ghes_do_proc(struct ghes *ghes,
>  			 const struct acpi_hest_generic_status *estatus)
>  {
> @@ -585,18 +489,30 @@ static void ghes_do_proc(struct ghes *ghes,
>  		} else if (guid_equal(sec_type, &CPER_SEC_CXL_PROT_ERR)) {
>  			struct cxl_cper_sec_prot_err *prot_err = acpi_hest_get_payload(gdata);
>  
> +			if (!ghes_cxl_prot_err_len_valid(gdata, prot_err))
> +				continue;
> +
>  			cxl_cper_post_prot_err(prot_err, gdata->error_severity);
>  		} else if (guid_equal(sec_type, &CPER_SEC_CXL_GEN_MEDIA_GUID)) {
>  			struct cxl_cper_event_rec *rec = acpi_hest_get_payload(gdata);
>  
> +			if (!ghes_cxl_event_len_valid(gdata, rec))
> +				continue;
> +
>  			cxl_cper_post_event(CXL_CPER_EVENT_GEN_MEDIA, rec);
>  		} else if (guid_equal(sec_type, &CPER_SEC_CXL_DRAM_GUID)) {
>  			struct cxl_cper_event_rec *rec = acpi_hest_get_payload(gdata);
>  
> +			if (!ghes_cxl_event_len_valid(gdata, rec))
> +				continue;
> +
>  			cxl_cper_post_event(CXL_CPER_EVENT_DRAM, rec);
>  		} else if (guid_equal(sec_type, &CPER_SEC_CXL_MEM_MODULE_GUID)) {
>  			struct cxl_cper_event_rec *rec = acpi_hest_get_payload(gdata);
>  
> +			if (!ghes_cxl_event_len_valid(gdata, rec))
> +				continue;
> +
>  			cxl_cper_post_event(CXL_CPER_EVENT_MEM_MODULE, rec);
>  		} else {
>  			void *err = acpi_hest_get_payload(gdata);
> diff --git a/drivers/acpi/apei/ghes_cper.c b/drivers/acpi/apei/ghes_cper.c
> index 7e4a66b788b8..b59e3ed3eab3 100644
> --- a/drivers/acpi/apei/ghes_cper.c
> +++ b/drivers/acpi/apei/ghes_cper.c
> @@ -12,9 +12,12 @@
>   *   Author: Huang Ying <ying.huang@intel.com>
>   */
>  
> +#include <linux/aer.h>
> +#include <linux/cleanup.h>
>  #include <linux/err.h>
>  #include <linux/genalloc.h>
>  #include <linux/io.h>
> +#include <linux/kfifo.h>
>  #include <linux/kernel.h>
>  #include <linux/math64.h>
>  #include <linux/mm.h>
> @@ -350,6 +353,138 @@ void ghes_defer_non_standard_event(struct acpi_hest_generic_data *gdata,
>  	schedule_work(&entry->work);
>  }
>  
> +/* Room for 8 entries */
> +#define CXL_CPER_PROT_ERR_FIFO_DEPTH 8
> +static DEFINE_KFIFO(cxl_cper_prot_err_fifo, struct cxl_cper_prot_err_work_data,
> +		    CXL_CPER_PROT_ERR_FIFO_DEPTH);
> +
> +/* Synchronize schedule_work() with cxl_cper_prot_err_work changes */
> +static DEFINE_SPINLOCK(cxl_cper_prot_err_work_lock);
> +struct work_struct *cxl_cper_prot_err_work;
> +
> +void cxl_cper_post_prot_err(struct cxl_cper_sec_prot_err *prot_err,
> +			    int severity)
> +{
> +#ifdef CONFIG_ACPI_APEI_PCIEAER
> +	struct cxl_cper_prot_err_work_data wd;
> +
> +	if (cxl_cper_sec_prot_err_valid(prot_err))
> +		return;
> +
> +	guard(spinlock_irqsave)(&cxl_cper_prot_err_work_lock);
> +
> +	if (!cxl_cper_prot_err_work)
> +		return;
> +
> +	if (cxl_cper_setup_prot_err_work_data(&wd, prot_err, severity))
> +		return;
> +
> +	if (!kfifo_put(&cxl_cper_prot_err_fifo, wd)) {
> +		pr_err_ratelimited("CXL CPER kfifo overflow\n");
> +		return;
> +	}
> +
> +	schedule_work(cxl_cper_prot_err_work);
> +#endif
> +}
> +
> +int cxl_cper_register_prot_err_work(struct work_struct *work)
> +{
> +	if (cxl_cper_prot_err_work)
> +		return -EINVAL;
> +
> +	guard(spinlock_irqsave)(&cxl_cper_prot_err_work_lock);
> +	cxl_cper_prot_err_work = work;
> +	return 0;
> +}
> +EXPORT_SYMBOL_NS_GPL(cxl_cper_register_prot_err_work, "CXL");
> +
> +int cxl_cper_unregister_prot_err_work(struct work_struct *work)
> +{
> +	if (cxl_cper_prot_err_work != work)
> +		return -EINVAL;
> +
> +	guard(spinlock_irqsave)(&cxl_cper_prot_err_work_lock);
> +	cxl_cper_prot_err_work = NULL;
> +	return 0;
> +}
> +EXPORT_SYMBOL_NS_GPL(cxl_cper_unregister_prot_err_work, "CXL");
> +
> +int cxl_cper_prot_err_kfifo_get(struct cxl_cper_prot_err_work_data *wd)
> +{
> +	return kfifo_get(&cxl_cper_prot_err_fifo, wd);
> +}
> +EXPORT_SYMBOL_NS_GPL(cxl_cper_prot_err_kfifo_get, "CXL");
> +
> +/* Room for 8 entries for each of the 4 event log queues */
> +#define CXL_CPER_FIFO_DEPTH 32
> +static DEFINE_KFIFO(cxl_cper_fifo, struct cxl_cper_work_data, CXL_CPER_FIFO_DEPTH);
> +
> +/* Synchronize schedule_work() with cxl_cper_work changes */
> +static DEFINE_SPINLOCK(cxl_cper_work_lock);
> +struct work_struct *cxl_cper_work;
> +
> +void cxl_cper_post_event(enum cxl_event_type event_type,
> +			 struct cxl_cper_event_rec *rec)
> +{
> +	struct cxl_cper_work_data wd;
> +
> +	if (rec->hdr.length <= sizeof(rec->hdr) ||
> +	    rec->hdr.length > sizeof(*rec)) {
> +		pr_err(FW_WARN "CXL CPER Invalid section length (%u)\n",
> +		       rec->hdr.length);
> +		return;
> +	}
> +
> +	if (!(rec->hdr.validation_bits & CPER_CXL_COMP_EVENT_LOG_VALID)) {
> +		pr_err(FW_WARN "CXL CPER invalid event\n");
> +		return;
> +	}
> +
> +	guard(spinlock_irqsave)(&cxl_cper_work_lock);
> +
> +	if (!cxl_cper_work)
> +		return;
> +
> +	wd.event_type = event_type;
> +	memcpy(&wd.rec, rec, sizeof(wd.rec));
> +
> +	if (!kfifo_put(&cxl_cper_fifo, wd)) {
> +		pr_err_ratelimited("CXL CPER kfifo overflow\n");
> +		return;
> +	}
> +
> +	schedule_work(cxl_cper_work);
> +}
> +
> +int cxl_cper_register_work(struct work_struct *work)
> +{
> +	if (cxl_cper_work)
> +		return -EINVAL;
> +
> +	guard(spinlock_irqsave)(&cxl_cper_work_lock);
> +	cxl_cper_work = work;
> +	return 0;
> +}
> +EXPORT_SYMBOL_NS_GPL(cxl_cper_register_work, "CXL");
> +
> +int cxl_cper_unregister_work(struct work_struct *work)
> +{
> +	if (cxl_cper_work != work)
> +		return -EINVAL;
> +
> +	guard(spinlock_irqsave)(&cxl_cper_work_lock);
> +	cxl_cper_work = NULL;
> +	return 0;
> +}
> +EXPORT_SYMBOL_NS_GPL(cxl_cper_unregister_work, "CXL");
> +
> +int cxl_cper_kfifo_get(struct cxl_cper_work_data *wd)
> +{
> +	return kfifo_get(&cxl_cper_fifo, wd);
> +}
> +EXPORT_SYMBOL_NS_GPL(cxl_cper_kfifo_get, "CXL");
> +
>  /*
>   * GHES error status reporting throttle, to report more kinds of
>   * errors, instead of just most frequently occurred errors.
> diff --git a/include/acpi/ghes_cper.h b/include/acpi/ghes_cper.h
> index d9f9253d8de9..a853a5996cdf 100644
> --- a/include/acpi/ghes_cper.h
> +++ b/include/acpi/ghes_cper.h
> @@ -20,6 +20,7 @@
>  
>  #include <acpi/ghes.h>
>  #include <asm/fixmap.h>
> +#include <cxl/event.h>
>  
>  #define GHES_PFX	"GHES: "
>  
> @@ -106,5 +107,15 @@ void ghes_estatus_cache_add(struct acpi_hest_generic *generic,
>  			    struct acpi_hest_generic_status *estatus);
>  void ghes_defer_non_standard_event(struct acpi_hest_generic_data *gdata,
>  				   int sev);
> +void cxl_cper_post_prot_err(struct cxl_cper_sec_prot_err *prot_err,
> +			    int severity);
> +int cxl_cper_register_prot_err_work(struct work_struct *work);
> +int cxl_cper_unregister_prot_err_work(struct work_struct *work);
> +int cxl_cper_prot_err_kfifo_get(struct cxl_cper_prot_err_work_data *wd);
> +void cxl_cper_post_event(enum cxl_event_type event_type,
> +			 struct cxl_cper_event_rec *rec);
> +int cxl_cper_register_work(struct work_struct *work);
> +int cxl_cper_unregister_work(struct work_struct *work);
> +int cxl_cper_kfifo_get(struct cxl_cper_work_data *wd);
>  
>  #endif /* ACPI_APEI_GHES_CPER_H */
> 
> -- 
> 2.43.0
> 


^ permalink raw reply

* Re: [PATCH v2 12/13] mm/mprotect: convert mprotect code to use vma_flags_t
From: Zi Yan @ 2026-07-14  2:46 UTC (permalink / raw)
  To: Lorenzo Stoakes
  Cc: Andrew Morton, David Hildenbrand, Liam R. Howlett,
	Vlastimil Babka, Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
	Thomas Bogendoerfer, Benjamin LaHaise, Alexander Viro,
	Christian Brauner, Jan Kara, Hugh Dickins, Baolin Wang, Jann Horn,
	Pedro Falcato, Muchun Song, Oscar Salvador, Nico Pache,
	Ryan Roberts, Dev Jain, Barry Song, Lance Yang, Usama Arif,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Lucas Stach,
	Russell King, Christian Gmeiner, Inki Dae, Seung-Woo Kim,
	Kyungmin Park, Krzysztof Kozlowski, Peter Griffin, Alim Akhtar,
	Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
	Sean Paul, Marijn Suijten, Lyude Paul, Danilo Krummrich,
	Tomi Valkeinen, Sandy Huang, Heiko Stübner, Andy Yan,
	Thierry Reding, Mikko Perttunen, Jonathan Hunter, Gerd Hoffmann,
	Dmitry Osipenko, Gurchetan Singh, Chia-I Wu, Zack Rusin,
	Broadcom internal kernel review list, Matthew Brost,
	Thomas Hellström, Oleksandr Andrushchenko, Helge Deller,
	Kees Cook, Jaroslav Kysela, Takashi Iwai, Boris Brezillon,
	Steven Price, Liviu Dudau, linux-mm, linux-kernel, linux-mips,
	linux-aio, linux-fsdevel, linuxppc-dev, dri-devel, etnaviv,
	linux-arm-kernel, linux-samsung-soc, intel-gfx, linux-arm-msm,
	freedreno, nouveau, linux-rockchip, linux-tegra, virtualization,
	intel-xe, xen-devel, linux-fbdev, linux-sound
In-Reply-To: <20260711-b4-vma-flags-mm-v2-12-0fa2357d5431@kernel.org>

On 11 Jul 2026, at 14:45, Lorenzo Stoakes wrote:

> Replace use of the legacy vm_flags_t flags with vma_flags_t values
> throughout the mprotect logic.
>
> Note that we retain the legacy vm_flags_t bit shifting code in
> do_mprotect_pkey(), deferring a vma_flags_t approach to this for the time
> being.
>
> Additionally update comments to reflect the changes to be consistent.
>
> No functional change intended.
>
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> ---
>  mm/mprotect.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
LGTM.

Reviewed-by: Zi Yan <ziy@nvidia.com>


Best Regards,
Yan, Zi


^ permalink raw reply

* Re: [PATCH v7 02/22] dma-pool: fix page leak in atomic_pool_expand() cleanup
From: Aneesh Kumar K.V @ 2026-07-14  3:35 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: iommu, linux-arm-kernel, linux-kernel, linux-coco, Robin Murphy,
	Marek Szyprowski, Will Deacon, Marc Zyngier, Steven Price,
	Suzuki K Poulose, Catalin Marinas, Jiri Pirko, Mostafa Saleh,
	Petr Tesarik, Alexey Kardashevskiy, Dan Williams, Xu Yilun,
	linuxppc-dev, linux-s390, Madhavan Srinivasan, Michael Ellerman,
	Nicholas Piggin, Christophe Leroy (CS GROUP), Alexander Gordeev,
	Gerald Schaefer, Heiko Carstens, Vasily Gorbik,
	Christian Borntraeger, Sven Schnelle, x86, Michael Kelley
In-Reply-To: <20260713175433.GI3133966@ziepe.ca>

Jason Gunthorpe <jgg@ziepe.ca> writes:

> On Wed, Jul 01, 2026 at 11:19:06AM +0530, Aneesh Kumar K.V (Arm) wrote:
>> @@ -115,8 +116,10 @@ static int atomic_pool_expand(struct gen_pool *pool, size_t pool_size,
>>  	 */
>>  	ret = set_memory_decrypted((unsigned long)page_to_virt(page),
>>  				   1 << order);
>> -	if (ret)
>> +	if (ret) {
>> +		leak_pages = true;
>>  		goto remove_mapping;
>> +	}
>
> Truely these _set_memory_decrypted() things are an insane API. So a if
> it fails to decrypt it can be in any messy state?
>

Yes, we could possibly try to encrypt the page again and, if that
succeeds, avoid leaking it. We might want to do that tree-wide in a
separate patch.

>
>> @@ -130,14 +133,15 @@ static int atomic_pool_expand(struct gen_pool *pool, size_t pool_size,
>>  				   1 << order);
>>  	if (WARN_ON_ONCE(ret)) {
>>  		/* Decrypt succeeded but encrypt failed, purposely leak */
>> -		goto out;
>> +		leak_pages = true;
>
> At least this one makes some sense..
>
> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
>
> Jason

-aneesh


^ permalink raw reply

* Re: [PATCH v7 04/22] dma: free atomic pool pages by physical address
From: Aneesh Kumar K.V @ 2026-07-14  3:57 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: iommu, linux-arm-kernel, linux-kernel, linux-coco, Robin Murphy,
	Marek Szyprowski, Will Deacon, Marc Zyngier, Steven Price,
	Suzuki K Poulose, Catalin Marinas, Jiri Pirko, Mostafa Saleh,
	Petr Tesarik, Alexey Kardashevskiy, Dan Williams, Xu Yilun,
	linuxppc-dev, linux-s390, Madhavan Srinivasan, Michael Ellerman,
	Nicholas Piggin, Christophe Leroy (CS GROUP), Alexander Gordeev,
	Gerald Schaefer, Heiko Carstens, Vasily Gorbik,
	Christian Borntraeger, Sven Schnelle, x86, Michael Kelley
In-Reply-To: <20260713181059.GL3133966@ziepe.ca>

Jason Gunthorpe <jgg@ziepe.ca> writes:

> On Wed, Jul 01, 2026 at 11:19:08AM +0530, Aneesh Kumar K.V (Arm) wrote:
>> dma_direct_alloc_pages() may satisfy atomic allocations from the coherent
>> atomic pools. The pool allocation is keyed by the virtual address stored in
>> the gen_pool, but the pages API returns only the backing struct page.
>> 
>> On architectures with CONFIG_DMA_DIRECT_REMAP, atomic pool chunks are added
>> to the gen_pool using their remapped virtual address.
>> dma_direct_free_pages() reconstructs a linear-map address with
>> page_address(page) and passes that to dma_free_from_pool(). That address
>> does not match the gen_pool virtual range, so the pool lookup can fail and
>> the code can fall through to freeing a pool-owned page through the normal
>> page allocator path.
>> 
>> Add a page-based pool free helper that looks up the owning pool chunk by
>> physical address, translates it back to the gen_pool virtual address, and
>> frees that address to the pool. Use it from dma_direct_free_pages() while
>> keeping the existing virtual-address helper for coherent allocation frees.
>> 
>> Tested-by: Michael Kelley <mhklinux@outlook.com>
>> Tested-by: Mostafa Saleh <smostafa@google.com>
>> Signed-off-by: Aneesh Kumar K.V (Arm) <aneesh.kumar@kernel.org>
>> ---
>>  include/linux/dma-map-ops.h |  1 +
>>  kernel/dma/direct.c         |  4 +--
>>  kernel/dma/pool.c           | 54 +++++++++++++++++++++++++++++++++++++
>>  3 files changed, 57 insertions(+), 2 deletions(-)
>
> This seems pretty suboptimal?
>
> If !CONFIG_DMA_DIRECT_REMAP then page_to_virt() was used to compute
> the genpool's addr so dma_free_from_pool_page() can use the same
> logic, which is how things must be working at all today
>
> The CONFIG_DMA_DIRECT_REMAP scenario does look broken, so I'm
> surprised there isn't a Fixes line on this commit? I don't have an
> opinion on the search, but since alloc_pages() is used there is 8
> bytes in the struct page that could be used to store the remapped
> vaddr to avoid the search if someday someone wants to improve
> this. Maybe a small comment hinting that direction would be a nice
> addition.
>
> Jason
>

Something like

+/*
+ * FIXME!! We could avoid this by storing the remapped virtual address in
+ * struct page and using that for lookup.
+ */
 bool dma_free_from_pool_page(struct device *dev, struct page *page, size_t size)

-aneesh


^ permalink raw reply

* Re: [PATCH v7 11/22] dma-pool: track decrypted atomic pools and select them via attrs
From: Aneesh Kumar K.V @ 2026-07-14  4:02 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: iommu, linux-arm-kernel, linux-kernel, linux-coco, Robin Murphy,
	Marek Szyprowski, Will Deacon, Marc Zyngier, Steven Price,
	Suzuki K Poulose, Catalin Marinas, Jiri Pirko, Mostafa Saleh,
	Petr Tesarik, Alexey Kardashevskiy, Dan Williams, Xu Yilun,
	linuxppc-dev, linux-s390, Madhavan Srinivasan, Michael Ellerman,
	Nicholas Piggin, Christophe Leroy (CS GROUP), Alexander Gordeev,
	Gerald Schaefer, Heiko Carstens, Vasily Gorbik,
	Christian Borntraeger, Sven Schnelle, x86, Jiri Pirko,
	Michael Kelley
In-Reply-To: <20260713175616.GJ3133966@ziepe.ca>

Jason Gunthorpe <jgg@ziepe.ca> writes:

> On Wed, Jul 01, 2026 at 11:19:15AM +0530, Aneesh Kumar K.V (Arm) wrote:
>> -static int atomic_pool_expand(struct gen_pool *pool, size_t pool_size,
>> +static int atomic_pool_expand(struct dma_gen_pool *dma_pool, size_t pool_size,
>>  			      gfp_t gfp)
>>  {
>>  	unsigned int order;
>> @@ -114,14 +120,17 @@ static int atomic_pool_expand(struct gen_pool *pool, size_t pool_size,
>>  	 * Memory in the atomic DMA pools must be unencrypted, the pools do not
>>  	 * shrink so no re-encryption occurs in dma_direct_free().
>>  	 */
>> -	ret = set_memory_decrypted((unsigned long)page_to_virt(page),
>> -				   1 << order);
>> -	if (ret) {
>> -		leak_pages = true;
>> -		goto remove_mapping;
>> +	if (dma_pool->cc_shared) {
>> +		ret = set_memory_decrypted((unsigned long)page_to_virt(page),
>> +					   1 << order);
>> +		if (ret) {
>> +			leak_pages = true;
>> +			goto remove_mapping;
>> +		}
>>  	}
>> -	ret = gen_pool_add_virt(pool, (unsigned long)addr, page_to_phys(page),
>> -				pool_size, NUMA_NO_NODE);
>> +
>> +	ret = gen_pool_add_virt(dma_pool->pool, (unsigned long)addr,
>> +				page_to_phys(page), pool_size, NUMA_NO_NODE);
>>  	if (ret)
>>  		goto encrypt_mapping;
>>  
>> @@ -129,12 +138,10 @@ static int atomic_pool_expand(struct gen_pool *pool, size_t pool_size,
>>  	return 0;
>>  
>>  encrypt_mapping:
>> -	ret = set_memory_encrypted((unsigned long)page_to_virt(page),
>> -				   1 << order);
>> -	if (WARN_ON_ONCE(ret)) {
>> -		/* Decrypt succeeded but encrypt failed, purposely leak */
>> +	if (dma_pool->cc_shared &&
>> +	    set_memory_encrypted((unsigned long)page_to_virt(page), 1 << order))
>>  		leak_pages = true;
>> -	}
>> +
>
> Was it intentional to remove the WARN_ON and comment ?

That WARN_ON() was a bit inconsistent. Not all page leaks due to
encrypt/decrypt failures triggered a warning, so I removed it.

If we want to warn about such failures, we should add the warning
consistently across the code. We may also want to handle decrypt
failures by encrypting the page again to avoid leaking it.

I will work on that as a tree-wide change in a separate patch.

-aneesh


^ permalink raw reply

* Re: [PATCH v7 11/22] dma-pool: track decrypted atomic pools and select them via attrs
From: Aneesh Kumar K.V @ 2026-07-14  4:27 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: iommu, linux-arm-kernel, linux-kernel, linux-coco, Robin Murphy,
	Marek Szyprowski, Will Deacon, Marc Zyngier, Steven Price,
	Suzuki K Poulose, Catalin Marinas, Jiri Pirko, Mostafa Saleh,
	Petr Tesarik, Alexey Kardashevskiy, Dan Williams, Xu Yilun,
	linuxppc-dev, linux-s390, Madhavan Srinivasan, Michael Ellerman,
	Nicholas Piggin, Christophe Leroy (CS GROUP), Alexander Gordeev,
	Gerald Schaefer, Heiko Carstens, Vasily Gorbik,
	Christian Borntraeger, Sven Schnelle, x86, Jiri Pirko,
	Michael Kelley
In-Reply-To: <20260713184810.GM3133966@ziepe.ca>

Jason Gunthorpe <jgg@ziepe.ca> writes:

> On Wed, Jul 01, 2026 at 11:19:15AM +0530, Aneesh Kumar K.V (Arm) wrote:
>> @@ -114,14 +120,17 @@ static int atomic_pool_expand(struct gen_pool *pool, size_t pool_size,
>>  	 * Memory in the atomic DMA pools must be unencrypted, the pools do not
>>  	 * shrink so no re-encryption occurs in dma_direct_free().
>>  	 */
>> -	ret = set_memory_decrypted((unsigned long)page_to_virt(page),
>> -				   1 << order);
>> -	if (ret) {
>> -		leak_pages = true;
>> -		goto remove_mapping;
>> +	if (dma_pool->cc_shared) {
>> +		ret = set_memory_decrypted((unsigned long)page_to_virt(page),
>> +					   1 << order);
>> +		if (ret) {
>> +			leak_pages = true;
>> +			goto remove_mapping;
>> +		}
>>  	}
>
> This makes the memory_decrypted conditional, but it doesn't change
> the lines a few above:
>
> 	addr = dma_common_contiguous_remap(page, pool_size,
> 			pgprot_decrypted(pgprot_dmacoherent(PAGE_KERNEL)),
>                             ^^^^^^^^^^^^
> 			__builtin_return_address(0));
> 	if (!addr)
> 		goto free_page;
>
> It is wrong to pass pgprot_decrypted() to the arch code if
> set_memory_decrypted() was not called.
>
> Also it looks at some point the nature of the atomic pool has become
> confused. Originally it was just to allocate atomic memory that had
> been vmap'd outside the atomic context (to set the non-coherent
> pgprot), so every caller was expecting non-cached memory.
>
> Then it was reused to also allocate CC shared memory outside the
> atomic context. That was fine for x86 that doesn't use DMA_REMAP but
> on ARM64 it now means all atomic pool CC memory is uncached? That
> doesn't seem to make any sense...
>
> I suppose along the lines of this patch the solution is to add a
> noncoherent property to the pool so we can select the correct
> combination:
>
>  noncoherent !SHARED = vmap pgprot_noncached
> !noncoherent  SHARED= vmap pgprot_decrypted + set_memory_decrypted
>  noncoherent  SHARED = (probably unrealistic in real systems)
> !noncoherent !SHARED = normal __dma_direct_alloc_pages()
>
> But I don't view this as that important, the CC hypervisor is probably
> going to use the S2 page table to force cachable on all system memory
> so the non-cached pgprot is a NOP, but the extra vmap is wasteful and
> it is confusing.. So maybe a little fixme is all that is needed here.
>

Something like?

modified   kernel/dma/direct.c
@@ -260,6 +260,9 @@ void *dma_direct_alloc(struct device *dev, size_t size,
 	/*
 	 * Remapping or decrypting memory may block, allocate the memory from
 	 * the atomic pools instead if we aren't allowed block.
+	 * FIXME!! With CONFIG_DMA_DIRECT_REMAP, the pool is also mapped as
+	 * DMA-coherent (non-cacheable). We may want to create a separate pool
+	 * dedicated to CC_SHARED atomic allocations.
 	 */
 	if ((remap || (attrs & __DMA_ATTR_ALLOC_CC_SHARED)) &&
 	    dma_direct_use_pool(dev, gfp)) {
modified   kernel/dma/pool.c
@@ -88,6 +88,7 @@ static int atomic_pool_expand(struct dma_gen_pool *dma_pool, size_t pool_size,
 	unsigned int order;
 	struct page *page = NULL;
 	bool leak_pages = false;
+	pgprot_t prot;
 	void *addr;
 	int ret = -ENOMEM;
 	unsigned int min_encrypt_order = get_order(mem_cc_shared_granule_size());
@@ -110,8 +111,12 @@ static int atomic_pool_expand(struct dma_gen_pool *dma_pool, size_t pool_size,
 	arch_dma_prep_coherent(page, pool_size);
 
 #ifdef CONFIG_DMA_DIRECT_REMAP
-	addr = dma_common_contiguous_remap(page, pool_size,
-			pgprot_decrypted(pgprot_dmacoherent(PAGE_KERNEL)),
+	if (dma_pool->cc_shared)
+		prot = pgprot_decrypted(pgprot_dmacoherent(PAGE_KERNEL));
+	else
+		prot = pgprot_dmacoherent(PAGE_KERNEL);
+
+	addr = dma_common_contiguous_remap(page, pool_size, prot,
 			__builtin_return_address(0));
 	if (!addr)
 		goto free_page;


^ permalink raw reply

* Re: [PATCH] powerpc/powernv: fix null pointer dereference in pnv_get_random_long()
From: Madhavan Srinivasan @ 2026-07-14  4:48 UTC (permalink / raw)
  To: Paul Menzel, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Kees Cook, Tony Luck,
	Guilherme G. Piccoli, Jason A. Donenfeld
  Cc: stable, linuxppc-dev, linux-kernel
In-Reply-To: <20260511120413.254934-2-pmenzel@molgen.mpg.de>


On 5/11/26 5:34 PM, Paul Menzel wrote:
> pnv_get_random_long() dereferences the per-CPU pnv_rng pointer without
> checking whether it has been initialized resulting in the oops below:
>
>      [    0.000000] Linux version 7.1.0-rc2+ (pmenzel@flughafenberlinbrandenburgwillybrandt.molgen.mpg.de) (gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0, GNU ld (GNU Binutils for Ubuntu) 2.37) #3 SMP PREEMPT Wed May  6 08:50:58 CEST 2026
>      […]
>      [   17.901992] Kernel attempted to read user page (0) - exploit attempt? (uid: 0)
>      [   17.902011] BUG: Kernel NULL pointer dereference on read at 0x00000000
>      [   17.902018] Faulting instruction address: 0xc0000000000e7138
>      [   17.902027] Oops: Kernel access of bad area, sig: 11 [#1]
>      [   17.902034] LE PAGE_SIZE=64K MMU=Hash  SMP NR_CPUS=2048 NUMA PowerNV
>      [   17.902045] Modules linked in: powernv_rng(+) bnx2x ofpart ibmpowernv bfq mdio cmdlinepart powernv_flash ipmi_powernv ipmi_devintf mtd ipmi_msghandler at24(+) vmx_crypto opal_prd sch_fq_codel nfsd parport_pc ppdev auth_rpcgss nfs_acl lp lockd grace parport sunrpc autofs4 btrfs xor libblake2b raid6_pq ast drm_shmem_helper drm_client_lib i2c_algo_bit drm_kms_helper drm ahci drm_panel_orientation_quirks libahci
>      [   17.902185] CPU: 147 UID: 0 PID: 2626 Comm: hwrng Not tainted 7.1.0-rc2+ #3 PREEMPTLAZY
>      [   17.902197] Hardware name: 8335-GCA POWER8 (raw) 0x4d0200 opal:skiboot-5.4.8-5787ad3 PowerNV
>      [   17.902204] NIP:  c0000000000e7138 LR: c00800001ec8013c CTR: c0000000000e70fc
>      [   17.902212] REGS: c000000092913c50 TRAP: 0300   Not tainted  (7.1.0-rc2+)
>      [   17.902222] MSR:  900000000280b033 <SF,HV,VEC,VSX,EE,FP,ME,IR,DR,RI,LE>  CR: 44420220  XER: 20000000
>      [   17.902269] CFAR: c00800001ec8026c DAR: 0000000000000000 DSISR: 40000000 IRQMASK: 0
>                     GPR00: c00800001ec8013c c000000092913ef0 c000000001c18100 c00000002222d900
>                     GPR04: c00000002222d900 0000000000000080 0000000000000001 0000000000000000
>                     GPR08: 0000000000000000 c000000002212000 c0000000951e1780 c00800001ec80258
>                     GPR12: c0000000000e70fc c00000ffff6fd700 c0000000001d11c0 c00000001b99b9c0
>                     GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
>                     GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
>                     GPR24: 0000000000000000 c000000002fe6a58 0000000000000000 0000000000000000
>                     GPR28: c000000002fe6a20 0000000000000010 000000000000000f c00000002222d900
>      [   17.902406] NIP [c0000000000e7138] pnv_get_random_long+0x3c/0x114
>      [   17.902426] LR [c00800001ec8013c] powernv_rng_read+0x78/0xc4 [powernv_rng]
>      [   17.902444] Call Trace:
>      [   17.902448] [c000000092913ef0] [c000000092913f30] 0xc000000092913f30 (unreliable)
>      [   17.902463] [c000000092913f30] [c000000000decd58] hwrng_fillfn+0xd4/0x3dc
>      [   17.902484] [c000000092913f90] [c0000000001d1328] kthread+0x170/0x1a4
>      [   17.902498] [c000000092913fe0] [c00000000000d030] start_kernel_thread+0x14/0x18
>      [   17.902513] Code: 60000000 7d2000a6 71290010 418200bc e94d0908 812a0000 39290001 912a0000 e90d0030 3d220060 39299f00 7d08482a <e9280000> 7c0004ac e8e90000 0c070000
>      [   17.902569] ---[ end trace 0000000000000000 ]---
>      [   18.008801] pstore: backend (nvram) writing error (-1)
>
>      [   18.015458] note: hwrng[2626] exited with irqs disabled
>      [   18.015483] note: hwrng[2626] exited with preempt_count 1
>
> Commit f3eac426657d ("powerpc/powernv: wire up rng during setup_arch")
> introduced a lazy initialization path via pnv_get_random_long_early():
> per-CPU pointers are left NULL until slab becomes available and
> rng_create() completes.
>
> pnv_get_random_long() is an exported symbol called directly by the
> powernv_rng hwrng module (powernv_rng_read()), bypassing the
> ppc_md.get_random_seed guard that would otherwise ensure per-CPU data is
> ready.  If the hwrng fill thread runs on a CPU whose slot is still NULL,
> the function crashes dereferencing rng->regs at offset 0.
>
> Guard both branches with a NULL check and return 0 (no data) when the
> per-CPU pointer has not been set up yet.
>
> Testing on the IBM Power S822LC (8335-GCA POWER8 (raw) 0x4d0200
> opal:skiboot-5.4.8-5787ad3 PowerNV) is successful:
>
>      [   23.850775] powernv_rng: Registered powernv hwrng.
>
> Fixes: f3eac426657d ("powerpc/powernv: wire up rng during setup_arch")
> Link: https://lore.kernel.org/all/a159e81a-ccfd-440f-af68-6a56cca09cb2@molgen.mpg.de/
> Cc: Jason A. Donenfeld <Jason@zx2c4.com>
> Cc: stable@vger.kernel.org # v5.18
> Assisted-by: Claude Sonnet 4.6
> Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
> ---
> No idea, how to test, that the rng works as expected (and if, despite
> the missing message) it  didn’t work before.
>
>   arch/powerpc/platforms/powernv/rng.c | 12 ++++++++----
>   1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/platforms/powernv/rng.c b/arch/powerpc/platforms/powernv/rng.c
> index 7a4c38cd6a82..dc71eaf5d954 100644
> --- a/arch/powerpc/platforms/powernv/rng.c
> +++ b/arch/powerpc/platforms/powernv/rng.c
> @@ -87,12 +87,16 @@ int pnv_get_random_long(unsigned long *v)
>   
>   	if (mfmsr() & MSR_DR) {
>   		rng = get_cpu_var(pnv_rng);
> -		*v = rng_whiten(rng, in_be64(rng->regs));
> +		if (rng)
> +			*v = rng_whiten(rng, in_be64(rng->regs));
>   		put_cpu_var(rng);
> -	} else {
> -		rng = raw_cpu_read(pnv_rng);
> -		*v = rng_whiten(rng, __raw_rm_readq(rng->regs_real));


Not sure whether I understand this. rng is not initialized, we will need 
raw_cpu_read before check right?


> +		return rng ? 1 : 0;
>   	}
> +
> +	rng = raw_cpu_read(pnv_rng);
> +	if (!rng)
> +		return 0;
> +	*v = rng_whiten(rng, __raw_rm_readq(rng->regs_real));
>   	return 1;
>   }
>   EXPORT_SYMBOL_GPL(pnv_get_random_long);


^ permalink raw reply

* Re: [PATCH v7 20/22] dma: swiotlb: free dynamic pools from process context
From: Aneesh Kumar K.V @ 2026-07-14  5:03 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: iommu, linux-arm-kernel, linux-kernel, linux-coco, Robin Murphy,
	Marek Szyprowski, Will Deacon, Marc Zyngier, Steven Price,
	Suzuki K Poulose, Catalin Marinas, Jiri Pirko, Mostafa Saleh,
	Petr Tesarik, Alexey Kardashevskiy, Dan Williams, Xu Yilun,
	linuxppc-dev, linux-s390, Madhavan Srinivasan, Michael Ellerman,
	Nicholas Piggin, Christophe Leroy (CS GROUP), Alexander Gordeev,
	Gerald Schaefer, Heiko Carstens, Vasily Gorbik,
	Christian Borntraeger, Sven Schnelle, x86, Michael Kelley
In-Reply-To: <20260713194131.GZ3133966@ziepe.ca>

Jason Gunthorpe <jgg@ziepe.ca> writes:

> On Wed, Jul 01, 2026 at 11:19:24AM +0530, Aneesh Kumar K.V (Arm) wrote:
>
>> @@ -840,7 +843,7 @@ static void swiotlb_del_pool(struct device *dev, struct io_tlb_pool *pool)
>>  	list_del_rcu(&pool->node);
>>  	spin_unlock_irqrestore(&dev->dma_io_tlb_lock, flags);
>>  
>> -	call_rcu(&pool->rcu, swiotlb_dyn_free);
>> +	swiotlb_schedule_dyn_free(pool);
>
> This knows if the pool has cc_shared memory in it since there is now a
> flag tracking that? So should the work queue version be conditional on
> that flag?
>

We could definitely do that. I was not sure whether it was worth it,
considering that it would add two paths for SWIOTLB dynamic free.

-aneesh


^ permalink raw reply

* Re: [PATCH v7 00/22] dma-mapping: Track shared DMA state through direct, pool and swiotlb paths
From: Marek Szyprowski @ 2026-07-14  6:06 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Aneesh Kumar K.V, iommu, linux-arm-kernel, linux-kernel,
	linux-coco, Robin Murphy, Will Deacon, Marc Zyngier, Steven Price,
	Suzuki K Poulose, Catalin Marinas, Jiri Pirko, Mostafa Saleh,
	Petr Tesarik, Alexey Kardashevskiy, Dan Williams, Xu Yilun,
	linuxppc-dev, linux-s390, Madhavan Srinivasan, Michael Ellerman,
	Nicholas Piggin, Christophe Leroy (CS GROUP), Alexander Gordeev,
	Gerald Schaefer, Heiko Carstens, Vasily Gorbik,
	Christian Borntraeger, Sven Schnelle, x86
In-Reply-To: <20260713194323.GC3133966@ziepe.ca>

On 13.07.2026 21:43, Jason Gunthorpe wrote:
> On Tue, Jul 07, 2026 at 03:03:48PM +0200, Marek Szyprowski wrote:
>> I'm fine with merging on top of the topic branch and I assume that this
>> patchset is mature enough to give it a try in linux-next, but first I
>> would like to get a review or at least acks from others with good CC
>> knowledge or experience.
> I think it is good to go from a CC perspective, there are still some
> more items to fix up (like the MMIO) but I'd rather they be followups
> at this point.

Great. Aneesh, any chance You could send v8 with the remaining items fixed till end of this week? I will be happy to push it to dma-mapping-for-next for testing in linux-next asap.

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland



^ permalink raw reply

* Re: [patch 4/4] entry, treewide: Make syscall_enter_from_user_mode[_work]() indicate syscall execution
From: Michal Suchánek @ 2026-07-14  7:29 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: LKML, Michael Ellerman, Shrikanth Hegde, linuxppc-dev,
	Huacai Chen, loongarch, Paul Walmsley, Palmer Dabbelt,
	linux-riscv, Sven Schnelle, linux-s390, x86, Mark Rutland,
	Jinjie Ruan, Magnus Lindholm, Mukesh Kumar Chaurasiya (IBM),
	Jonathan Corbet, Radu Rendec
In-Reply-To: <871pd6r0ou.ffs@fw13>

On Tue, Jul 14, 2026 at 12:20:49AM +0200, Thomas Gleixner wrote:
> On Mon, Jul 13 2026 at 10:44, Michal Suchánek wrote:
> > On Sun, Jul 12, 2026 at 11:25:32PM +0200, Thomas Gleixner wrote:
> >> The return values of syscall_enter_from_user_mode[_work]() are
> >> non-intuitive. Both functions return the syscall number which should be
> >> invoked by the architecture specific syscall entry code. The returned
> >> number can be:
> >> 
> >>   - the unmodified syscall number which was handed in by the caller
> >> 
> >>   - a modified syscall number (ptrace, seccomp, trace/probe/bpf)
> >> 
> >> That has an additional twist. If the return value is -1L then the caller is
> >> not allowed to modify the return value as that indicates that the modifying
> >> entity requests to abort the syscall and set the return value already. That
> >> can obviously not be differentiated from a syscall which handed in -1 as
> >> syscall number.
> >> 
> >> The most trivial way to deal with that is:
> >> 
> >>     set_return_value(regs, -ENOSYS);
> >>     nr = syscall_enter_from_user_mode(regs, nr);
> >>     if (valid(nr))
> >>     	handle_syscall(regs, nr);
> >> 
> >> That's what LOONGARCH, RISCV, and X86 do. But PowerPC and S390 do not
> >> preset the return value, so when user space hands in -1 and there is
> >> nothing setting the return value in the entry work code, then the syscall
> >> is skipped but the return value is whatever random data has been in the
> >> return value register.
> >
> > The reason why PowerPC and S390 do not preset the return value is that
> > the return value uses the same register as the syscall number. There are
> > apparently other architectures on which the return value overlaps with
> > the arguments which also do not preset the return value for that reason.
> > If they would use the generic entry the same problem would arise.
> 
> That's an implementation choice of PPC/S390 as I explained before, which
> could trivially be solved by having an explicit pt_regs->return_val
> member,
> 
> >> Change the return values of syscall_enter_from_user_mode[_work]() to
> >> boolean and return false, when either ptrace or seccomp request to skip the
> >
> > There is a difference between seccomp and ptrace.
> >
> > When seccomp indicates to skip the syscall it has also set the syscall
> > return value.
> >
> > However, when the syscall number is -1 and the return value is not
> > preset that does not indicate anything.
> 
> I agree it's an invalid syscall, but the current generic entry code made
> the rightful assumption that returning -1L as the syscall number either
> results in -ENOSYS or in the value which was set by one of the entry
> mechanisms as that code originated from the x86 implementation.

You know, the world is not x86. For 20+ years that is not true.

> 
> It's not the fault of that code that PPC and S390 converted their stuff
> over without paying attention to that detail.

So this is not generic entry but rather x86-like entry do I get it
correct?

> 
> > The return value can still hold garbage. ptrace does not have the
> > ability to indicate that a syscall is to be skipped, at least on the
> > entry trace. It needs to be skipped based on the syscall number being
> > invalid.
> 
> That's what I explained you before and you told me I'm all wrong.
> 
> But that's moot as this latest version does not care anymore. The
> architectures whixh preset the return value are correct under all
> circumstances and PPC/S390 can keep their own world view.

So do I get it that you do not care about breaking userspace then?

Thanks

Michal


^ permalink raw reply

* [PATCH V5] powerpc/syscall: Fix syscall skip handling for seccomp and ptrace
From: Mukesh Kumar Chaurasiya (IBM) @ 2026-07-14  7:59 UTC (permalink / raw)
  To: oleg, maddy, mpe, npiggin, chleroy, msuchanek, mchauras,
	mkchauras, sshegde, segher, thuth, kees, ryan.roberts,
	linuxppc-dev, linux-kernel

After enabling GENERIC_ENTRY on PowerPC, syscall_enter_from_user_mode()
returns -1 as a sentinel to signal that seccomp or ptrace has intercepted
the syscall and already set a return value via syscall_set_return_value().
system_call_exception() was not handling this sentinel, and since -1UL
is >= NR_syscalls, the code fell into the out-of-range path and returned
-ENOSYS, overwriting the errno already placed in regs->gpr[3].

The naive fix of checking r0 == -1L before the NR_syscalls bounds check
is ambiguous: a user legitimately calling syscall(-1) also produces r0 ==
-1L, and a tracer intercepting such a call would have its injected return
value silently discarded.

Fix this properly by introducing regs->entry_flags, a kernel-internal
field in struct pt_regs (consuming one slot of the existing __pt_regs_pad
so the ABI is preserved), with SYSCALL_ENTRY_RET_SET as an out-of-band
flag. syscall_set_return_value() sets this flag whenever seccomp or ptrace
injects a return value. system_call_exception() zeros entry_flags before
calling syscall_enter_from_user_mode(), then checks and clears the flag
afterwards: if set, it returns regs->gpr[3] directly regardless of what
syscall number the user originally requested.

This handles all seccomp actions correctly:

  - SECCOMP_RET_ERRNO, SECCOMP_RET_TRACE (no tracer), SECCOMP_RET_USER_NOTIF:
    all call syscall_set_return_value(), flag is set, injected value returned.
  - SECCOMP_RET_TRAP, SECCOMP_RET_KILL: call syscall_rollback() and deliver
    a signal; flag is not set, but the process is dying so the return value
    is irrelevant.

The fix covers both ppc32 and ppc64 with no #ifdefs.

Fixes: bee25f97ad24 ("powerpc: Enable GENERIC_ENTRY feature")
Reported-by: Michal Suchánek <msuchanek@suse.de>
Closes: https://lore.kernel.org/all/ajpp-_XnbF3UTM_E@kunlun.suse.cz/
Tested-by: Michal Suchánek <msuchanek@suse.de>
Reviewed-by: Michal Suchánek <msuchanek@suse.de>
Signed-off-by: Mukesh Kumar Chaurasiya (IBM) <mkchauras@gmail.com>
---
v4 -> v5:
 - Fixed build failure where BITS macro is not available
v3 -> v4:
 - Use syscall_get_error (Michal)
v2 -> v3:
 - Last fix is not working for -1 syscall. Fixed that with this.
v2: https://lore.kernel.org/all/20260629182946.419552-1-mkchauras@gmail.com

v1 -> v2:
 - Fix issues in the previous fix (Michal)
v1: https://lore.kernel.org/all/20260624171520.772408-1-mkchauras@gmail.com


 arch/powerpc/include/asm/ptrace.h      | 23 ++++++++++++++++++++++-
 arch/powerpc/include/asm/syscall.h     |  6 ++++++
 arch/powerpc/include/uapi/asm/ptrace.h |  6 ++++--
 arch/powerpc/kernel/ptrace/ptrace.c    |  2 ++
 arch/powerpc/kernel/syscall.c          | 18 ++++++++++++++++++
 5 files changed, 52 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/include/asm/ptrace.h b/arch/powerpc/include/asm/ptrace.h
index fdeb97421785..363a89787f1c 100644
--- a/arch/powerpc/include/asm/ptrace.h
+++ b/arch/powerpc/include/asm/ptrace.h
@@ -19,6 +19,7 @@
 #ifndef _ASM_POWERPC_PTRACE_H
 #define _ASM_POWERPC_PTRACE_H
 
+#include <linux/bits.h>
 #include <linux/err.h>
 #include <uapi/asm/ptrace.h>
 #include <asm/asm-const.h>
@@ -54,8 +55,9 @@ struct pt_regs
 			};
 			unsigned long result;
 			unsigned long exit_flags;
+			unsigned long entry_flags;
 			/* Maintain 16 byte interrupt stack alignment */
-			unsigned long __pt_regs_pad[3];
+			unsigned long __pt_regs_pad[2];
 		};
 	};
 #if defined(CONFIG_PPC64) || defined(CONFIG_PPC_KUAP)
@@ -233,6 +235,25 @@ static inline unsigned long frame_pointer(struct pt_regs *regs)
 #define current_pt_regs() \
 	((struct pt_regs *)((unsigned long)task_stack_page(current) + THREAD_SIZE) - 1)
 
+/*
+ * SYSCALL_ENTRY_RET_SET: seccomp or ptrace called syscall_set_return_value()
+ * and wants the syscall skipped; regs->gpr[3] already holds the return value.
+ */
+#define SYSCALL_ENTRY_RET_SET	BIT(0)
+
+static inline void set_syscall_entry_ret(struct pt_regs *regs)
+{
+	regs->entry_flags |= SYSCALL_ENTRY_RET_SET;
+}
+
+static inline bool test_and_clear_syscall_entry_ret(struct pt_regs *regs)
+{
+	bool set = !!(regs->entry_flags & SYSCALL_ENTRY_RET_SET);
+
+	regs->entry_flags &= ~SYSCALL_ENTRY_RET_SET;
+	return set;
+}
+
 /*
  * The 4 low bits (0xf) are available as flags to overload the trap word,
  * because interrupt vectors have minimum alignment of 0x10. TRAP_FLAGS_MASK
diff --git a/arch/powerpc/include/asm/syscall.h b/arch/powerpc/include/asm/syscall.h
index 834fcc4f7b54..9ae79326abe3 100644
--- a/arch/powerpc/include/asm/syscall.h
+++ b/arch/powerpc/include/asm/syscall.h
@@ -98,6 +98,12 @@ static inline void syscall_set_return_value(struct task_struct *task,
 			regs->gpr[3] = val;
 		}
 	}
+	/*
+	 * Mark that a return value has been explicitly set by seccomp or
+	 * ptrace so that system_call_exception() can skip the syscall
+	 * unconditionally, even when the user requested syscall(-1).
+	 */
+	set_syscall_entry_ret(regs);
 }
 
 static inline void syscall_get_arguments(struct task_struct *task,
diff --git a/arch/powerpc/include/uapi/asm/ptrace.h b/arch/powerpc/include/uapi/asm/ptrace.h
index a393b7f2760a..2f2a43414fe6 100644
--- a/arch/powerpc/include/uapi/asm/ptrace.h
+++ b/arch/powerpc/include/uapi/asm/ptrace.h
@@ -56,7 +56,8 @@ struct pt_regs
 	unsigned long dsisr;		/* on 4xx/Book-E used for ESR */
 	unsigned long result;		/* Result of a system call */
 	unsigned long exit_flags;	/* System call exit flags */
-	unsigned long __pt_regs_pad[3];	/* Maintain 16 byte interrupt stack alignment */
+	unsigned long entry_flags;	/* System call entry flags */
+	unsigned long __pt_regs_pad[2];	/* Maintain 16 byte interrupt stack alignment */
 };
 
 #endif /* __ASSEMBLER__ */
@@ -117,7 +118,8 @@ struct pt_regs
 #define PT_DSISR 42
 #define PT_RESULT 43
 #define PT_EXIT_FLAGS 44
-#define PT_PAD 47 /* 3 times */
+#define PT_ENTRY_FLAGS 45
+#define PT_PAD 46 /* 2 times */
 #define PT_DSCR 48
 #define PT_REGS_COUNT 48
 
diff --git a/arch/powerpc/kernel/ptrace/ptrace.c b/arch/powerpc/kernel/ptrace/ptrace.c
index 316d4f5ead8e..440d00690cf2 100644
--- a/arch/powerpc/kernel/ptrace/ptrace.c
+++ b/arch/powerpc/kernel/ptrace/ptrace.c
@@ -235,6 +235,8 @@ void __init pt_regs_check(void)
 		     offsetof(struct user_pt_regs, dsisr));
 	BUILD_BUG_ON(offsetof(struct pt_regs, result) !=
 		     offsetof(struct user_pt_regs, result));
+	BUILD_BUG_ON(offsetof(struct pt_regs, entry_flags) !=
+		     offsetof(struct user_pt_regs, entry_flags));
 
 	BUILD_BUG_ON(sizeof(struct user_pt_regs) > sizeof(struct pt_regs));
 
diff --git a/arch/powerpc/kernel/syscall.c b/arch/powerpc/kernel/syscall.c
index a9da2af6efa8..a43d3a9428cc 100644
--- a/arch/powerpc/kernel/syscall.c
+++ b/arch/powerpc/kernel/syscall.c
@@ -19,9 +19,27 @@ notrace long system_call_exception(struct pt_regs *regs, unsigned long r0)
 	long ret;
 	syscall_fn f;
 
+	/*
+	 * Zero entry_flags before syscall_enter_from_user_mode() so that
+	 * syscall_set_return_value() can set SYSCALL_ENTRY_RET_SET as an
+	 * unambiguous out-of-band signal.  The field is not initialised by
+	 * the entry assembly.
+	 */
+	regs->entry_flags = 0;
 	add_random_kstack_offset();
 	r0 = syscall_enter_from_user_mode(regs, r0);
 
+	/*
+	 * Seccomp or ptrace may have set a return value and requested that
+	 * the syscall be skipped. syscall_set_return_value() sets
+	 * SYSCALL_ENTRY_RET_SET in regs->entry_flags as an
+	 * unambiguous out-of-band signal. This avoids the ambiguity of
+	 * using r0 == -1 as the skip sentinel when the user themselves
+	 * called syscall(-1).
+	 */
+	if (unlikely(test_and_clear_syscall_entry_ret(regs)))
+		return syscall_get_error(current, regs);
+
 	if (unlikely(r0 >= NR_syscalls)) {
 		if (unlikely(trap_is_unsupported_scv(regs))) {
 			/* Unsupported scv vector */
-- 
2.55.0



^ permalink raw reply related

* Re: [PATCH 13/14] ASoC: qcom: audioreach: use C-style "/*" comment
From: Srinivas Kandagatla @ 2026-07-14  8:05 UTC (permalink / raw)
  To: Randy Dunlap, linux-sound
  Cc: Jaroslav Kysela, Takashi Iwai, Shengjiu Wang, Xiubo Li,
	Fabio Estevam, Nicolin Chen, linuxppc-dev, Charles Keepax,
	Maciej Strozek, Bard Liao, Pierre-Louis Bossart, patches,
	Srinivas Kandagatla, linux-arm-msm, Liam Girdwood, Mark Brown
In-Reply-To: <20260714014445.569992-14-rdunlap@infradead.org>



On 7/14/26 2:44 AM, Randy Dunlap wrote:
> Modify the "/**" to use "/*" instead since this is not a kernel-doc
> comment. This avoids all kernel-doc warnings in this header file:
> 
> Warning: include/uapi/sound/snd_ar_tokens.h:61 Cannot find identifier on line:
>  * %AR_TKN_U32_SUB_GRAPH_INSTANCE_ID:           Sub Graph Instance Id
> Warning: ../include/uapi/sound/snd_ar_tokens.h:62 Cannot find identifier on line: *
> Warning: ../include/uapi/sound/snd_ar_tokens.h:63 Cannot find identifier on line:
>  * %AR_TKN_U32_SUB_GRAPH_PERF_MODE:             Performance mode of subgraph
> Warning: include/uapi/sound/snd_ar_tokens.h:64 This comment starts with '/**', but isn't a kernel-doc comment.
> 
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>


Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>

--srini
> ---
> Cc: Liam Girdwood <lgirdwood@gmail.com>
> Cc: Mark Brown <broonie@kernel.org>
> Cc: Srinivas Kandagatla <srini@kernel.org>
> Cc: linux-arm-msm@vger.kernel.org
> 
>  include/uapi/sound/snd_ar_tokens.h |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- linext-2026-0710.orig/include/uapi/sound/snd_ar_tokens.h
> +++ linext-2026-0710/include/uapi/sound/snd_ar_tokens.h
> @@ -58,7 +58,7 @@ enum ar_event_types {
>  #define SND_SOC_AR_TPLG_FE_BE_GRAPH_CTL_MIX	256
>  #define SND_SOC_AR_TPLG_VOL_CTL			257
>  
> -/**
> +/*
>   * %AR_TKN_U32_SUB_GRAPH_INSTANCE_ID:		Sub Graph Instance Id
>   *
>   * %AR_TKN_U32_SUB_GRAPH_PERF_MODE:		Performance mode of subgraph



^ permalink raw reply

* Re: [patch 13/18] entry: Make trace_syscall_enter() return type bool
From: Michal Suchánek @ 2026-07-14  8:20 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: LKML, Peter Zijlstra, Michael Ellerman, Shrikanth Hegde,
	linuxppc-dev, Kees Cook, Huacai Chen, loongarch, Paul Walmsley,
	Palmer Dabbelt, linux-riscv, Sven Schnelle, linux-s390, x86,
	Mark Rutland, Jinjie Ruan, Andy Lutomirski, Oleg Nesterov,
	Richard Henderson, Russell King, Catalin Marinas, Guo Ren,
	Geert Uytterhoeven, Thomas Bogendoerfer, Helge Deller,
	Yoshinori Sato, Richard Weinberger, Chris Zankel,
	linux-arm-kernel, linux-alpha, linux-csky, linux-m68k, linux-mips,
	linux-parisc, linux-sh, linux-um, Arnd Bergmann, Vineet Gupta,
	Will Deacon, Brian Cain, Michal Simek, Dinh Nguyen,
	David S. Miller, Andreas Larsson, linux-snps-arc, linux-hexagon,
	linux-openrisc, sparclinux, linux-arch, Jonathan Corbet,
	linux-doc
In-Reply-To: <87a4rxqnar.ffs@fw13>

On Sat, Jul 11, 2026 at 10:33:16PM +0200, Thomas Gleixner wrote:
> Michal!
> 
> On Fri, Jul 10 2026 at 13:01, Michal Suchánek wrote:
> > On Wed, Jul 08, 2026 at 10:34:38PM +0200, Thomas Gleixner wrote:
> >> does not make #2 magically go away. It's still the same problem whether
> >> you like it or not.
> >
> > However, reading the syscall number from pt_regs only after
> > syscall_enter_from_user_mode exits does.
> 
> That does not solve anything at all.
> 
> TBH, your communication style is annoying as hell. You fail to provide
> any useful arguments and explanations despite me giving you a proper
> analysis. And I'm absolutely tired of this.
> 
> So let me try again for _ONE_ last time to explain you why your ppc/s390
> world view is broken and let's look at the current code (irrelevant
> portions omitted).
> 
> static __always_inline long syscall_trace_enter(struct pt_regs *regs, unsigned long work)
> {
> 	if (work & SYSCALL_WORK_SYSCALL_USER_DISPATCH) {
> #1		if (syscall_user_dispatch(regs))
> 			return -1L;
> 	}
>         
> 	if (work & (SYSCALL_WORK_SYSCALL_TRACE | SYSCALL_WORK_SYSCALL_EMU)) {
> #2		ret = arch_ptrace_report_syscall_entry(regs);
> 		if (ret || (work & SYSCALL_WORK_SYSCALL_EMU))
> 			return -1L;
> 	}
> 
> 	/* Do seccomp after ptrace, to catch any tracer changes. */
> 	if (work & SYSCALL_WORK_SECCOMP) {
> #3		ret = __secure_computing();
> 		if (ret == -1L)
> 			return ret;
> 	}
> 
> 	/* Either of the above might have changed the syscall number */
> #4	syscall = syscall_get_nr(current, regs);
> 
> 	if (unlikely(work & SYSCALL_WORK_SYSCALL_TRACEPOINT))
> #5		syscall = trace_syscall_enter(regs, syscall);
> 
>         return syscall;
> }
> 
> #1) The user dispatch mechanism does not modify the syscall return
>     value, but it can rollback the syscall and tell the call site to
>     skip the invocation.
> 
>     The mechanism used in upstream today is to return -1L as the syscall
>     number which makes the architecture specific entry code skip the
>     syscall and refrain from touching the return value.
> 
> #2) ptrace
> 
>     ptrace can poke whatever it wants into the syscall number storage
>     via ptrace_set_syscall_info_entry() -> syscall_set_nr()
> 
>     It does not set the return code.
> 
>     It does not abort the syscall when the poked syscall number is -1L.

Indeed, it does not abort on -1 syscall number anymore although there
are still comments around that claim that setting the syscall number to
-1 is special.

Thanks

Michal


^ permalink raw reply

* Re: [patch 4/4] entry, treewide: Make syscall_enter_from_user_mode[_work]() indicate syscall execution
From: Michal Suchánek @ 2026-07-14  8:40 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: LKML, Michael Ellerman, Shrikanth Hegde, linuxppc-dev,
	Huacai Chen, loongarch, Paul Walmsley, Palmer Dabbelt,
	linux-riscv, Sven Schnelle, linux-s390, x86, Mark Rutland,
	Jinjie Ruan, Magnus Lindholm, Mukesh Kumar Chaurasiya (IBM),
	Jonathan Corbet, Radu Rendec
In-Reply-To: <alXlSUcT2TWOlM7r@kunlun.suse.cz>

On Tue, Jul 14, 2026 at 09:29:13AM +0200, Michal Suchánek wrote:
> On Tue, Jul 14, 2026 at 12:20:49AM +0200, Thomas Gleixner wrote:
> > On Mon, Jul 13 2026 at 10:44, Michal Suchánek wrote:
> > > On Sun, Jul 12, 2026 at 11:25:32PM +0200, Thomas Gleixner wrote:
> > >> The return values of syscall_enter_from_user_mode[_work]() are
> > >> non-intuitive. Both functions return the syscall number which should be
> > >> invoked by the architecture specific syscall entry code. The returned
> > >> number can be:
> > >> 
> > >>   - the unmodified syscall number which was handed in by the caller
> > >> 
> > >>   - a modified syscall number (ptrace, seccomp, trace/probe/bpf)
> > >> 
> > >> That has an additional twist. If the return value is -1L then the caller is
> > >> not allowed to modify the return value as that indicates that the modifying
> > >> entity requests to abort the syscall and set the return value already. That
> > >> can obviously not be differentiated from a syscall which handed in -1 as
> > >> syscall number.
> > >> 
> > >> The most trivial way to deal with that is:
> > >> 
> > >>     set_return_value(regs, -ENOSYS);
> > >>     nr = syscall_enter_from_user_mode(regs, nr);
> > >>     if (valid(nr))
> > >>     	handle_syscall(regs, nr);
> > >> 
> > >> That's what LOONGARCH, RISCV, and X86 do. But PowerPC and S390 do not
> > >> preset the return value, so when user space hands in -1 and there is
> > >> nothing setting the return value in the entry work code, then the syscall
> > >> is skipped but the return value is whatever random data has been in the
> > >> return value register.
> > >
> > > The reason why PowerPC and S390 do not preset the return value is that
> > > the return value uses the same register as the syscall number. There are
> > > apparently other architectures on which the return value overlaps with
> > > the arguments which also do not preset the return value for that reason.
> > > If they would use the generic entry the same problem would arise.
> > 
> > That's an implementation choice of PPC/S390 as I explained before, which
> > could trivially be solved by having an explicit pt_regs->return_val
> > member,

Sorry, I got confused, and was looking at the previous revision of the
patchset.

In this revision I do not see any obvious problem that did not exist
before.

Thanks

Michal


^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox