All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v3 0/2] regmap: provide simple bitops and use them in a driver
From: Mark Brown @ 2020-05-29 16:51 UTC (permalink / raw)
  To: Bartosz Golaszewski, Sean Wang, John Crispin, Matthias Brugger,
	Mark Lee, Jakub Kicinski, David S . Miller
  Cc: linux-arm-kernel, linux-mediatek, Pedro Tsai, Andrew Perepech,
	netdev, linux-kernel, Bartosz Golaszewski, Fabien Parent,
	Stephane Le Provost
In-Reply-To: <20200528154503.26304-1-brgl@bgdev.pl>

On Thu, 28 May 2020 17:45:01 +0200, Bartosz Golaszewski wrote:
> I noticed that oftentimes I use regmap_update_bits() for simple bit
> setting or clearing. In this case the fourth argument is superfluous as
> it's always 0 or equal to the mask argument.
> 
> This series proposes to add simple bit operations for setting, clearing
> and testing specific bits with regmap.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git for-next

Thanks!

[1/1] regmap: provide helpers for simple bit operations
      commit: aa2ff9dbaeddabb5ad166db5f9f1a0580a8bbba8

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply

* Re: [PATCH v2] ASoC: reduce verbosity of error messages for sof-dai and sof-link
From: Mark Brown @ 2020-05-29 16:50 UTC (permalink / raw)
  To: Pierre-Louis Bossart, alsa-devel; +Cc: tiwai, Kuninori Morimoto
In-Reply-To: <20200529123613.13447-1-pierre-louis.bossart@linux.intel.com>

On Fri, 29 May 2020 07:36:13 -0500, Pierre-Louis Bossart wrote:
> Recent changes result in multiple dmesg traces such as:
> 
> [ 14.410435] Audio Port: ASoC: error at snd_soc_link_startup on Audio
> Port: 1
> 
> [ 14.410446] sst-mfld-platform sst-mfld-platform: ASoC: error at
> snd_soc_dai_startup on media-cpu-dai: 1
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: reduce verbosity of error messages for sof-dai and sof-link
      commit: 28ff437a44fa618a14bc7402c7472b278af4c9eb

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply

* Re: [PATCH] watchdog: sunxi_wdt: fix improper error exit code
From: Guenter Roeck @ 2020-05-29 16:51 UTC (permalink / raw)
  To: Frank Lee
  Cc: linux-watchdog, tiny.windzz, linux-kernel, mripard, wens, wuyan,
	wim, linux-arm-kernel
In-Reply-To: <20200529094514.26374-1-frank@allwinnertech.com>

On Fri, May 29, 2020 at 05:45:14PM +0800, Frank Lee wrote:
> From: Martin Wu <wuyan@allwinnertech.com>
> 
> sunxi_wdt_probe() should return -ENOMEM when devm_kzalloc() fails.
> 
> Signed-off-by: Martin Wu <wuyan@allwinnertech.com>
> Signed-off-by: Frank Lee <frank@allwinnertech.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/sunxi_wdt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/sunxi_wdt.c b/drivers/watchdog/sunxi_wdt.c
> index 5f05a45ac187..b50757882a98 100644
> --- a/drivers/watchdog/sunxi_wdt.c
> +++ b/drivers/watchdog/sunxi_wdt.c
> @@ -235,7 +235,7 @@ static int sunxi_wdt_probe(struct platform_device *pdev)
>  
>  	sunxi_wdt = devm_kzalloc(dev, sizeof(*sunxi_wdt), GFP_KERNEL);
>  	if (!sunxi_wdt)
> -		return -EINVAL;
> +		return -ENOMEM;
>  
>  	sunxi_wdt->wdt_regs = of_device_get_match_data(dev);
>  	if (!sunxi_wdt->wdt_regs)
> -- 
> 2.24.0
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply

* Re: [PATCH] watchdog: sunxi_wdt: fix improper error exit code
From: Guenter Roeck @ 2020-05-29 16:51 UTC (permalink / raw)
  To: Frank Lee
  Cc: wim, mripard, wens, linux-watchdog, linux-arm-kernel,
	linux-kernel, wuyan, tiny.windzz
In-Reply-To: <20200529094514.26374-1-frank@allwinnertech.com>

On Fri, May 29, 2020 at 05:45:14PM +0800, Frank Lee wrote:
> From: Martin Wu <wuyan@allwinnertech.com>
> 
> sunxi_wdt_probe() should return -ENOMEM when devm_kzalloc() fails.
> 
> Signed-off-by: Martin Wu <wuyan@allwinnertech.com>
> Signed-off-by: Frank Lee <frank@allwinnertech.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/sunxi_wdt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/sunxi_wdt.c b/drivers/watchdog/sunxi_wdt.c
> index 5f05a45ac187..b50757882a98 100644
> --- a/drivers/watchdog/sunxi_wdt.c
> +++ b/drivers/watchdog/sunxi_wdt.c
> @@ -235,7 +235,7 @@ static int sunxi_wdt_probe(struct platform_device *pdev)
>  
>  	sunxi_wdt = devm_kzalloc(dev, sizeof(*sunxi_wdt), GFP_KERNEL);
>  	if (!sunxi_wdt)
> -		return -EINVAL;
> +		return -ENOMEM;
>  
>  	sunxi_wdt->wdt_regs = of_device_get_match_data(dev);
>  	if (!sunxi_wdt->wdt_regs)
> -- 
> 2.24.0
> 

^ permalink raw reply

* Re: [PATCH net-next 00/11] New DSA driver for VSC9953 Seville switch
From: Mark Brown @ 2020-05-29 16:51 UTC (permalink / raw)
  To: Vladimir Oltean, davem
  Cc: linux, claudiu.manoil, vivien.didelot, f.fainelli, andrew,
	allan.nielsen, antoine.tenart, netdev, fido_max,
	alexandre.belloni, radu-andrei.bulie, horatiu.vultur,
	alexandru.marginean, UNGLinuxDriver, madalin.bucur
In-Reply-To: <20200527234113.2491988-1-olteanv@gmail.com>

On Thu, 28 May 2020 02:41:02 +0300, Vladimir Oltean wrote:
> Looking at the Felix and Ocelot drivers, Maxim asked if it would be
> possible to use them as a base for a new driver for the switch inside
> NXP T1040. Turns out, it is! The result is a driver eerily similar to
> Felix.
> 
> The biggest challenge seems to be getting register read/write API
> generic enough to cover such wild bitfield variations between hardware
> generations. There is a patch on the regmap core which I would like to
> get in through the networking subsystem, if possible (and if Mark is
> ok), since it's a trivial addition.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git for-next

Thanks!

[1/1] regmap: add helper for per-port regfield initialization
      commit: 8baebfc2aca26e3fa67ab28343671b82be42b22c

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply

* Re: [PATCH] ASoC: img-i2s-out: Fix runtime PM imbalance on error
From: Mark Brown @ 2020-05-29 16:51 UTC (permalink / raw)
  To: Dinghao Liu, kjlu
  Cc: Greg Kroah-Hartman, Thomas Gleixner, Liam Girdwood,
	Allison Randal, Takashi Iwai, Kuninori Morimoto, linux-kernel,
	alsa-devel
In-Reply-To: <20200529012230.5863-1-dinghao.liu@zju.edu.cn>

On Fri, 29 May 2020 09:22:28 +0800, Dinghao Liu wrote:
> pm_runtime_get_sync() increments the runtime PM usage counter even
> the call returns an error code. Thus a pairing decrement is needed
> on the error handling path to keep the counter balanced.

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: img-i2s-out: Fix runtime PM imbalance on error
      commit: 65bd91dd6957390c42a0491b9622cf31a2cdb140

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply

* Re: [PATCH 3/4] exfat: add boot region verification
From: kbuild test robot @ 2020-05-29 16:51 UTC (permalink / raw)
  To: Tetsuhiro Kohada
  Cc: kbuild-all, kohada.tetsuhiro, mori.takahiro, motai.hirotaka,
	Namjae Jeon, Sungjong Seo, linux-fsdevel, linux-kernel
In-Reply-To: <20200525115052.19243-3-kohada.t2@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3329 bytes --]

Hi Tetsuhiro,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on next-20200519]
[cannot apply to linus/master v5.7-rc7 v5.7-rc6 v5.7-rc5 v5.7-rc7]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Tetsuhiro-Kohada/exfat-redefine-PBR-as-boot_sector/20200525-195329
base:    fb57b1fabcb28f358901b2df90abd2b48abc1ca8
config: c6x-randconfig-s032-20200529 (attached as .config)
compiler: c6x-elf-gcc (GCC) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-243-gc100a7ab-dirty
        # save the attached .config to linux build tree
        make W=1 C=1 ARCH=c6x CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)

>> fs/exfat/super.c:485:29: sparse: sparse: cast to restricted __le32
>> fs/exfat/super.c:485:29: sparse: sparse: cast to restricted __le32
>> fs/exfat/super.c:485:29: sparse: sparse: cast to restricted __le32
>> fs/exfat/super.c:485:29: sparse: sparse: cast to restricted __le32
>> fs/exfat/super.c:485:29: sparse: sparse: cast to restricted __le32
>> fs/exfat/super.c:485:29: sparse: sparse: cast to restricted __le32
   fs/exfat/super.c:504:21: sparse: sparse: cast to restricted __le32
   fs/exfat/super.c:504:21: sparse: sparse: cast to restricted __le32
   fs/exfat/super.c:504:21: sparse: sparse: cast to restricted __le32
   fs/exfat/super.c:504:21: sparse: sparse: cast to restricted __le32
   fs/exfat/super.c:504:21: sparse: sparse: cast to restricted __le32
   fs/exfat/super.c:504:21: sparse: sparse: cast to restricted __le32

vim +485 fs/exfat/super.c

   469	
   470	static int exfat_verify_boot_region(struct super_block *sb)
   471	{
   472		struct buffer_head *bh = NULL;
   473		u32 chksum = 0, *p_sig, *p_chksum;
   474		int sn, i;
   475	
   476		/* read boot sector sub-regions */
   477		for (sn = 0; sn < 11; sn++) {
   478			bh = sb_bread(sb, sn);
   479			if (!bh)
   480				return -EIO;
   481	
   482			if (sn != 0 && sn <= 8) {
   483				/* extended boot sector sub-regions */
   484				p_sig = (u32 *)&bh->b_data[sb->s_blocksize - 4];
 > 485				if (le32_to_cpu(*p_sig) != EXBOOT_SIGNATURE) {
   486					exfat_err(sb, "no exboot-signature");
   487					brelse(bh);
   488					return -EINVAL;
   489				}
   490			}
   491	
   492			chksum = exfat_calc_chksum32(bh->b_data, sb->s_blocksize,
   493				chksum, sn ? CS_DEFAULT : CS_BOOT_SECTOR);
   494			brelse(bh);
   495		}
   496	
   497		/* boot checksum sub-regions */
   498		bh = sb_bread(sb, sn);
   499		if (!bh)
   500			return -EIO;
   501	
   502		for (i = 0; i < sb->s_blocksize; i += sizeof(u32)) {
   503			p_chksum = (u32 *)&bh->b_data[i];
   504			if (le32_to_cpu(*p_chksum) != chksum) {
   505				exfat_err(sb, "mismatch checksum");
   506				brelse(bh);
   507				return -EINVAL;
   508			}
   509		}
   510		brelse(bh);
   511		return 0;
   512	}
   513	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28873 bytes --]

^ permalink raw reply

* [PATCH 2/2] exec: Compute file based creds only once
From: Eric W. Biederman @ 2020-05-29 16:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Linus Torvalds, Oleg Nesterov, Jann Horn, Kees Cook, Greg Ungerer,
	Rob Landley, Bernd Edlinger, linux-fsdevel, Al Viro,
	Alexey Dobriyan, Andrew Morton, Casey Schaufler,
	linux-security-module, James Morris, Serge E. Hallyn,
	Andy Lutomirski
In-Reply-To: <87d06mr8ps.fsf_-_@x220.int.ebiederm.org>


Move the computation of creds from prepare_binfmt into begin_new_exec
so that the creds need only be computed once.  This is just code
reorganization no semantic changes of any kind are made.

Moving the computation is safe.  I have looked through the kernel and
verified none of the binfmts look at bprm->cred directly, and that
there are no helpers that look at bprm->cred indirectly.  Which means
that it is not a problem to compute the bprm->cred later in the
execution flow as it is not used until it becomes current->cred.

A new function bprm_creds_from_file is added to contain the work that
needs to be done.  bprm_creds_from_file first computes which file
bprm->executable or most likely bprm->file that the bprm->creds
will be computed from.

The funciton bprm_fill_uid is updated to receive the file instead of
accessing bprm->file.  The now unnecessary work needed to reset the
bprm->cred->euid, and bprm->cred->egid is removed from brpm_fill_uid.
A small comment to document that bprm_fill_uid now only deals with the
work to handle suid and sgid files.  The default case is already
heandled by prepare_exec_creds.

The function security_bprm_repopulate_creds is renamed
security_bprm_creds_from_file and now is explicitly passed the file
from which to compute the creds.  The documentation of the
bprm_creds_from_file security hook is updated to explain when the hook
is called and what it needs to do.  The file is passed from
cap_bprm_creds_from_file into get_file_caps so that the caps are
computed for the appropriate file.  The now unnecessary work in
cap_bprm_creds_from_file to reset the ambient capabilites has been
removed.  A small comment to document that the work of
cap_bprm_creds_from_file is to read capabilities from the files
secureity attribute and derive capabilities from the fact the
user had uid 0 has been added.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 fs/binfmt_misc.c              |  2 +-
 fs/exec.c                     | 63 +++++++++++++++--------------------
 include/linux/binfmts.h       | 14 ++------
 include/linux/lsm_hook_defs.h |  2 +-
 include/linux/lsm_hooks.h     | 22 ++++++------
 include/linux/security.h      |  9 ++---
 security/commoncap.c          | 24 +++++++------
 security/security.c           |  4 +--
 8 files changed, 61 insertions(+), 79 deletions(-)

diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
index 53968ea07b57..bc5506619b7e 100644
--- a/fs/binfmt_misc.c
+++ b/fs/binfmt_misc.c
@@ -192,7 +192,7 @@ static int load_misc_binary(struct linux_binprm *bprm)
 
 	bprm->interpreter = interp_file;
 	if (fmt->flags & MISC_FMT_CREDENTIALS)
-		bprm->preserve_creds = 1;
+		bprm->execfd_creds = 1;
 
 	retval = 0;
 ret:
diff --git a/fs/exec.c b/fs/exec.c
index 0f793536e393..e8599236290d 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -72,6 +72,8 @@
 
 #include <trace/events/sched.h>
 
+static int bprm_creds_from_file(struct linux_binprm *bprm);
+
 int suid_dumpable = 0;
 
 static LIST_HEAD(formats);
@@ -1304,6 +1306,11 @@ int begin_new_exec(struct linux_binprm * bprm)
 	struct task_struct *me = current;
 	int retval;
 
+	/* Once we are committed compute the creds */
+	retval = bprm_creds_from_file(bprm);
+	if (retval)
+		return retval;
+
 	/*
 	 * Ensure all future errors are fatal.
 	 */
@@ -1354,7 +1361,6 @@ int begin_new_exec(struct linux_binprm * bprm)
 	me->flags &= ~(PF_RANDOMIZE | PF_FORKNOEXEC | PF_KTHREAD |
 					PF_NOFREEZE | PF_NO_SETAFFINITY);
 	flush_thread();
-	bprm->per_clear |= bprm->pf_per_clear;
 	me->personality &= ~bprm->per_clear;
 
 	/*
@@ -1365,13 +1371,6 @@ int begin_new_exec(struct linux_binprm * bprm)
 	 */
 	do_close_on_exec(me->files);
 
-	/*
-	 * Once here, prepare_binrpm() will not be called any more, so
-	 * the final state of setuid/setgid/fscaps can be merged into the
-	 * secureexec flag.
-	 */
-	bprm->secureexec |= bprm->active_secureexec;
-
 	if (bprm->secureexec) {
 		/* Make sure parent cannot signal privileged process. */
 		me->pdeath_signal = 0;
@@ -1587,29 +1586,21 @@ static void check_unsafe_exec(struct linux_binprm *bprm)
 	spin_unlock(&p->fs->lock);
 }
 
-static void bprm_fill_uid(struct linux_binprm *bprm)
+static void bprm_fill_uid(struct linux_binprm *bprm, struct file *file)
 {
+	/* Handle suid and sgid on files */
 	struct inode *inode;
 	unsigned int mode;
 	kuid_t uid;
 	kgid_t gid;
 
-	/*
-	 * Since this can be called multiple times (via prepare_binprm),
-	 * we must clear any previous work done when setting set[ug]id
-	 * bits from any earlier bprm->file uses (for example when run
-	 * first for a setuid script then again for its interpreter).
-	 */
-	bprm->cred->euid = current_euid();
-	bprm->cred->egid = current_egid();
-
-	if (!mnt_may_suid(bprm->file->f_path.mnt))
+	if (!mnt_may_suid(file->f_path.mnt))
 		return;
 
 	if (task_no_new_privs(current))
 		return;
 
-	inode = bprm->file->f_path.dentry->d_inode;
+	inode = file->f_path.dentry->d_inode;
 	mode = READ_ONCE(inode->i_mode);
 	if (!(mode & (S_ISUID|S_ISGID)))
 		return;
@@ -1629,19 +1620,31 @@ static void bprm_fill_uid(struct linux_binprm *bprm)
 		return;
 
 	if (mode & S_ISUID) {
-		bprm->pf_per_clear |= PER_CLEAR_ON_SETID;
+		bprm->per_clear |= PER_CLEAR_ON_SETID;
 		bprm->cred->euid = uid;
 	}
 
 	if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) {
-		bprm->pf_per_clear |= PER_CLEAR_ON_SETID;
+		bprm->per_clear |= PER_CLEAR_ON_SETID;
 		bprm->cred->egid = gid;
 	}
 }
 
+/*
+ * Compute brpm->cred based upon the final binary.
+ */
+static int bprm_creds_from_file(struct linux_binprm *bprm)
+{
+	/* Compute creds based on which file? */
+	struct file *file = bprm->execfd_creds ? bprm->executable : bprm->file;
+
+	bprm_fill_uid(bprm, file);
+	return security_bprm_creds_from_file(bprm, file);
+}
+
 /*
  * Fill the binprm structure from the inode.
- * Check permissions, then read the first BINPRM_BUF_SIZE bytes
+ * Read the first BINPRM_BUF_SIZE bytes
  *
  * This may be called multiple times for binary chains (scripts for example).
  */
