aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2004-08-09 12:12:59 +0000
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2004-08-09 12:12:59 +0000
commit8fed8fe5a02c49a0846c45813e942f121221f1e3 (patch)
tree0f30345df979b36caa5e35a1408e9700c8427ec4
parent99a0431ec98ad31cbcea034c8e5c2d6dabc11f04 (diff)
downloadxen-8fed8fe5a02c49a0846c45813e942f121221f1e3.tar.gz
xen-8fed8fe5a02c49a0846c45813e942f121221f1e3.tar.bz2
xen-8fed8fe5a02c49a0846c45813e942f121221f1e3.zip
bitkeeper revision 1.1159.8.1 (41176a4bLElcLg3fxcgHsObA3Tdk8w)
Clean up synchronous 'event-channel callbacks' so that do_IRQ() is always called with a valid pt_regs pointer.
-rw-r--r--.rootkeys2
-rw-r--r--linux-2.4.26-xen-sparse/include/asm-xen/processor.h3
-rw-r--r--linux-2.4.26-xen-sparse/include/asm-xen/ptrace.h63
-rw-r--r--linux-2.4.26-xen-sparse/include/asm-xen/system.h6
-rwxr-xr-xlinux-2.4.26-xen-sparse/mkbuildtree2
-rw-r--r--linux-2.6.7-xen-sparse/arch/xen/kernel/evtchn.c10
-rw-r--r--linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/ptrace.h62
-rw-r--r--linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/system.h6
-rw-r--r--linux-2.6.7-xen-sparse/include/asm-xen/evtchn.h5
9 files changed, 23 insertions, 136 deletions
diff --git a/.rootkeys b/.rootkeys
index 8cdac7d9ab..bdeeb555d1 100644
--- a/.rootkeys
+++ b/.rootkeys
@@ -103,7 +103,6 @@
3e5a4e67X7JyupgdYkgDX19Huj2sAw linux-2.4.26-xen-sparse/include/asm-xen/pgtable-2level.h
3e5a4e67gr4NLGtQ5CvSLimMYZlkOA linux-2.4.26-xen-sparse/include/asm-xen/pgtable.h
3e5a4e676uK4xErTBDH6XJREn9LSyg linux-2.4.26-xen-sparse/include/asm-xen/processor.h
-3e5a4e67AJPjW-zL7p-xWuA6IVeH1g linux-2.4.26-xen-sparse/include/asm-xen/ptrace.h
3e5a4e68uJz-xI0IBVMD7xRLQKJDFg linux-2.4.26-xen-sparse/include/asm-xen/segment.h
3e5a4e68Nfdh6QcOKUTGCaYkf2LmYA linux-2.4.26-xen-sparse/include/asm-xen/smp.h
4062f7e2PzFOUGT0PaE7A0VprTU3JQ linux-2.4.26-xen-sparse/include/asm-xen/synch_bitops.h
@@ -222,7 +221,6 @@
40f5623aEToIXouJgO-ao5d5pcEt1w linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h
40f5623aCCXRPlGpNthVXstGz9ZV3A linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/pgtable.h
40f5623aPCkQQfPtJSooGdhcatrvnQ linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/processor.h
-40f5623bvhcUmESJrtcII6Bmd61b3w linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/ptrace.h
40f5623bzLvxr7WoJIxVf2OH4rCBJg linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/segment.h
40f5623bG_LzgG6-qwk292nTc5Wabw linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/setup.h
40f5623bgzm_9vwxpzJswlAxg298Gg linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/synch_bitops.h
diff --git a/linux-2.4.26-xen-sparse/include/asm-xen/processor.h b/linux-2.4.26-xen-sparse/include/asm-xen/processor.h
index 2b290252be..9036704e23 100644
--- a/linux-2.4.26-xen-sparse/include/asm-xen/processor.h
+++ b/linux-2.4.26-xen-sparse/include/asm-xen/processor.h
@@ -7,6 +7,7 @@
#ifndef __ASM_I386_PROCESSOR_H
#define __ASM_I386_PROCESSOR_H
+#include <asm/vm86.h>
#include <asm/math_emu.h>
#include <asm/segment.h>
#include <asm/page.h>
@@ -479,6 +480,4 @@ extern inline void prefetchw(const void *x)
#endif
-#define TF_MASK 0x100
-
#endif /* __ASM_I386_PROCESSOR_H */
diff --git a/linux-2.4.26-xen-sparse/include/asm-xen/ptrace.h b/linux-2.4.26-xen-sparse/include/asm-xen/ptrace.h
deleted file mode 100644
index 4457ac0b17..0000000000
--- a/linux-2.4.26-xen-sparse/include/asm-xen/ptrace.h
+++ /dev/null
@@ -1,63 +0,0 @@
-#ifndef _I386_PTRACE_H
-#define _I386_PTRACE_H
-
-#define EBX 0
-#define ECX 1
-#define EDX 2
-#define ESI 3
-#define EDI 4
-#define EBP 5
-#define EAX 6
-#define DS 7
-#define ES 8
-#define FS 9
-#define GS 10
-#define ORIG_EAX 11
-#define EIP 12
-#define CS 13
-#define EFL 14
-#define UESP 15
-#define SS 16
-#define FRAME_SIZE 17
-
-/* this struct defines the way the registers are stored on the
- stack during a system call. */
-
-struct pt_regs {
- long ebx;
- long ecx;
- long edx;
- long esi;
- long edi;
- long ebp;
- long eax;
- int xds;
- int xes;
- long orig_eax;
- long eip;
- int xcs;
- long eflags;
- long esp;
- int xss;
-};
-
-/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
-#define PTRACE_GETREGS 12
-#define PTRACE_SETREGS 13
-#define PTRACE_GETFPREGS 14
-#define PTRACE_SETFPREGS 15
-#define PTRACE_GETFPXREGS 18
-#define PTRACE_SETFPXREGS 19
-
-#define PTRACE_SETOPTIONS 21
-
-/* options set using PTRACE_SETOPTIONS */
-#define PTRACE_O_TRACESYSGOOD 0x00000001
-
-#ifdef __KERNEL__
-#define user_mode(regs) ((regs) && (2 & (regs)->xcs))
-#define instruction_pointer(regs) ((regs) ? (regs)->eip : NULL)
-extern void show_regs(struct pt_regs *);
-#endif
-
-#endif
diff --git a/linux-2.4.26-xen-sparse/include/asm-xen/system.h b/linux-2.4.26-xen-sparse/include/asm-xen/system.h
index 6a8e352ac5..9be6e291fe 100644
--- a/linux-2.4.26-xen-sparse/include/asm-xen/system.h
+++ b/linux-2.4.26-xen-sparse/include/asm-xen/system.h
@@ -323,7 +323,7 @@ do { \
_shared->vcpu_data[0].evtchn_upcall_mask = 0; \
barrier(); /* unmask then check (avoid races) */ \
if ( unlikely(_shared->vcpu_data[0].evtchn_upcall_pending) ) \
- evtchn_do_upcall(NULL); \
+ force_evtchn_callback(); \
} while (0)
#define __save_flags(x) \
@@ -338,7 +338,7 @@ do { \
if ( (_shared->vcpu_data[0].evtchn_upcall_mask = x) == 0 ) { \
barrier(); /* unmask then check (avoid races) */ \
if ( unlikely(_shared->vcpu_data[0].evtchn_upcall_pending) ) \
- evtchn_do_upcall(NULL); \
+ force_evtchn_callback(); \
} \
} while (0)
@@ -357,7 +357,7 @@ do { \
_shared->vcpu_data[0].evtchn_upcall_mask = 0; \
barrier(); /* unmask then check (avoid races) */ \
if ( unlikely(_shared->vcpu_data[0].evtchn_upcall_pending) ) \
- evtchn_do_upcall(NULL); \
+ force_evtchn_callback(); \
} while (0)
#define local_irq_save(x) __save_and_cli(x)
diff --git a/linux-2.4.26-xen-sparse/mkbuildtree b/linux-2.4.26-xen-sparse/mkbuildtree
index 2e8e20e6a9..8396693b74 100755
--- a/linux-2.4.26-xen-sparse/mkbuildtree
+++ b/linux-2.4.26-xen-sparse/mkbuildtree
@@ -170,6 +170,7 @@ ln -sf ../asm-i386/parport.h
ln -sf ../asm-i386/pgtable-3level.h
ln -sf ../asm-i386/poll.h
ln -sf ../asm-i386/posix_types.h
+ln -sf ../asm-i386/ptrace.h
ln -sf ../asm-i386/resource.h
ln -sf ../asm-i386/rwlock.h
ln -sf ../asm-i386/rwsem.h
@@ -202,6 +203,7 @@ ln -sf ../asm-i386/ucontext.h
ln -sf ../asm-i386/unaligned.h
ln -sf ../asm-i386/unistd.h
ln -sf ../asm-i386/user.h
+ln -sf ../asm-i386/vm86.h
ln -sf ../../${LINUX_26}/include/asm-xen/ctrl_if.h
ln -sf ../../${LINUX_26}/include/asm-xen/evtchn.h
ln -sf ../../${LINUX_26}/include/asm-xen/hypervisor.h
diff --git a/linux-2.6.7-xen-sparse/arch/xen/kernel/evtchn.c b/linux-2.6.7-xen-sparse/arch/xen/kernel/evtchn.c
index 057bd8ab48..06d6ae948e 100644
--- a/linux-2.6.7-xen-sparse/arch/xen/kernel/evtchn.c
+++ b/linux-2.6.7-xen-sparse/arch/xen/kernel/evtchn.c
@@ -46,6 +46,16 @@ extern asmlinkage unsigned int do_IRQ(int irq, struct pt_regs *regs);
#define VALID_EVTCHN(_chn) ((_chn) != -1)
+/*
+ * Force a proper event-channel callback from Xen after clearing the
+ * callback mask. We do this in a very simple manner, by making a call
+ * down into Xen. The pending flag will be checked by Xen on return.
+ */
+void force_evtchn_callback(void)
+{
+ (void)HYPERVISOR_xen_version(0);
+}
+
void evtchn_do_upcall(struct pt_regs *regs)
{
unsigned long l1, l2;
diff --git a/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/ptrace.h b/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/ptrace.h
deleted file mode 100644
index eabe6d3267..0000000000
--- a/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/ptrace.h
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef _I386_PTRACE_H
-#define _I386_PTRACE_H
-
-#define EBX 0
-#define ECX 1
-#define EDX 2
-#define ESI 3
-#define EDI 4
-#define EBP 5
-#define EAX 6
-#define DS 7
-#define ES 8
-#define FS 9
-#define GS 10
-#define ORIG_EAX 11
-#define EIP 12
-#define CS 13
-#define EFL 14
-#define UESP 15
-#define SS 16
-#define FRAME_SIZE 17
-
-/* this struct defines the way the registers are stored on the
- stack during a system call. */
-
-struct pt_regs {
- long ebx;
- long ecx;
- long edx;
- long esi;
- long edi;
- long ebp;
- long eax;
- int xds;
- int xes;
- long orig_eax;
- long eip;
- int xcs;
- long eflags;
- long esp;
- int xss;
-};
-
-/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
-#define PTRACE_GETREGS 12
-#define PTRACE_SETREGS 13
-#define PTRACE_GETFPREGS 14
-#define PTRACE_SETFPREGS 15
-#define PTRACE_GETFPXREGS 18
-#define PTRACE_SETFPXREGS 19
-
-#define PTRACE_OLDSETOPTIONS 21
-
-#define PTRACE_GET_THREAD_AREA 25
-#define PTRACE_SET_THREAD_AREA 26
-
-#ifdef __KERNEL__
-#define user_mode(regs) ((regs) && ((VM_MASK & (regs)->eflags) || (2 & (regs)->xcs)))
-#define instruction_pointer(regs) ((regs)->eip)
-#endif
-
-#endif
diff --git a/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/system.h b/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/system.h
index 05c6fc4abc..920b1c31db 100644
--- a/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/system.h
+++ b/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/system.h
@@ -458,7 +458,7 @@ do { \
_shared->vcpu_data[0].evtchn_upcall_mask = 0; \
barrier(); /* unmask then check (avoid races) */ \
if ( unlikely(_shared->vcpu_data[0].evtchn_upcall_pending) ) \
- evtchn_do_upcall(NULL); \
+ force_evtchn_callback(); \
} while (0)
#define __save_flags(x) \
@@ -473,7 +473,7 @@ do { \
if ( (_shared->vcpu_data[0].evtchn_upcall_mask = (x)) == 0 ) { \
barrier(); /* unmask then check (avoid races) */ \
if ( unlikely(_shared->vcpu_data[0].evtchn_upcall_pending) ) \
- evtchn_do_upcall(NULL); \
+ force_evtchn_callback(); \
} \
} while (0)
@@ -494,7 +494,7 @@ do { \
_shared->vcpu_data[0].evtchn_upcall_mask = 0; \
barrier(); /* unmask then check (avoid races) */ \
if ( unlikely(_shared->vcpu_data[0].evtchn_upcall_pending) ) \
- evtchn_do_upcall(NULL); \
+ force_evtchn_callback(); \
} while (0)
#define local_irq_save(x) __save_and_cli(x)
diff --git a/linux-2.6.7-xen-sparse/include/asm-xen/evtchn.h b/linux-2.6.7-xen-sparse/include/asm-xen/evtchn.h
index 7949b6e088..d4c43ee91d 100644
--- a/linux-2.6.7-xen-sparse/include/asm-xen/evtchn.h
+++ b/linux-2.6.7-xen-sparse/include/asm-xen/evtchn.h
@@ -20,6 +20,9 @@
* LOW-LEVEL DEFINITIONS
*/
+/* Force a proper event-channel callback from Xen. */
+void force_evtchn_callback(void);
+
/* Entry point for notifications into Linux subsystems. */
void evtchn_do_upcall(struct pt_regs *regs);
@@ -47,7 +50,7 @@ static inline void unmask_evtchn(int port)
{
s->vcpu_data[0].evtchn_upcall_pending = 1;
if ( !s->vcpu_data[0].evtchn_upcall_mask )
- evtchn_do_upcall(NULL);
+ force_evtchn_callback();
}
}