From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753831AbdBNLgv (ORCPT ); Tue, 14 Feb 2017 06:36:51 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:48404 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753141AbdBNLgO (ORCPT ); Tue, 14 Feb 2017 06:36:14 -0500 Subject: Re: [PATCH v3 1/2] powerpc: Emulation support for load/store instructions on LE To: Michael Ellerman References: <1487063803-10848-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com> <1487063803-10848-2-git-send-email-ravi.bangoria@linux.vnet.ibm.com> <87d1elm5uu.fsf@concordia.ellerman.id.au> Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, benh@kernel.crashing.org, paulus@samba.org, lsorense@csclub.uwaterloo.ca, oohall@gmail.com, naveen.n.rao@linux.vnet.ibm.com, ast@kernel.org, chris@distroguy.com, aneesh.kumar@linux.vnet.ibm.com, bsingharora@gmail.com, anton@samba.org, paul.gortmaker@windriver.com, bauerman@linux.vnet.ibm.com, viro@zeniv.linux.org.uk, christophe.leroy@c-s.fr, duwe@lst.de, oss@buserror.net, Ravi Bangoria From: Ravi Bangoria Date: Tue, 14 Feb 2017 17:05:57 +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: <87d1elm5uu.fsf@concordia.ellerman.id.au> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17021411-0028-0000-0000-0000070B023B X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006614; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000203; SDB=6.00821780; UDB=6.00401955; IPR=6.00599234; BA=6.00005135; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014278; XFM=3.00000011; UTC=2017-02-14 11:36:12 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17021411-0029-0000-0000-0000338F2143 Message-Id: <58A2EB9D.4080506@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-02-14_07:,, 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-1612050000 definitions=main-1702140116 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks Michael, On Tuesday 14 February 2017 03:50 PM, Michael Ellerman wrote: > Ravi Bangoria writes: > >> emulate_step() uses a number of underlying kernel functions that were >> initially not enabled for LE. This has been rectified since. > When exactly? ie. which commit. I found couple of commits: 6506b4718b ("powerpc: Fix Unaligned Loads and Stores") dbc2fbd7c2 ("powerpc: Fix Unaligned LE Floating Point Loads and Stores") There may be more. Patch2 is to test emulate_step() for basic load/store instructions and it seems to be working fine on LE. > > Should we backport this? ie. is it actually a bug people are hitting in > the real world much? Yes, we should backport this. kernel-space hw-breakpoint feature is broken on LE without this. This is 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 > > cheers >