Re: [git pull] kgdb light, v5

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jan Kiszka <jan.kiszka@...>
Cc: Ray Lee <ray-lk@...>, Ingo Molnar <mingo@...>, Sam Ravnborg <sam@...>, <linux-kernel@...>, Andrew Morton <akpm@...>, Thomas Gleixner <tglx@...>, Jason Wessel <jason.wessel@...>
Date: Sunday, February 10, 2008 - 3:44 pm

On Sun, 10 Feb 2008, Jan Kiszka wrote:

Ok, so this is a pretty function after all the cleanups, but I actually 
don't think that "if ((unsigned long)addr < TASK_SIZE)" is really even 
asked for.

Why not let kgdb look at user memory? I'd argue that in a lot of cases, it 
might be quite nice to do, to see what user arguments in memory are etc 
etc (think things like futexes, where user memory contents really do 
matter).

So I'd suggest getting rid of the whole "kgdb_{get|set}_mem()" functions, 
and just using "probe_kernel_{read|write}()" directly instead.

(Not that I necessarily love those names either, but whatever..)

The TASK_SIZE checks make more sense in kgdb_validate_break_address() and 
friends, where it actually does make sense to check that it's really a 
*kernel* address.

But even there, I'm not sure if the right check is to compare against 
TASK_SIZE, since kernel and user memory addresses can in theory be 
distinct (that's why we have "set_fs()" historically, and while it's no 
longer true on x86 and hasn't been in a long time, the kernel conceptually 
allows it - see my previous reply about that whole get_fs/set_fs thing in 
the definition of probe_kernel_read/write).


There's absolutely no reason to care about the alignment, since if you now 
use "probe_kernel_read()", the sane thing to do is to just do

	err = probe_kernel_read(tmp, mem, count);
	if (!err) {
		while (count > 0) {
			buf = pack_hex_byte(buf, *tmp);
			tmp++;
			count--;
	}

and you're all done. No?

		Linus
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[0/6] kgdb light, Ingo Molnar, (Sun Feb 10, 3:13 am)
Re: [0/6] kgdb light, Sam Ravnborg, (Sun Feb 10, 6:47 am)
[git pull] kgdb light, v5, Ingo Molnar, (Sun Feb 10, 12:36 pm)
Re: [git pull] kgdb light, v5, Sam Ravnborg, (Sun Feb 10, 3:34 pm)
Re: [git pull] kgdb light, v5, Ray Lee, (Sun Feb 10, 1:30 pm)
Re: [git pull] kgdb light, v5, Jan Kiszka, (Sun Feb 10, 2:53 pm)
Re: [git pull] kgdb light, v5, Linus Torvalds, (Sun Feb 10, 3:44 pm)
Re: [git pull] kgdb light, v5, Ingo Molnar, (Sun Feb 10, 4:29 pm)
Re: [git pull] kgdb light, v5, Ingo Molnar, (Sun Feb 10, 4:41 pm)
Re: [git pull] kgdb light, v5, Jan Kiszka, (Sun Feb 10, 4:22 pm)
Re: [git pull] kgdb light, v5, Ingo Molnar, (Sun Feb 10, 5:13 pm)
Re: [git pull] kgdb light, v5, Ingo Molnar, (Sun Feb 10, 4:19 pm)
Re: [git pull] kgdb light, v5, Ingo Molnar, (Sun Feb 10, 3:34 pm)
Re: [git pull] kgdb light, v5, Jan Kiszka, (Sun Feb 10, 1:39 pm)
Re: [git pull] kgdb light, v5, Ray Lee, (Sun Feb 10, 2:59 pm)
Re: [0/6] kgdb light, Jan Kiszka, (Sun Feb 10, 9:25 am)
Re: [0/6] kgdb light, Sam Ravnborg, (Sun Feb 10, 3:31 pm)
Re: [0/6] kgdb light, Ingo Molnar, (Sun Feb 10, 5:16 pm)
Re: [0/6] kgdb light, Sam Ravnborg, (Sun Feb 10, 5:30 pm)
Re: [0/6] kgdb light, Ingo Molnar, (Sun Feb 10, 5:34 pm)
Re: [0/6] kgdb light, Jan Kiszka, (Sun Feb 10, 4:23 pm)
Re: [0/6] kgdb light, David Miller, (Sun Feb 10, 3:37 am)