Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1149197pxb; Thu, 16 Sep 2021 00:22:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcLNUVFjQ7KX+jVYxie1FkFaJl7xvDIQdUgfqts1nrWbZBj5FaFIna8Mm6LOHnfjSwws2t X-Received: by 2002:a05:6402:28ad:: with SMTP id eg45mr4952977edb.226.1631776967891; Thu, 16 Sep 2021 00:22:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631776967; cv=none; d=google.com; s=arc-20160816; b=ZZy1zyzs3/gSEfLjQozwTYBCAedsdNtinFBwoKn5H/pKc79HyeIE7taoTeFDH31Fp+ ooIqNTNQw3oCHrHVXplReWi+wxKYklWz3bbiLtCVDtGzpEb22RE8dcdiyF/FwTVYqgMV Z2fqTeLlbhGKycJ/9GSJyxLPW3rHhQYgk0XW1RQTRmRGgWalzRYVxN5ShbtCglS0mbml wIetDpGg+Ka2n28F/pqb4CHwBivqmZgETuOHtYRbZvcbNlNAzBuC27D5G6LaIbyO7nR+ kccvg02IXoeCeknGZZqFQzO3AT16qUiAbhM/Uaozz5/KbKz+iUPnx+1G0hPFKu3uwUZQ g+KA== 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:date:cc:to:from:subject :message-id; bh=kuwugluc+2TM7v/rRpg073povg6W5xK8P1Urw3B3Om0=; b=L1RU+4rrJsq14tz8s+iG89IL7pxuK4c8bIrjjuFDm8gJmX5NgArmrH8VHetorPUrUN XxzpCey3o5IDd73Q7TLL0CjUYj62giXkuDZJI20pzedNsa4YJGy7qLnMnIVPbFrB+IAv njQ9283cxZllR2AgJPYFX2iqZc9rydemLlDNJkvAtX0lGmL4LeJWRqLwn4rcU/j5jgPb h9cpHm6OU58c2/WtMsLEwSGxGReThcIc89n3+uIdicWMWJJBPr0fxuSjz1SoJnqcrgc6 9QM57XvZBLNVXHnWZzl2MhZEMqiME3d4kVvTs4Z6oyvedsKGnGrsiHb07mWurU1XUKn4 SG/g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w25si2777211ejk.769.2021.09.16.00.22.22; Thu, 16 Sep 2021 00:22:47 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234689AbhIPHWM (ORCPT + 99 others); Thu, 16 Sep 2021 03:22:12 -0400 Received: from gate.crashing.org ([63.228.1.57]:33881 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234568AbhIPHWL (ORCPT ); Thu, 16 Sep 2021 03:22:11 -0400 Received: from ip6-localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 18G7FGqQ031443; Thu, 16 Sep 2021 02:15:17 -0500 Message-ID: <2c0fd775625c76c4dd09b3e923da4405a003f3bd.camel@kernel.crashing.org> Subject: Re: [PATCH] powerpc: warn on emulation of dcbz instruction From: Benjamin Herrenschmidt To: Christophe Leroy , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Stan Johnson , Finn Thain Date: Thu, 16 Sep 2021 17:15:16 +1000 In-Reply-To: <62b33ca839f3d1d7d4b64b6f56af0bbe4d2c9057.1631716292.git.christophe.leroy@csgroup.eu> References: <62b33ca839f3d1d7d4b64b6f56af0bbe4d2c9057.1631716292.git.christophe.leroy@csgroup.eu> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2021-09-15 at 16:31 +0200, Christophe Leroy wrote: > dcbz instruction shouldn't be used on non-cached memory. Using > it on non-cached memory can result in alignment exception and > implies a heavy handling. > > Instead of silentely emulating the instruction and resulting in high > performance degradation, warn whenever an alignment exception is > taken due to dcbz, so that the user is made aware that dcbz > instruction has been used unexpectedly. > > Reported-by: Stan Johnson > Cc: Finn Thain > Signed-off-by: Christophe Leroy > --- > arch/powerpc/kernel/align.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/powerpc/kernel/align.c > b/arch/powerpc/kernel/align.c > index bbb4181621dd..adc3a4a9c6e4 100644 > --- a/arch/powerpc/kernel/align.c > +++ b/arch/powerpc/kernel/align.c > @@ -349,6 +349,7 @@ int fix_alignment(struct pt_regs *regs) > if (op.type != CACHEOP + DCBZ) > return -EINVAL; > PPC_WARN_ALIGNMENT(dcbz, regs); > + WARN_ON_ONCE(1); This is heavy handed ... It will be treated as an oops by various things uselessly spit out a kernel backtrace. Isn't PPC_WARN_ALIGNMENT enough ? Ben.