All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: manual merge of the userns tree with the mips tree
@ 2017-08-08  5:10 Stephen Rothwell
  2017-08-08  5:58 ` Ralf Baechle
  2017-09-05  0:22 ` linux-next: manual merge of the userns tree with the mips tree Stephen Rothwell
  0 siblings, 2 replies; 6+ messages in thread
From: Stephen Rothwell @ 2017-08-08  5:10 UTC (permalink / raw)
  To: Eric W. Biederman, Ralf Baechle, James Hogan
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List

Hi Eric,

Today's linux-next merge of the userns tree got a conflict in:

  arch/mips/kernel/traps.c

between commit:

  260a789828aa ("MIPS: signal: Remove unreachable code from force_fcr31_sig().")

from the mips tree and commit:

  ea1b75cf9138 ("signal/mips: Document a conflict with SI_USER with SIGFPE")

from the userns tree.

I fixed it up (the former removed the code updated by the latter) and
can carry the fix as necessary. This is now fixed as far as linux-next
is concerned, but any non trivial conflicts should be mentioned to your
upstream maintainer when your tree is submitted for merging.  You may
also want to consider cooperating with the maintainer of the conflicting
tree to minimise any particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux-next: manual merge of the userns tree with the mips tree
  2017-08-08  5:10 linux-next: manual merge of the userns tree with the mips tree Stephen Rothwell
@ 2017-08-08  5:58 ` Ralf Baechle
  2017-08-08 17:33   ` Eric W. Biederman
  2017-09-05  0:22 ` linux-next: manual merge of the userns tree with the mips tree Stephen Rothwell
  1 sibling, 1 reply; 6+ messages in thread
From: Ralf Baechle @ 2017-08-08  5:58 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Eric W. Biederman, James Hogan, Linux-Next Mailing List,
	Linux Kernel Mailing List, Maciej W. Rozycki

On Tue, Aug 08, 2017 at 03:10:04PM +1000, Stephen Rothwell wrote:

(Maciej added to cc.)

> Hi Eric,
> 
> Today's linux-next merge of the userns tree got a conflict in:
> 
>   arch/mips/kernel/traps.c
> 
> between commit:
> 
>   260a789828aa ("MIPS: signal: Remove unreachable code from force_fcr31_sig().")
> 
> from the mips tree and commit:
> 
>   ea1b75cf9138 ("signal/mips: Document a conflict with SI_USER with SIGFPE")
> 
> from the userns tree.
> 
> I fixed it up (the former removed the code updated by the latter) and
> can carry the fix as necessary. This is now fixed as far as linux-next
> is concerned, but any non trivial conflicts should be mentioned to your
> upstream maintainer when your tree is submitted for merging.  You may
> also want to consider cooperating with the maintainer of the conflicting
> tree to minimise any particularly complex conflicts.

Eric,

after yesterday's emails on the topic I think commit ea1b75cf9138 ("signal/
mips: Document a conflict with SI_USER with SIGFPE") should be dropped.

  Ralf

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux-next: manual merge of the userns tree with the mips tree
  2017-08-08  5:58 ` Ralf Baechle
@ 2017-08-08 17:33   ` Eric W. Biederman
  2017-08-08 19:07     ` [PATCH] mips/signal: In force_fcr31_sig return in the impossible case Eric W. Biederman
  0 siblings, 1 reply; 6+ messages in thread
From: Eric W. Biederman @ 2017-08-08 17:33 UTC (permalink / raw)
  To: Ralf Baechle
  Cc: Stephen Rothwell, James Hogan, Linux-Next Mailing List,
	Linux Kernel Mailing List, Maciej W. Rozycki

Ralf Baechle <ralf@linux-mips.org> writes:

> On Tue, Aug 08, 2017 at 03:10:04PM +1000, Stephen Rothwell wrote:
>
> (Maciej added to cc.)
>
>> Hi Eric,
>> 
>> Today's linux-next merge of the userns tree got a conflict in:
>> 
>>   arch/mips/kernel/traps.c
>> 
>> between commit:
>> 
>>   260a789828aa ("MIPS: signal: Remove unreachable code from force_fcr31_sig().")
>> 
>> from the mips tree and commit:
>> 
>>   ea1b75cf9138 ("signal/mips: Document a conflict with SI_USER with SIGFPE")
>> 
>> from the userns tree.
>> 
>> I fixed it up (the former removed the code updated by the latter) and
>> can carry the fix as necessary. This is now fixed as far as linux-next
>> is concerned, but any non trivial conflicts should be mentioned to your
>> upstream maintainer when your tree is submitted for merging.  You may
>> also want to consider cooperating with the maintainer of the conflicting
>> tree to minimise any particularly complex conflicts.
>
> Eric,
>
> after yesterday's emails on the topic I think commit ea1b75cf9138 ("signal/
> mips: Document a conflict with SI_USER with SIGFPE") should be
> dropped.


