[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrW6wDRMYohRwqg1eOVneSF5_gk3ZQtGDnuBtnja6oknsw@mail.gmail.com>
Date: Fri, 22 Jul 2016 11:22:46 -0700
From: Andy Lutomirski <luto@...capital.net>
To: Dave Hansen <dave@...1.net>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
X86 ML <x86@...nel.org>,
Dave Hansen <dave.hansen@...ux.intel.com>
Subject: Re: [PATCH 2/3] x86: add some better documentation for probe_kernel_address()
On Fri, Jul 22, 2016 at 11:18 AM, Dave Hansen <dave@...1.net> wrote:
> On 07/22/2016 11:10 AM, Andy Lutomirski wrote:
>> On Jul 22, 2016 11:03 AM, "Dave Hansen" <dave@...1.net> wrote:
>>> From: Dave Hansen <dave.hansen@...ux.intel.com>
>>>
>>> probe_kernel_address() has an unfortunate name since it is used
>>> to probe kernel *and* userspace addresses. Add a comment
>>> explaining some of the situation to help the next developer who
>>> might make the silly assumption that it is for probing kernel
>>> addresses.
>>
>> This can't work on architectures like s390 that have separate,
>> overlapping user and kernel address spaces. Maybe we should fix x86
>> to stop abusing it and use get_user instead. (In which case, your new
>> function should be called get_user_insn_byte or similar.)
>
> Urg.
>
> But can't the x86 use in no_context() be called from a kernel-initiated
> fault? Like a prefetch instruction to a vmalloc() page that we needed
> to do a vmalloc fault for?
>
> In either case, it would be awfully nice to have the clarity about
> exactly what is being probed. The other 2 calls to is_prefetch() do
> appear to be userspace-only.
Indeed.
Perhaps we should pass a bool is_kernel into is_prefetch().
--Andy
--
Andy Lutomirski
AMA Capital Management, LLC
Powered by blists - more mailing lists