Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1605927ybi; Thu, 20 Jun 2019 00:21:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/ODbthQppXny4bE/y/FUFs6xfYHj8X13xUVMFGq8oOv3Q+Mp3jWizWpbAtqetswiZaVvf X-Received: by 2002:a62:8c81:: with SMTP id m123mr13675767pfd.240.1561015270439; Thu, 20 Jun 2019 00:21:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561015270; cv=none; d=google.com; s=arc-20160816; b=lHG62eGw/i0FDkiwZI9bjlaylRSxylzrB1S1jRAz+HWSwbe9e5ZEAOAQa9+q5m6EiK LuwucqG/f49hePtZB53SSEIdvV09qj41RuHNQ5WmC/bdL7nIT9DWbzdswpJ+sUyPfK7c VjEVx0/EgXElHyZeoVlTcxmLs9fja2up9x1kMMZoqy6hyMdfXCNNl7hqotEafDdEiqvB AdD3uU6+DU12gzXYR8WS1CB48VL68tuc0LPZ5GaYQcViXsr2UYi4Xx5oynbHcPoRfRV3 Sn+dWOFKLSjw5Oueedc9K2doy+sMfsXBFylLufmp2kc21FiyqWk9JKcakE45lNWxCshP zQiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=wAqewpyLg9wyfyO+W4xMU0VSpAQed917bo3KrM2+hhA=; b=MS190KT+aJqxeKjdixHugCygUBsE4fQVE3urFt9BU74akNf6UWK2XBl+uVKCe9BxHm pJpAb33aYclG2/EaCVn9vmr24huEOmq3yfaZfrROfr8VrEgtUeGxCbQGNfqlTFf9zwFR LchgEvqvWlDlpYyO+c93ixB424q1XL63lTjawGA7VafMxBUTbxbDBipq7KX1ZSYTg86f V19jkyd7F7HK5N5Zmv4N+J5YJIfmR/q5YCJ28R9ICANI34cjlbKAqSkSzkxeyMr6mvNR xtr0NLh7BgRBgiOZoPDJDxsHGiN7rtBFI1xe0VICglptqU/swTVNrSgu/rysVXCB3Ay+ KLYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fyBYqmEq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w21si19069142pff.263.2019.06.20.00.20.54; Thu, 20 Jun 2019 00:21:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fyBYqmEq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726519AbfFTHTV (ORCPT + 99 others); Thu, 20 Jun 2019 03:19:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:49292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725875AbfFTHTV (ORCPT ); Thu, 20 Jun 2019 03:19:21 -0400 Received: from devnote2 (113x40x119x170.ap113.ftth.ucom.ne.jp [113.40.119.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 81DA02084A; Thu, 20 Jun 2019 07:19:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561015160; bh=ditT581I77m/ZbUu7CLuX7DQIEDwZUnG/8oeauPi0io=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=fyBYqmEqZeklNLUnmdmPM/4625Mcbao07QGNIYQw5knhEZK8wIHjcm8xUL4RmnX0r PMnegxpi1BIQAjhCwgTuEYSEaa/KbTsng4M1dGIJ9/yq3pToiPLhZ1loMNuNQ0OZTt fyFz0fNafXWDnlMWBNAdXCvQrux1gSBdpWnS1k4c= Date: Thu, 20 Jun 2019 16:19:17 +0900 From: Masami Hiramatsu To: Vineet Gupta Cc: , , Eugeniy Paltsev , Anshuman Khandual , Fenghua Yu , arcml , "Masami Hiramatsu" Subject: Re: [PATCH] mm: Generalize and rename notify_page_fault() as kprobe_page_fault() Message-Id: <20190620161917.a713ea0ff38fa18a2c6f05c2@kernel.org> In-Reply-To: <8b184218-6880-204e-a9dd-e627c5ca92ca@synopsys.com> References: <1560420444-25737-1-git-send-email-anshuman.khandual@arm.com> <8b184218-6880-204e-a9dd-e627c5ca92ca@synopsys.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tue, 18 Jun 2019 08:56:33 -0700 Vineet Gupta wrote: > +CC Masami San, Eugeniy > > On 6/13/19 10:57 AM, Vineet Gupta wrote: > > > > On 6/13/19 3:07 AM, Anshuman Khandual wrote: > >> Questions: > >> > >> AFAICT there is no equivalent of erstwhile notify_page_fault() during page > >> fault handling in arc and mips archs which can call this generic function. > >> Please let me know if that is not the case. > > > > For ARC do_page_fault() is entered for MMU exceptions (TLB Miss, access violations > > r/w/x etc). kprobes uses a combination of UNIMP_S and TRAP_S instructions which > > don't funnel into do_page_fault(). > > > > UINMP_S leads to > > > > instr_service > > do_insterror_or_kprobe > > notify_die(DIE_IERR) > > kprobe_exceptions_notify > > arc_kprobe_handler > > > > > > TRAP_S 2 leads to > > > > EV_Trap > > do_non_swi_trap > > trap_is_kprobe > > notify_die(DIE_TRAP) > > kprobe_exceptions_notify > > arc_post_kprobe_handler > > > > But indeed we are *not* calling into kprobe_fault_handler() - from eithet of those > > paths and not sure if the existing arc*_kprobe_handler() combination does the > > equivalent in tandem. Interesting, it seems that the kprobe_fault_handler() has never been called. Anyway, it is used for handling a page fault in kprobe's user handler or single stepping. And a page fault in user handler will not hard to fix up. Only a hard case is a page fault in single stepping. If ARC's kprobes using single-stepping on copied buffer, it may crashes kernel, since fixup code can not find correct address without kprobe_fault_handler. Thank you, > > @Eugeniy can you please investigate this - do we have krpobes bit rot in ARC port. > > -Vineet > > -- Masami Hiramatsu