@@ -1649,20 +1652,6 @@ static int prepare_binprm(struct linux_binprm *bprm)
 {
 	loff_t pos = 0;
 
-	/* Can the interpreter get to the executable without races? */
-	if (!bprm->preserve_creds) {
-		int retval;
-
-		/* Recompute parts of bprm->cred based on bprm->file */
-		bprm->active_secureexec = 0;
-		bprm->pf_per_clear = 0;
-		bprm_fill_uid(bprm);
-		retval = security_bprm_repopulate_creds(bprm);
-		if (retval)
-			return retval;
-	}
-	bprm->preserve_creds = 0;
-
 	memset(bprm->buf, 0, BINPRM_BUF_SIZE);
 	return kernel_read(bprm->file, bprm->buf, BINPRM_BUF_SIZE, &pos);
 }
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index 50025ead0b72..aece1b340e7d 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -29,13 +29,8 @@ struct linux_binprm {
 		/* Should an execfd be passed to userspace? */
 		have_execfd:1,
 
-		/* It is safe to use the creds of a script (see binfmt_misc) */
-		preserve_creds:1,
-		/*
-		 * True if most recent call to security_bprm_set_creds
-		 * resulted in elevated privileges.
-		 */
-		active_secureexec:1,
+		/* Use the creds of a script (see binfmt_misc) */
+		execfd_creds:1,
 		/*
 		 * Set by bprm_creds_for_exec hook to indicate a
 		 * privilege-gaining exec has happened. Used to set
@@ -55,11 +50,6 @@ struct linux_binprm {
 	struct file * file;
 	struct cred *cred;	/* new credentials */
 	int unsafe;		/* how unsafe this exec is (mask of LSM_UNSAFE_*) */
-	/*
-	 * bits to clear in current->personality
-	 * recalculated for each bprm->file.
-	 */
-	unsigned int pf_per_clear;
 	unsigned int per_clear;	/* bits to clear in current->personality */
 	int argc, envc;
 	const char * filename;	/* Name of binary as seen by procps */
diff --git a/include/linux/lsm_hook_defs.h b/include/linux/lsm_hook_defs.h
index 1e295ba12c0d..adbc6603abba 100644
--- a/include/linux/lsm_hook_defs.h
+++ b/include/linux/lsm_hook_defs.h
@@ -50,7 +50,7 @@ LSM_HOOK(int, 0, settime, const struct timespec64 *ts,
 	 const struct timezone *tz)
 LSM_HOOK(int, 0, vm_enough_memory, struct mm_struct *mm, long pages)
 LSM_HOOK(int, 0, bprm_creds_for_exec, struct linux_binprm *bprm)
-LSM_HOOK(int, 0, bprm_repopulate_creds, struct linux_binprm *bprm)
+LSM_HOOK(int, 0, bprm_creds_from_file, struct linux_binprm *bprm, struct file *file)
 LSM_HOOK(int, 0, bprm_check_security, struct linux_binprm *bprm)
 LSM_HOOK(void, LSM_RET_VOID, bprm_committing_creds, struct linux_binprm *bprm)
 LSM_HOOK(void, LSM_RET_VOID, bprm_committed_creds, struct linux_binprm *bprm)
diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h
index cd3dd0afceb5..37bb3df751c6 100644
--- a/include/linux/lsm_hooks.h
+++ b/include/linux/lsm_hooks.h
@@ -44,18 +44,18 @@
  *	request libc enable secure mode.
  *	@bprm contains the linux_binprm structure.
  *	Return 0 if the hook is successful and permission is granted.
- * @bprm_repopulate_creds:
- *	Assuming that the relevant bits of @bprm->cred->security have been
- *	previously set, examine @bprm->file and regenerate them.  This is
- *	so that the credentials derived from the interpreter the code is
- *	actually going to run are used rather than credentials derived
- *	from a script.  This done because the interpreter binary needs to
- *	reopen script, and may end up opening something completely different.
- *	This hook may also optionally check permissions (e.g. for
- *	transitions between security domains).
- *	The hook must set @bprm->active_secureexec to 1 if AT_SECURE should be set to
+ * @bprm_creds_from_file:
+ *	If @file is setpcap, suid, sgid or otherwise marked to change
+ *	privilege upon exec, update @bprm->cred to reflect that change.
+ *	This is called after finding the binary that will be executed.
+ *	without an interpreter.  This ensures that the credentials will not
+ *	be derived from a script that the binary will need to reopen, which
+ *	when reopend may end up being a completely different file.  This
+ *	hook may also optionally check permissions (e.g. for transitions
+ *	between security domains).
+ *	The hook must set @bprm->secureexec to 1 if AT_SECURE should be set to
  *	request libc enable secure mode.
- *	The hook must set @bprm->pf_per_clear to the personality flags that
+ *	The hook must set @bprm->per_clear to the personality flags that
  *	should be cleared from current->personality.
  *	@bprm contains the linux_binprm structure.
  *	Return 0 if the hook is successful and permission is granted.
diff --git a/include/linux/security.h b/include/linux/security.h
index 6dcec9375e8f..8444fae7c5b9 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -140,7 +140,7 @@ extern int cap_capset(struct cred *new, const struct cred *old,
 		      const kernel_cap_t *effective,
 		      const kernel_cap_t *inheritable,
 		      const kernel_cap_t *permitted);
-extern int cap_bprm_repopulate_creds(struct linux_binprm *bprm);
+extern int cap_bprm_creds_from_file(struct linux_binprm *bprm, struct file *file);
 extern int cap_inode_setxattr(struct dentry *dentry, const char *name,
 			      const void *value, size_t size, int flags);
 extern int cap_inode_removexattr(struct dentry *dentry, const char *name);
@@ -277,7 +277,7 @@ int security_syslog(int type);
 int security_settime64(const struct timespec64 *ts, const struct timezone *tz);
 int security_vm_enough_memory_mm(struct mm_struct *mm, long pages);
 int security_bprm_creds_for_exec(struct linux_binprm *bprm);
-int security_bprm_repopulate_creds(struct linux_binprm *bprm);
+int security_bprm_creds_from_file(struct linux_binprm *bprm, struct file *file);
 int security_bprm_check(struct linux_binprm *bprm);
 void security_bprm_committing_creds(struct linux_binprm *bprm);
 void security_bprm_committed_creds(struct linux_binprm *bprm);
@@ -575,9 +575,10 @@ static inline int security_bprm_creds_for_exec(struct linux_binprm *bprm)
 	return 0;
 }
 
-static inline int security_bprm_repopulate_creds(struct linux_binprm *bprm)
+static inline int security_bprm_creds_from_file(struct linux_binprm *bprm,
+						struct file *file)
 {
-	return cap_bprm_repopulate_creds(bprm);
+	return cap_bprm_creds_from_file(bprm, file);
 }
 
 static inline int security_bprm_check(struct linux_binprm *bprm)
diff --git a/security/commoncap.c b/security/commoncap.c
index 6de72d22dc6c..59bf3c1674c8 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -647,7 +647,8 @@ int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data
  * its xattrs and, if present, apply them to the proposed credentials being
  * constructed by execve().
  */
