Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp472178pxk; Thu, 17 Sep 2020 07:55:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVYhPI0tuS0LDBp2P4o+6gXpZzA/9Rt3svFG7x6rvGZapfrZ3LZ31SFEFVAPrxpzkl1vGN X-Received: by 2002:a17:906:4819:: with SMTP id w25mr30916196ejq.300.1600354521233; Thu, 17 Sep 2020 07:55:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600354521; cv=none; d=google.com; s=arc-20160816; b=AjFWrlCiYl/ITPYksRHuoShwKVQtk+PXIfoy+AADr4DEM2sMqdG8qCwcoooP/a4njN v7n9cchvUUU7ANKJorMgJdpY8x/xxrGAS4ZMrPAdRIl+hMGXFksz6YpZSgz1SFg5qni8 WPUDvFGCpjxTflOpYlcSfTcBhB16zpHUGbaImkPW4SYCpviPhJ069sxwDRUsEetv6bGQ j1dN4wvaJ0mNu5Ek/6ND+i9p9vkRIR2azmzmAyNWcM6WKOG6DwsCmtwU7zcWB6QOGwG4 z0rVC/CVeptp63ChtnPr19BbiICghuo0L5Grbx6L3PI0JPqhUJCByV5Q9b+PUAMf2b7I 98Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=hnwSP26nUyxJVjfKriUNAIMcTHY25FLJy3FKVmmHnBU=; b=gSSIPxQ36WkjacQIPzLXKi0yIMW+hmmvDjfJfPJhW3DfwJsPaPdFcHit/hYwYo0oeW GX8myb20c8vP39uVJ4JuWffWt0fjWAiiXcdagqtEba8dHWdlUgMDxzgi/9OzDzFi5POv L1+rRt7PjkE7/L2DP05R45M9669NmsxQqdC297LqllAPpJdbgKCm0jHfDwtdwVLOKpVB Fxqtw0BzTZs+q0lCFw8+bI5w1Ec+ZFUF6M92AL/bNbe9OptSGgoe1P/lAGrNQA2WJ/yK zlEpW5hAGIDoU2Aazad1OFNQlkCTuc8A2gilFo8H+wPhbVbNO2KMHBSaAX+RgQ+4TxjN mxlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=Vxv6d3E8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m13si10314988edi.602.2020.09.17.07.54.58; Thu, 17 Sep 2020 07:55:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=Vxv6d3E8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727695AbgIQOvd (ORCPT + 99 others); Thu, 17 Sep 2020 10:51:33 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:41866 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727534AbgIQOYy (ORCPT ); Thu, 17 Sep 2020 10:24:54 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08HDC7k4042811; Thu, 17 Sep 2020 09:25:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=hnwSP26nUyxJVjfKriUNAIMcTHY25FLJy3FKVmmHnBU=; b=Vxv6d3E8z4V5wRwQibk4PbHaLEnSXesYVfyNLvTMM2bR8E6UoRQI//Wg3qMaYq7KRLUC qEXqaLteWDAH3pUr2k+r0B1rBcbyLk8uxN8JTbqqdSTEhDt9DENhfgfGW6sDdIk3ojqD rHh004djUyeYdRQXCDahtXSeId/q+21O4zb5f9/tL/w5yv+XrF+3g8EW1Csqyd1PVqvS ekie5uR1SZzGxIaDIPYLeOZ2sxLWWWDdOuyTKXJH6i9n6LrVPTs9pci+TkBWpgTED5lM eZPrTd1kIyGLg++DZqzbo5LRjU6Zah8iDOsr/4LvYcT3F6GyJ2MbYZwd1FCA/FyjoKp1 8w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 33m8fnrd8s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 17 Sep 2020 09:25:01 -0400 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 08HDCOB0043136; Thu, 17 Sep 2020 09:25:00 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0b-001b2d01.pphosted.com with ESMTP id 33m8fnrd8b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 17 Sep 2020 09:25:00 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 08HDMfZb008450; Thu, 17 Sep 2020 13:25:00 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma03dal.us.ibm.com with ESMTP id 33k5v20xa9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 17 Sep 2020 13:25:00 +0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 08HDOx6054067638 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 17 Sep 2020 13:24:59 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 45FCDAE060; Thu, 17 Sep 2020 13:24:59 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 27FA8AE05F; Thu, 17 Sep 2020 13:24:56 +0000 (GMT) Received: from localhost.localdomain (unknown [9.211.95.89]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 17 Sep 2020 13:24:55 +0000 (GMT) Subject: Re: [PATCH v6 0/8] powerpc/watchpoint: Bug fixes plus new feature flag To: Ravi Bangoria , mpe@ellerman.id.au, christophe.leroy@c-s.fr Cc: mikey@neuling.org, jniethe5@gmail.com, pedromfc@linux.ibm.com, linux-kernel@vger.kernel.org, paulus@samba.org, rogealve@linux.ibm.com, naveen.n.rao@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org References: <20200902042945.129369-1-ravi.bangoria@linux.ibm.com> From: Rogerio Alves Message-ID: <6927523d-de63-910a-e789-5fab424c7eb9@linux.ibm.com> Date: Thu, 17 Sep 2020 10:24:54 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200902042945.129369-1-ravi.bangoria@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-09-17_09:2020-09-16,2020-09-17 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 suspectscore=0 mlxscore=0 spamscore=0 impostorscore=0 adultscore=0 mlxlogscore=999 clxscore=1011 priorityscore=1501 malwarescore=0 bulkscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009170098 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/2/20 1:29 AM, Ravi Bangoria wrote: > Patch #1 fixes issue for quardword instruction on p10 predecessors. > Patch #2 fixes issue for vector instructions. > Patch #3 fixes a bug about watchpoint not firing when created with > ptrace PPC_PTRACE_SETHWDEBUG and CONFIG_HAVE_HW_BREAKPOINT=N. > The fix uses HW_BRK_TYPE_PRIV_ALL for ptrace user which, I > guess, should be fine because we don't leak any kernel > addresses and PRIV_ALL will also help to cover scenarios when > kernel accesses user memory. > Patch #4,#5 fixes infinite exception bug, again the bug happens only > with CONFIG_HAVE_HW_BREAKPOINT=N. > Patch #6 fixes two places where we are missing to set hw_len. > Patch #7 introduce new feature bit PPC_DEBUG_FEATURE_DATA_BP_ARCH_31 > which will be set when running on ISA 3.1 compliant machine. > Patch #8 finally adds selftest to test scenarios fixed by patch#2,#3 > and also moves MODE_EXACT tests outside of BP_RANGE condition. > > Christophe, let me know if this series breaks something for 8xx. > > v5: https://lore.kernel.org/r/20200825043617.1073634-1-ravi.bangoria@linux.ibm.com > > v5->v6: > - Fix build faulure reported by kernel test robot > - patch #5. Use more compact if condition, suggested by Christophe > > > Ravi Bangoria (8): > powerpc/watchpoint: Fix quarword instruction handling on p10 > predecessors > powerpc/watchpoint: Fix handling of vector instructions > powerpc/watchpoint/ptrace: Fix SETHWDEBUG when > CONFIG_HAVE_HW_BREAKPOINT=N > powerpc/watchpoint: Move DAWR detection logic outside of > hw_breakpoint.c > powerpc/watchpoint: Fix exception handling for > CONFIG_HAVE_HW_BREAKPOINT=N > powerpc/watchpoint: Add hw_len wherever missing > powerpc/watchpoint/ptrace: Introduce PPC_DEBUG_FEATURE_DATA_BP_ARCH_31 > powerpc/watchpoint/selftests: Tests for kernel accessing user memory > > Documentation/powerpc/ptrace.rst | 1 + > arch/powerpc/include/asm/hw_breakpoint.h | 12 ++ > arch/powerpc/include/uapi/asm/ptrace.h | 1 + > arch/powerpc/kernel/Makefile | 3 +- > arch/powerpc/kernel/hw_breakpoint.c | 149 +--------------- > .../kernel/hw_breakpoint_constraints.c | 162 ++++++++++++++++++ > arch/powerpc/kernel/process.c | 48 ++++++ > arch/powerpc/kernel/ptrace/ptrace-noadv.c | 9 +- > arch/powerpc/xmon/xmon.c | 1 + > .../selftests/powerpc/ptrace/ptrace-hwbreak.c | 48 +++++- > 10 files changed, 282 insertions(+), 152 deletions(-) > create mode 100644 arch/powerpc/kernel/hw_breakpoint_constraints.c > Tested this patch set for: - SETHWDEBUG when CONFIG_HAVE_HW_BREAKPOINT=N = OK - Fix exception handling for CONFIG_HAVE_HW_BREAKPOINT=N = OK - Check for PPC_DEBUG_FEATURE_DATA_BP_ARCH_31 = OK - Fix quarword instruction handling on p10 predecessors = OK - Fix handling of vector instructions = OK Also tested for: - Set second watchpoint (P10 Mambo) = OK - Infinity loop on sc instruction = OK