Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7800436ybi; Thu, 6 Jun 2019 01:34:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqx80boQzyT0Jex5Eb8QI9TMFUL1zCpYq49nyGPl4Kx1LKjYuUm64VgtoIge8orJuNiQyRj1 X-Received: by 2002:a62:3283:: with SMTP id y125mr1460527pfy.83.1559810043174; Thu, 06 Jun 2019 01:34:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559810043; cv=none; d=google.com; s=arc-20160816; b=EcSDehzZDzzOkJXXjpr3575Lt/Uu4B6bADkHp6+WRJjQB389T/24PG6zTM8x5LSnKX kpXU9bp7REefyILlG9xK5DBjmWMd7SLPKb6i0LMZ5GhbBTv3ze7ubrXh5rEfMHrOlvDp qDvoQ/TCHaoNjYWavRy2quoAN1aZMt4RiHUbk6Y7tNzbjPQsisG88uvKN9rYl0Zbb/jh LMnNNbGQnJYlNdkSc0jpA8qIjVAWioaSxrEtla4PgeWvGGXyoED7Yad2yaGI4x7Nkz8Z khwiMTzNkvxxAjcL5tGdSa2LTF3cUkh7LVCCqxyTWD5hoSN99wgIqM/QqbQb3zYTgsrJ D1RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date:from :references:cc:to:subject; bh=u7xsAraaUOn3UYrZN2koWuMrGRD9q2FWur6RTD69z4o=; b=HzAlBi9Gg5PoBSq9AJI/cqzI74m1RP0XeE+nY1J3gwMgG2EB7a6An3NsmYZuZnet2V Bf2x/owvSXoOjc0UvML0zPfKYTwurklU9jvUJcBMzCzrxVd58HucoVp8mTVf/aV0WUFZ NtlU3zoFVb/YgVs2V/1hjFvndvw8NskjjSBbiIyv7ni7g+QPCLQEs+VEiHpMQxXD7wMi w/3+pQgwLwG6GLRSxy/uZ08doe5pu1GwkR5SwZFHjDXsz9D7YqMwgSI2FFTvGQ4tyEmu SIECWVUaSH5r9WpBoVe5uB9I63meTwBzY67AC8oOJGLLXEVuZVYPDrcLp66IM8OCZ44+ tmRQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j4si1565189pgf.369.2019.06.06.01.33.45; Thu, 06 Jun 2019 01:34:03 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727184AbfFFIbT (ORCPT + 99 others); Thu, 6 Jun 2019 04:31:19 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:44688 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725267AbfFFIbT (ORCPT ); Thu, 6 Jun 2019 04:31:19 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x568S84X068566 for ; Thu, 6 Jun 2019 04:31:18 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2sxy8w8d06-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 06 Jun 2019 04:31:17 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 6 Jun 2019 09:31:15 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 6 Jun 2019 09:31:13 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x568VCln57278506 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 6 Jun 2019 08:31:12 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7842E5204E; Thu, 6 Jun 2019 08:31:12 +0000 (GMT) Received: from [9.199.33.95] (unknown [9.199.33.95]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 5DC6052051; Thu, 6 Jun 2019 08:31:06 +0000 (GMT) Subject: Re: [PATCH] Powerpc/Watchpoint: Restore nvgprs while returning from exception To: mpe@ellerman.id.au Cc: mikey@neuling.org, benh@kernel.crashing.org, paulus@samba.org, npiggin@gmail.com, christophe.leroy@c-s.fr, mahesh@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Ravi Bangoria References: <20190606072951.32116-1-ravi.bangoria@linux.ibm.com> From: Ravi Bangoria Date: Thu, 6 Jun 2019 14:00:59 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190606072951.32116-1-ravi.bangoria@linux.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 19060608-4275-0000-0000-0000033F4D72 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19060608-4276-0000-0000-0000384F512B Message-Id: <162079d5-bfc2-0707-5c98-33e196ed5d96@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-06_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=826 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906060062 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/6/19 12:59 PM, Ravi Bangoria wrote: > Powerpc hw triggers watchpoint before executing the instruction. > To make trigger-after-execute behavior, kernel emulates the > instruction. If the instruction is 'load something into non- > volatile register', exception handler should restore emulated > register state while returning back, otherwise there will be > register state corruption. Ex, Adding a watchpoint on a list > can corrput the list: > > # cat /proc/kallsyms | grep kthread_create_list > c00000000121c8b8 d kthread_create_list > > Add watchpoint on kthread_create_list->next: s/kthread_create_list->next/kthread_create_list->prev/