diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2007-05-02 13:27:14 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2007-05-02 13:27:14 -0400 |
commit | d582203578a1f3d408e27bb9042e8635954cd320 (patch) | |
tree | 385952bdda8f9c2b6b4c9c659a0eba872749e948 /arch/i386/kernel/paravirt.c | |
parent | 98de032b681d8a7532d44dfc66aa5c0c1c755a9d (diff) |
[PATCH] i386: PARAVIRT: Use patch site IDs computed from offset in paravirt_ops structure
Use patch type identifiers derived from the offset of the operation in
the paravirt_ops structure. This avoids having to maintain a separate
enum for patch site types.
Also, since the identifier is derived from the offset into
paravirt_ops, the offset can be derived from the identifier. This is
used to remove replicated information in the various callsite macros,
which has been a source of bugs in the past.
This patch also drops the fused save_fl+cli operation, which doesn't
really add much and makes things more complex - specifically because
it breaks the 1:1 relationship between identifiers and offsets. If
this operation turns out to be particularly beneficial, then the right
answer is to define a new entrypoint for it.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Zachary Amsden <zach@vmware.com>
Diffstat (limited to 'arch/i386/kernel/paravirt.c')
-rw-r--r-- | arch/i386/kernel/paravirt.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/arch/i386/kernel/paravirt.c b/arch/i386/kernel/paravirt.c index 54cc14d99740..f2982832d3b9 100644 --- a/arch/i386/kernel/paravirt.c +++ b/arch/i386/kernel/paravirt.c | |||
@@ -58,7 +58,6 @@ DEF_NATIVE(cli, "cli"); | |||
58 | DEF_NATIVE(sti, "sti"); | 58 | DEF_NATIVE(sti, "sti"); |
59 | DEF_NATIVE(popf, "push %eax; popf"); | 59 | DEF_NATIVE(popf, "push %eax; popf"); |
60 | DEF_NATIVE(pushf, "pushf; pop %eax"); | 60 | DEF_NATIVE(pushf, "pushf; pop %eax"); |
61 | DEF_NATIVE(pushf_cli, "pushf; pop %eax; cli"); | ||
62 | DEF_NATIVE(iret, "iret"); | 61 | DEF_NATIVE(iret, "iret"); |
63 | DEF_NATIVE(sti_sysexit, "sti; sysexit"); | 62 | DEF_NATIVE(sti_sysexit, "sti; sysexit"); |
64 | 63 | ||
@@ -66,13 +65,12 @@ static const struct native_insns | |||
66 | { | 65 | { |
67 | const char *start, *end; | 66 | const char *start, *end; |
68 | } native_insns[] = { | 67 | } native_insns[] = { |
69 | [PARAVIRT_IRQ_DISABLE] = { start_cli, end_cli }, | 68 | [PARAVIRT_PATCH(irq_disable)] = { start_cli, end_cli }, |
70 | [PARAVIRT_IRQ_ENABLE] = { start_sti, end_sti }, | 69 | [PARAVIRT_PATCH(irq_enable)] = { start_sti, end_sti }, |
71 | [PARAVIRT_RESTORE_FLAGS] = { start_popf, end_popf }, | 70 | [PARAVIRT_PATCH(restore_fl)] = { start_popf, end_popf }, |
72 | [PARAVIRT_SAVE_FLAGS] = { start_pushf, end_pushf }, | 71 | [PARAVIRT_PATCH(save_fl)] = { start_pushf, end_pushf }, |
73 | [PARAVIRT_SAVE_FLAGS_IRQ_DISABLE] = { start_pushf_cli, end_pushf_cli }, | 72 | [PARAVIRT_PATCH(iret)] = { start_iret, end_iret }, |
74 | [PARAVIRT_INTERRUPT_RETURN] = { start_iret, end_iret }, | 73 | [PARAVIRT_PATCH(irq_enable_sysexit)] = { start_sti_sysexit, end_sti_sysexit }, |
75 | [PARAVIRT_STI_SYSEXIT] = { start_sti_sysexit, end_sti_sysexit }, | ||
76 | }; | 74 | }; |
77 | 75 | ||
78 | static unsigned native_patch(u8 type, u16 clobbers, void *insns, unsigned len) | 76 | static unsigned native_patch(u8 type, u16 clobbers, void *insns, unsigned len) |