[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20080422131226.GA20591@Krystal>
Date: Tue, 22 Apr 2008 09:12:26 -0400
From: Mathieu Desnoyers <compudj@...stal.dyndns.org>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: Pavel Machek <pavel@....cz>, mingo@...e.hu, akpm@...l.org,
Jeremy Fitzhardinge <jeremy@...p.org>,
Steven Rostedt <rostedt@...dmis.org>,
"Frank Ch. Eigler" <fche@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH] x86 NMI-safe INT3 and Page Fault (v5)
* H. Peter Anvin (hpa@...or.com) wrote:
> Mathieu Desnoyers wrote:
>> * H. Peter Anvin (hpa@...or.com) wrote:
>>> Pavel Machek wrote:
>>>>> There is also the page fault case. I think putting this test in
>>>>> ret_from_exception would be both safe (it is executed for any
>>>>> exception return) and fast (exceptions are rare).
>>>> Eh? I thought that page fault is one of the hottest paths in kernel
>>>> (along with syscall and packet receive/send)...
>>>> Pavel
>> On x86_64, we can pinpoint only the page faults returning to the kernel,
>> which are rare and only caused by vmalloc accesses. Ideally we could do
>> the same on x86_32.
>
> Pinpoint, how? Ultimately you need a runtime test, and you better be
> showing that people are going to die unless before you add a cycle to the
> page fault path. I'm only slightly exaggerating that.
>
On x86_32, ret_from_exception identifies the return path taken to return
from an exception. By dulicating the check_userspace code both in the
ret_from_intr and in the ret_from_exception (that's only 4
instructions), we can know if we are in the specific condition of
returning to the kernel from an exception without any supplementary
test. Therefore, we can do the nmi nesting test only in the specific
return-to-kernel-from-exception case without slowing down any critical
code.
Something similar is done on x86_64. That will appear in my next
version.
Thanks,
Mathieu
> -hpa
>
--
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists