lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 20 Nov 2013 20:18:41 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Jacob Pan <jacob.jun.pan@...ux.intel.com>
Cc:	Arjan van de Ven <arjan@...ux.intel.com>, lenb@...nel.org,
	rjw@...ysocki.net, Eliezer Tamir <eliezer.tamir@...ux.intel.com>,
	Chris Leech <christopher.leech@...el.com>,
	David Miller <davem@...emloft.net>, rui.zhang@...el.com,
	Mike Galbraith <bitbucket@...ine.de>,
	Ingo Molnar <mingo@...nel.org>, hpa@...or.com,
	Thomas Gleixner <tglx@...utronix.de>,
	linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
	Rusty Russell <rusty@...tcorp.com.au>
Subject: Re: [PATCH 7/7] preempt: Take away preempt_enable_no_resched() from
 modules

On Wed, Nov 20, 2013 at 10:54:57AM -0800, Jacob Pan wrote:
> run into a couple of compile issues.
> 
> 1)
> include/linux/rcupdate.h: In function ‘rcu_read_unlock_sched_notrace’:
> include/linux/rcupdate.h:889:2: error: implicit declaration of function
> ‘preempt_enable_no_resched_notrace’ [-Werror=implicit-function-declaration]
> 
> 2)
> In file included from drivers/cpufreq/acpi-cpufreq.c:41:0:
> include/linux/uaccess.h: In function ‘pagefault_enable’:
> include/linux/uaccess.h:34:2: error: implicit declaration of function
> ‘preempt_check_resched’ [-Werror=implicit-function-declaration]
> 
> 1) happens when CONFIG_PREEMPT is not set, perhaps add a dummy function?
> 2) I am not sure if we should take pagefault_enable away from modules

I think the below will cure both -- will fold in the proper patches
tomorrow, need to get away from the computer noaw.

---
 include/linux/preempt.h | 6 +++++-
 include/linux/uaccess.h | 5 ++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index a3d9dc8c2c00..41bc3fc4cdc5 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -93,7 +93,11 @@ do { \
 		__preempt_schedule_context(); \
 } while (0)
 #else
-#define preempt_enable_notrace() preempt_enable_no_resched_notrace()
+#define preempt_enable_notrace() \
+do { \
+	barrier(); \
+	__preempt_count_dec(); \
+} while (0)
 #endif
 
 #else /* !CONFIG_PREEMPT_COUNT */
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h
index 9d8cf056e661..ecd3319dac33 100644
--- a/include/linux/uaccess.h
+++ b/include/linux/uaccess.h
@@ -25,13 +25,16 @@ static inline void pagefault_disable(void)
 
 static inline void pagefault_enable(void)
 {
+#ifndef CONFIG_PREEMPT
 	/*
 	 * make sure to issue those last loads/stores before enabling
 	 * the pagefault handler again.
 	 */
 	barrier();
 	preempt_count_dec();
-	preempt_check_resched();
+#else
+	preempt_enable();
+#endif
 }
 
 #ifndef ARCH_HAS_NOCACHE_UACCESS
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