Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Protect IDT table with a spinlock
Kevin Pedretti [Tue, 21 Oct 2008 22:03:46 +0000 (17:03 -0500)]
kitten/arch/x86_64/kernel/interrupts.c
kitten/include/arch-x86_64/ptrace.h

index a62c106..7441829 100644 (file)
@@ -10,9 +10,8 @@
 #include <arch/xcall.h>
 #include <arch/i387.h>
 
-typedef void (*idtvec_handler_t)(struct pt_regs *regs, unsigned int vector);
-
 idtvec_handler_t idtvec_table[NUM_IDT_ENTRIES];
+static DEFINE_SPINLOCK(idtvec_table_lock);
 
 extern void asm_idtvec_table(void);
 
@@ -220,11 +219,12 @@ do_apic_spurious(struct pt_regs *regs, unsigned int vector)
        while (1) {}
 }
 
-void __init
+void
 set_idtvec_handler(unsigned int vector, idtvec_handler_t handler)
 {
        char namebuf[KSYM_NAME_LEN+1];
        unsigned long symsize, offset;
+       unsigned long irqstate;
 
        ASSERT(vector < NUM_IDT_ENTRIES);
 
@@ -235,7 +235,9 @@ set_idtvec_handler(unsigned int vector, idtvec_handler_t handler)
                );
        }
 
+       spin_lock_irqsave(&idtvec_table_lock, irqstate);
        idtvec_table[vector] = handler;
+       spin_unlock_irqrestore(&idtvec_table_lock, irqstate);
 }
 
 void
index e57c4f4..19f91d9 100644 (file)
@@ -116,6 +116,10 @@ enum {
         EF_ID   = 0x00200000,   /* id */
 };
 
+/* TODO: remove this */
+typedef void (*idtvec_handler_t)(struct pt_regs *regs, unsigned int vector);
+void set_idtvec_handler(unsigned int vector, idtvec_handler_t handler);
+
 #endif
 
 #endif