Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752065AbcKFS7u (ORCPT ); Sun, 6 Nov 2016 13:59:50 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:40398 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751221AbcKFS7T (ORCPT ); Sun, 6 Nov 2016 13:59:19 -0500 Subject: Re: [PATCH 1/3] powerpc: Emulation support for load/store instructions on LE To: Anton Blanchard , Michael Ellerman References: <1478076783-2872-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com> <1478076783-2872-2-git-send-email-ravi.bangoria@linux.vnet.ibm.com> <20161103080412.68240cda@kryten> <581ACDF2.1010409@linux.vnet.ibm.com> <8737j8opwb.fsf@concordia.ellerman.id.au> <581B110F.9050805@linux.vnet.ibm.com> <581C1D32.50108@linux.vnet.ibm.com> <20161106063151.3ef04e9e@kryten> Cc: Andrew Donnellan , chris@distroguy.com, aneesh.kumar@linux.vnet.ibm.com, ast@kernel.org, linux-kernel@vger.kernel.org, oss@buserror.net, paul.gortmaker@windriver.com, duwe@lst.de, lsorense@csclub.uwaterloo.ca, bauerman@linux.vnet.ibm.com, oohall@gmail.com, naveen.n.rao@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org, paulus@samba.org, viro@zeniv.linux.org.uk, Ravi Bangoria From: Ravi Bangoria Date: Mon, 7 Nov 2016 00:29:04 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20161106063151.3ef04e9e@kryten> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16110618-0016-0000-0000-00000517AEDE X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006035; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000189; SDB=6.00777392; UDB=6.00374240; IPR=6.00554664; BA=6.00004857; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013221; XFM=3.00000011; UTC=2016-11-06 18:59:17 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16110618-0017-0000-0000-0000346699BE Message-Id: <581F7D78.1040008@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-06_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611060361 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1736 Lines: 54 On Sunday 06 November 2016 01:01 AM, Anton Blanchard wrote: > Hi, > >> kprobe, uprobe, hw-breakpoint and xmon are the only user of >> emulate_step. >> >> Kprobe / uprobe single-steps instruction if they can't emulate it, so >> there is no problem with them. As I mention, hw-breakpoint is broken. >> However I'm not sure about xmon, I need to check that. > I was mostly concerned that it would impact kprobes. Sounds like we are > ok there. > >> So yes, there is no user-visible feature that depends on this. > Aren't hardware breakpoints exposed via perf? I'd call perf > user-visible. Thanks Anton, That's a good catch. I tried this on ppc64le: $ sudo cat /proc/kallsyms | grep pid_max c00000000116998c D pid_max $ sudo ./perf record -a --event=mem:0xc00000000116998c sleep 10 Before patch: It does not record any data and throws below warning. $ dmesg [ 817.895573] Unable to handle hardware breakpoint. Breakpoint at 0xc00000000116998c will be disabled. [ 817.895581] ------------[ cut here ]------------ [ 817.895588] WARNING: CPU: 24 PID: 2032 at arch/powerpc/kernel/hw_breakpoint.c:277 hw_breakpoint_handler+0x124/0x230 ... After patch: It records data properly. $ sudo ./perf report --stdio ... # Samples: 36 of event 'mem:0xc00000000116998c' # Event count (approx.): 36 # # Overhead Command Shared Object Symbol # ........ ............. ................ ............. # 63.89% kdumpctl [kernel.vmlinux] [k] alloc_pid 27.78% opal_errd [kernel.vmlinux] [k] alloc_pid 5.56% kworker/u97:4 [kernel.vmlinux] [k] alloc_pid 2.78% systemd [kernel.vmlinux] [k] alloc_pid -Ravi