All of lore.kernel.org
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] ARC: mm: fix build breakage with STRICT_MM_TYPECHECKS" failed to apply to 4.4-stable tree
@ 2016-09-05 13:06 gregkh
  2016-09-06 17:24 ` Vineet Gupta
  0 siblings, 1 reply; 11+ messages in thread
From: gregkh @ 2016-09-05 13:06 UTC (permalink / raw)
  To: vgupta, stable; +Cc: stable


The patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

>From 1c3c909303924d30145601f47b6c058fdd2cbc2e Mon Sep 17 00:00:00 2001
From: Vineet Gupta <vgupta@synopsys.com>
Date: Tue, 16 Aug 2016 18:27:07 -0700
Subject: [PATCH] ARC: mm: fix build breakage with STRICT_MM_TYPECHECKS
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

|  CC      mm/memory.o
| In file included from ../mm/memory.c:53:0:
| ../include/linux/pfn_t.h: In function ‘pfn_t_pte’:
| ../include/linux/pfn_t.h:78:2: error: conversion to non-scalar type requested
|  return pfn_pte(pfn_t_to_pfn(pfn), pgprot);

With STRICT_MM_TYPECHECKS pte_t is a struct and the offending code
forces a cast which ends up shifting a struct and hence the gcc warning.

Note that in recent past some of the arches (aarch64, s390) made
STRICT_MM_TYPECHECKS default, but we don't for ARC as this leads to slightly
worse generated code, given ARC ABI definition of returning structs
(which pte_t would become)

Quoting from ARC ABI...

  "Results of type struct are returned in a caller-supplied temporary
  variable whose address is passed in r0.
  For such functions, the arguments are shifted so that they are
  passed in r1 and up."

So
 - struct to be returned would be allocated on stack requiring extra
   code at call sites
 - callee updates stack memory to facilitate the return (vs. simple
   MOV into return reg r0)

Hence STRICT_MM_TYPECHECKS is not enabled by default for ARC

Cc: <stable@vger.kernel.org>   #4.4+
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

diff --git a/arch/arc/include/asm/pgtable.h b/arch/arc/include/asm/pgtable.h
index 0f92d97432a2..89eeb3720051 100644
--- a/arch/arc/include/asm/pgtable.h
+++ b/arch/arc/include/asm/pgtable.h
@@ -280,7 +280,7 @@ static inline void pmd_set(pmd_t *pmdp, pte_t *ptep)
 
 #define pte_page(pte)		pfn_to_page(pte_pfn(pte))
 #define mk_pte(page, prot)	pfn_pte(page_to_pfn(page), prot)
-#define pfn_pte(pfn, prot)	(__pte(((pte_t)(pfn) << PAGE_SHIFT) | pgprot_val(prot)))
+#define pfn_pte(pfn, prot)	__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
 
 /* Don't use virt_to_pfn for macros below: could cause truncations for PAE40*/
 #define pte_pfn(pte)		(pte_val(pte) >> PAGE_SHIFT)


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

end of thread, other threads:[~2016-09-13 16:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-05 13:06 FAILED: patch "[PATCH] ARC: mm: fix build breakage with STRICT_MM_TYPECHECKS" failed to apply to 4.4-stable tree gregkh
2016-09-06 17:24 ` Vineet Gupta
2016-09-09 14:19   ` gregkh
2016-09-09 16:47     ` Vineet Gupta
2016-09-10 15:50       ` gregkh
2016-09-12 16:32         ` [PATCH] ARC: mm: fix build breakage with STRICT_MM_TYPECHECKS Vineet Gupta
2016-09-12 17:08           ` gregkh @ linuxfoundation . org
2016-09-12 17:39             ` Vineet Gupta
2016-09-12 18:04             ` Vineet Gupta
2016-09-13  6:12               ` gregkh
2016-09-13 16:29                 ` Vineet Gupta

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.