Magellan Linux

Contents of /trunk/kernel26-xen/patches-2.6.25-r1/1090-2.6.25-xen-Implement-some-xen-callbacks-on-xen-entry_64.S.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 606 - (show annotations) (download)
Thu May 22 23:13:13 2008 UTC (15 years, 11 months ago) by niro
File size: 2274 byte(s)
-ver bump to 2.6.25-magellan-r1:
- linux-2.6.25.4
- fbcondecor-0.9.4
- squashfs-3.3
- unionfs-2.3.3
- tuxonice-3.0-rc7
- linux-phc-0.3.0
- acpi-dstd-0.9a
- reiser4
- xen-3.2.0
. ipw3945-1.2.2

1 From ff331648798c6d057c6d1863b94d7f294680f811 Mon Sep 17 00:00:00 2001
2 From: Eduardo Habkost <ehabkost@redhat.com>
3 Date: Mon, 11 Feb 2008 12:00:28 -0200
4 Subject: [PATCH] Implement some xen callbacks on xen/entry_64.S
5
6 hypervisor callback and failsafe callback. Not tested yet.
7
8 Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
9 ---
10 arch/x86/xen/entry_64.S | 44 +++++++++++++++++++++++++++++++++++++++++++-
11 1 files changed, 43 insertions(+), 1 deletions(-)
12
13 diff --git a/arch/x86/xen/entry_64.S b/arch/x86/xen/entry_64.S
14 index c8c1473..927108c 100644
15 --- a/arch/x86/xen/entry_64.S
16 +++ b/arch/x86/xen/entry_64.S
17 @@ -1 +1,43 @@
18 -#error foo
19 +ENTRY(xen_hypervisor_callback)
20 + zeroentry do_hypervisor_callback
21 +ENDPROC(xen_hypervisor_callback)
22 +
23 +ENTRY(xen_failsafe_callback)
24 + /*FIXME: implement me! */
25 + ud2a
26 +ENDPROC(xen_failsafe_callback)
27 +
28 +
29 +/*
30 + * Copied from arch/xen/i386/kernel/entry.S
31 + */
32 +# A note on the "critical region" in our callback handler.
33 +# We want to avoid stacking callback handlers due to events occurring
34 +# during handling of the last event. To do this, we keep events disabled
35 +# until we've done all processing. HOWEVER, we must enable events before
36 +# popping the stack frame (can't be done atomically) and so it would still
37 +# be possible to get enough handler activations to overflow the stack.
38 +# Although unlikely, bugs of that kind are hard to track down, so we'd
39 +# like to avoid the possibility.
40 +# So, on entry to the handler we detect whether we interrupted an
41 +# existing activation in its critical region -- if so, we pop the current
42 +# activation and restart the handler using the previous one.
43 +ENTRY(do_hypervisor_callback) # do_hypervisor_callback(struct *pt_regs)
44 + CFI_STARTPROC
45 +# Since we don't modify %rdi, evtchn_do_upall(struct *pt_regs) will
46 +# see the correct pointer to the pt_regs
47 + movq %rdi, %rsp # we don't return, adjust the stack frame
48 + CFI_ENDPROC
49 + CFI_DEFAULT_STACK
50 +11: incl %gs:pda_irqcount
51 + movq %rsp,%rbp
52 + CFI_DEF_CFA_REGISTER rbp
53 + cmovzq %gs:pda_irqstackptr,%rsp
54 + pushq %rbp # backlink for old unwinder
55 + call xen_evtchn_do_upcall
56 + popq %rsp
57 + CFI_DEF_CFA_REGISTER rsp
58 + decl %gs:pda_irqcount
59 + jmp error_exit
60 + CFI_ENDPROC
61 +END(do_hypervisor_callback)
62 --
63 1.5.4.1
64