Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1463884 > unrolled thread
| Started by | Paul Gortmaker <paul.gortmaker@windriver.com> |
|---|---|
| First post | 2016-08-16 17:20 +0200 |
| Last post | 2016-08-19 05:30 +0200 |
| Articles | 4 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 0/2] ia64: make use of new extable.h header Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-08-16 17:20 +0200
[PATCH 1/2] ia64: macro-ize ia64_done_with_exception in asm/uaccess.h Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-08-16 17:20 +0200
Re: [PATCH 1/2] ia64: macro-ize ia64_done_with_exception in asm/uaccess.h Al Viro <viro@ZenIV.linux.org.uk> - 2016-08-17 19:20 +0200
Re: [PATCH 1/2] ia64: macro-ize ia64_done_with_exception in asm/uaccess.h Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-08-19 05:30 +0200
| From | Paul Gortmaker <paul.gortmaker@windriver.com> |
|---|---|
| Date | 2016-08-16 17:20 +0200 |
| Subject | [PATCH 0/2] ia64: make use of new extable.h header |
| Message-ID | <s6OjL-4IB-9@gated-at.bofh.it> |
We forked the exception table content out of module.h into a new extable.h file[1]. We temporarily include extable.h into the module.h itself. Now we work our way across the arch independent and arch specific files needing just exception table content, and move them off module.h and onto extable.h Once that is done, we can remove the extable.h from module.h and in doing it like this, we avoid introducing build failures into the git history. Here we move ia64 onto using the new header, and in doing so also macro-ize something in uaccess.h to make it more consistent with the rest of that file. Paul. [1] https://lkml.org/lkml/2016/7/24/224 -- Paul Gortmaker (2): ia64: macro-ize ia64_done_with_exception in asm/uaccess.h ia64: ensure exception table search users include extable.h arch/ia64/include/asm/uaccess.h | 28 ++++++++++++++-------------- arch/ia64/kernel/kprobes.c | 2 +- arch/ia64/kernel/traps.c | 3 ++- arch/ia64/kernel/unaligned.c | 1 + arch/ia64/mm/fault.c | 1 + 5 files changed, 19 insertions(+), 16 deletions(-) -- 2.8.4
[toc] | [next] | [standalone]
| From | Paul Gortmaker <paul.gortmaker@windriver.com> |
|---|---|
| Date | 2016-08-16 17:20 +0200 |
| Subject | [PATCH 1/2] ia64: macro-ize ia64_done_with_exception in asm/uaccess.h |
| Message-ID | <s6OjM-4IB-25@gated-at.bofh.it> |
| In reply to | #1463884 |
Most of the other C content in this file is already implemented
in macro form. Doing the same for this function will allow us
to get rid of the duplicated search_exception_tables prototype.
We will bring it in as required via <linux/extable.h> inclusion.
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: linux-ia64@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/ia64/include/asm/uaccess.h | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/arch/ia64/include/asm/uaccess.h b/arch/ia64/include/asm/uaccess.h
index 465c70982f40..4b52b79213a3 100644
--- a/arch/ia64/include/asm/uaccess.h
+++ b/arch/ia64/include/asm/uaccess.h
@@ -363,17 +363,17 @@ struct exception_table_entry {
extern void ia64_handle_exception (struct pt_regs *regs, const struct exception_table_entry *e);
extern const struct exception_table_entry *search_exception_tables (unsigned long addr);
-static inline int
-ia64_done_with_exception (struct pt_regs *regs)
-{
- const struct exception_table_entry *e;
- e = search_exception_tables(regs->cr_iip + ia64_psr(regs)->ri);
- if (e) {
- ia64_handle_exception(regs, e);
- return 1;
- }
- return 0;
-}
+#define ia64_done_with_exception(regs) \
+({ \
+ int __ex_ret = 0; \
+ const struct exception_table_entry *e; \
+ e = search_exception_tables((regs)->cr_iip + ia64_psr(regs)->ri); \
+ if (e) { \
+ ia64_handle_exception(regs, e); \
+ __ex_ret = 1; \
+ } \
+ __ex_ret; \
+})
#define ARCH_HAS_TRANSLATE_MEM_PTR 1
static __inline__ void *
--
2.8.4
[toc] | [prev] | [next] | [standalone]
| From | Al Viro <viro@ZenIV.linux.org.uk> |
|---|---|
| Date | 2016-08-17 19:20 +0200 |
| Subject | Re: [PATCH 1/2] ia64: macro-ize ia64_done_with_exception in asm/uaccess.h |
| Message-ID | <s7cFs-40T-25@gated-at.bofh.it> |
| In reply to | #1463885 |
On Tue, Aug 16, 2016 at 11:14:42AM -0400, Paul Gortmaker wrote: > Most of the other C content in this file is already implemented > in macro form. Doing the same for this function will allow us > to get rid of the duplicated search_exception_tables prototype. > We will bring it in as required via <linux/extable.h> inclusion. What is it doing in uaccess.h in the first place? ia64_done_with_exception() is used only in the guts of arch/ia64 (2 in kernel, 1 in mm), so why dump it into a widely-used header?
[toc] | [prev] | [next] | [standalone]
| From | Paul Gortmaker <paul.gortmaker@windriver.com> |
|---|---|
| Date | 2016-08-19 05:30 +0200 |
| Subject | Re: [PATCH 1/2] ia64: macro-ize ia64_done_with_exception in asm/uaccess.h |
| Message-ID | <s7IFj-ej-7@gated-at.bofh.it> |
| In reply to | #1464669 |
[Re: [PATCH 1/2] ia64: macro-ize ia64_done_with_exception in asm/uaccess.h] On 17/08/2016 (Wed 18:15) Al Viro wrote: > On Tue, Aug 16, 2016 at 11:14:42AM -0400, Paul Gortmaker wrote: > > Most of the other C content in this file is already implemented > > in macro form. Doing the same for this function will allow us > > to get rid of the duplicated search_exception_tables prototype. > > We will bring it in as required via <linux/extable.h> inclusion. > > What is it doing in uaccess.h in the first place? ia64_done_with_exception() > is used only in the guts of arch/ia64 (2 in kernel, 1 in mm), so why dump it > into a widely-used header? Looking at arm and alpha, it seems there are other arch that have exception stuff in their own arch specific uaccess.h file, so I'm guessing it got there in ia64 just by happenstance of copying existing implementations. THere is a precedent for arch specific asm/exception.h -- we could create one for ia64 and move the chunks over there if folks thought that was worthwhile I suppose. Paul. --
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web