KVM: MMU: invalidate and flush on spte small->large page size change
[safe/jmp/linux-2.6] / kernel / kallsyms.c
index 3a29dbe..6f6d091 100644 (file)
 #include <linux/init.h>
 #include <linux/seq_file.h>
 #include <linux/fs.h>
+#include <linux/kdb.h>
 #include <linux/err.h>
 #include <linux/proc_fs.h>
 #include <linux/sched.h>       /* for cond_resched */
 #include <linux/mm.h>
 #include <linux/ctype.h>
+#include <linux/slab.h>
 
 #include <asm/sections.h>
 
@@ -59,7 +61,8 @@ static inline int is_kernel_inittext(unsigned long addr)
 
 static inline int is_kernel_text(unsigned long addr)
 {
-       if (addr >= (unsigned long)_stext && addr <= (unsigned long)_etext)
+       if ((addr >= (unsigned long)_stext && addr <= (unsigned long)_etext) ||
+           arch_is_kernel_text(addr))
                return 1;
        return in_gate_area_no_task(addr);
 }
@@ -180,6 +183,7 @@ unsigned long kallsyms_lookup_name(const char *name)
        }
        return module_kallsyms_lookup_name(name);
 }
+EXPORT_SYMBOL_GPL(kallsyms_lookup_name);
 
 int kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module *,
                                      unsigned long),
@@ -513,6 +517,26 @@ static int kallsyms_open(struct inode *inode, struct file *file)
        return ret;
 }
 
+#ifdef CONFIG_KGDB_KDB
+const char *kdb_walk_kallsyms(loff_t *pos)
+{
+       static struct kallsym_iter kdb_walk_kallsyms_iter;
+       if (*pos == 0) {
+               memset(&kdb_walk_kallsyms_iter, 0,
+                      sizeof(kdb_walk_kallsyms_iter));
+               reset_iter(&kdb_walk_kallsyms_iter, 0);
+       }
+       while (1) {
+               if (!update_iter(&kdb_walk_kallsyms_iter, *pos))
+                       return NULL;
+               ++*pos;
+               /* Some debugging symbols have no name.  Ignore them. */
+               if (kdb_walk_kallsyms_iter.name[0])
+                       return kdb_walk_kallsyms_iter.name;
+       }
+}
+#endif /* CONFIG_KGDB_KDB */
+
 static const struct file_operations kallsyms_operations = {
        .open = kallsyms_open,
        .read = seq_read,