Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp269216pxx; Wed, 28 Oct 2020 04:35:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9Ye5+qM0+RhhgdkZUiZ7KPtQy/+wPCJ8a8IATGIp1BOQ7ixwG1AR5yfXlFG4ZSkHQfZHC X-Received: by 2002:a17:906:da03:: with SMTP id fi3mr7128822ejb.321.1603884959558; Wed, 28 Oct 2020 04:35:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603884959; cv=none; d=google.com; s=arc-20160816; b=HZQwzOCKnGjKIGDxVoxEdTffosCAh81WX1JI97v8qiENhf4zbCNMyXNnkjLqt7UV/R EQpCIGYiLsU0KXoImsswahmuNX+nSBAPl9wmuc0xHuze8MDFlOmj2N8D1y0Rb2g/xm7T 11WoM+4RTpekxz6Eco9u5AGiSiWPPNllQiVUln7qCk0yJ4JxHfNny6pkppYrXhkHFqIs 5DcxOWI/RQLJpUe5wkfnTfPNj9aukCmjkjhIVUAkvY/1XhuHVIwjoWgFIn4FltRHPY2x QThyCzF6a3OlP16g5eiN87MMYPIzBBvl0sGKYGjfMvCPB+nzSuujbut+quippgFHptdl uItA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8OvaLuzku5f+t/mvnPDLD+BSecRCts1+auuW68hdy5s=; b=fRZTKr+nSe51vSiG6EE13IPwkf9hNkhSpHwUSSlMEyx4x3dCX8qcIq+jBfy1bHDMVQ nJvoNeumDzOaYoPJvARVEcxyG+ZUkQ6ihZzDRZJP35oJb5fWLxEKTEmTogKfSpV1QsMd rsyxZSf2n1h045cnF/6y6vq/n/P94iNt0yVtTaWB5ihFTrW0SnxlnJZtHmtx6r6hZmKO l/9ehZJqlXjnNrSbiMulqKU+YoF2kRDRv/ZhPUeMzLztDKpW6mZNkBMtiZ4HHWdQqRvd XUHhAm8NZdBI6Yge7nzEpOaJFinDfs3Flus2ocliy58JxdYZLdeZmrSJnNypGj7szv8z 31Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="KQ/U1wkG"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i19si2816688ejh.153.2020.10.28.04.35.36; Wed, 28 Oct 2020 04:35:59 -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=@kernel.org header.s=default header.b="KQ/U1wkG"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1793938AbgJ0PJN (ORCPT + 99 others); Tue, 27 Oct 2020 11:09:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:39002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1790310AbgJ0PE1 (ORCPT ); Tue, 27 Oct 2020 11:04:27 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 E39CF2071A; Tue, 27 Oct 2020 15:04:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811066; bh=xZgfhOUdCgITy5fRdjWo8BUTSh/b2mnlmcYlyA3ZZ5s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KQ/U1wkG/etm0g6zPfz+fH4La8xe1uZSTSJ2QtoQkMIIC+owSdh8y4ArUXtUj95Zd qPUT+hXwSZwTuJoGNaDOWaBJogvvzbagfFboew1aK/IlIiMUQMbFpaRVEDQV4Nl6nn Eur8MJ+VX8hBDQigWq8t2RaTEaiio+keo99bnpxM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ravi Bangoria , Michael Ellerman , Sasha Levin Subject: [PATCH 5.8 362/633] powerpc/watchpoint: Add hw_len wherever missing Date: Tue, 27 Oct 2020 14:51:45 +0100 Message-Id: <20201027135539.677215255@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ravi Bangoria [ Upstream commit 58da5984d2ea6d95f3f9d9e8dd9f7e1b0dddfb3c ] There are couple of places where we set len but not hw_len. For ptrace/perf watchpoints, when CONFIG_HAVE_HW_BREAKPOINT=Y, hw_len will be calculated and set internally while parsing watchpoint. But when CONFIG_HAVE_HW_BREAKPOINT=N, we need to manually set 'hw_len'. Similarly for xmon as well, hw_len needs to be set directly. Fixes: b57aeab811db ("powerpc/watchpoint: Fix length calculation for unaligned target") Signed-off-by: Ravi Bangoria Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200902042945.129369-7-ravi.bangoria@linux.ibm.com Signed-off-by: Sasha Levin --- arch/powerpc/kernel/ptrace/ptrace-noadv.c | 1 + arch/powerpc/xmon/xmon.c | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/powerpc/kernel/ptrace/ptrace-noadv.c b/arch/powerpc/kernel/ptrace/ptrace-noadv.c index 697c7e4b5877f..8bd8d8de5c40b 100644 --- a/arch/powerpc/kernel/ptrace/ptrace-noadv.c +++ b/arch/powerpc/kernel/ptrace/ptrace-noadv.c @@ -219,6 +219,7 @@ long ppc_set_hwdebug(struct task_struct *child, struct ppc_hw_breakpoint *bp_inf brk.address = ALIGN_DOWN(bp_info->addr, HW_BREAKPOINT_SIZE); brk.type = HW_BRK_TYPE_TRANSLATE; brk.len = DABR_MAX_LEN; + brk.hw_len = DABR_MAX_LEN; if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_READ) brk.type |= HW_BRK_TYPE_READ; if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_WRITE) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 7efe4bc3ccf63..ac5862cee142a 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -962,6 +962,7 @@ static void insert_cpu_bpts(void) brk.address = dabr[i].address; brk.type = (dabr[i].enabled & HW_BRK_TYPE_DABR) | HW_BRK_TYPE_PRIV_ALL; brk.len = 8; + brk.hw_len = 8; __set_breakpoint(i, &brk); } } -- 2.25.1