I have a follow on change I am about to post and would like to carry
that replaces force_sig_info with force_sig_fault.  So force_fcr31_sig
winds up looking like:

void force_fcr31_sig(unsigned long fcr31, void __user *fault_addr,
		     struct task_struct *tsk)
{
	int si_code;

	if (fcr31 & FPU_CSR_INV_X)
		si_code = FPE_FLTINV;
	else if (fcr31 & FPU_CSR_DIV_X)
		si_code = FPE_FLTDIV;
	else if (fcr31 & FPU_CSR_OVF_X)
		si_code = FPE_FLTOVF;
	else if (fcr31 & FPU_CSR_UDF_X)
		si_code = FPE_FLTUND;
	else if (fcr31 & FPU_CSR_INE_X)
		si_code = FPE_FLTRES;
	else
		si_code = FPE_FIXME;
	force_sig_fault(SIGFPE, si_code, fault_addr, tsk);
}

Which causes gcc to complain if the last else clause is dropped.

Would you be happy if the function wound up looking like:

void force_fcr31_sig(unsigned long fcr31, void __user *fault_addr,
		     struct task_struct *tsk)
{
	int si_code;

	if (fcr31 & FPU_CSR_INV_X)
		si_code = FPE_FLTINV;
	else if (fcr31 & FPU_CSR_DIV_X)
		si_code = FPE_FLTDIV;
	else if (fcr31 & FPU_CSR_OVF_X)
		si_code = FPE_FLTOVF;
	else if (fcr31 & FPU_CSR_UDF_X)
		si_code = FPE_FLTUND;
	else if (fcr31 & FPU_CSR_INE_X)
		si_code = FPE_FLTRES;
	else
		return; /* Broken hardware? */

	force_sig_fault(SIGFPE, si_code, fault_addr, tsk);
}

As it is now clear that code path should never happen I will be happy to
queue change that effectively reverts of ea1b75cf9138 ("signal/mips:
Document a conflict with SI_USER with SIGFPE") and just returns from
force_fcr32_sig in that case.

Eric

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] mips/signal: In force_fcr31_sig return in the impossible case
  2017-08-08 17:33   ` Eric W. Biederman
@ 2017-08-08 19:07     ` Eric W. Biederman
  0 siblings, 0 replies; 6+ messages in thread
From: Eric W. Biederman @ 2017-08-08 19:07 UTC (permalink / raw)
  To: Ralf Baechle
  Cc: Stephen Rothwell, James Hogan, Linux-Next Mailing List,
	Linux Kernel Mailing List, Maciej W. Rozycki


In a recent discussion Maciej Rozycki reported that this case is
impossible.

Handle the impossible case by just returning instead of trying to
handle it.  This makes static analysis simpler as it means nothing
needs to consider the impossible case after the return statement.

As the code no longer has to deal with this case remove FPE_FIXME from
the mips siginfo.h

Cc: "Maciej W. Rozycki" <macro@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Link: http://lkml.kernel.org/r/20170718140651.15973-4-ebiederm@xmission.com
Ref: ea1b75cf9138 ("signal/mips: Document a conflict with SI_USER with SIGFPE")
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/mips/include/uapi/asm/siginfo.h | 7 -------
 arch/mips/kernel/traps.c             | 2 +-
 2 files changed, 1 insertion(+), 8 deletions(-)

Ralf, unless someone objects this is the patch I plan on merging into my
tree, and building up.

