linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@redhat.com>,
	linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: hch@lst.de
Subject: [PATCH v2 1/4] MIPS: kernel: Remove not needed set_fs calls
Date: Wed, 31 Mar 2021 13:55:58 +0200	[thread overview]
Message-ID: <20210331115603.146159-2-tsbogend@alpha.franken.de> (raw)
In-Reply-To: <20210331115603.146159-1-tsbogend@alpha.franken.de>

flush_icache_range always does flush kernel address ranges, so no
need to do the set_fs dance.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---
 arch/mips/kernel/ftrace.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/arch/mips/kernel/ftrace.c b/arch/mips/kernel/ftrace.c
index 666b9969c1bd..8c401e42301c 100644
--- a/arch/mips/kernel/ftrace.c
+++ b/arch/mips/kernel/ftrace.c
@@ -90,7 +90,6 @@ static int ftrace_modify_code_2(unsigned long ip, unsigned int new_code1,
 				unsigned int new_code2)
 {
 	int faulted;
-	mm_segment_t old_fs;
 
 	safe_store_code(new_code1, ip, faulted);
 	if (unlikely(faulted))
@@ -102,10 +101,7 @@ static int ftrace_modify_code_2(unsigned long ip, unsigned int new_code1,
 		return -EFAULT;
 
 	ip -= 4;
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
 	flush_icache_range(ip, ip + 8);
-	set_fs(old_fs);
 
 	return 0;
 }
@@ -114,7 +110,6 @@ static int ftrace_modify_code_2r(unsigned long ip, unsigned int new_code1,
 				 unsigned int new_code2)
 {
 	int faulted;
-	mm_segment_t old_fs;
 
 	ip += 4;
 	safe_store_code(new_code2, ip, faulted);
@@ -126,10 +121,7 @@ static int ftrace_modify_code_2r(unsigned long ip, unsigned int new_code1,
 	if (unlikely(faulted))
 		return -EFAULT;
 
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
 	flush_icache_range(ip, ip + 8);
-	set_fs(old_fs);
 
 	return 0;
 }
-- 
2.29.2


  reply	other threads:[~2021-03-31 11:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-31 11:55 [PATCH v2 0/4] MIPS: Remove get_fs/set_fs Thomas Bogendoerfer
2021-03-31 11:55 ` Thomas Bogendoerfer [this message]
2021-04-01  6:22   ` [PATCH v2 1/4] MIPS: kernel: Remove not needed set_fs calls Christoph Hellwig
2021-03-31 11:55 ` [PATCH v2 2/4] MIPS: uaccess: Added __get/__put_kernel_nofault Thomas Bogendoerfer
2021-04-01  6:27   ` Christoph Hellwig
2021-03-31 11:56 ` [PATCH v2 3/4] MIPS: uaccess: Remove get_fs/set_fs call sites Thomas Bogendoerfer
2021-04-01  6:30   ` Christoph Hellwig
2021-04-01 12:51     ` Thomas Bogendoerfer
2021-03-31 11:56 ` [PATCH v2 4/4] MIPS: Remove get_fs/set_fs Thomas Bogendoerfer

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=20210331115603.146159-2-tsbogend@alpha.franken.de \
    --to=tsbogend@alpha.franken.de \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.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).