linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org,
	Guenter Roeck <linux@roeck-us.net>,
	Atsushi Nemoto <anemo@mba.ocn.ne.jp>,
	Matthew Wilcox <matthew.r.wilcox@intel.com>
Subject: [PATCH] mips: Re-introduce copy_user_page
Date: Fri, 30 Jan 2015 21:23:27 -0800	[thread overview]
Message-ID: <1422681807-28395-1-git-send-email-linux@roeck-us.net> (raw)

Commit bcd022801ee5 ("MIPS: Fix COW D-cache aliasing on fork") replaced
the inline function copy_user_page for mips with an external reference,
but neglected to introduce the actual non-inline function. Restore it.

Fixes: bcd022801ee5 ("MIPS: Fix COW D-cache aliasing on fork")
Fixes: 4927b7d77c00 ("dax,ext2: replace the XIP page fault handler with the DAX page fault handler")
Cc: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: Matthew Wilcox <matthew.r.wilcox@intel.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
4927b7d77c00 is in -next.

 arch/mips/include/asm/page.h | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index 154b70a..69c2f19 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -105,8 +105,17 @@ static inline void clear_user_page(void *addr, unsigned long vaddr,
 		flush_data_cache_page((unsigned long)addr);
 }
 
-extern void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
-	struct page *to);
+static inline void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
+				  struct page *to)
+{
+	extern void (*flush_data_cache_page)(unsigned long addr);
+
+	copy_page(vto, vfrom);
+	if (!cpu_has_ic_fills_f_dc || pages_do_alias((unsigned long)vto,
+						     vaddr & PAGE_MASK))
+		flush_data_cache_page((unsigned long)vto);
+}
+
 struct vm_area_struct;
 extern void copy_user_highpage(struct page *to, struct page *from,
 	unsigned long vaddr, struct vm_area_struct *vma);
-- 
2.1.0


             reply	other threads:[~2015-01-31  5:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-31  5:23 Guenter Roeck [this message]
2015-02-03 18:40 ` mips: Re-introduce copy_user_page Leonid Yegoshin
2015-02-04  3:33   ` Guenter Roeck
2015-02-04 16:25   ` Wilcox, Matthew R

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=1422681807-28395-1-git-send-email-linux@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=matthew.r.wilcox@intel.com \
    --cc=ralf@linux-mips.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).