diff --git a/arch/mips/include/uapi/asm/siginfo.h b/arch/mips/include/uapi/asm/siginfo.h
index 22a86d84a504..cf6113bbcb98 100644
--- a/arch/mips/include/uapi/asm/siginfo.h
+++ b/arch/mips/include/uapi/asm/siginfo.h
@@ -123,11 +123,4 @@ typedef struct siginfo {
 #define SI_TIMER	-3	/* sent by timer expiration */
 #define SI_MESGQ	-4	/* sent by real time mesq state change */
 
-/*
- * SIGFPE si_codes
- */
-#ifdef __KERNEL__
-#define FPE_FIXME	0	/* Broken dup of SI_USER */
-#endif /* __KERNEL__ */
-
 #endif /* _UAPI_ASM_SIGINFO_H */
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 6c9cca9c5341..2bf414993347 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -735,7 +735,7 @@ void force_fcr31_sig(unsigned long fcr31, void __user *fault_addr,
 	else if (fcr31 & FPU_CSR_INE_X)
 		si.si_code = FPE_FLTRES;
 	else
-		si.si_code = FPE_FIXME;
+		return; /* Broken hardware? */
 	force_sig_info(SIGFPE, &si, tsk);
 }
 
-- 
2.10.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: linux-next: manual merge of the userns tree with the mips tree
  2017-08-08  5:10 linux-next: manual merge of the userns tree with the mips tree Stephen Rothwell
  2017-08-08  5:58 ` Ralf Baechle
@ 2017-09-05  0:22 ` Stephen Rothwell
  1 sibling, 0 replies; 6+ messages in thread
From: Stephen Rothwell @ 2017-09-05  0:22 UTC (permalink / raw)
  To: Eric W. Biederman, Ralf Baechle, James Hogan
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List

Hi all,

On Tue, 8 Aug 2017 15:10:04 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Today's linux-next merge of the userns tree got a conflict in:
> 
>   arch/mips/kernel/traps.c
> 
> between commit:
> 
>   260a789828aa ("MIPS: signal: Remove unreachable code from force_fcr31_sig().")
> 
> from the mips tree and commit:
> 
>   ea1b75cf9138 ("signal/mips: Document a conflict with SI_USER with SIGFPE")
> 
> from the userns tree.
> 
> I fixed it up (the former removed the code updated by the latter) and
> can carry the fix as necessary. This is now fixed as far as linux-next
> is concerned, but any non trivial conflicts should be mentioned to your
> upstream maintainer when your tree is submitted for merging.  You may
> also want to consider cooperating with the maintainer of the conflicting
> tree to minimise any particularly complex conflicts.

Just a reminder that the above conflict still exists.
-- 
Cheers,
Stephen Rothwell

^ permalink raw reply	[flat|nested] 6+ messages in thread

* linux-next: manual merge of the userns tree with the mips tree
@ 2014-01-23  4:13 Stephen Rothwell
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Rothwell @ 2014-01-23  4:13 UTC (permalink / raw)
  To: Eric W. Biederman, Ralf Baechle
  Cc: linux-next, linux-kernel, Deng-Cheng Zhu, Steven J. Hill

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

Hi Eric,

Today's linux-next merge of the userns tree got conflicts in
arch/mips/include/asm/vpe.h and arch/mips/kernel/vpe.c between commits
1a2a6d7e8816 ("MIPS: APRP: Split VPE loader into separate files") and
5792bf643865 ("MIPS: APRP: Code formatting clean-ups") from the mips tree
and commit f58437f1f916 ("MIPS: VPE: Remove vpe_getuid and vpe_getgid")
from the userns tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc arch/mips/include/asm/vpe.h
index e0684f5f0054,0880fe8809b1..000000000000
--- a/arch/mips/include/asm/vpe.h
+++ b/arch/mips/include/asm/vpe.h
@@@ -9,88 -18,7 +9,87 @@@
  #ifndef _ASM_VPE_H
  #define _ASM_VPE_H
  
 +#include <linux/init.h>
 +#include <linux/list.h>
 +#include <linux/smp.h>
 +#include <linux/spinlock.h>
 +
 +#define VPE_MODULE_NAME "vpe"
 +#define VPE_MODULE_MINOR 1
 +
 +/* grab the likely amount of memory we will need. */
 +#ifdef CONFIG_MIPS_VPE_LOADER_TOM
 +#define P_SIZE (2 * 1024 * 1024)
 +#else
 +/* add an overhead to the max kmalloc size for non-striped symbols/etc */
 +#define P_SIZE (256 * 1024)
 +#endif
 +
 +#define MAX_VPES 16
 +#define VPE_PATH_MAX 256
 +
 +static inline int aprp_cpu_index(void)
 +{
 +#ifdef CONFIG_MIPS_CMP
 +	return setup_max_cpus;
 +#else
 +	extern int tclimit;
 +	return tclimit;
 +#endif
 +}
 +
 +enum vpe_state {
 +	VPE_STATE_UNUSED = 0,
 +	VPE_STATE_INUSE,
 +	VPE_STATE_RUNNING
 +};
 +
 +enum tc_state {
 +	TC_STATE_UNUSED = 0,
 +	TC_STATE_INUSE,
 +	TC_STATE_RUNNING,
 +	TC_STATE_DYNAMIC
 +};
 +
 +struct vpe {
 +	enum vpe_state state;
 +
 +	/* (device) minor associated with this vpe */
 +	int minor;
 +
 +	/* elfloader stuff */
 +	void *load_addr;
 +	unsigned long len;
 +	char *pbuffer;
 +	unsigned long plen;
- 	unsigned int uid, gid;
 +	char cwd[VPE_PATH_MAX];
 +
 +	unsigned long __start;
 +
 +	/* tc's associated with this vpe */
 +	struct list_head tc;
 +
 +	/* The list of vpe's */
 +	struct list_head list;
 +
 +	/* shared symbol address */
 +	void *shared_ptr;
 +
 +	/* the list of who wants to know when something major happens */
 +	struct list_head notify;
 +
 +	unsigned int ntcs;
 +};
 +
 +struct tc {
 +	enum tc_state state;
 +	int index;
 +
 +	struct vpe *pvpe;	/* parent VPE */
 +	struct list_head tc;	/* The list of TC's with this VPE */
 +	struct list_head list;	/* The global list of tc's */
 +};
 +
  struct vpe_notifications {
  	void (*start)(int vpe);
  	void (*stop)(int vpe);
@@@ -98,36 -26,10 +97,34 @@@
  	struct list_head list;
  };
  
 +struct vpe_control {
 +	spinlock_t vpe_list_lock;
 +	struct list_head vpe_list;      /* Virtual processing elements */
 +	spinlock_t tc_list_lock;
 +	struct list_head tc_list;       /* Thread contexts */
 +};
 +
 +extern unsigned long physical_memsize;
 +extern struct vpe_control vpecontrol;
 +extern const struct file_operations vpe_fops;
 +
 +int vpe_notify(int index, struct vpe_notifications *notify);
 +
 +void *vpe_get_shared(int index);
- int vpe_getuid(int index);
- int vpe_getgid(int index);
 +char *vpe_getcwd(int index);
 +
 +struct vpe *get_vpe(int minor);
 +struct tc *get_tc(int index);
 +struct vpe *alloc_vpe(int minor);
 +struct tc *alloc_tc(int index);
 +void release_vpe(struct vpe *v);
  
 -extern int vpe_notify(int index, struct vpe_notifications *notify);
 +void *alloc_progmem(unsigned long len);
 +void release_progmem(void *ptr);
  
 -extern void *vpe_get_shared(int index);
 -extern char *vpe_getcwd(int index);
 +int __weak vpe_run(struct vpe *v);
 +void cleanup_tc(struct tc *tc);
  
 +int __init vpe_module_init(void);
 +void __exit vpe_module_exit(void);
  #endif /* _ASM_VPE_H */
diff --cc arch/mips/kernel/vpe.c
index 42d3ca08bd28,2d5c142bad67..000000000000
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@@ -899,35 -1262,14 +896,13 @@@ void *vpe_get_shared(int index
  
  	return v->shared_ptr;
  }
 -
  EXPORT_SYMBOL(vpe_get_shared);
  
- int vpe_getuid(int index)
- {
- 	struct vpe *v = get_vpe(index);
- 
- 	if (v == NULL)
- 		return -1;
- 
- 	return v->uid;
- }
- EXPORT_SYMBOL(vpe_getuid);
- 
- int vpe_getgid(int index)
- {
- 	struct vpe *v = get_vpe(index);
- 
- 	if (v == NULL)
- 		return -1;
- 
- 	return v->gid;
- }
- EXPORT_SYMBOL(vpe_getgid);
- 
  int vpe_notify(int index, struct vpe_notifications *notify)
  {
 -	struct vpe *v;
 +	struct vpe *v = get_vpe(index);
  
 -	if ((v = get_vpe(index)) == NULL)
 +	if (v == NULL)
  		return -1;
  
  	list_add(&notify->list, &v->notify);

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-09-05  0:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-08  5:10 linux-next: manual merge of the userns tree with the mips tree Stephen Rothwell
2017-08-08  5:58 ` Ralf Baechle
2017-08-08 17:33   ` Eric W. Biederman
2017-08-08 19:07     ` [PATCH] mips/signal: In force_fcr31_sig return in the impossible case Eric W. Biederman
2017-09-05  0:22 ` linux-next: manual merge of the userns tree with the mips tree Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2014-01-23  4:13 Stephen Rothwell

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.