linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wessel <jason.wessel@windriver.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org,
	kgdb-bugreport@lists.sourceforge.net, kdb@oss.sgi.com,
	mingo@elte.hu, mort@sgi.com, linux-arch@vger.kernel.org
Subject: Re: [PATCH 05/37] kdb: core for kgdb back end
Date: Thu, 24 Dec 2009 05:55:20 -0600	[thread overview]
Message-ID: <4B3356A8.4020901@windriver.com> (raw)
In-Reply-To: <1261652509.4937.185.camel@laptop>

Peter Zijlstra wrote:

> On Wed, 2009-12-23 at 15:19 -0600, Jason Wessel wrote:
>   
>> diff --git a/kernel/module.c b/kernel/module.c
>> index e96b8ed..25f6a7b 100644
>> --- a/kernel/module.c
>> +++ b/kernel/module.c
>> @@ -79,6 +80,10 @@ EXPORT_TRACEPOINT_SYMBOL(module_get);
>>  DEFINE_MUTEX(module_mutex);
>>  EXPORT_SYMBOL_GPL(module_mutex);
>>  static LIST_HEAD(modules);
>> +#ifdef CONFIG_KGDB_KDB
>> +struct list_head *kdb_modules = &modules; /* kdb needs the list of
>> modules */
>> +#endif /* CONFIG_KGDB_KDB */
>> +
>>     

Above we export "modules" so that kdb can emulate lsmod.


The remainder was a port from the original kdb, and should not been
needed.  The preempt_disable and preempt_enable should be able to be
safely called while the system in the kgdb exception context, so this
chunk of code is going to get axed and re-tested.

Thanks,
Jason.

>>  
>>  /* Block module loading/unloading? */
>>  int modules_disabled = 0;
>> @@ -2654,8 +2659,14 @@ int module_get_kallsym(unsigned int symnum,
>> unsigned long *value, char *type,
>>                         char *name, char *module_name, int *exported)
>>  {
>>         struct module *mod;
>> +#ifdef CONFIG_KGDB_KDB
>> +       int get_lock = !KDB_IS_RUNNING();
>> +#else
>> +#define        get_lock 1
>> +#endif
>>  
>> -       preempt_disable();
>> +       if (get_lock)
>> +               preempt_disable();
>>         list_for_each_entry_rcu(mod, &modules, list) {
>>                 if (symnum < mod->num_symtab) {
>>                         *value = mod->symtab[symnum].st_value;
>> @@ -2664,12 +2675,14 @@ int module_get_kallsym(unsigned int symnum,
>> unsigned long *value, char *type,
>>                                 KSYM_NAME_LEN);
>>                         strlcpy(module_name, mod->name,
>> MODULE_NAME_LEN);
>>                         *exported = is_exported(name, *value, mod);
>> -                       preempt_enable();
>> +                       if (get_lock)
>> +                               preempt_enable();
>>                         return 0;
>>                 }
>>                 symnum -= mod->num_symtab;
>>         }
>> -       preempt_enable();
>> +       if (get_lock)
>> +               preempt_enable();
>>         return -ERANGE;
>>  }
>>     

  parent reply	other threads:[~2009-12-24 11:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1261603190-5036-1-git-send-email-jason.wessel@windriver.com>
     [not found] ` <1261603190-5036-2-git-send-email-jason.wessel@windriver.com>
     [not found]   ` <1261603190-5036-3-git-send-email-jason.wessel@windriver.com>
     [not found]     ` <1261603190-5036-4-git-send-email-jason.wessel@windriver.com>
     [not found]       ` <1261603190-5036-5-git-send-email-jason.wessel@windriver.com>
2009-12-23 21:19         ` [PATCH 05/37] kdb: core for kgdb back end Jason Wessel
2009-12-24  1:28           ` Andi Kleen
2009-12-28 22:36             ` Jason Wessel
2009-12-28 23:37               ` Andi Kleen
2009-12-24 11:01           ` Peter Zijlstra
2009-12-24 11:16             ` Peter Zijlstra
2009-12-24 15:57               ` Jason Wessel
2009-12-26 21:34                 ` Mike Frysinger
2009-12-24 11:55             ` Jason Wessel [this message]
2009-12-24 11:55               ` Jason Wessel
2009-12-24 12:01               ` Peter Zijlstra
2009-12-24 11:04           ` Peter Zijlstra
2009-12-28 16:33             ` Jason Wessel
2009-12-28 16:55               ` Peter Zijlstra
2009-12-28 17:15                 ` Jason Wessel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B3356A8.4020901@windriver.com \
    --to=jason.wessel@windriver.com \
    --cc=kdb@oss.sgi.com \
    --cc=kgdb-bugreport@lists.sourceforge.net \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mort@sgi.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).