From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753491AbcGVSST (ORCPT ); Fri, 22 Jul 2016 14:18:19 -0400 Received: from www.sr71.net ([198.145.64.142]:42585 "EHLO blackbird.sr71.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752037AbcGVSSS (ORCPT ); Fri, 22 Jul 2016 14:18:18 -0400 Subject: Re: [PATCH 2/3] x86: add some better documentation for probe_kernel_address() To: Andy Lutomirski References: <20160722180310.99F5BCFF@viggo.jf.intel.com> <20160722180313.59F73015@viggo.jf.intel.com> Cc: "linux-kernel@vger.kernel.org" , X86 ML , Dave Hansen From: Dave Hansen Message-ID: <57926365.5040307@sr71.net> Date: Fri, 22 Jul 2016 11:18:13 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/22/2016 11:10 AM, Andy Lutomirski wrote: > On Jul 22, 2016 11:03 AM, "Dave Hansen" wrote: >> From: Dave Hansen >> >> 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.