Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
fd68505a
Commit
fd68505a
authored
Jan 06, 2003
by
Andi Kleen
Committed by
Linus Torvalds
Jan 06, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] x86_64 extable fixes
Make x86-64 compile again after recent extable changes.
parent
94781db5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
74 deletions
+18
-74
arch/x86_64/kernel/setup.c
arch/x86_64/kernel/setup.c
+0
-2
arch/x86_64/kernel/traps.c
arch/x86_64/kernel/traps.c
+6
-8
arch/x86_64/mm/extable.c
arch/x86_64/mm/extable.c
+7
-58
arch/x86_64/mm/fault.c
arch/x86_64/mm/fault.c
+5
-3
include/asm-x86_64/uaccess.h
include/asm-x86_64/uaccess.h
+0
-3
No files found.
arch/x86_64/kernel/setup.c
View file @
fd68505a
...
...
@@ -384,8 +384,6 @@ void __init setup_arch(char **cmdline_p)
conswitchp
=
&
dummy_con
;
#endif
#endif
exception_table_check
();
}
#ifndef CONFIG_X86_TSC
...
...
arch/x86_64/kernel/traps.c
View file @
fd68505a
...
...
@@ -397,7 +397,8 @@ static void do_trap(int trapnr, int signr, char *str,
/* kernel trap */
{
unsigned
long
fixup
=
search_exception_table
(
regs
->
rip
);
const
struct
exception_table_entry
*
fixup
;
fixup
=
search_exception_tables
(
regs
->
rip
);
if
(
fixup
)
{
extern
int
exception_trace
;
if
(
exception_trace
)
...
...
@@ -405,7 +406,7 @@ static void do_trap(int trapnr, int signr, char *str,
"%s: fixed kernel exception at %lx err:%ld
\n
"
,
current
->
comm
,
regs
->
rip
,
error_code
);
regs
->
rip
=
fixup
;
regs
->
rip
=
fixup
->
fixup
;
}
else
die
(
str
,
regs
,
error_code
);
return
;
...
...
@@ -449,8 +450,6 @@ asmlinkage void do_int3(struct pt_regs * regs, long error_code)
do_trap
(
3
,
SIGTRAP
,
"int3"
,
regs
,
error_code
,
NULL
);
}
extern
void
dump_pagetable
(
unsigned
long
);
asmlinkage
void
do_general_protection
(
struct
pt_regs
*
regs
,
long
error_code
)
{
#ifdef CONFIG_CHECKING
...
...
@@ -479,13 +478,12 @@ asmlinkage void do_general_protection(struct pt_regs * regs, long error_code)
/* kernel gp */
{
unsigned
long
fixup
;
fixup
=
search_exception_table
(
regs
->
rip
);
const
struct
exception_table_entry
*
fixup
;
fixup
=
search_exception_table
s
(
regs
->
rip
);
if
(
fixup
)
{
regs
->
rip
=
fixup
;
regs
->
rip
=
fixup
->
fixup
;
return
;
}
// dump_pagetable(regs->rip);
die
(
"general protection fault"
,
regs
,
error_code
);
}
}
...
...
arch/x86_64/mm/extable.c
View file @
fd68505a
...
...
@@ -6,32 +6,12 @@
#include <linux/module.h>
#include <linux/spinlock.h>
#include <asm/uaccess.h>
#include <linux/init.h>
extern
const
struct
exception_table_entry
__start___ex_table
[];
extern
const
struct
exception_table_entry
__stop___ex_table
[];
void
__init
exception_table_check
(
void
)
{
const
struct
exception_table_entry
*
e
;
unsigned
long
prev
;
prev
=
0
;
for
(
e
=
__start___ex_table
;
e
<
__stop___ex_table
;
e
++
)
{
if
(
e
->
insn
<
prev
)
{
panic
(
"unordered exception table at %016lx:%016lx and %016lx:%016lx
\n
"
,
prev
,
e
[
-
1
].
fixup
,
e
->
insn
,
e
->
fixup
);
}
prev
=
e
->
insn
;
}
}
static
unsigned
long
search_one_table
(
const
struct
exception_table_entry
*
first
,
const
struct
exception_table_entry
*
last
,
unsigned
long
value
)
/* Simple binary search */
const
struct
exception_table_entry
*
search_extable
(
const
struct
exception_table_entry
*
first
,
const
struct
exception_table_entry
*
last
,
unsigned
long
value
)
{
while
(
first
<=
last
)
{
const
struct
exception_table_entry
*
mid
;
...
...
@@ -40,42 +20,11 @@ search_one_table(const struct exception_table_entry *first,
mid
=
(
last
-
first
)
/
2
+
first
;
diff
=
mid
->
insn
-
value
;
if
(
diff
==
0
)
return
mid
->
fixup
;
return
mid
;
else
if
(
diff
<
0
)
first
=
mid
+
1
;
else
last
=
mid
-
1
;
}
return
0
;
}
extern
spinlock_t
modlist_lock
;
unsigned
long
search_exception_table
(
unsigned
long
addr
)
{
unsigned
long
ret
=
0
;
unsigned
long
flags
;
#ifndef CONFIG_MODULES
/* There is only the kernel to search. */
return
search_one_table
(
__start___ex_table
,
__stop___ex_table
-
1
,
addr
);
#else
/* The kernel is the last "module" -- no need to treat it special. */
struct
list_head
*
i
;
spin_lock_irqsave
(
&
modlist_lock
,
flags
);
list_for_each
(
i
,
&
extables
)
{
struct
exception_table
*
ex
=
list_entry
(
i
,
struct
exception_table
,
list
);
if
(
ex
->
num_entries
==
0
)
continue
;
ret
=
search_one_table
(
ex
->
entry
,
ex
->
entry
+
ex
->
num_entries
-
1
,
addr
);
if
(
ret
)
break
;
}
spin_unlock_irqrestore
(
&
modlist_lock
,
flags
);
return
ret
;
#endif
return
NULL
;
}
arch/x86_64/mm/fault.c
View file @
fd68505a
...
...
@@ -22,6 +22,7 @@
#include <linux/tty.h>
#include <linux/vt_kern.h>
/* For unblank_screen() */
#include <linux/compiler.h>
#include <linux/module.h>
#include <asm/system.h>
#include <asm/uaccess.h>
...
...
@@ -101,7 +102,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
struct
mm_struct
*
mm
;
struct
vm_area_struct
*
vma
;
unsigned
long
address
;
unsigned
long
fixup
;
const
struct
exception_table_entry
*
fixup
;
int
write
;
siginfo_t
info
;
...
...
@@ -239,8 +240,9 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
no_context:
/* Are we prepared to handle this kernel fault? */
if
((
fixup
=
search_exception_table
(
regs
->
rip
))
!=
0
)
{
regs
->
rip
=
fixup
;
fixup
=
search_exception_tables
(
regs
->
rip
);
if
(
fixup
)
{
regs
->
rip
=
fixup
->
fixup
;
if
(
0
&&
exception_trace
)
printk
(
KERN_ERR
"%s: fixed kernel exception at %lx address %lx err:%ld
\n
"
,
...
...
include/asm-x86_64/uaccess.h
View file @
fd68505a
...
...
@@ -71,9 +71,6 @@ struct exception_table_entry
unsigned
long
insn
,
fixup
;
};
/* Returns 0 if exception not found and fixup otherwise. */
extern
unsigned
long
search_exception_table
(
unsigned
long
);
/*
* These are the main single-value transfer routines. They automatically
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment