All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: WTF: patch "[PATCH] ARC: Support syscall ABI v4" was seriously submitted to be applied to the 4.7-stable tree?
Date: Tue, 6 Sep 2016 09:50:46 -0700	[thread overview]
Message-ID: <584a8fcd-6876-de0d-3c5e-8b4dad12c49d@synopsys.com> (raw)
In-Reply-To: <1473080592214136@kroah.com>

On 09/05/2016 06:03 AM, gregkh@linuxfoundation.org wrote:
> The patch below was submitted to be applied to the 4.7-stable tree.
>
> I fail to see how this patch meets the stable kernel rules as found at
> Documentation/stable_kernel_rules.txt.
>
> I could be totally wrong, and if so, please respond to 
> <stable@vger.kernel.org> and let me know why this patch should be
> applied.  Otherwise, it is now dropped from my patch queues, never to be
> seen again.

Hi Greg,

We are about to switch to new version of GNU tools (gcc 6.x based) which
unfortunately has a non compatible ABI change - as described in the patch.

Some of our customers are going to stick with older kernels and thus this helps
them upgrade to newer tools with their existing baseline kernels.

Thx,
-Vineet

>
> thanks,
>
> greg k-h
>
> ------------------ original commit in Linus's tree ------------------
>
> From 840c054fd0efb048df6fceb0c46385ec5b66dfe6 Mon Sep 17 00:00:00 2001
> From: Vineet Gupta <vgupta@synopsys.com>
> Date: Wed, 10 Aug 2016 14:10:57 -0700
> Subject: [PATCH] ARC: Support syscall ABI v4
>
> The syscall ABI includes the gcc functional calling ABI since a syscall
> implies userland caller and kernel callee.
>
> The current gcc ABI (v3) for ARCv2 ISA required 64-bit data be passed in
> even-odd register pairs, (potentially punching reg holes when passing such
> values as args). This was partly driven by the fact that the double-word
> LDD/STD instructions in ARCv2 expect the register alignment and thus gcc
> forcing this avoids extra MOV at the cost of a few unused register (which we
> have plenty anyways).
>
> This however was rejected as part of upstreaming gcc port to HS. So the new
> ABI v4 doesn't enforce the even-odd reg restriction.
>
> Do note that for ARCompact ISA builds v3 and v4 are practically the same in
> terms of gcc code generation.
>
> In terms of change management, we infer the new ABI if gcc 6.x onwards
> is used for building the kernel.
>
> This also needs a stable backport to enable older kernels to work with
> new tools/user-space
>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
>
> diff --git a/arch/arc/include/uapi/asm/elf.h b/arch/arc/include/uapi/asm/elf.h
> index 0f99ac8fcbb2..0037a587320d 100644
> --- a/arch/arc/include/uapi/asm/elf.h
> +++ b/arch/arc/include/uapi/asm/elf.h
> @@ -13,8 +13,15 @@
>  
>  /* Machine specific ELF Hdr flags */
>  #define EF_ARC_OSABI_MSK	0x00000f00
> -#define EF_ARC_OSABI_ORIG	0x00000000   /* MUST be zero for back-compat */
> -#define EF_ARC_OSABI_CURRENT	0x00000300   /* v3 (no legacy syscalls) */
> +
> +#define EF_ARC_OSABI_V3		0x00000300   /* v3 (no legacy syscalls) */
> +#define EF_ARC_OSABI_V4		0x00000400   /* v4 (64bit data any reg align) */
> +
> +#if __GNUC__ < 6
> +#define EF_ARC_OSABI_CURRENT	EF_ARC_OSABI_V3
> +#else
> +#define EF_ARC_OSABI_CURRENT	EF_ARC_OSABI_V4
> +#endif
>  
>  typedef unsigned long elf_greg_t;
>  typedef unsigned long elf_fpregset_t;
> diff --git a/arch/arc/kernel/process.c b/arch/arc/kernel/process.c
> index b5db9e7fd649..be1972bd2729 100644
> --- a/arch/arc/kernel/process.c
> +++ b/arch/arc/kernel/process.c
> @@ -199,7 +199,7 @@ int elf_check_arch(const struct elf32_hdr *x)
>  	}
>  
>  	eflags = x->e_flags;
> -	if ((eflags & EF_ARC_OSABI_MSK) < EF_ARC_OSABI_CURRENT) {
> +	if ((eflags & EF_ARC_OSABI_MSK) != EF_ARC_OSABI_CURRENT) {
>  		pr_err("ABI mismatch - you need newer toolchain\n");
>  		force_sigsegv(SIGSEGV, current);
>  		return 0;
> diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c
> index a946400a86d0..f52a0d0dc462 100644
> --- a/arch/arc/kernel/setup.c
> +++ b/arch/arc/kernel/setup.c
> @@ -291,8 +291,10 @@ static char *arc_extn_mumbojumbo(int cpu_id, char *buf, int len)
>  			       cpu->dccm.base_addr, TO_KB(cpu->dccm.sz),
>  			       cpu->iccm.base_addr, TO_KB(cpu->iccm.sz));
>  
> -	n += scnprintf(buf + n, len - n,
> -		       "OS ABI [v3]\t: no-legacy-syscalls\n");
> +	n += scnprintf(buf + n, len - n, "OS ABI [v%d]\t: %s\n",
> +			EF_ARC_OSABI_CURRENT >> 8,
> +			EF_ARC_OSABI_CURRENT == EF_ARC_OSABI_V3 ?
> +			"no-legacy-syscalls" : "64-bit data any register aligned");
>  
>  	return buf;
>  }
>
>


  reply	other threads:[~2016-09-06 16:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-05 13:03 WTF: patch "[PATCH] ARC: Support syscall ABI v4" was seriously submitted to be applied to the 4.7-stable tree? gregkh
2016-09-06 16:50 ` Vineet Gupta [this message]
2016-09-06 19:38   ` gregkh
2016-09-06 20:21     ` Vineet Gupta
2016-09-06 20:21       ` Vineet Gupta
2016-09-06 20:28       ` Vineet Gupta
2016-09-06 20:28         ` Vineet Gupta
2016-09-07  6:28         ` Greg Kroah-Hartman
2016-09-07  6:28           ` Greg Kroah-Hartman
2016-09-07 16:38           ` Vineet Gupta
2016-09-07 16:38             ` Vineet Gupta
2016-09-09 11:39             ` Greg Kroah-Hartman
2016-09-09 11:39               ` Greg Kroah-Hartman
2016-09-09 17:08               ` Vineet Gupta
2016-09-09 17:08                 ` Vineet Gupta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=584a8fcd-6876-de0d-3c5e-8b4dad12c49d@synopsys.com \
    --to=vineet.gupta1@synopsys.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.