Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp270683pxx; Wed, 28 Oct 2020 04:38:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+8h0AYQH4gjpRJnYuCYFAO9kfdR35HgyqfTedfuWFDAi1xNO90Ln+dfJFEa+GLH0Pq369 X-Received: by 2002:a17:906:35d7:: with SMTP id p23mr4078694ejb.312.1603885094668; Wed, 28 Oct 2020 04:38:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603885094; cv=none; d=google.com; s=arc-20160816; b=tdZyiVfK//jO5fgkmbCc38dbjQVuMe9DsNAwMyTu/k8DMpw0N7jMlozRC+p6JimHJG hfdWVuENTom0YvHY72QxOXCAZsSwklYC+IdBeoJkfOAW+jrDQTivD+5IBeai5XwMzFho HOtz6BaPB0j6KU39vqHq3ATJKKTFcW4SHpj00f5aZk0sb+CY9KvhPBT9yqVh44U8ydUl UZx+Ljdfkb7+1jMcUb9Cz3VTQweTsbu5DxZ7kDwOVlXz7qkbHxh2tIAXCNCpBoKTMths EtdwezJWrWHc+k8QeeHPJlzy/iwacE2QigUALS9K6qcLoZSjsk9lNEgKypvD65yWX8bs k2Uw== 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=dKcMv50ObbOIeO385aBhYGa49FLKxE4XxMkyoJ95EBo=; b=DaAt8qVjyse7UK0aXH/AT2FdDTOVKPbeUenkCoQlJWmpDaMo3LHl8aFfXIKzVt0uA9 epjvL0UcSZwR4sp7OiVjPpMvv7vNEIQL0qPuRoRkV0aQaZbbjpyrEvVfwBxRHZGKnYBS q8fY+RJGLAKDNi94qa8g/qR/nysfo/FY53q+Hnx34j8zx/42li823oqGVq9yDoFwn3Vx acigvJby3MpfIEqNnJIYoQQijJ4ye/xHxh+BAX+5Tlo1EOf4MFahAIevlLTjJK1UJ97z AhLOS+3ZnT29JcHpKauNK9WNPlzclyDOncbMgmAE2Wvv6NfrABLVMVIkiyZc/+6ZYTe5 zP4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BPEvzyKj; 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 z8si2802677eju.267.2020.10.28.04.37.51; Wed, 28 Oct 2020 04:38:14 -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=BPEvzyKj; 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 S368314AbgJ0PJr (ORCPT + 99 others); Tue, 27 Oct 2020 11:09:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:38968 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1790305AbgJ0PEY (ORCPT ); Tue, 27 Oct 2020 11:04:24 -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 34A9F20747; Tue, 27 Oct 2020 15:04:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811063; bh=RFMwSIua67ij+5d8vhBow1V7AfxFAiUOljRmCneloQY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BPEvzyKjoa8JWnpTZ3I+EuNcDji6kPW+50zT6aAtj32vwnrHxMUwDlNI8BodEPXfc YTHboTC5P3FfXQdbXzEArLT9hFnd8kn5ZSFMmZfm01rbJfyHzbZ0ilW0UV/8Uw4P9w 8mUnrkcqCDbwyHtF9/tmSy9eBSc2Ia7KKuOwKzbA= 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 361/633] powerpc/watchpoint: Fix handling of vector instructions Date: Tue, 27 Oct 2020 14:51:44 +0100 Message-Id: <20201027135539.627901619@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 4441eb02333a9b46a0d919aa7a6d3b137b5f2562 ] Vector load/store instructions are special because they are always aligned. Thus unaligned EA needs to be aligned down before comparing it with watch ranges. Otherwise we might consider valid event as invalid. Fixes: 74c6881019b7 ("powerpc/watchpoint: Prepare handler to handle more than one watchpoint") Signed-off-by: Ravi Bangoria Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200902042945.129369-3-ravi.bangoria@linux.ibm.com Signed-off-by: Sasha Levin --- arch/powerpc/kernel/hw_breakpoint.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c index f39e86d751144..2190be70c7fd9 100644 --- a/arch/powerpc/kernel/hw_breakpoint.c +++ b/arch/powerpc/kernel/hw_breakpoint.c @@ -643,6 +643,8 @@ static void get_instr_detail(struct pt_regs *regs, struct ppc_inst *instr, if (*type == CACHEOP) { *size = cache_op_size(); *ea &= ~(*size - 1); + } else if (*type == LOAD_VMX || *type == STORE_VMX) { + *ea &= ~(*size - 1); } } -- 2.25.1