-static int get_file_caps(struct linux_binprm *bprm, bool *effective, bool *has_fcap)
+static int get_file_caps(struct linux_binprm *bprm, struct file *file,
+			 bool *effective, bool *has_fcap)
 {
 	int rc = 0;
 	struct cpu_vfs_cap_data vcaps;
@@ -657,7 +658,7 @@ static int get_file_caps(struct linux_binprm *bprm, bool *effective, bool *has_f
 	if (!file_caps_enabled)
 		return 0;
 
-	if (!mnt_may_suid(bprm->file->f_path.mnt))
+	if (!mnt_may_suid(file->f_path.mnt))
 		return 0;
 
 	/*
@@ -665,10 +666,10 @@ static int get_file_caps(struct linux_binprm *bprm, bool *effective, bool *has_f
 	 * explicit that capability bits are limited to s_user_ns and its
 	 * descendants.
 	 */
-	if (!current_in_userns(bprm->file->f_path.mnt->mnt_sb->s_user_ns))
+	if (!current_in_userns(file->f_path.mnt->mnt_sb->s_user_ns))
 		return 0;
 
-	rc = get_vfs_caps_from_disk(bprm->file->f_path.dentry, &vcaps);
+	rc = get_vfs_caps_from_disk(file->f_path.dentry, &vcaps);
 	if (rc < 0) {
 		if (rc == -EINVAL)
 			printk(KERN_NOTICE "Invalid argument reading file caps for %s\n",
@@ -797,26 +798,27 @@ static inline bool nonroot_raised_pE(struct cred *new, const struct cred *old,
 }
 
 /**
- * cap_bprm_repopulate_creds - Set up the proposed credentials for execve().
+ * cap_bprm_creds_from_file - Set up the proposed credentials for execve().
  * @bprm: The execution parameters, including the proposed creds
+ * @file: The file to pull the credentials from
  *
  * Set up the proposed credentials for a new execution context being
  * constructed by execve().  The proposed creds in @bprm->cred is altered,
  * which won't take effect immediately.  Returns 0 if successful, -ve on error.
  */
-int cap_bprm_repopulate_creds(struct linux_binprm *bprm)
+int cap_bprm_creds_from_file(struct linux_binprm *bprm, struct file *file)
 {
+	/* Process setpcap binaries and capabilities for uid 0 */
 	const struct cred *old = current_cred();
 	struct cred *new = bprm->cred;
 	bool effective = false, has_fcap = false, is_setid;
 	int ret;
 	kuid_t root_uid;
 
-	new->cap_ambient = old->cap_ambient;
 	if (WARN_ON(!cap_ambient_invariant_ok(old)))
 		return -EPERM;
 
-	ret = get_file_caps(bprm, &effective, &has_fcap);
+	ret = get_file_caps(bprm, file, &effective, &has_fcap);
 	if (ret < 0)
 		return ret;
 
@@ -826,7 +828,7 @@ int cap_bprm_repopulate_creds(struct linux_binprm *bprm)
 
 	/* if we have fs caps, clear dangerous personality flags */
 	if (__cap_gained(permitted, new, old))
-		bprm->pf_per_clear |= PER_CLEAR_ON_SETID;
+		bprm->per_clear |= PER_CLEAR_ON_SETID;
 
 	/* Don't let someone trace a set[ug]id/setpcap binary with the revised
 	 * credentials unless they have the appropriate permit.
@@ -889,7 +891,7 @@ int cap_bprm_repopulate_creds(struct linux_binprm *bprm)
 	    (!__is_real(root_uid, new) &&
 	     (effective ||
 	      __cap_grew(permitted, ambient, new))))
-		bprm->active_secureexec = 1;
+		bprm->secureexec = 1;
 
 	return 0;
 }
@@ -1346,7 +1348,7 @@ static struct security_hook_list capability_hooks[] __lsm_ro_after_init = {
 	LSM_HOOK_INIT(ptrace_traceme, cap_ptrace_traceme),
 	LSM_HOOK_INIT(capget, cap_capget),
 	LSM_HOOK_INIT(capset, cap_capset),
-	LSM_HOOK_INIT(bprm_repopulate_creds, cap_bprm_repopulate_creds),
+	LSM_HOOK_INIT(bprm_creds_from_file, cap_bprm_creds_from_file),
 	LSM_HOOK_INIT(inode_need_killpriv, cap_inode_need_killpriv),
 	LSM_HOOK_INIT(inode_killpriv, cap_inode_killpriv),
 	LSM_HOOK_INIT(inode_getsecurity, cap_inode_getsecurity),
diff --git a/security/security.c b/security/security.c
index b890b7e2a765..259b8e750aa2 100644
--- a/security/security.c
+++ b/security/security.c
@@ -828,9 +828,9 @@ int security_bprm_creds_for_exec(struct linux_binprm *bprm)
 	return call_int_hook(bprm_creds_for_exec, 0, bprm);
 }
 
-int security_bprm_repopulate_creds(struct linux_binprm *bprm)
+int security_bprm_creds_from_file(struct linux_binprm *bprm, struct file *file)
 {
-	return call_int_hook(bprm_repopulate_creds, 0, bprm);
+	return call_int_hook(bprm_creds_from_file, 0, bprm, file);
 }
 
 int security_bprm_check(struct linux_binprm *bprm)
-- 
2.25.0


^ permalink raw reply related

* Re: Regression with PM / wakeup: Show wakeup sources stats in sysfs"
From: Rafael J. Wysocki @ 2020-05-29 16:51 UTC (permalink / raw)
  To: Florian Fainelli, linux-kernel@vger.kernel.org, trong, Greg KH,
	swboyd, kaleshsingh
In-Reply-To: <11459cde-7f57-c95b-8cac-4301f0a2390e@gmail.com>

On 5/28/2020 10:46 PM, Florian Fainelli wrote:
> Hi,
>
> Commit c8377adfa78103be5380200eb9dab764d7ca890e ("PM / wakeup: Show
> wakeup sources stats in sysfs") is causing some of our tests to fail
> because /sys/class/net/*/device/power/wakeup_count is now 0, despite
> /sys/kernel/debug/wakeup_sources clearly indicating that the Ethernet
> device was responsible for system wake-up.
>
> What's more in looking at /sys/class/wakekup/wakeup2/event_count, we
> have the number of Wake-on-LAN wakeups recorded properly, but
> wakeup_count is desperately 0, why is that?

I need to look at that commit in detail to find out what is going on.


> This is seen on 5.4.43, but it is reproducible on Linus' master as well.
>
> The Ethernet driver being used is under
> drivers/net/ethernet/broadcom/genet/ and the relevant part is in the
> function bcmgenet_set_wol().
>
> BTW, I think you want to backport
> e976eb4b91e906f20ec25b20c152d53c472fc3fd ("PM: wakeup: Show statistics
> for deleted wakeup sources again") into 5.4 and 4.19 at least.

Well, please feel free to send a request to do that to 
stable@vger.kernel.org.

Thanks!



^ permalink raw reply

* Re: [igt-dev] [PATCH i-g-t] tests/kms_fbcon_fbt: When restoring fbcon always set mode to text mode
From: Souza, Jose @ 2020-05-29 16:51 UTC (permalink / raw)
  To: Shankar, Uma, igt-dev@lists.freedesktop.org
In-Reply-To: <E7C9878FBA1C6D42A1CA3F62AEB6945F825145DC@BGSMSX104.gar.corp.intel.com>

On Fri, 2020-05-29 at 21:19 +0530, Shankar, Uma wrote:
> > -----Original Message-----
> > From: igt-dev <igt-dev-bounces@lists.freedesktop.org> On Behalf Of José Roberto
> > de Souza
> > Sent: Friday, May 29, 2020 6:22 AM
> > To: igt-dev@lists.freedesktop.org
> > Subject: [igt-dev] [PATCH i-g-t] tests/kms_fbcon_fbt: When restoring fbcon always
> > set mode to text mode
> > 
> > If by some reason or tests, this tests is executed and VT mode is already in
> > KD_GRAPHICS the call to kmstest_set_vt_graphics_mode() will set orig_vt_mode
> > as KD_GRAPHICS and when it was calling
> > kmstest_restore_vt_mode() it would set KD_GRAPHICS again not returning to
> > fbcon and causing the test to fail.
> > 
> > As it can be seen here:
> > (kms_fbcon_fbt:11004) igt_kms-DEBUG: VT: graphics mode set (mode was 0x1)"
> > https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_499/fi-ehl-
> > 1/igt@kms_fbcon_fbt@fbc.html
> > 
> > So here adding a new function to alaways set mode the KD_TEXT when we want
> > to restore to fbcon.
> > 
> > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > ---
> >  lib/igt_kms.c         | 11 +++++++++++
> >  lib/igt_kms.h         |  1 +
> >  tests/kms_fbcon_fbt.c |  2 +-
> >  3 files changed, 13 insertions(+), 1 deletion(-)
> > 
> > diff --git a/lib/igt_kms.c b/lib/igt_kms.c index d4cbc1c53..afef59396 100644
> > --- a/lib/igt_kms.c
> > +++ b/lib/igt_kms.c
> > @@ -968,6 +968,17 @@ void kmstest_set_vt_graphics_mode(void)
> >  	igt_debug("VT: graphics mode set (mode was 0x%lx)\n", ret);  }
> > 
> > +/**
> > + * kmstest_set_vt_text_mode:
> > + *
> > + * Sets the controlling VT (if available) into text mode.
> > + * Unlikely kmstest_set_vt_graphics_mode() it do not install an igt
> > +exit
> > + * handler to set the VT back to the previous mode.
> > + */
> > +void kmstest_set_vt_text_mode(void)
> > +{
> > +	igt_assert(set_vt_mode(KD_TEXT) >= 0); }
> > 
> >  static void reset_connectors_at_exit(int sig)  { diff --git a/lib/igt_kms.h
> > b/lib/igt_kms.h index adca59ac6..32a0e4cc6 100644
> > --- a/lib/igt_kms.h
> > +++ b/lib/igt_kms.h
> > @@ -93,6 +93,7 @@ void kmstest_dump_mode(drmModeModeInfo *mode);  int
> > kmstest_get_pipe_from_crtc_id(int fd, int crtc_id);  void
> > kmstest_set_vt_graphics_mode(void);
> >  void kmstest_restore_vt_mode(void);
> > +void kmstest_set_vt_text_mode(void);
> > 
> >  enum igt_atomic_crtc_properties {
> >         IGT_CRTC_BACKGROUND = 0,
> > diff --git a/tests/kms_fbcon_fbt.c b/tests/kms_fbcon_fbt.c index
> > e6dd4353b..e99a1f2f2 100644
> > --- a/tests/kms_fbcon_fbt.c
> > +++ b/tests/kms_fbcon_fbt.c
> > @@ -283,7 +283,7 @@ static void restore_fbcon(struct drm_info *drm)
> >  	kmstest_unset_all_crtcs(drm->fd, drm->res);
> >  	igt_remove_fb(drm->fd, &drm->fb);
> >  	igt_device_drop_master(drm->fd);
> > -	kmstest_restore_vt_mode();
> > +	kmstest_set_vt_text_mode();
> 
> Can we level set the state to KD_TEXT in beginning only before we begin our test.
> This way test will start with the expected state, and we can then set KD_GRAPHICS,
> restore will ensure previous state is set again as KD_TEXT, and we can just continue with the
> existing restore logic. Will that cause any issue ?

We could be overwriting the previous state, KD_TEXT is the state we expect in our CI but it do not means that is the state that other users have prior
of executing this test, that is why kmstest_restore_vt_mode() don't just set to KD_TEXT.

> 
> Regards,
> Uma Shankar
> 
> >  }
> > 
> >  static void subtest(struct drm_info *drm, struct feature *feature, bool suspend)
> > --
> > 2.26.2
> > 
> > _______________________________________________
> > igt-dev mailing list
> > igt-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply

* Re: [PATCH] ASoC: fsl_asrc_dma: Fix dma_chan leak when config DMA channel failed
From: Mark Brown @ 2020-05-29 16:51 UTC (permalink / raw)
  To: Xiyu Yang, Liam Girdwood, Takashi Iwai, Timur Tabi, linux-kernel,
	Jaroslav Kysela, alsa-devel, linuxppc-dev, Xiubo Li,
	Fabio Estevam, Nicolin Chen
  Cc: yuanxzhang, kjlu, Xin Tan
In-Reply-To: <1590415966-52416-1-git-send-email-xiyuyang19@fudan.edu.cn>

On Mon, 25 May 2020 22:12:46 +0800, Xiyu Yang wrote:
> fsl_asrc_dma_hw_params() invokes dma_request_channel() or
> fsl_asrc_get_dma_channel(), which returns a reference of the specified
> dma_chan object to "pair->dma_chan[dir]" with increased refcnt.
> 
> The reference counting issue happens in one exception handling path of
> fsl_asrc_dma_hw_params(). When config DMA channel failed for Back-End,
> the function forgets to decrease the refcnt increased by
> dma_request_channel() or fsl_asrc_get_dma_channel(), causing a refcnt
> leak.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: fsl_asrc_dma: Fix dma_chan leak when config DMA channel failed
      commit: 36124fb19f1ae68a500cd76a76d40c6e81bee346

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply

* Re: [PATCH 3/4] exfat: add boot region verification
From: kbuild test robot @ 2020-05-29 16:51 UTC (permalink / raw)
  To: kbuild-all
In-Reply-To: <20200525115052.19243-3-kohada.t2@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3421 bytes --]

Hi Tetsuhiro,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on next-20200519]
[cannot apply to linus/master v5.7-rc7 v5.7-rc6 v5.7-rc5 v5.7-rc7]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Tetsuhiro-Kohada/exfat-redefine-PBR-as-boot_sector/20200525-195329
base:    fb57b1fabcb28f358901b2df90abd2b48abc1ca8
config: c6x-randconfig-s032-20200529 (attached as .config)
compiler: c6x-elf-gcc (GCC) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-243-gc100a7ab-dirty
        # save the attached .config to linux build tree
        make W=1 C=1 ARCH=c6x CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)

>> fs/exfat/super.c:485:29: sparse: sparse: cast to restricted __le32
>> fs/exfat/super.c:485:29: sparse: sparse: cast to restricted __le32
>> fs/exfat/super.c:485:29: sparse: sparse: cast to restricted __le32
>> fs/exfat/super.c:485:29: sparse: sparse: cast to restricted __le32
>> fs/exfat/super.c:485:29: sparse: sparse: cast to restricted __le32
>> fs/exfat/super.c:485:29: sparse: sparse: cast to restricted __le32
   fs/exfat/super.c:504:21: sparse: sparse: cast to restricted __le32
   fs/exfat/super.c:504:21: sparse: sparse: cast to restricted __le32
   fs/exfat/super.c:504:21: sparse: sparse: cast to restricted __le32
   fs/exfat/super.c:504:21: sparse: sparse: cast to restricted __le32
   fs/exfat/super.c:504:21: sparse: sparse: cast to restricted __le32
   fs/exfat/super.c:504:21: sparse: sparse: cast to restricted __le32

vim +485 fs/exfat/super.c

   469	
   470	static int exfat_verify_boot_region(struct super_block *sb)
   471	{
   472		struct buffer_head *bh = NULL;
   473		u32 chksum = 0, *p_sig, *p_chksum;
   474		int sn, i;
   475	
   476		/* read boot sector sub-regions */
   477		for (sn = 0; sn < 11; sn++) {
   478			bh = sb_bread(sb, sn);
   479			if (!bh)
   480				return -EIO;
   481	
   482			if (sn != 0 && sn <= 8) {
   483				/* extended boot sector sub-regions */
   484				p_sig = (u32 *)&bh->b_data[sb->s_blocksize - 4];
 > 485				if (le32_to_cpu(*p_sig) != EXBOOT_SIGNATURE) {
   486					exfat_err(sb, "no exboot-signature");
   487					brelse(bh);
   488					return -EINVAL;
   489				}
   490			}
   491	
   492			chksum = exfat_calc_chksum32(bh->b_data, sb->s_blocksize,
   493				chksum, sn ? CS_DEFAULT : CS_BOOT_SECTOR);
   494			brelse(bh);
   495		}
   496	
   497		/* boot checksum sub-regions */
   498		bh = sb_bread(sb, sn);
   499		if (!bh)
   500			return -EIO;
   501	
   502		for (i = 0; i < sb->s_blocksize; i += sizeof(u32)) {
   503			p_chksum = (u32 *)&bh->b_data[i];
   504			if (le32_to_cpu(*p_chksum) != chksum) {
   505				exfat_err(sb, "mismatch checksum");
   506				brelse(bh);
   507				return -EINVAL;
   508			}
   509		}
   510		brelse(bh);
   511		return 0;
   512	}
   513	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 28873 bytes --]

^ permalink raw reply

* [PATCH 1/2] exec: Add a per bprm->file version of per_clear
From: Eric W. Biederman @ 2020-05-29 16:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: Linus Torvalds, Oleg Nesterov, Jann Horn, Kees Cook, Greg Ungerer,
	Rob Landley, Bernd Edlinger, linux-fsdevel, Al Viro,
	Alexey Dobriyan, Andrew Morton, Casey Schaufler,
	linux-security-module, James Morris, Serge E. Hallyn,
	Andy Lutomirski
In-Reply-To: <87d06mr8ps.fsf_-_@x220.int.ebiederm.org>


There is a small bug in the code that recomputes parts of bprm->cred
for every bprm->file.  The code never recomputes the part of
clear_dangerous_personality_flags it is responsible for.

Which means that in practice if someone creates a sgid script
the interpreter will not be able to use any of:
	READ_IMPLIES_EXEC
	ADDR_NO_RANDOMIZE
	ADDR_COMPAT_LAYOUT
	MMAP_PAGE_ZERO.

This accentially clearing of personality flags probably does
not matter in practice because no one has complained
but it does make the code more difficult to understand.

Further remaining bug compatible prevents the recomputation from being
removed and replaced by simply computing bprm->cred once from the
final bprm->file.

Making this change removes the last behavior difference between
computing bprm->creds from the final file and recomputing
bprm->cred several times.  Which allows this behavior change
to be justified for it's own reasons, and for any but hunts
looking into why the behavior changed to wind up here instead
of in the code that will follow that computes bprm->cred
from the final bprm->file.

This small logic bug appears to have existed since the code
started clearing dangerous personality bits.

History Tree: git://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git
Fixes: 1bb0fa189c6a ("[PATCH] NX: clean up legacy binary support")
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 fs/exec.c                 | 6 ++++--
 include/linux/binfmts.h   | 5 +++++
 include/linux/lsm_hooks.h | 2 ++
 security/commoncap.c      | 2 +-
 4 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/fs/exec.c b/fs/exec.c
index c3c879a55d65..0f793536e393 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1354,6 +1354,7 @@ int begin_new_exec(struct linux_binprm * bprm)
 	me->flags &= ~(PF_RANDOMIZE | PF_FORKNOEXEC | PF_KTHREAD |
 					PF_NOFREEZE | PF_NO_SETAFFINITY);
 	flush_thread();
+	bprm->per_clear |= bprm->pf_per_clear;
 	me->personality &= ~bprm->per_clear;
 
 	/*
@@ -1628,12 +1629,12 @@ static void bprm_fill_uid(struct linux_binprm *bprm)
 		return;
 
 	if (mode & S_ISUID) {
-		bprm->per_clear |= PER_CLEAR_ON_SETID;
+		bprm->pf_per_clear |= PER_CLEAR_ON_SETID;
 		bprm->cred->euid = uid;
 	}
 
 	if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) {
-		bprm->per_clear |= PER_CLEAR_ON_SETID;
+		bprm->pf_per_clear |= PER_CLEAR_ON_SETID;
 		bprm->cred->egid = gid;
 	}
 }
@@ -1654,6 +1655,7 @@ static int prepare_binprm(struct linux_binprm *bprm)
 
 		/* Recompute parts of bprm->cred based on bprm->file */
 		bprm->active_secureexec = 0;
+		bprm->pf_per_clear = 0;
 		bprm_fill_uid(bprm);
 		retval = security_bprm_repopulate_creds(bprm);
 		if (retval)
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index 7fc05929c967..50025ead0b72 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -55,6 +55,11 @@ struct linux_binprm {
 	struct file * file;
 	struct cred *cred;	/* new credentials */
 	int unsafe;		/* how unsafe this exec is (mask of LSM_UNSAFE_*) */
+	/*
+	 * bits to clear in current->personality
+	 * recalculated for each bprm->file.
+	 */
+	unsigned int pf_per_clear;
 	unsigned int per_clear;	/* bits to clear in current->personality */
 	int argc, envc;
 	const char * filename;	/* Name of binary as seen by procps */
diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h
index d618ecc4d660..cd3dd0afceb5 100644
--- a/include/linux/lsm_hooks.h
+++ b/include/linux/lsm_hooks.h
@@ -55,6 +55,8 @@
  *	transitions between security domains).
  *	The hook must set @bprm->active_secureexec to 1 if AT_SECURE should be set to
  *	request libc enable secure mode.
+ *	The hook must set @bprm->pf_per_clear to the personality flags that
+ *	should be cleared from current->personality.
  *	@bprm contains the linux_binprm structure.
  *	Return 0 if the hook is successful and permission is granted.
  * @bprm_check_security:
diff --git a/security/commoncap.c b/security/commoncap.c
index 77b04cb6feac..6de72d22dc6c 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -826,7 +826,7 @@ int cap_bprm_repopulate_creds(struct linux_binprm *bprm)
 
 	/* if we have fs caps, clear dangerous personality flags */
 	if (__cap_gained(permitted, new, old))
-		bprm->per_clear |= PER_CLEAR_ON_SETID;
+		bprm->pf_per_clear |= PER_CLEAR_ON_SETID;
 
 	/* Don't let someone trace a set[ug]id/setpcap binary with the revised
 	 * credentials unless they have the appropriate permit.
-- 
2.25.0

^ permalink raw reply related

* Re: mmotm 2020-05-13-20-30 uploaded (objtool warnings)
From: Josh Poimboeuf @ 2020-05-29 16:50 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Christoph Hellwig, Randy Dunlap, Andrew Morton, broonie,
	linux-fsdevel, linux-kernel, linux-mm, linux-next, mhocko,
	mm-commits, sfr, Linus Torvalds, viro, x86, Steven Rostedt
In-Reply-To: <20200529161253.GD706460@hirez.programming.kicks-ass.net>

On Fri, May 29, 2020 at 06:12:53PM +0200, Peter Zijlstra wrote:
> On Fri, May 29, 2020 at 11:05:14AM -0500, Josh Poimboeuf wrote:
> 
> > It looks to me like GCC is doing the right thing.  That likely()
> > translates to:
> > 
> > #  define likely(x)	(__branch_check__(x, 1, __builtin_constant_p(x)))
> > 
> > which becomes:
> > 
> > #define __branch_check__(x, expect, is_constant) ({			\
> > 			long ______r;					\
> > 			static struct ftrace_likely_data		\
> > 				__aligned(4)				\
> > 				__section(_ftrace_annotated_branch)	\
> > 				______f = {				\
> > 				.data.func = __func__,			\
> > 				.data.file = __FILE__,			\
> > 				.data.line = __LINE__,			\
> > 			};						\
> > 			______r = __builtin_expect(!!(x), expect);	\
> > 			ftrace_likely_update(&______f, ______r,		\
> > 					     expect, is_constant);	\
> > 			______r;					\
> > 		})
> > 
> > Here 'x' is the call to user_access_begin().  It evaluates 'x' -- and
> > thus calls user_access_begin() -- before the call to
> > ftrace_likely_update().
> > 
> > So it's working as designed, right?  The likely() just needs to be
> > changed to likely_notrace().
> 
> But if !x (ie we fail user_access_begin()), we should not pass STAC() on
> the way to out_err. OTOH if x, we should not be jumping to out_err.
> 
> I'm most confused... must not stare at asm for a while.

Yeah, I saw that call to ftrace_likely_update() and got distracted.  I
forgot it's on the uaccess safe list.

From staring at the asm I think the generated code is correct, it's just
that the nested likelys with ftrace profiling cause GCC to converge the
error/success paths.  But objtool doesn't do register value tracking so
it's not smart enough to know that it's safe.

The nested likelys seem like overkill anyway -- user_access_begin() is
__always_inline and it already has unlikely(), which should be
propagated.

So just remove the outer likelys?

diff --git a/arch/x86/lib/csum-wrappers_64.c b/arch/x86/lib/csum-wrappers_64.c
index a12b8629206d..ee63d7576fd2 100644
--- a/arch/x86/lib/csum-wrappers_64.c
+++ b/arch/x86/lib/csum-wrappers_64.c
@@ -27,7 +27,7 @@ csum_and_copy_from_user(const void __user *src, void *dst,
 	might_sleep();
 	*errp = 0;
 
-	if (!likely(user_access_begin(src, len)))
+	if (!user_access_begin(src, len))
 		goto out_err;
 
 	/*
@@ -89,7 +89,7 @@ csum_and_copy_to_user(const void *src, void __user *dst,
 
 	might_sleep();
 
-	if (unlikely(!user_access_begin(dst, len))) {
+	if (!user_access_begin(dst, len)) {
 		*errp = -EFAULT;
 		return 0;
 	}


^ permalink raw reply related

* Re: [PATCH v6 07/13] ARC: Linux Syscall Interface
From: Adhemerval Zanella @ 2020-05-29 16:49 UTC (permalink / raw)
  To: Vineet Gupta, libc-alpha; +Cc: linux-snps-arc
In-Reply-To: <20200423014126.10417-8-vgupta@synopsys.com>



On 22/04/2020 22:41, Vineet Gupta via Libc-alpha wrote:
> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

As prior patches we do not use DCO, but rather copyright assignment.

Some comments below.

> ---
>  sysdeps/unix/sysv/linux/arc/arch-syscall.h    | 303 ++++++++++++++++++
>  sysdeps/unix/sysv/linux/arc/bits/timesize.h   |  21 ++
>  sysdeps/unix/sysv/linux/arc/clone.S           |  98 ++++++
>  .../unix/sysv/linux/arc/fixup-asm-unistd.h    |  41 +++
>  sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h  |   6 +
>  sysdeps/unix/sysv/linux/arc/kernel-features.h |  28 ++
>  sysdeps/unix/sysv/linux/arc/kernel_stat.h     |  26 ++
>  sysdeps/unix/sysv/linux/arc/mmap_internal.h   |  27 ++
>  sysdeps/unix/sysv/linux/arc/pt-vfork.S        |   1 +
>  sysdeps/unix/sysv/linux/arc/sigaction.c       |  31 ++
>  sysdeps/unix/sysv/linux/arc/sigrestorer.S     |  29 ++
>  sysdeps/unix/sysv/linux/arc/syscall.S         |  33 ++
>  sysdeps/unix/sysv/linux/arc/syscalls.list     |   3 +
>  sysdeps/unix/sysv/linux/arc/sysctl.mk         |   1 +
>  sysdeps/unix/sysv/linux/arc/sysdep.c          |  33 ++
>  sysdeps/unix/sysv/linux/arc/sysdep.h          | 224 +++++++++++++
>  sysdeps/unix/sysv/linux/arc/vfork.S           |  42 +++
>  17 files changed, 947 insertions(+)
>  create mode 100644 sysdeps/unix/sysv/linux/arc/arch-syscall.h
>  create mode 100644 sysdeps/unix/sysv/linux/arc/bits/timesize.h
>  create mode 100644 sysdeps/unix/sysv/linux/arc/clone.S
>  create mode 100644 sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h
>  create mode 100644 sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h
>  create mode 100644 sysdeps/unix/sysv/linux/arc/kernel-features.h
>  create mode 100644 sysdeps/unix/sysv/linux/arc/kernel_stat.h
>  create mode 100644 sysdeps/unix/sysv/linux/arc/mmap_internal.h
>  create mode 100644 sysdeps/unix/sysv/linux/arc/pt-vfork.S
>  create mode 100644 sysdeps/unix/sysv/linux/arc/sigaction.c
>  create mode 100644 sysdeps/unix/sysv/linux/arc/sigrestorer.S
>  create mode 100644 sysdeps/unix/sysv/linux/arc/syscall.S
>  create mode 100644 sysdeps/unix/sysv/linux/arc/syscalls.list
>  create mode 100644 sysdeps/unix/sysv/linux/arc/sysctl.mk
>  create mode 100644 sysdeps/unix/sysv/linux/arc/sysdep.c
>  create mode 100644 sysdeps/unix/sysv/linux/arc/sysdep.h
>  create mode 100644 sysdeps/unix/sysv/linux/arc/vfork.S
> 
> diff --git a/sysdeps/unix/sysv/linux/arc/arch-syscall.h b/sysdeps/unix/sysv/linux/arc/arch-syscall.h
> new file mode 100644
> index 000000000000..2b017eb5bbaa
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/arc/arch-syscall.h
> @@ -0,0 +1,303 @@
> +/* AUTOGENERATED by update-syscall-lists.py.  */
> +#define __NR_accept 202
> +#define __NR_accept4 242
> +#define __NR_acct 89
> +#define __NR_add_key 217
> +#define __NR_adjtimex 171
> +#define __NR_arc_gettls 246
> +#define __NR_arc_settls 245
> +#define __NR_arc_usr_cmpxchg 248
> +#define __NR_bind 200
> +#define __NR_bpf 280
> +#define __NR_brk 214
> +#define __NR_cacheflush 244
> +#define __NR_capget 90
> +#define __NR_capset 91
> +#define __NR_chdir 49
> +#define __NR_chroot 51
> +#define __NR_clock_adjtime64 405
> +#define __NR_clock_getres_time64 406
> +#define __NR_clock_gettime 113
> +#define __NR_clock_gettime64 403
> +#define __NR_clock_nanosleep 115
> +#define __NR_clock_nanosleep_time64 407
> +#define __NR_clock_settime 112
> +#define __NR_clock_settime64 404
> +#define __NR_clone 220
> +#define __NR_clone3 435
> +#define __NR_close 57
> +#define __NR_connect 203
> +#define __NR_copy_file_range 285
> +#define __NR_delete_module 106
> +#define __NR_dup 23
> +#define __NR_dup3 24
> +#define __NR_epoll_create1 20
> +#define __NR_epoll_ctl 21
> +#define __NR_epoll_pwait 22
> +#define __NR_eventfd2 19
> +#define __NR_execve 221
> +#define __NR_execveat 281
> +#define __NR_exit 93
> +#define __NR_exit_group 94
> +#define __NR_faccessat 48
> +#define __NR_fadvise64_64 223
> +#define __NR_fallocate 47
> +#define __NR_fanotify_init 262
> +#define __NR_fanotify_mark 263
> +#define __NR_fchdir 50
> +#define __NR_fchmod 52
> +#define __NR_fchmodat 53
> +#define __NR_fchown 55
> +#define __NR_fchownat 54
> +#define __NR_fcntl64 25
> +#define __NR_fdatasync 83
> +#define __NR_fgetxattr 10
> +#define __NR_finit_module 273
> +#define __NR_flistxattr 13
> +#define __NR_flock 32
> +#define __NR_fremovexattr 16
> +#define __NR_fsconfig 431
> +#define __NR_fsetxattr 7
> +#define __NR_fsmount 432
> +#define __NR_fsopen 430
> +#define __NR_fspick 433
> +#define __NR_fstatfs64 44
> +#define __NR_fsync 82
> +#define __NR_ftruncate64 46
> +#define __NR_futex_time64 422
> +#define __NR_get_mempolicy 236
> +#define __NR_get_robust_list 100
> +#define __NR_getcpu 168
> +#define __NR_getcwd 17
> +#define __NR_getdents64 61
> +#define __NR_getegid 177
> +#define __NR_geteuid 175
> +#define __NR_getgid 176
> +#define __NR_getgroups 158
> +#define __NR_getitimer 102
> +#define __NR_getpeername 205
> +#define __NR_getpgid 155
> +#define __NR_getpid 172
> +#define __NR_getppid 173
> +#define __NR_getpriority 141
> +#define __NR_getrandom 278
> +#define __NR_getresgid 150
> +#define __NR_getresuid 148
> +#define __NR_getrlimit 163
> +#define __NR_getrusage 165
> +#define __NR_getsid 156
> +#define __NR_getsockname 204
> +#define __NR_getsockopt 209
> +#define __NR_gettid 178
> +#define __NR_gettimeofday 169
> +#define __NR_getuid 174
> +#define __NR_getxattr 8
> +#define __NR_init_module 105
> +#define __NR_inotify_add_watch 27
> +#define __NR_inotify_init1 26
> +#define __NR_inotify_rm_watch 28
> +#define __NR_io_cancel 3
> +#define __NR_io_destroy 1
> +#define __NR_io_getevents 4
> +#define __NR_io_pgetevents 292
> +#define __NR_io_pgetevents_time64 416
> +#define __NR_io_setup 0
> +#define __NR_io_submit 2
> +#define __NR_io_uring_enter 426
> +#define __NR_io_uring_register 427
> +#define __NR_io_uring_setup 425
> +#define __NR_ioctl 29
> +#define __NR_ioprio_get 31
> +#define __NR_ioprio_set 30
> +#define __NR_kcmp 272
> +#define __NR_kexec_file_load 294
> +#define __NR_kexec_load 104
> +#define __NR_keyctl 219
> +#define __NR_kill 129
> +#define __NR_lgetxattr 9
> +#define __NR_linkat 37
> +#define __NR_listen 201
> +#define __NR_listxattr 11
> +#define __NR_llistxattr 12
> +#define __NR_llseek 62
> +#define __NR_lookup_dcookie 18
> +#define __NR_lremovexattr 15
> +#define __NR_lsetxattr 6
> +#define __NR_madvise 233
> +#define __NR_mbind 235
> +#define __NR_membarrier 283
> +#define __NR_memfd_create 279
> +#define __NR_migrate_pages 238
> +#define __NR_mincore 232
> +#define __NR_mkdirat 34
> +#define __NR_mknodat 33
> +#define __NR_mlock 228
> +#define __NR_mlock2 284
> +#define __NR_mlockall 230
> +#define __NR_mmap2 222
> +#define __NR_mount 40
> +#define __NR_move_mount 429
> +#define __NR_move_pages 239
> +#define __NR_mprotect 226
> +#define __NR_mq_getsetattr 185
> +#define __NR_mq_notify 184
> +#define __NR_mq_open 180
> +#define __NR_mq_timedreceive_time64 419
> +#define __NR_mq_timedsend_time64 418
> +#define __NR_mq_unlink 181
> +#define __NR_mremap 216
> +#define __NR_msgctl 187
> +#define __NR_msgget 186
> +#define __NR_msgrcv 188
> +#define __NR_msgsnd 189
> +#define __NR_msync 227
> +#define __NR_munlock 229
> +#define __NR_munlockall 231
> +#define __NR_munmap 215
> +#define __NR_name_to_handle_at 264
> +#define __NR_nanosleep 101
> +#define __NR_nfsservctl 42
> +#define __NR_open_by_handle_at 265
> +#define __NR_open_tree 428
> +#define __NR_openat 56
> +#define __NR_openat2 437
> +#define __NR_perf_event_open 241
> +#define __NR_personality 92
> +#define __NR_pidfd_getfd 438
> +#define __NR_pidfd_open 434
> +#define __NR_pidfd_send_signal 424
> +#define __NR_pipe2 59
> +#define __NR_pivot_root 41
> +#define __NR_pkey_alloc 289
> +#define __NR_pkey_free 290
> +#define __NR_pkey_mprotect 288
> +#define __NR_ppoll_time64 414
> +#define __NR_prctl 167
> +#define __NR_pread64 67
> +#define __NR_preadv 69
> +#define __NR_preadv2 286
> +#define __NR_prlimit64 261
> +#define __NR_process_vm_readv 270
> +#define __NR_process_vm_writev 271
> +#define __NR_pselect6_time64 413
> +#define __NR_ptrace 117
> +#define __NR_pwrite64 68
> +#define __NR_pwritev 70
> +#define __NR_pwritev2 287
> +#define __NR_quotactl 60
> +#define __NR_read 63
> +#define __NR_readahead 213
> +#define __NR_readlinkat 78
> +#define __NR_readv 65
> +#define __NR_reboot 142
> +#define __NR_recvfrom 207
> +#define __NR_recvmmsg_time64 417
> +#define __NR_recvmsg 212
> +#define __NR_remap_file_pages 234
> +#define __NR_removexattr 14
> +#define __NR_renameat 38
> +#define __NR_renameat2 276
> +#define __NR_request_key 218
> +#define __NR_restart_syscall 128
> +#define __NR_rseq 293
> +#define __NR_rt_sigaction 134
> +#define __NR_rt_sigpending 136
> +#define __NR_rt_sigprocmask 135
> +#define __NR_rt_sigqueueinfo 138
> +#define __NR_rt_sigreturn 139
> +#define __NR_rt_sigsuspend 133
> +#define __NR_rt_sigtimedwait_time64 421
> +#define __NR_rt_tgsigqueueinfo 240
> +#define __NR_sched_get_priority_max 125
> +#define __NR_sched_get_priority_min 126
> +#define __NR_sched_getaffinity 123
> +#define __NR_sched_getattr 275
> +#define __NR_sched_getparam 121
> +#define __NR_sched_getscheduler 120
> +#define __NR_sched_rr_get_interval_time64 423
> +#define __NR_sched_setaffinity 122
> +#define __NR_sched_setattr 274
> +#define __NR_sched_setparam 118
> +#define __NR_sched_setscheduler 119
> +#define __NR_sched_yield 124
> +#define __NR_seccomp 277
> +#define __NR_semctl 191
> +#define __NR_semget 190
> +#define __NR_semop 193
> +#define __NR_semtimedop_time64 420
> +#define __NR_sendfile64 71
> +#define __NR_sendmmsg 269
> +#define __NR_sendmsg 211
> +#define __NR_sendto 206
> +#define __NR_set_mempolicy 237
> +#define __NR_set_robust_list 99
> +#define __NR_set_tid_address 96
> +#define __NR_setdomainname 162
> +#define __NR_setfsgid 152
> +#define __NR_setfsuid 151
> +#define __NR_setgid 144
> +#define __NR_setgroups 159
> +#define __NR_sethostname 161
> +#define __NR_setitimer 103
> +#define __NR_setns 268
> +#define __NR_setpgid 154
> +#define __NR_setpriority 140
> +#define __NR_setregid 143
> +#define __NR_setresgid 149
> +#define __NR_setresuid 147
> +#define __NR_setreuid 145
> +#define __NR_setrlimit 164
> +#define __NR_setsid 157
> +#define __NR_setsockopt 208
> +#define __NR_settimeofday 170
> +#define __NR_setuid 146
> +#define __NR_setxattr 5
> +#define __NR_shmat 196
> +#define __NR_shmctl 195
> +#define __NR_shmdt 197
> +#define __NR_shmget 194
> +#define __NR_shutdown 210
> +#define __NR_sigaltstack 132
> +#define __NR_signalfd4 74
> +#define __NR_socket 198
> +#define __NR_socketpair 199
> +#define __NR_splice 76
> +#define __NR_statfs64 43
> +#define __NR_statx 291
> +#define __NR_swapoff 225
> +#define __NR_swapon 224
> +#define __NR_symlinkat 36
> +#define __NR_sync 81
> +#define __NR_sync_file_range 84
> +#define __NR_syncfs 267
> +#define __NR_sysfs 247
> +#define __NR_sysinfo 179
> +#define __NR_syslog 116
> +#define __NR_tee 77
> +#define __NR_tgkill 131
> +#define __NR_timer_create 107
> +#define __NR_timer_delete 111
> +#define __NR_timer_getoverrun 109
> +#define __NR_timer_gettime 108
> +#define __NR_timer_gettime64 408
> +#define __NR_timer_settime 110
> +#define __NR_timer_settime64 409
> +#define __NR_timerfd_create 85
> +#define __NR_timerfd_gettime64 410
> +#define __NR_timerfd_settime64 411
> +#define __NR_times 153
> +#define __NR_tkill 130
> +#define __NR_truncate64 45
> +#define __NR_umask 166
> +#define __NR_umount2 39
> +#define __NR_uname 160
> +#define __NR_unlinkat 35
> +#define __NR_unshare 97
> +#define __NR_userfaultfd 282
> +#define __NR_utimensat_time64 412
> +#define __NR_vhangup 58
> +#define __NR_vmsplice 75
> +#define __NR_wait4 260
> +#define __NR_waitid 95
> +#define __NR_write 64
> +#define __NR_writev 66

Ok, although I did not confered it was done with lastest Linux kernel 
releases used by build-many-glibcs.py. You might double check it.

> diff --git a/sysdeps/unix/sysv/linux/arc/bits/timesize.h b/sysdeps/unix/sysv/linux/arc/bits/timesize.h
> new file mode 100644
> index 000000000000..1259077c6412
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/arc/bits/timesize.h
> @@ -0,0 +1,21 @@
> +/* Bit size of the time_t type at glibc build time, general case.
> +   Copyright (C) 2019-2020 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <http://www.gnu.org/licenses/>.  */
> +
> +#include <bits/wordsize.h>
> +
> +#define __TIMESIZE	64

Ok.

> diff --git a/sysdeps/unix/sysv/linux/arc/clone.S b/sysdeps/unix/sysv/linux/arc/clone.S
> new file mode 100644
> index 000000000000..c5ba38541163
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/arc/clone.S
> @@ -0,0 +1,98 @@
> +/* clone() implementation for ARC.
> +   Copyright (C) 2008-2020 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +   Contributed by Andrew Jenner <andrew@codesourcery.com>, 2008.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +
> +#include <sysdep.h>
> +#define _ERRNO_H	1
> +#include <bits/errno.h>
> +#include <tcb-offsets.h>
> +
> +#define CLONE_SETTLS		0x00080000
> +
> +/* int clone(int (*fn)(void *), void *child_stack,
> +           int flags, void *arg, ...
> +           < pid_t *ptid, struct user_desc *tls, pid_t *ctid > );
> +
> + NOTE: I'm assuming that the last 3 args are NOT var-args and in case all
> +	3 are not relevant, caller will nevertheless pass those as NULL.

Maybe we should update our clone prototype, although this might incur 
in a ABI break. The assumption here should be ok, since all other
implementations do the same.

> +
> + clone syscall in kernel (ABI: CONFIG_CLONE_BACKWARDS)
> +
> +  int sys_clone(unsigned long int clone_flags,
> +	        unsigned long int newsp,
> +		int __user *parent_tidptr,
> +		void *tls,
> +		int __user *child_tidptr).  */
> +
> +ENTRY (__clone)
> +	cmp	r0, 0		; @fn can't be NULL
> +	cmp.ne	r1, 0		; @child_stack can't be NULL
> +	bz	.L__sys_err
> +
> +	; save some of the orig args
> +	; r0 containg @fn will be clobbered AFTER syscall (with ret val)
> +	; rest are clobbered BEFORE syscall due to different arg ordering
> +	mov	r10, r0		; @fn
> +	mov	r11, r3		; @args
> +	mov	r12, r2		; @clone_flags
> +	mov	r9,  r5		; @tls
> +
> +	; adjust libc args for syscall
> +
> +	mov 	r0, r2		; libc @flags is 1st syscall arg
> +	mov	r2, r4		; libc @ptid
> +	mov	r3, r5		; libc @tls
> +	mov	r4, r6		; libc @ctid
> +	mov	r8, __NR_clone
> +	ARC_TRAP_INSN
> +
> +	cmp	r0, 0		; return code : 0 new process, !0 parent
> +	blt	.L__sys_err2	; < 0 (signed) error
> +	jnz	[blink]		; Parent returns
> +
> +	; ----- child starts here ---------
> +
> +	; Setup TP register (only recent kernels v4.19+ do that)
> +	and.f	0, r12, CLONE_SETTLS
> +	mov.nz	r25, r9

Do you still need to set it since the minimum supported kernel
for ARC is 5.1 ?

It should be safe for internal glibc usage, since for both pthread
and posix_spawn it blocks all signals including SIGCANCEL and SIGXID.
However this is still small race window if this is called directly 
with pthread cancellation or g*uid in multithread.

> +
> +	; child jumps off to @fn with @arg as argument, and returns here
> +	jl.d	[r10]
> +	mov	r0, r11
> +
> +	; exit() with result from @fn (already in r0)
> +	mov	r8, __NR_exit
> +	ARC_TRAP_INSN
> +	; In case it ever came back
> +	flag	1
> +
> +.L__sys_err:

Can't you use L(...) macro as other architectures? 

> +	mov	r0, -EINVAL
> +.L__sys_err2:
> +	; (1) No need to make -ve kernel error code as positive errno
> +	;   __syscall_error expects the -ve error code returned by kernel
> +	; (2) r0 still had orig -ve kernel error code
> +	; (3) Tail call to __syscall_error so we dont have to come back
> +	;     here hence instead of jmp-n-link (reg push/pop) we do jmp
> +	; (4) No need to route __syscall_error via PLT, B is inherently
> +	;     position independent
> +	b   __syscall_error
> +PSEUDO_END (__clone)
> +libc_hidden_def (__clone)
> +weak_alias (__clone, clone)

Ok.

> diff --git a/sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h b/sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h
> new file mode 100644
> index 000000000000..47faaecc8970
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h
> @@ -0,0 +1,41 @@
> +/* Regularize <asm/unistd.h> definitions.  ARC version.
> +   Copyright (C) 2020 Free Software Foundation, Inc.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <http://www.gnu.org/licenses/>.  */
> +
> +/* Adjustments to ARC asm-generic syscall ABI (3.9 kernel) for 64-bit time_t
> +   support.  */
> +
> +/* fstat64 and fstatat64 need to be replaced with statx.  */
> +
> +#undef __NR_fstat64
> +#undef __NR_fstatat64
> +
> +/* Replace all other 32-bit time syscalls with 64-bit variants.  */
> +
> +# undef __NR_clock_adjtime
> +# undef __NR_clock_getres
> +# undef __NR_futex
> +# undef __NR_mq_timedreceive
> +# undef __NR_mq_timedsend
> +# undef __NR_ppoll
> +# undef __NR_pselect6
> +# undef __NR_recvmmsg
> +# undef __NR_rt_sigtimedwait
> +# undef __NR_sched_rr_get_interval
> +# undef __NR_semtimedop
> +# undef __NR_timerfd_settime
> +# undef __NR_timerfd_gettime
> +# undef __NR_utimensat

Ok.

> diff --git a/sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h
> new file mode 100644
> index 000000000000..296f3197ee31
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h
> @@ -0,0 +1,6 @@
> +#define JMP_BUF_SIZE		(32 + 1 + 64 / (8 * sizeof (unsigned long int))) * sizeof (unsigned long int)
> +#define SIGJMP_BUF_SIZE		(32 + 1 + 64 / (8 * sizeof (unsigned long int))) * sizeof (unsigned long int)
> +#define JMP_BUF_ALIGN		__alignof__ (unsigned long int)
> +#define SIGJMP_BUF_ALIGN	__alignof__ (unsigned long int)
> +#define MASK_WAS_SAVED_OFFSET	(32 * sizeof (unsigned long int))
> +#define SAVED_MASK_OFFSET	(33 * sizeof (unsigned long int))

Ok.

> diff --git a/sysdeps/unix/sysv/linux/arc/kernel-features.h b/sysdeps/unix/sysv/linux/arc/kernel-features.h
> new file mode 100644
> index 000000000000..4f23a34489eb
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/arc/kernel-features.h
> @@ -0,0 +1,28 @@
> +/* Set flags signalling availability of kernel features based on given
> +   kernel version number.
> +
> +   Copyright (C) 2009-2020 Free Software Foundation, Inc.
> +
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +/* The minimum supported kernel version for ARC is 5.1 (64-bit time, offsets),
> +   although the asm-generic ABI is from 3.9 (when Linux port was merged).  */
> +
> +#include_next <kernel-features.h>
> +
> +#undef __ASSUME_CLONE_DEFAULT
> +#define __ASSUME_CLONE_BACKWARDS 1

Ok.

> diff --git a/sysdeps/unix/sysv/linux/arc/kernel_stat.h b/sysdeps/unix/sysv/linux/arc/kernel_stat.h
> new file mode 100644
> index 000000000000..8fdd86b9e843
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/arc/kernel_stat.h
> @@ -0,0 +1,26 @@
> +/* Copyright (C) 2020 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library.  If not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <bits/wordsize.h>
> +
> +/* Needed to elide the itemized copy code in common xstatconv.c.  */
> +#define STAT_IS_KERNEL_STAT 1
> +
> +/* Nice side-effect of 64-bit time_t switch is these are same.  */
> +#define XSTAT_IS_XSTAT64 1
> +
> +#define STATFS_IS_STATFS64 0

Ok.

> diff --git a/sysdeps/unix/sysv/linux/arc/mmap_internal.h b/sysdeps/unix/sysv/linux/arc/mmap_internal.h
> new file mode 100644
> index 000000000000..19aa078dd45e
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/arc/mmap_internal.h
> @@ -0,0 +1,27 @@
> +/* mmap - map files or devices into memory.  Linux/ARC version.
> +   Copyright (C) 2017-2020 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#ifndef MMAP_ARC_INTERNAL_H
> +#define MMAP_ARC_INTERNAL_H
> +
> +/* 8K is default but determine the shift dynamically with getpagesize.  */
> +#define MMAP2_PAGE_UNIT -1
> +
> +#include_next <mmap_internal.h>
> +
> +#endif

Ok.  I would be interesting if kernel could consolidate de mmap
implementation to return EINVAL for invalid offsets. A lot of
architectures have its own implementation to handle.

> diff --git a/sysdeps/unix/sysv/linux/arc/pt-vfork.S b/sysdeps/unix/sysv/linux/arc/pt-vfork.S
> new file mode 100644
> index 000000000000..1cc893170070
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/arc/pt-vfork.S
> @@ -0,0 +1 @@
> +/* Not needed.  */

This file is not required since "nptl: Remove vfork IFUNC-based
forwarder from libpthread [BZ #20188]" (41d6f74e6cb6a9).

> diff --git a/sysdeps/unix/sysv/linux/arc/sigaction.c b/sysdeps/unix/sysv/linux/arc/sigaction.c
> new file mode 100644
> index 000000000000..2613eb883fb1
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/arc/sigaction.c
> @@ -0,0 +1,31 @@
> +/* ARC specific sigaction.
> +   Copyright (C) 1997-2020 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library.  If not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#define SA_RESTORER	0x04000000
> +
> +extern void __default_rt_sa_restorer (void);
> +
> +#define SET_SA_RESTORER(kact, act)				\
> + ({								\
> +   (kact)->sa_restorer = __default_rt_sa_restorer;		\
> +   (kact)->sa_flags |= SA_RESTORER;				\
> + })
> +
> +#define RESET_SA_RESTORER(act, kact)
> +
> +#include <sysdeps/unix/sysv/linux/sigaction.c>

Ok.

> diff --git a/sysdeps/unix/sysv/linux/arc/sigrestorer.S b/sysdeps/unix/sysv/linux/arc/sigrestorer.S
> new file mode 100644
> index 000000000000..cc3c1a0d09ff
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/arc/sigrestorer.S
> @@ -0,0 +1,29 @@
> +/* Default sigreturn stub for ARC Linux.
> +   Copyright (C) 2005-2020 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <sys/syscall.h>
> +#include <sysdep.h>
> +#include <tcb-offsets.h>
> +
> +/* Note the NOP has to be outside body.  */
> +	nop

Wy exactly do you need it here?

> +ENTRY (__default_rt_sa_restorer)
> +	mov r8, __NR_rt_sigreturn
> +	ARC_TRAP_INSN
> +	j_s     [blink]

Ok.

> +PSEUDO_END_NOERRNO (__default_rt_sa_restorer)
> diff --git a/sysdeps/unix/sysv/linux/arc/syscall.S b/sysdeps/unix/sysv/linux/arc/syscall.S
> new file mode 100644
> index 000000000000..ff17e71575b1
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/arc/syscall.S
> @@ -0,0 +1,33 @@
> +/* syscall - indirect system call.
> +   Copyright (C) 2017-2020 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <sysdep.h>
> +
> +ENTRY (syscall)
> +	mov_s	r8, r0
> +	mov_s	r0, r1
> +	mov_s	r1, r2
> +	mov_s	r2, r3
> +	mov_s	r3, r4
> +	mov_s	r4, r5
> +	mov_s	r5, r6
> +
> +	ARC_TRAP_INSN
> +	brhi	r0, -1024, .Lcall_syscall_err
> +	j	[blink]
> +PSEUDO_END (syscall)

Ok.

> diff --git a/sysdeps/unix/sysv/linux/arc/syscalls.list b/sysdeps/unix/sysv/linux/arc/syscalls.list
> new file mode 100644
> index 000000000000..d0ef5977ee06
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/arc/syscalls.list
> @@ -0,0 +1,3 @@
> +# File name	Caller	Syscall name	Args	Strong name	Weak names
> +
> +cacheflush	-	cacheflush	i:pii	_flush_cache	cacheflush

Ok.

> diff --git a/sysdeps/unix/sysv/linux/arc/sysctl.mk b/sysdeps/unix/sysv/linux/arc/sysctl.mk
> new file mode 100644
> index 000000000000..05a4e2f8c99b
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/arc/sysctl.mk
> @@ -0,0 +1 @@
> +# ARC doesn't support sysctl.

This file is not required since "Linux: Remove <sys/sysctl.h>
and the sysctl function" (076f09afbac1a).

> diff --git a/sysdeps/unix/sysv/linux/arc/sysdep.c b/sysdeps/unix/sysv/linux/arc/sysdep.c
> new file mode 100644
> index 000000000000..42c8575ba461
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/arc/sysdep.c
> @@ -0,0 +1,33 @@
> +/* ARC wrapper for setting errno.
> +   Copyright (C) 1997-2020 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <sysdep.h>
> +#include <errno.h>
> +
> +/* All syscall handlers land here to avoid generated code bloat due to
> +   GOT reference  to errno_location or it's equivalent.  */
> +int
> +__syscall_error (int err_no)
> +{
> +  __set_errno (-err_no);
> +  return -1;
> +}
> +
> +#if IS_IN (libc)
> +hidden_def (__syscall_error)
> +#endif

Ok.

> diff --git a/sysdeps/unix/sysv/linux/arc/sysdep.h b/sysdeps/unix/sysv/linux/arc/sysdep.h
> new file mode 100644
> index 000000000000..3aee9b95326f
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/arc/sysdep.h
> @@ -0,0 +1,224 @@
> +/* Assembler macros for ARC.
> +   Copyright (C) 2000-2020 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#ifndef _LINUX_ARC_SYSDEP_H
> +#define _LINUX_ARC_SYSDEP_H 1
> +
> +#include <sysdeps/arc/sysdep.h>
> +#include <sysdeps/unix/sysv/linux/generic/sysdep.h>
> +
> +/* 32-bit time syscalls are not available, but the redefines allow generic
> +   wrappers to work.  */
> +#define __NR_clock_adjtime	__NR_clock_adjtime64
> +#define __NR_clock_getres	__NR_clock_getres_time64
> +#define __NR_futex		__NR_futex_time64
> +#define __NR_mq_timedreceive	__NR_mq_timedreceive_time64
> +#define __NR_mq_timedsend	__NR_mq_timedsend_time64
> +#define __NR_ppoll		__NR_ppoll_time64
> +#define __NR_pselect6		__NR_pselect6_time64
> +#define __NR_recvmmsg		__NR_recvmmsg_time64
> +#define __NR_rt_sigtimedwait	__NR_rt_sigtimedwait_time64
> +#define __NR_sched_rr_get_interval	__NR_sched_rr_get_interval_time64
> +#define __NR_semtimedop		__NR_semtimedop_time64
> +#define __NR_timerfd_gettime	__NR_timerfd_gettime64
> +#define __NR_timerfd_settime	__NR_timerfd_settime64
> +#define __NR_utimensat		__NR_utimensat_time64
> +
> +/* For RTLD_PRIVATE_ERRNO.  */
> +#include <dl-sysdep.h>
> +
> +#include <tls.h>
> +
> +#undef SYS_ify
> +#define SYS_ify(syscall_name)   __NR_##syscall_name
> +
> +#ifdef __ASSEMBLER__
> +
> +/* This is a "normal" system call stub: if there is an error,
> +   it returns -1 and sets errno.  */
> +
> +# undef PSEUDO
> +# define PSEUDO(name, syscall_name, args)			\
> +  PSEUDO_NOERRNO(name, syscall_name, args)	ASM_LINE_SEP	\
> +    brhi   r0, -4096, .Lcall_syscall_err	ASM_LINE_SEP
> +
> +# define ret	j_s  [blink]
> +
> +# undef PSEUDO_END
> +# define PSEUDO_END(name)					\
> +  SYSCALL_ERROR_HANDLER				ASM_LINE_SEP	\
> +  END (name)
> +
> +/* --------- Helper for SYSCALL_NOERRNO -----------
> +   This kind of system call stub never returns an error.
> +   We return the return value register to the caller unexamined.  */
> +
> +# undef PSEUDO_NOERRNO
> +# define PSEUDO_NOERRNO(name, syscall_name, args)		\
> +  .text						ASM_LINE_SEP	\
> +  ENTRY (name)					ASM_LINE_SEP	\
> +    DO_CALL (syscall_name, args)		ASM_LINE_SEP	\
> +
> +/* Return the return value register unexamined. Since r0 is both
> +   syscall return reg and function return reg, no work needed.  */
> +# define ret_NOERRNO						\
> +  j_s  [blink]		ASM_LINE_SEP
> +
> +# undef PSEUDO_END_NOERRNO
> +# define PSEUDO_END_NOERRNO(name)				\
> +  END (name)
> +
> +/* --------- Helper for SYSCALL_ERRVAL -----------
> +   This kind of system call stub returns the errno code as its return
> +   value, or zero for success.  We may massage the kernel's return value
> +   to meet that ABI, but we never set errno here.  */
> +
> +# undef PSEUDO_ERRVAL
> +# define PSEUDO_ERRVAL(name, syscall_name, args)		\
> +  PSEUDO_NOERRNO(name, syscall_name, args)	ASM_LINE_SEP
> +
> +/* Don't set errno, return kernel error (in errno form) or zero.  */
> +# define ret_ERRVAL						\
> +  rsub   r0, r0, 0				ASM_LINE_SEP	\
> +  ret_NOERRNO
> +
> +# undef PSEUDO_END_ERRVAL
> +# define PSEUDO_END_ERRVAL(name)				\
> +  END (name)
> +
> +
> +/* To reduce the code footprint, we confine the actual errno access
> +   to single place in __syscall_error().
> +   This takes raw kernel error value, sets errno and returns -1.  */
> +# if IS_IN (libc)
> +#  define CALL_ERRNO_SETTER_C	bl     PLTJMP(HIDDEN_JUMPTARGET(__syscall_error))
> +# else
> +#  define CALL_ERRNO_SETTER_C	bl     PLTJMP(__syscall_error)
> +# endif
> +
> +# define SYSCALL_ERROR_HANDLER				\
> +.Lcall_syscall_err:			ASM_LINE_SEP	\
> +    push_s   blink			ASM_LINE_SEP	\
> +    cfi_adjust_cfa_offset (4)		ASM_LINE_SEP	\
> +    cfi_rel_offset (blink, 0)		ASM_LINE_SEP	\
> +    CALL_ERRNO_SETTER_C			ASM_LINE_SEP	\
> +    pop_s  blink			ASM_LINE_SEP	\
> +    cfi_adjust_cfa_offset (-4)		ASM_LINE_SEP	\
> +    cfi_restore (blink)			ASM_LINE_SEP	\
> +    j_s      [blink]
> +
> +# define DO_CALL(syscall_name, args)				\
> +    mov    r8, SYS_ify (syscall_name)	ASM_LINE_SEP	\
> +    ARC_TRAP_INSN			ASM_LINE_SEP
> +
> +# define ARC_TRAP_INSN	trap_s 0
> +
> +#else  /* !__ASSEMBLER__ */
> +
> +# define SINGLE_THREAD_BY_GLOBAL		1
> +
> +# if IS_IN (libc)
> +extern int __syscall_error (int);
> +hidden_proto (__syscall_error)
> +# endif
> +
> +# define ARC_TRAP_INSN	"trap_s 0	\n\t"
> +
> +# undef INTERNAL_SYSCALL_NCS
> +# define INTERNAL_SYSCALL_NCS(number, nr_args, args...)	\
> +  ({								\
> +    /* Per ABI, r0 is 1st arg and return reg.  */		\
> +    register int __ret __asm__("r0");				\
> +    register int _sys_num __asm__("r8");			\
> +								\
> +    LOAD_ARGS_##nr_args (number, args)				\
> +								\
> +    __asm__ volatile (						\
> +                      ARC_TRAP_INSN				\
> +                      : "+r" (__ret)				\
> +                      : "r"(_sys_num) ASM_ARGS_##nr_args	\
> +                      : "memory");				\
> +                                                                \
> +    __ret; })
> +
> +# undef INTERNAL_SYSCALL
> +# define INTERNAL_SYSCALL(name, nr, args...) 	\
> +  INTERNAL_SYSCALL_NCS(SYS_ify(name), nr, args)
> +
> +/* Macros for setting up inline __asm__ input regs.  */
> +# define ASM_ARGS_0
> +# define ASM_ARGS_1	ASM_ARGS_0, "r" (__ret)
> +# define ASM_ARGS_2	ASM_ARGS_1, "r" (_arg2)
> +# define ASM_ARGS_3	ASM_ARGS_2, "r" (_arg3)
> +# define ASM_ARGS_4	ASM_ARGS_3, "r" (_arg4)
> +# define ASM_ARGS_5	ASM_ARGS_4, "r" (_arg5)
> +# define ASM_ARGS_6	ASM_ARGS_5, "r" (_arg6)
> +# define ASM_ARGS_7	ASM_ARGS_6, "r" (_arg7)
> +
> +/* Macros for converting sys-call wrapper args into sys call args.  */
> +# define LOAD_ARGS_0(nm, arg)				\
> +  _sys_num = (int) (nm);
> +
> +# define LOAD_ARGS_1(nm, arg1)				\
> +  __ret = (int) (arg1);					\
> +  LOAD_ARGS_0 (nm, arg1)
> +
> +/* Note that the use of _tmpX might look superflous, however it is needed
> +   to ensure that register variables are not clobbered if arg happens to be
> +   a function call itself. e.g. sched_setaffinity() calling getpid() for arg2
> +   Also this specific order of recursive calling is important to segregate
> +   the tmp args evaluation (function call case described above) and assigment
> +   of register variables.  */
> +
> +# define LOAD_ARGS_2(nm, arg1, arg2)			\
> +  int _tmp2 = (int) (arg2);				\
> +  LOAD_ARGS_1 (nm, arg1)				\
> +  register int _arg2 __asm__ ("r1") = _tmp2;
> +
> +# define LOAD_ARGS_3(nm, arg1, arg2, arg3)		\
> +  int _tmp3 = (int) (arg3);				\
> +  LOAD_ARGS_2 (nm, arg1, arg2)				\
> +  register int _arg3 __asm__ ("r2") = _tmp3;
> +
> +#define LOAD_ARGS_4(nm, arg1, arg2, arg3, arg4)		\
> +  int _tmp4 = (int) (arg4);				\
> +  LOAD_ARGS_3 (nm, arg1, arg2, arg3)			\
> +  register int _arg4 __asm__ ("r3") = _tmp4;
> +
> +# define LOAD_ARGS_5(nm, arg1, arg2, arg3, arg4, arg5)	\
> +  int _tmp5 = (int) (arg5);				\
> +  LOAD_ARGS_4 (nm, arg1, arg2, arg3, arg4)		\
> +  register int _arg5 __asm__ ("r4") = _tmp5;
> +
> +# define LOAD_ARGS_6(nm,  arg1, arg2, arg3, arg4, arg5, arg6)\
> +  int _tmp6 = (int) (arg6);				\
> +  LOAD_ARGS_5 (nm, arg1, arg2, arg3, arg4, arg5)	\
> +  register int _arg6 __asm__ ("r5") = _tmp6;
> +
> +# define LOAD_ARGS_7(nm, arg1, arg2, arg3, arg4, arg5, arg6, arg7)\
> +  int _tmp7 = (int) (arg7);				\
> +  LOAD_ARGS_6 (nm, arg1, arg2, arg3, arg4, arg5, arg6)	\
> +  register int _arg7 __asm__ ("r6") = _tmp7;
> +
> +/* Pointer mangling not yet supported.  */
> +# define PTR_MANGLE(var) (void) (var)
> +# define PTR_DEMANGLE(var) (void) (var)
> +
> +#endif /* !__ASSEMBLER__ */
> +
> +#endif /* linux/arc/sysdep.h */

Ok.

> diff --git a/sysdeps/unix/sysv/linux/arc/vfork.S b/sysdeps/unix/sysv/linux/arc/vfork.S
> new file mode 100644
> index 000000000000..ac1cce5258e0
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/arc/vfork.S
> @@ -0,0 +1,42 @@
> +/* vfork for ARC Linux.
> +   Copyright (C) 2005-2020 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <sys/syscall.h>
> +#include <sysdep.h>
> +#include <tcb-offsets.h>
> +#define _SIGNAL_H
> +#include <bits/signum.h>       /* For SIGCHLD */
> +
> +#define CLONE_VM		0x00000100
> +#define CLONE_VFORK		0x00004000
> +#define CLONE_FLAGS_FOR_VFORK	(CLONE_VM|CLONE_VFORK|SIGCHLD)
> +
> +ENTRY (__vfork)
> +	mov	r0, CLONE_FLAGS_FOR_VFORK
> +	mov_s	r1, sp
> +	mov	r8, __NR_clone
> +	ARC_TRAP_INSN
> +
> +	cmp	r0, 0
> +	jge	[blink]	; child continues
> +
> +	b   __syscall_error
> +PSEUDO_END (__vfork)
> +libc_hidden_def (__vfork)
> +
> +weak_alias (__vfork, vfork)
> 

Ok. As a side note I think we should start to think about deprecate
vfork.

_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

^ permalink raw reply

* [PATCH 0/2] exec: Remove the computation of bprm->cred
From: Eric W. Biederman @ 2020-05-29 16:45 UTC (permalink / raw)
  To: linux-kernel
  Cc: Linus Torvalds, Oleg Nesterov, Jann Horn, Kees Cook, Greg Ungerer,
	Rob Landley, Bernd Edlinger, linux-fsdevel, Al Viro,
	Alexey Dobriyan, Andrew Morton, Casey Schaufler,
	linux-security-module, James Morris, Serge E. Hallyn,
	Andy Lutomirski
In-Reply-To: <87k10wysqz.fsf_-_@x220.int.ebiederm.org>


My last chunk of cleanups was clearly too a bit too big, with too many
issues going on so let's try this again with just the most important
cleanup.

Recomputing the uids, gids, capabilities, and related flags each time a
new bprm->file is set is error prone, and as it turns out unnecessary.

Building upon my previous exec clean up work this set of changes splits
per_clear temporarily into two separate flags which is the last step in
causing the code to recompute everything each time a new bprm->file is
considered. Then the code is refactored to run the credential from file
calculation later so that recomputation is not necessary.

Doing this in two steps should allow anyone who has problems later to
bisect and tell if it was the semantic change or the refactoring that
caused them problems.

Eric W. Biederman (2):
      exec: Add a per bprm->file version of per_clear
      exec: Compute file based creds only once

 fs/binfmt_misc.c              |  2 +-
 fs/exec.c                     | 57 ++++++++++++++++++-------------------------
 include/linux/binfmts.h       |  9 ++-----
 include/linux/lsm_hook_defs.h |  2 +-
 include/linux/lsm_hooks.h     | 22 +++++++++--------
 include/linux/security.h      |  9 ++++---
 security/commoncap.c          | 22 +++++++++--------
 security/security.c           |  4 +--
 8 files changed, 59 insertions(+), 68 deletions(-)

---

This builds upon my previous exec cleanup work at:
git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace.git exec-next

Thank you,
Eric

^ permalink raw reply

* Re: [PATCH v3 bpf-next 5/5] selftest: Add tests for XDP programs in devmap entries
From: David Ahern @ 2020-05-29 16:48 UTC (permalink / raw)
  To: Toke Høiland-Jørgensen, David Ahern, netdev
  Cc: bpf, davem, kuba, brouer, lorenzo, daniel, john.fastabend, ast,
	kafai, songliubraving, yhs, andriin
In-Reply-To: <87r1v2zo3y.fsf@toke.dk>

On 5/29/20 10:45 AM, Toke Høiland-Jørgensen wrote:
>> diff --git a/tools/testing/selftests/bpf/progs/test_xdp_devmap_helpers.c b/tools/testing/selftests/bpf/progs/test_xdp_devmap_helpers.c
>> new file mode 100644
>> index 000000000000..b360ba2bd441
>> --- /dev/null
>> +++ b/tools/testing/selftests/bpf/progs/test_xdp_devmap_helpers.c
>> @@ -0,0 +1,22 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +/* fails to load without expected_attach_type = BPF_XDP_DEVMAP
>> + * because of access to egress_ifindex
>> + */
>> +#include <linux/bpf.h>
>> +#include <bpf/bpf_helpers.h>
>> +
>> +SEC("xdp_dm_log")
> Guess this should be xdp_devmap_log now?
> 
no. this program is for negative testing - it should load as an XDP
program without the expected_attach_type set. See the comment at the top
of the file.

^ permalink raw reply

* Re: [PULL 00/21] Vga 20200528 patches
From: Philippe Mathieu-Daudé @ 2020-05-29 16:47 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Igor Mitsyanko, Alistair Francis, Mark Cave-Ayland,
	QEMU Developers, qemu-arm, qemu-ppc, Gerd Hoffmann
In-Reply-To: <CAFEAcA_Su+2O6nm0hRfj1BqwQzSsLva+ft_f=1O47-o6U8NxBA@mail.gmail.com>

On 5/29/20 6:36 PM, Peter Maydell wrote:
> On Fri, 29 May 2020 at 17:15, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>> On 5/29/20 12:29 PM, Peter Maydell wrote:
>>> Could somebody send a followup patch to fix the indentation
>>> error checkpatch notices, please?
>>
>> If this is part of your scripts, this is a nice feature :)
> 
> No, I just noticed the patchew email.
> 
>>>
>>> 5/21 Checking commit 97f369f2479d (hw/display/cirrus_vga: Use
>>> qemu_log_mask(ERROR) instead of debug printf)
>>> ERROR: suspect code indent for conditional statements (16, 12)
>>> #34: FILE: hw/display/cirrus_vga.c:1038:
>>>                 if (s->cirrus_blt_pixelwidth > 2) {
>>> +            qemu_log_mask(LOG_GUEST_ERROR,
>>
>> I explained on the patches:
>>
>>   False positive.
> 
> The code is
>             if (s->cirrus_blt_mode & CIRRUS_BLTMODE_TRANSPARENTCOMP) {
>                 if (s->cirrus_blt_pixelwidth > 2) {
>             qemu_log_mask(LOG_GUEST_ERROR,
>                           "cirrus: src transparent without colorexpand "
>                           "must be 8bpp or 16bpp\n");
>                     goto bitblt_ignore;
>                 }
> 
> checkpatch seems correct; the qemu_log_mask line is misindented,
> and looking at the commit this is a misindent introduced in
> commit 2b55f4d3504a9f34 "hw/display/cirrus_vga: Use
> qemu_log_mask(ERROR) instead of debug printf". The old
> fprintf() line was using indent of tab+tab+4 spaces, but
> the new qemu_log_mask line is indented by 12 spaces, not 20.
> (Tabs are always 8 spaces equivalent.)

OK now I understand, I use "set ts=4 sw=4" in my .vimrc and see this
file completely un-indented (and the qemu_log_mask call well placed).

I'll send a cleanup patch. Sorry and thanks for noticing this.

> 
> Some days I wonder whether we should just do a bulk detabify
> of the QEMU sources.
> 
> thanks
> -- PMM
> 


^ permalink raw reply

* Re: [PULL 00/21] Vga 20200528 patches
From: Philippe Mathieu-Daudé @ 2020-05-29 16:47 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Igor Mitsyanko, Alistair Francis, Mark Cave-Ayland,
	QEMU Developers, BALATON Zoltan, qemu-arm, qemu-ppc,
	Gerd Hoffmann, Andrzej Zaborowski
In-Reply-To: <CAFEAcA_Su+2O6nm0hRfj1BqwQzSsLva+ft_f=1O47-o6U8NxBA@mail.gmail.com>

On 5/29/20 6:36 PM, Peter Maydell wrote:
> On Fri, 29 May 2020 at 17:15, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>> On 5/29/20 12:29 PM, Peter Maydell wrote:
>>> Could somebody send a followup patch to fix the indentation
>>> error checkpatch notices, please?
>>
>> If this is part of your scripts, this is a nice feature :)
> 
> No, I just noticed the patchew email.
> 
>>>
>>> 5/21 Checking commit 97f369f2479d (hw/display/cirrus_vga: Use
>>> qemu_log_mask(ERROR) instead of debug printf)
>>> ERROR: suspect code indent for conditional statements (16, 12)
>>> #34: FILE: hw/display/cirrus_vga.c:1038:
>>>                 if (s->cirrus_blt_pixelwidth > 2) {
>>> +            qemu_log_mask(LOG_GUEST_ERROR,
>>
>> I explained on the patches:
>>
>>   False positive.
> 
> The code is
>             if (s->cirrus_blt_mode & CIRRUS_BLTMODE_TRANSPARENTCOMP) {
>                 if (s->cirrus_blt_pixelwidth > 2) {
>             qemu_log_mask(LOG_GUEST_ERROR,
>                           "cirrus: src transparent without colorexpand "
>                           "must be 8bpp or 16bpp\n");
>                     goto bitblt_ignore;
>                 }
> 
> checkpatch seems correct; the qemu_log_mask line is misindented,
> and looking at the commit this is a misindent introduced in
> commit 2b55f4d3504a9f34 "hw/display/cirrus_vga: Use
> qemu_log_mask(ERROR) instead of debug printf". The old
> fprintf() line was using indent of tab+tab+4 spaces, but
> the new qemu_log_mask line is indented by 12 spaces, not 20.
> (Tabs are always 8 spaces equivalent.)

OK now I understand, I use "set ts=4 sw=4" in my .vimrc and see this
file completely un-indented (and the qemu_log_mask call well placed).

I'll send a cleanup patch. Sorry and thanks for noticing this.

> 
> Some days I wonder whether we should just do a bulk detabify
> of the QEMU sources.
> 
> thanks
> -- PMM
> 

^ permalink raw reply

* [lkundrak-linux-mmp:lr/nand/cafe-nand-exec-op-debug 74/104] drivers/mtd/nand/raw/bcm47xx-nand-controller.c:235:5: warning: no previous prototype for 'bcm47xxnflash_ops_bcm4706_init'
From: kbuild test robot @ 2020-05-29 16:47 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 8418 bytes --]

Hi Boris,

FYI, the error/warning still remains.

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/lkundrak/linux-mmp.git lr/nand/cafe-nand-exec-op-debug
head:   ca82ff45fe30d46aad41d713abb8f8d381a8264f
commit: e06af39cbcf87124b53029c3d91fa5ed0230b053 [74/104] mtd: rawnand: bcm47xx: Merge all source files
config: arc-allyesconfig (attached as .config)
compiler: arc-elf-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout e06af39cbcf87124b53029c3d91fa5ed0230b053
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

>> drivers/mtd/nand/raw/bcm47xx-nand-controller.c:235:5: warning: no previous prototype for 'bcm47xxnflash_ops_bcm4706_init' [-Wmissing-prototypes]
235 | int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n)
|     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/bcm47xxnflash_ops_bcm4706_init +235 drivers/mtd/nand/raw/bcm47xx-nand-controller.c

344f8f81f468ab drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c Boris Brezillon 2020-04-19  230  
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  231  /**************************************************
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  232   * Init
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  233   **************************************************/
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  234  
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12 @235  int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n)
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  236  {
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  237  	int err;
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  238  	u32 freq;
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  239  	u16 clock;
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  240  	u8 w0, w1, w2, w3, w4;
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  241  
344f8f81f468ab drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c Boris Brezillon 2020-04-19  242  	nand_controller_init(&b47n->base);
344f8f81f468ab drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c Boris Brezillon 2020-04-19  243  	b47n->base.ops = &bcm47xxnflash_ops;
344f8f81f468ab drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c Boris Brezillon 2020-04-19  244  	b47n->nand_chip.controller = &b47n->base;
3c01d4cb7576ff drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  245  	b47n->nand_chip.bbt_options = NAND_BBT_USE_FLASH;
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  246  	b47n->nand_chip.ecc.mode = NAND_ECC_NONE; /* TODO: implement ECC */
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  247  
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  248  	/* Enable NAND flash access */
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  249  	bcma_cc_set32(b47n->cc, BCMA_CC_4706_FLASHSCFG,
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  250  		      BCMA_CC_4706_FLASHSCFG_NF1);
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  251  
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  252  	/* Configure wait counters */
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  253  	if (b47n->cc->status & BCMA_CC_CHIPST_4706_PKG_OPTION) {
785e5e111f2187 drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2014-08-19  254  		/* 400 MHz */
785e5e111f2187 drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2014-08-19  255  		freq = 400000000 / 4;
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  256  	} else {
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  257  		freq = bcma_chipco_pll_read(b47n->cc, 4);
785e5e111f2187 drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2014-08-19  258  		freq = (freq & 0xFFF) >> 3;
785e5e111f2187 drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2014-08-19  259  		/* Fixed reference clock 25 MHz and m = 2 */
785e5e111f2187 drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2014-08-19  260  		freq = (freq * 25000000 / 2) / 4;
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  261  	}
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  262  	clock = freq / 1000000;
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  263  	w0 = bcm47xxnflash_ops_bcm4706_ns_to_cycle(15, clock);
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  264  	w1 = bcm47xxnflash_ops_bcm4706_ns_to_cycle(20, clock);
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  265  	w2 = bcm47xxnflash_ops_bcm4706_ns_to_cycle(10, clock);
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  266  	w3 = bcm47xxnflash_ops_bcm4706_ns_to_cycle(10, clock);
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  267  	w4 = bcm47xxnflash_ops_bcm4706_ns_to_cycle(100, clock);
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  268  	bcma_cc_write32(b47n->cc, BCMA_CC_NFLASH_WAITCNT0,
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  269  			(w4 << 24 | w3 << 18 | w2 << 12 | w1 << 6 | w0));
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  270  
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  271  	/* Scan NAND */
00ad378f304a09 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c Boris Brezillon 2018-09-06  272  	err = nand_scan(&b47n->nand_chip, 1);
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  273  	if (err) {
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  274  		pr_err("Could not scan NAND flash: %d\n", err);
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  275  		bcma_cc_mask32(b47n->cc, BCMA_CC_4706_FLASHSCFG,
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  276  			       ~BCMA_CC_4706_FLASHSCFG_NF1);
20a1a41adcb667 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c Boris Brezillon 2020-04-19  277  	}
20a1a41adcb667 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c Boris Brezillon 2020-04-19  278  
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  279  	return err;
19c0921c842e0a drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c     Rafał Miłecki   2012-11-12  280  }
e06af39cbcf871 drivers/mtd/nand/raw/bcm47xx-nand-controller.c   Boris Brezillon 2020-04-19  281  

:::::: The code at line 235 was first introduced by commit
:::::: 19c0921c842e0aa9ce8c540c9134fd358acc9b28 mtd: bcm47xxnflash: init NAND on BCM4706

:::::: TO: Rafał Miłecki <zajec5@gmail.com>
:::::: CC: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 63028 bytes --]

^ permalink raw reply

* Re: [PATCH v3 bpf-next 0/5] bpf: Add support for XDP programs in DEVMAP entries
From: Toke Høiland-Jørgensen @ 2020-05-29 16:46 UTC (permalink / raw)
  To: David Ahern, netdev
  Cc: bpf, davem, kuba, brouer, lorenzo, daniel, john.fastabend, ast,
	kafai, songliubraving, yhs, andriin, dsahern, David Ahern
In-Reply-To: <20200529052057.69378-1-dsahern@kernel.org>

David Ahern <dsahern@kernel.org> writes:

> Implementation of Daniel's proposal for allowing DEVMAP entries to be
> a device index, program fd pair.
>
> Programs are run after XDP_REDIRECT and have access to both Rx device
> and Tx device.

Found one more nit apart from the changes you already said you'd do for
v4. So with those fixes, feel free to add my:

Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>


^ permalink raw reply

* Re: [PATCH v3 bpf-next 5/5] selftest: Add tests for XDP programs in devmap entries
From: Toke Høiland-Jørgensen @ 2020-05-29 16:45 UTC (permalink / raw)
  To: David Ahern, netdev
  Cc: bpf, davem, kuba, brouer, lorenzo, daniel, john.fastabend, ast,
	kafai, songliubraving, yhs, andriin, dsahern, David Ahern
In-Reply-To: <20200529052057.69378-6-dsahern@kernel.org>

David Ahern <dsahern@kernel.org> writes:

> Add tests to verify ability to add an XDP program to a
> entry in a DEVMAP.
>
> Add negative tests to show DEVMAP programs can not be
> attached to devices as a normal XDP program, and accesses
> to egress_ifindex require BPF_XDP_DEVMAP attach type.
>
> Signed-off-by: David Ahern <dsahern@kernel.org>
> ---
>  .../bpf/prog_tests/xdp_devmap_attach.c        | 89 +++++++++++++++++++
>  .../bpf/progs/test_xdp_devmap_helpers.c       | 22 +++++
>  .../bpf/progs/test_xdp_with_devmap_helpers.c  | 43 +++++++++
>  3 files changed, 154 insertions(+)
>  create mode 100644 tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c
>  create mode 100644 tools/testing/selftests/bpf/progs/test_xdp_devmap_helpers.c
>  create mode 100644 tools/testing/selftests/bpf/progs/test_xdp_with_devmap_helpers.c
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c b/tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c
> new file mode 100644
> index 000000000000..caeea19f2772
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c
> @@ -0,0 +1,89 @@
> +// SPDX-License-Identifier: GPL-2.0
> +#include <uapi/linux/bpf.h>
> +#include <linux/if_link.h>
> +#include <test_progs.h>
> +
> +#include "test_xdp_devmap_helpers.skel.h"
> +#include "test_xdp_with_devmap_helpers.skel.h"
> +
> +#define IFINDEX_LO 1
> +
> +void test_xdp_with_devmap_helpers(void)
> +{
> +	struct test_xdp_with_devmap_helpers *skel;
> +	struct bpf_prog_info info = {};
> +	struct bpf_devmap_val val = {
> +		.ifindex = IFINDEX_LO,
> +	};
> +	__u32 id, len = sizeof(info);
> +	__u32 duration, idx = 0;
> +	int err, dm_fd, map_fd;
> +
> +
> +	skel = test_xdp_with_devmap_helpers__open_and_load();
> +	if (CHECK_FAIL(!skel)) {
> +		perror("test_xdp_with_devmap_helpers__open_and_load");
> +		return;
> +	}
> +
> +	/* can not attach program with DEVMAPs that allow programs
> +	 * as xdp generic
> +	 */
> +	dm_fd = bpf_program__fd(skel->progs.xdp_redir_prog);
> +	err = bpf_set_link_xdp_fd(IFINDEX_LO, dm_fd, XDP_FLAGS_SKB_MODE);
> +	CHECK(err == 0, "Generic attach of program with 8-byte devmap",
> +	      "should have failed\n");
> +
> +	dm_fd = bpf_program__fd(skel->progs.xdp_dummy_dm);
> +	map_fd = bpf_map__fd(skel->maps.dm_ports);
> +	err = bpf_obj_get_info_by_fd(dm_fd, &info, &len);
> +	if (CHECK_FAIL(err))
> +		goto out_close;
> +
> +	val.bpf_prog_fd = dm_fd;
> +	err = bpf_map_update_elem(map_fd, &idx, &val, 0);
> +	CHECK(err, "Add program to devmap entry",
> +	      "err %d errno %d\n", err, errno);
> +
> +	err = bpf_map_lookup_elem(map_fd, &id, &val);
> +	CHECK(err, "Read devmap entry", "err %d errno %d\n", err, errno);
> +	CHECK(info.id != val.bpf_prog_id, "Expected program id in devmap entry",
> +	      "expected %u read %u\n", info.id, val.bpf_prog_id);
> +
> +	/* can not attach BPF_XDP_DEVMAP program to a device */
> +	err = bpf_set_link_xdp_fd(IFINDEX_LO, dm_fd, XDP_FLAGS_SKB_MODE);
> +	CHECK(err == 0, "Attach of BPF_XDP_DEVMAP program",
> +	      "should have failed\n");
> +
> +	val.ifindex = 1;
> +	val.bpf_prog_fd = bpf_program__fd(skel->progs.xdp_dummy_prog);
> +	err = bpf_map_update_elem(map_fd, &idx, &val, 0);
> +	CHECK(err == 0, "Add non-BPF_XDP_DEVMAP program to devmap entry",
> +	      "should have failed\n");
> +
> +out_close:
> +	test_xdp_with_devmap_helpers__destroy(skel);
> +}
> +
> +void test_neg_xdp_devmap_helpers(void)
> +{
> +	struct test_xdp_devmap_helpers *skel;
> +	__u32 duration;
> +
> +	skel = test_xdp_devmap_helpers__open_and_load();
> +	if (CHECK(skel,
> +		  "Load of XDP program accessing egress ifindex without attach type",
> +		  "should have failed\n")) {
> +		test_xdp_devmap_helpers__destroy(skel);
> +	}
> +}
> +
> +
> +void test_xdp_devmap_attach(void)
> +{
> +	if (test__start_subtest("DEVMAP with programs in entries"))
> +		test_xdp_with_devmap_helpers();
> +
> +	if (test__start_subtest("Verifier check of DEVMAP programs"))
> +		test_neg_xdp_devmap_helpers();
> +}
> diff --git a/tools/testing/selftests/bpf/progs/test_xdp_devmap_helpers.c b/tools/testing/selftests/bpf/progs/test_xdp_devmap_helpers.c
> new file mode 100644
> index 000000000000..b360ba2bd441
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/progs/test_xdp_devmap_helpers.c
> @@ -0,0 +1,22 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/* fails to load without expected_attach_type = BPF_XDP_DEVMAP
> + * because of access to egress_ifindex
> + */
> +#include <linux/bpf.h>
> +#include <bpf/bpf_helpers.h>
> +
> +SEC("xdp_dm_log")

Guess this should be xdp_devmap_log now?

-Toke


^ permalink raw reply

* Re: [Patch 1/2] dt-binbings: media: ti-vpe: Document the VIP driver
From: Benoit Parrot @ 2020-05-29 16:45 UTC (permalink / raw)
  To: Rob Herring; +Cc: Hans Verkuil, linux-media, devicetree, linux-kernel
In-Reply-To: <20200528233933.GA881467@bogus>

Hi Rob,

Thanks for the review.

Rob Herring <robh@kernel.org> wrote on Thu [2020-May-28 17:39:33 -0600]:
> On Fri, May 22, 2020 at 05:54:11PM -0500, Benoit Parrot wrote:
> > Device Tree bindings for the Video Input Port (VIP) driver.
> 
> Bindings document h/w, not drivers.

I'll fix that.

> 
> > 
> > Signed-off-by: Benoit Parrot <bparrot@ti.com>
> > ---
> >  .../devicetree/bindings/media/ti,vip.yaml     | 394 ++++++++++++++++++
> >  MAINTAINERS                                   |   1 +
> >  2 files changed, 395 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/media/ti,vip.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/media/ti,vip.yaml b/Documentation/devicetree/bindings/media/ti,vip.yaml
> > new file mode 100644
> > index 000000000000..8a9084e42329
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/media/ti,vip.yaml
> > @@ -0,0 +1,394 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/media/ti,vip.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Texas Instruments DRA7x VIDEO INPUT PORT (VIP) Device Tree Bindings
> > +
> > +maintainers:
> > +  - Benoit Parrot <bparrot@ti.com>
> > +
> > +description: |-
> > +  The Video Input Port (VIP) is a key component for image capture
> > +  applications. The capture module provides the system interface and the
> > +  processing capability to connect parallel image-sensor as well as
> > +  BT.656/1120 capable encoder chip to DRA7x device.
> > +
> > +  Each VIP instance supports 2 independently configurable external video
> > +  input capture slices (Slice 0 and Slice 1) each providing up to two video
> > +  input ports (Port A and Port B) where Port A can be configured as
> > +  24/16/8-bit port and Port B is fixed as 8-bit port.
> > +  Here these ports a represented as follows
> > +    port@0 -> Slice 0 Port A
> > +    port@1 -> Slice 0 Port B
> > +    port@2 -> Slice 1 Port A
> > +    port@3 -> Slice 1 Port B
> > +
> > +  Each camera port nodes should contain a 'port' child node with child
> > +  'endpoint' node. Please refer to the bindings defined in
> > +  Documentation/devicetree/bindings/media/video-interfaces.txt.
> > +
> > +properties:
> > +  compatible:
> > +    const: ti,dra7-vip
> > +
> > +  label:
> > +    description: Instance name
> 
> Kind of odd for this type of binding. Are there a define set or pattern 
> of values.

The label here are used to 'name' each H/W instance. And so far there can
be a up to 3 instances with the currently available devices, but that
doesn't mean there couldn't be more in the future. So I did not want to
limit it here.

> 
> > +
> > +  reg:
> > +    items:
> > +      - description: The VIP main register region
> > +      - description: Video Data Parser (PARSER) register region for Slice0
> > +      - description: Color Space Conversion (CSC) register region for Slice0
> > +      - description: Scaler (SC) register region for Slice0
> > +      - description: Video Data Parser (PARSER) register region for Slice1
> > +      - description: Color Space Conversion (CSC) register region for Slice1
> > +      - description: Scaler (SC) register region for Slice1
> > +      - description: Video Port Direct Memory Access (VPDMA) register region
> > +
> > +  reg-names:
> > +    items:
> > +      - const: vip
> > +      - const: parser0
> > +      - const: csc0
> > +      - const: sc0
> > +      - const: parser1
> > +      - const: csc1
> > +      - const: sc1
> > +      - const: vpdma
> > +
> > +  interrupts:
> > +    minItems: 2
> > +    description:
> > +      IRQ index 0 is used for Slice0 interrupts
> > +      IRQ index 1 is used for Slice1 interrupts
> > +
> > +  ti,vip-clk-polarity:
> > +    $ref: "/schemas/types.yaml#/definitions/phandle-array"
> > +    description:
> > +      phandle to the device control module. The 1st argument should
> > +      contain the register offset to the CTRL_CORE_SMA_SW_1 register.
> > +      2nd argument contains the bit field to slice 0 port A,
> > +      3rd argument contains the bit field to slice 0 port B,
> > +      4th argument contains the bit field to slice 1 port A,
> > +      5th argument contains the bit field to slice 1 port B.
> > +
> > +  # See ./video-interfaces.txt for details
> > +  ports:
> > +    type: object
> > +    additionalProperties: false
> > +
> > +    properties:
> > +      "#address-cells":
> > +        const: 1
> > +
> > +      "#size-cells":
> > +        const: 0
> > +
> > +      port@0:
> > +        type: object
> > +        additionalProperties: false
> > +
> > +        properties:
> > +          reg:
> > +            const: 0
> > +            description: Slice 0 Port A
> > +
> > +          label:
> > +            description: Port name. Usually the pin group name
> > +
> > +        patternProperties:
> > +          endpoint:
> > +            type: object
> > +            additionalProperties: false
> > +
> > +            properties:
> > +              hsync-active:
> > +                maxItems: 1
> 
> Not an array. Just:
> 
> hsync-active: true

OK I'll fix all of those.

> 
> > +
> > +              vsync-active:
> > +                maxItems: 1
> > +
> > +              pclk-sample:
> > +                maxItems: 1
> > +
> > +              bus-width:
> > +                maxItems: 1
> 
> Not an array. What subset of values are allowed?

So something like oneOf with a list then?

> 
> > +
> > +              ti,vip-pixel-mux:
> > +                type: boolean
> > +                description:
> > +                  In BT656/1120 mode, this enable pixel-muxing if
> > +                  the number of channels is either 1, 2 or 4. If this
> > +                  property is present then pixel-muxing is enabled
> > +                  otherwise it will use line-muxing.
> > +
> > +              ti,vip-channels:
> > +                $ref: "/schemas/types.yaml#definitions/uint8-array"
> > +                minItems: 1
> > +                maxItems: 16
> > +                description: |-
> > +                  In BT656/1120 mode, list of channel ids to be captured.
> > +                  If the property is not present then 1 channel is assumed.
> > +
> > +              remote-endpoint: true
> > +
> > +        required:
> > +          - reg
> > +          - label
> > +
> > +      port@1:
> > +        type: object
> > +        additionalProperties: false
> > +
> > +        properties:
> > +          reg:
> > +            const: 1
> > +            description: Slice 0 Port B
> > +
> > +          label:
> > +            description: Port name. Usually the pin group name
> > +
> > +        patternProperties:
> > +          endpoint:
> > +            type: object
> > +            additionalProperties: false
> > +
> > +            properties:
> > +              hsync-active:
> > +                maxItems: 1
> > +
> > +              vsync-active:
> > +                maxItems: 1
> > +
> > +              pclk-sample:
> > +                maxItems: 1
> > +
> > +              bus-width:
> > +                maxItems: 1
> > +
> > +              ti,vip-pixel-mux:
> > +                type: boolean
> > +                description:
> > +                  In BT656/1120 mode, this enable pixel-muxing if
> > +                  the number of channels is either 1, 2 or 4. If this
> > +                  property is present then pixel-muxing is enabled
> > +                  otherwise it will use line-muxing.
> > +
> > +              ti,vip-channels:
> > +                $ref: "/schemas/types.yaml#definitions/uint8-array"
> > +                minItems: 1
> > +                maxItems: 16
> > +                description:
> > +                  In BT656/1120 mode, list of channel ids to be captured.
> > +                  If the property is not present then 1 channel is assumed.
> > +
> > +              remote-endpoint: true
> > +
> > +        required:
> > +          - reg
> > +          - label
> > +
> > +      port@2:
> > +        type: object
> > +        additionalProperties: false
> > +
> > +        properties:
> > +          reg:
> > +            const: 2
> > +            description: Slice 1 Port A
> > +
> > +          label:
> > +            description: Port name. Usually the pin group name
> > +
> > +        patternProperties:
> > +          endpoint:
> > +            type: object
> > +            additionalProperties: false
> > +
> > +            properties:
> > +              hsync-active:
> > +                maxItems: 1
> > +
> > +              vsync-active:
> > +                maxItems: 1
> > +
> > +              pclk-sample:
> > +                maxItems: 1
> > +
> > +              bus-width:
> > +                maxItems: 1
> > +
> > +              ti,vip-pixel-mux:
> > +                type: boolean
> > +                description:
> > +                  In BT656/1120 mode, this enable pixel-muxing if
> > +                  the number of channels is either 1, 2 or 4. If this
> > +                  property is present then pixel-muxing is enabled
> > +                  otherwise it will use line-muxing.
> > +
> > +              ti,vip-channels:
> > +                $ref: "/schemas/types.yaml#definitions/uint8-array"
> > +                minItems: 1
> > +                maxItems: 16
> > +                description:
> > +                  In BT656/1120 mode, list of channel ids to be captured.
> > +                  If the property is not present then 1 channel is assumed.
> > +
> > +              remote-endpoint: true
> > +
> > +        required:
> > +          - reg
> > +          - label
> > +
> > +      port@3:
> > +        type: object
> > +        additionalProperties: false
> > +
> > +        properties:
> > +          reg:
> > +            const: 3
> > +            description: Slice 1 Port B
> > +
> > +          label:
> > +            description: Port name. Usually the pin group name
> > +
> > +        patternProperties:
> > +          endpoint:
> > +            type: object
> > +            additionalProperties: false
> > +
> > +            properties:
> > +              hsync-active:
> > +                maxItems: 1
> > +
> > +              vsync-active:
> > +                maxItems: 1
> > +
> > +              pclk-sample:
> > +                maxItems: 1
> > +
> > +              bus-width:
> > +                maxItems: 1
> > +
> > +              ti,vip-pixel-mux:
> > +                type: boolean
> > +                description:
> > +                  In BT656/1120 mode, this enable pixel-muxing if
> > +                  the number of channels is either 1, 2 or 4. If this
> > +                  property is present then pixel-muxing is enabled
> > +                  otherwise it will use line-muxing.
> > +
> > +              ti,vip-channels:
> > +                $ref: "/schemas/types.yaml#definitions/uint8-array"
> > +                minItems: 1
> > +                maxItems: 16
> > +                description:
> > +                  In BT656/1120 mode, list of channel ids to be captured.
> > +                  If the property is not present then 1 channel is assumed.
> > +
> > +              remote-endpoint: true
> 
> If all the properties are the same across ports, then do a 
> patternProperties with '^port@' and define them there. You'll still need 
> 'port@0', etc. to define what each port is.

Yeah I had tried to define something like that but I couldn't make pass
dt-binding-check wihtout any errors/warnings.

Can you point me to a recent example using this syntax?
Last time I check I couldn't find one.

Also I am not quite clear on the mechanism, you said to create a
patterProperties and then I wouols also have to define the individual port
themselves so I would have something like this:

      port@0:
        type: object
        additionalProperties: false

        properties:
          reg:
            const: 0
            description: Slice 0 Port A

          label:
            description: Port name. Usually the pin group name

      port@1:
        type: object
        additionalProperties: false

        properties:
          reg:
            const: 1
            description: Slice 0 Port B

          label:
            description: Port name. Usually the pin group name

      port@2:
        type: object
        additionalProperties: false

        properties:
          reg:
            const: 2
            description: Slice 1 Port A

          label:
            description: Port name. Usually the pin group name

      port@3:
        type: object
        additionalProperties: false

        properties:
          reg:
            const: 3
            description: Slice 1 Port B

          label:
            description: Port name. Usually the pin group name

And then in some way reference the patternProperties?
Or just put it before the individual ports?

> 
> > +
> > +        required:
> > +          - reg
> > +          - label
> > +
> > +    required:
> > +      - "#address-cells"
> > +      - "#size-cells"
> > +      - port@0
> > +
> > +required:
> > +  - compatible
> > +  - label
> > +  - reg
> > +  - reg-names
> > +  - interrupts
> > +  - ti,vip-clk-polarity
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> > +
> > +    vip1: vip@48970000 {
> > +        compatible = "ti,dra7-vip";
> > +        label = "vip1";
> > +        reg = <0x48970000 0x114>,
> > +              <0x48975500 0xD8>,
> > +              <0x48975700 0x18>,
> > +              <0x48975800 0x80>,
> > +              <0x48975a00 0xD8>,
> > +              <0x48975c00 0x18>,
> > +              <0x48975d00 0x80>,
> > +              <0x4897d000 0x400>;
> > +        reg-names = "vip",
> > +                    "parser0",
> > +                    "csc0",
> > +                    "sc0",
> > +                    "parser1",
> > +                    "csc1",
> > +                    "sc1",
> > +                    "vpdma";
> > +        interrupts = <GIC_SPI 351 IRQ_TYPE_LEVEL_HIGH>,
> > +                     <GIC_SPI 392 IRQ_TYPE_LEVEL_HIGH>;
> > +        ti,vip-clk-polarity = <&scm_conf 0x534 0x1 0x4 0x2 0x8>;
> > +
> > +        ports {
> > +              #address-cells = <1>;
> > +              #size-cells = <0>;
> > +
> > +              vin1a: port@0 {
> > +                    reg = <0>;
> > +                    label = "vin1a";
> > +
> > +                    vin1a_ep: endpoint {
> > +                           remote-endpoint = <&camera1>;
> > +                           hsync-active = <1>;
> > +                           vsync-active = <1>;
> > +                           pclk-sample = <0>;
> > +                           bus-width = <8>;
> > +                    };
> > +              };
> > +              vin1b: port@1 {
> > +                    reg = <1>;
> > +                    label = "vin1b";
> > +              };
> > +              vin2a: port@2 {
> > +                    reg = <2>;
> > +                    label = "vin2a";
> > +              };
> > +              vin2b: port@3 {
> > +                    reg = <3>;
> > +                    label = "vin2b";
> > +              };
> > +         };
> > +    };
> > +
> > +    i2c {
> > +        clock-frequency = <400000>;
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +         camera@37 {
> > +              compatible = "ovti,ov10633";
> > +              reg = <0x37>;
> > +
> > +              clocks = <&fixed_clock>;
> > +              clocks-names = "xvclk";
> > +
> > +              port {
> > +                   camera1: endpoint {
> > +                           remote-endpoint = <&vin1a_ep>;
> > +                           hsync-active = <1>;
> > +                           vsync-active = <1>;
> > +                           pclk-sample = <0>;
> > +                           bus-width = <8>;
> > +                   };
> > +              };
> > +         };
> > +    };
> > +
> > +...
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index 2e9a5f6e4ff7..06856d05b53b 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -16947,6 +16947,7 @@ S:	Maintained
> >  W:	http://linuxtv.org/
> >  Q:	http://patchwork.linuxtv.org/project/linux-media/list/
> >  F:	Documentation/devicetree/bindings/media/ti,cal.yaml
> > +F:	Documentation/devicetree/bindings/media/ti,vip.yaml
> >  F:	Documentation/devicetree/bindings/media/ti,vpe.yaml
> >  F:	drivers/media/platform/ti-vpe/
> >  
> > -- 
> > 2.17.1
> > 

Regards,
Benoit

^ permalink raw reply

* [mcgrof-next:20200528-sysctl-cleanups 14/36] fs/ocfs2/stackglue.c:710:2: note: in expansion of macro 'if'
From: kbuild test robot @ 2020-05-29 16:44 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2925 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git 20200528-sysctl-cleanups
head:   102093c1d4c075c165a83d2b69ecd64507a6cbe1
commit: c87b9d1480bf57435c6c0c07034ddad3aa93ebf5 [14/36] ocfs2: use new sysctl subdir helper register_sysctl_subdir()
config: x86_64-randconfig-a004-20200529 (attached as .config)
compiler: gcc-5 (Ubuntu 5.5.0-12ubuntu1) 5.5.0 20171010
reproduce (this is a W=1 build):
        git checkout c87b9d1480bf57435c6c0c07034ddad3aa93ebf5
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

fs/ocfs2/stackglue.c:680:2: error: expected identifier or '(' before '.' token
.data  = NULL,
^
fs/ocfs2/stackglue.c: In function 'ocfs2_stack_glue_init':
fs/ocfs2/stackglue.c:694:2: error: 'ocfs2_table_header' undeclared (first use in this function)
ocfs2_table_header = register_sysctl_subdir("fs", "ocfs2",
^
fs/ocfs2/stackglue.c:694:2: note: each undeclared identifier is reported only once for each function it appears in
In file included from include/linux/export.h:43:0,
from include/linux/linkage.h:7,
from include/linux/kernel.h:8,
from include/linux/list.h:9,
from fs/ocfs2/stackglue.c:13:
fs/ocfs2/stackglue.c: In function 'ocfs2_stack_glue_exit':
fs/ocfs2/stackglue.c:710:6: error: 'ocfs2_table_header' undeclared (first use in this function)
if (ocfs2_table_header)
^
include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^
>> fs/ocfs2/stackglue.c:710:2: note: in expansion of macro 'if'
if (ocfs2_table_header)
^

vim +/if +710 fs/ocfs2/stackglue.c

24ef1815e5e13e Joel Becker 2008-01-29  704  
286eaa95c5c591 Joel Becker 2008-02-01  705  static void __exit ocfs2_stack_glue_exit(void)
286eaa95c5c591 Joel Becker 2008-02-01  706  {
553b5eb91abd5f Joel Becker 2010-01-29  707  	memset(&locking_max_version, 0,
553b5eb91abd5f Joel Becker 2010-01-29  708  	       sizeof(struct ocfs2_protocol_version));
74ae4e104dfc57 Joel Becker 2008-01-31  709  	ocfs2_sysfs_exit();
3878f110f71a09 Joel Becker 2008-05-30 @710  	if (ocfs2_table_header)
3878f110f71a09 Joel Becker 2008-05-30  711  		unregister_sysctl_table(ocfs2_table_header);
24ef1815e5e13e Joel Becker 2008-01-29  712  }
24ef1815e5e13e Joel Becker 2008-01-29  713  

:::::: The code at line 710 was first introduced by commit
:::::: 3878f110f71a0971ff7acc15dd6db711b6ef37c6 ocfs2: Move the hb_ctl_path sysctl into the stack glue.

:::::: TO: Joel Becker <joel.becker@oracle.com>
:::::: CC: Mark Fasheh <mfasheh@suse.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 38803 bytes --]

^ permalink raw reply

* arch/powerpc/kernel/entry_32.S:450: Error: unsupported relocation against thread
From: kbuild test robot @ 2020-05-29 16:41 UTC (permalink / raw)
  To: Christophe, Leroy,; +Cc: kbuild-all, linux-kernel, Michael Ellerman

[-- Attachment #1: Type: text/plain, Size: 12052 bytes --]

Hi Christophe,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   75caf310d16cc5e2f851c048cd597f5437013368
commit: 4833ce06e6855d526234618b746ffb71d6612c9a powerpc/32s: Fix build failure with CONFIG_PPC_KUAP_DEBUG
date:   3 weeks ago
config: powerpc-randconfig-r035-20200529 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 4833ce06e6855d526234618b746ffb71d6612c9a
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>, old ones prefixed by <<):

arch/powerpc/kernel/entry_32.S: Assembler messages:
arch/powerpc/kernel/entry_32.S:450: Error: invalid operands (*UND* and *UND* sections) for `|'
arch/powerpc/kernel/entry_32.S:735: Error: invalid operands (*UND* and *UND* sections) for `|'
>> arch/powerpc/kernel/entry_32.S:450: Error: unsupported relocation against thread
arch/powerpc/kernel/entry_32.S:735: Error: unsupported relocation against thread

vim +450 arch/powerpc/kernel/entry_32.S

b86fb88855ea78 Christophe Leroy       2019-04-30  344  
9994a33865f4d5 Paul Mackerras         2005-10-10  345  /*
9994a33865f4d5 Paul Mackerras         2005-10-10  346   * Handle a system call.
9994a33865f4d5 Paul Mackerras         2005-10-10  347   */
9994a33865f4d5 Paul Mackerras         2005-10-10  348  	.stabs	"arch/powerpc/kernel/",N_SO,0,0,0f
9994a33865f4d5 Paul Mackerras         2005-10-10  349  	.stabs	"entry_32.S",N_SO,0,0,0f
9994a33865f4d5 Paul Mackerras         2005-10-10  350  0:
9994a33865f4d5 Paul Mackerras         2005-10-10  351  
9994a33865f4d5 Paul Mackerras         2005-10-10  352  _GLOBAL(DoSyscall)
9994a33865f4d5 Paul Mackerras         2005-10-10  353  	stw	r3,ORIG_GPR3(r1)
9994a33865f4d5 Paul Mackerras         2005-10-10  354  	li	r12,0
9994a33865f4d5 Paul Mackerras         2005-10-10  355  	stw	r12,RESULT(r1)
5d38902c483881 Benjamin Herrenschmidt 2009-06-17  356  #ifdef CONFIG_TRACE_IRQFLAGS
40530db7c65611 Christophe Leroy       2019-04-30  357  	/* Make sure interrupts are enabled */
5d38902c483881 Benjamin Herrenschmidt 2009-06-17  358  	mfmsr	r11
5d38902c483881 Benjamin Herrenschmidt 2009-06-17  359  	andi.	r12,r11,MSR_EE
40530db7c65611 Christophe Leroy       2019-04-30  360  	/* We came in with interrupts disabled, we WARN and mark them enabled
40530db7c65611 Christophe Leroy       2019-04-30  361  	 * for lockdep now */
40530db7c65611 Christophe Leroy       2019-04-30  362  0:	tweqi	r12, 0
40530db7c65611 Christophe Leroy       2019-04-30  363  	EMIT_BUG_ENTRY 0b,__FILE__,__LINE__, BUGFLAG_WARNING
5d38902c483881 Benjamin Herrenschmidt 2009-06-17  364  #endif /* CONFIG_TRACE_IRQFLAGS */
f7354ccac844da Christophe Leroy       2019-01-31  365  	lwz	r11,TI_FLAGS(r2)
10ea834364c867 Michael Ellerman       2015-01-15  366  	andi.	r11,r11,_TIF_SYSCALL_DOTRACE
9994a33865f4d5 Paul Mackerras         2005-10-10  367  	bne-	syscall_dotrace
9994a33865f4d5 Paul Mackerras         2005-10-10  368  syscall_dotrace_cont:
9994a33865f4d5 Paul Mackerras         2005-10-10  369  	cmplwi	0,r0,NR_syscalls
9994a33865f4d5 Paul Mackerras         2005-10-10  370  	lis	r10,sys_call_table@h
9994a33865f4d5 Paul Mackerras         2005-10-10  371  	ori	r10,r10,sys_call_table@l
9994a33865f4d5 Paul Mackerras         2005-10-10  372  	slwi	r0,r0,2
9994a33865f4d5 Paul Mackerras         2005-10-10  373  	bge-	66f
c28218d4abbf4f Diana Craciun          2018-07-28  374  
c28218d4abbf4f Diana Craciun          2018-07-28  375  	barrier_nospec_asm
c28218d4abbf4f Diana Craciun          2018-07-28  376  	/*
c28218d4abbf4f Diana Craciun          2018-07-28  377  	 * Prevent the load of the handler below (based on the user-passed
c28218d4abbf4f Diana Craciun          2018-07-28  378  	 * system call number) being speculatively executed until the test
c28218d4abbf4f Diana Craciun          2018-07-28  379  	 * against NR_syscalls and branch to .66f above has
c28218d4abbf4f Diana Craciun          2018-07-28  380  	 * committed.
c28218d4abbf4f Diana Craciun          2018-07-28  381  	 */
c28218d4abbf4f Diana Craciun          2018-07-28  382  
9994a33865f4d5 Paul Mackerras         2005-10-10  383  	lwzx	r10,r10,r0	/* Fetch system call handler [ptr] */
9994a33865f4d5 Paul Mackerras         2005-10-10  384  	mtlr	r10
9994a33865f4d5 Paul Mackerras         2005-10-10  385  	addi	r9,r1,STACK_FRAME_OVERHEAD
9994a33865f4d5 Paul Mackerras         2005-10-10  386  	PPC440EP_ERR42
9994a33865f4d5 Paul Mackerras         2005-10-10  387  	blrl			/* Call handler */
9994a33865f4d5 Paul Mackerras         2005-10-10  388  	.globl	ret_from_syscall
9994a33865f4d5 Paul Mackerras         2005-10-10  389  ret_from_syscall:
6f37be4b1364ee Boqun Feng             2018-06-02  390  #ifdef CONFIG_DEBUG_RSEQ
6f37be4b1364ee Boqun Feng             2018-06-02  391  	/* Check whether the syscall is issued inside a restartable sequence */
6f37be4b1364ee Boqun Feng             2018-06-02  392  	stw	r3,GPR3(r1)
6f37be4b1364ee Boqun Feng             2018-06-02  393  	addi    r3,r1,STACK_FRAME_OVERHEAD
6f37be4b1364ee Boqun Feng             2018-06-02  394  	bl      rseq_syscall
6f37be4b1364ee Boqun Feng             2018-06-02  395  	lwz	r3,GPR3(r1)
6f37be4b1364ee Boqun Feng             2018-06-02  396  #endif
9994a33865f4d5 Paul Mackerras         2005-10-10  397  	mr	r6,r3
9994a33865f4d5 Paul Mackerras         2005-10-10  398  	/* disable interrupts so current_thread_info()->flags can't change */
ba18025fb03306 Christophe Leroy       2019-08-20  399  	LOAD_REG_IMMEDIATE(r10,MSR_KERNEL)	/* doesn't include MSR_EE */
5d38902c483881 Benjamin Herrenschmidt 2009-06-17  400  	/* Note: We don't bother telling lockdep about it */
9994a33865f4d5 Paul Mackerras         2005-10-10  401  	SYNC
39bccfd1649705 Christophe Leroy       2019-12-21  402  	mtmsr	r10
f7354ccac844da Christophe Leroy       2019-01-31  403  	lwz	r9,TI_FLAGS(r2)
c3525940cca53c Michael Ellerman       2015-07-23  404  	li	r8,-MAX_ERRNO
10ea834364c867 Michael Ellerman       2015-01-15  405  	andi.	r0,r9,(_TIF_SYSCALL_DOTRACE|_TIF_SINGLESTEP|_TIF_USER_WORK_MASK|_TIF_PERSYSCALL_MASK)
9994a33865f4d5 Paul Mackerras         2005-10-10  406  	bne-	syscall_exit_work
401d1f029bebb7 David Woodhouse        2005-11-15  407  	cmplw	0,r3,r8
401d1f029bebb7 David Woodhouse        2005-11-15  408  	blt+	syscall_exit_cont
401d1f029bebb7 David Woodhouse        2005-11-15  409  	lwz	r11,_CCR(r1)			/* Load CR */
401d1f029bebb7 David Woodhouse        2005-11-15  410  	neg	r3,r3
401d1f029bebb7 David Woodhouse        2005-11-15  411  	oris	r11,r11,0x1000	/* Set SO bit in CR */
401d1f029bebb7 David Woodhouse        2005-11-15  412  	stw	r11,_CCR(r1)
9994a33865f4d5 Paul Mackerras         2005-10-10  413  syscall_exit_cont:
5d38902c483881 Benjamin Herrenschmidt 2009-06-17  414  	lwz	r8,_MSR(r1)
5d38902c483881 Benjamin Herrenschmidt 2009-06-17  415  #ifdef CONFIG_TRACE_IRQFLAGS
5d38902c483881 Benjamin Herrenschmidt 2009-06-17  416  	/* If we are going to return from the syscall with interrupts
40530db7c65611 Christophe Leroy       2019-04-30  417  	 * off, we trace that here. It shouldn't normally happen.
5d38902c483881 Benjamin Herrenschmidt 2009-06-17  418  	 */
5d38902c483881 Benjamin Herrenschmidt 2009-06-17  419  	andi.	r10,r8,MSR_EE
5d38902c483881 Benjamin Herrenschmidt 2009-06-17  420  	bne+	1f
5d38902c483881 Benjamin Herrenschmidt 2009-06-17  421  	stw	r3,GPR3(r1)
5d38902c483881 Benjamin Herrenschmidt 2009-06-17  422  	bl      trace_hardirqs_off
5d38902c483881 Benjamin Herrenschmidt 2009-06-17  423  	lwz	r3,GPR3(r1)
5d38902c483881 Benjamin Herrenschmidt 2009-06-17  424  1:
5d38902c483881 Benjamin Herrenschmidt 2009-06-17  425  #endif /* CONFIG_TRACE_IRQFLAGS */
9994a33865f4d5 Paul Mackerras         2005-10-10  426  #if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
4eaddb4d7ec380 Kumar Gala             2008-04-09  427  	/* If the process has its own DBCR0 value, load it up.  The internal
4eaddb4d7ec380 Kumar Gala             2008-04-09  428  	   debug mode bit tells us that dbcr0 should be loaded. */
9994a33865f4d5 Paul Mackerras         2005-10-10  429  	lwz	r0,THREAD+THREAD_DBCR0(r2)
2325f0a0c3d76b Kumar Gala             2008-07-26  430  	andis.	r10,r0,DBCR0_IDM@h
9994a33865f4d5 Paul Mackerras         2005-10-10  431  	bnel-	load_dbcr0
9994a33865f4d5 Paul Mackerras         2005-10-10  432  #endif
b98ac05d5e4603 Benjamin Herrenschmidt 2007-10-31  433  #ifdef CONFIG_44x
e7f75ad01d5902 Dave Kleikamp          2010-03-05  434  BEGIN_MMU_FTR_SECTION
b98ac05d5e4603 Benjamin Herrenschmidt 2007-10-31  435  	lis	r4,icache_44x_need_flush@ha
b98ac05d5e4603 Benjamin Herrenschmidt 2007-10-31  436  	lwz	r5,icache_44x_need_flush@l(r4)
b98ac05d5e4603 Benjamin Herrenschmidt 2007-10-31  437  	cmplwi	cr0,r5,0
b98ac05d5e4603 Benjamin Herrenschmidt 2007-10-31  438  	bne-	2f
b98ac05d5e4603 Benjamin Herrenschmidt 2007-10-31  439  1:
e7f75ad01d5902 Dave Kleikamp          2010-03-05  440  END_MMU_FTR_SECTION_IFCLR(MMU_FTR_TYPE_47x)
b98ac05d5e4603 Benjamin Herrenschmidt 2007-10-31  441  #endif /* CONFIG_44x */
b64f87c16f3c00 Becky Bruce            2007-11-10  442  BEGIN_FTR_SECTION
b64f87c16f3c00 Becky Bruce            2007-11-10  443  	lwarx	r7,0,r1
b64f87c16f3c00 Becky Bruce            2007-11-10  444  END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
9994a33865f4d5 Paul Mackerras         2005-10-10  445  	stwcx.	r0,0,r1			/* to clear the reservation */
f7354ccac844da Christophe Leroy       2019-01-31  446  	ACCOUNT_CPU_USER_EXIT(r2, r5, r7)
31ed2b13c48d77 Christophe Leroy       2019-03-11  447  #ifdef CONFIG_PPC_BOOK3S_32
31ed2b13c48d77 Christophe Leroy       2019-03-11  448  	kuep_unlock r5, r7
31ed2b13c48d77 Christophe Leroy       2019-03-11  449  #endif
e2fb9f5444312f Christophe Leroy       2019-03-11 @450  	kuap_check r2, r4
9994a33865f4d5 Paul Mackerras         2005-10-10  451  	lwz	r4,_LINK(r1)
9994a33865f4d5 Paul Mackerras         2005-10-10  452  	lwz	r5,_CCR(r1)
9994a33865f4d5 Paul Mackerras         2005-10-10  453  	mtlr	r4
9994a33865f4d5 Paul Mackerras         2005-10-10  454  	mtcr	r5
9994a33865f4d5 Paul Mackerras         2005-10-10  455  	lwz	r7,_NIP(r1)
9994a33865f4d5 Paul Mackerras         2005-10-10  456  	lwz	r2,GPR2(r1)
9994a33865f4d5 Paul Mackerras         2005-10-10  457  	lwz	r1,GPR1(r1)
cd99ddbea250ee Christophe Leroy       2018-01-12  458  #if defined(CONFIG_PPC_8xx) && defined(CONFIG_PERF_EVENTS)
75b824727680a9 Christophe Leroy       2016-12-15  459  	mtspr	SPRN_NRI, r0
75b824727680a9 Christophe Leroy       2016-12-15  460  #endif
9994a33865f4d5 Paul Mackerras         2005-10-10  461  	mtspr	SPRN_SRR0,r7
9994a33865f4d5 Paul Mackerras         2005-10-10  462  	mtspr	SPRN_SRR1,r8
9994a33865f4d5 Paul Mackerras         2005-10-10  463  	SYNC
9994a33865f4d5 Paul Mackerras         2005-10-10  464  	RFI
b98ac05d5e4603 Benjamin Herrenschmidt 2007-10-31  465  #ifdef CONFIG_44x
b98ac05d5e4603 Benjamin Herrenschmidt 2007-10-31  466  2:	li	r7,0
b98ac05d5e4603 Benjamin Herrenschmidt 2007-10-31  467  	iccci	r0,r0
b98ac05d5e4603 Benjamin Herrenschmidt 2007-10-31  468  	stw	r7,icache_44x_need_flush@l(r4)
b98ac05d5e4603 Benjamin Herrenschmidt 2007-10-31  469  	b	1b
b98ac05d5e4603 Benjamin Herrenschmidt 2007-10-31  470  #endif  /* CONFIG_44x */
9994a33865f4d5 Paul Mackerras         2005-10-10  471  

:::::: The code at line 450 was first introduced by commit
:::::: e2fb9f5444312fd01627c84a3e018c1fe8ac6ebb powerpc/32: Prepare for Kernel Userspace Access Protection

:::::: TO: Christophe Leroy <christophe.leroy@c-s.fr>
:::::: CC: Michael Ellerman <mpe@ellerman.id.au>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 32037 bytes --]

^ permalink raw reply


This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.