Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp532021pxb; Wed, 15 Sep 2021 07:37:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+d1Swly9JWxoLqcU3ejz4DlW9fdYmV3PeC7eEDl0AdK+f69njShtjoGPi9uCHQjnO18Yd X-Received: by 2002:a17:907:244a:: with SMTP id yw10mr284321ejb.571.1631716636285; Wed, 15 Sep 2021 07:37:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631716636; cv=none; d=google.com; s=arc-20160816; b=UYPJ71iNF2z+cRwdszXFp9ILHGDZmpb/CHgKWkhc4sCktIFGrGThZB+v7jdor/lj7l LECtusKWVGvqOfVMN+cQfqCYM17riex0bS+prDdawV5vVinVtK0tbzBDH0CR19iI07Kr Zr+aQNDhWfjNm25kTR2aBxBLBG2hVLGyZIPrTuulzgvPl61wLFTUu+avRnSWb9nhlvfF Dbstc0GzJkPFMWXo6ezkWBIWckSu/LLXlbnJKmbDES6c4Z0UJX3NIe5I53EXckQSixSu +lHHWKVoQO7n3VvuYtbe5FWOxMhkoMPfxB+QPhp0NA5YwtnqpPLEq+FYincTZvdrsp+F MZBQ== 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 :message-id:date:subject:cc:to:from; bh=RAay6zbcfecw+RU+I0PDBz8GUTUB3W8jKNbUjMxBwRM=; b=AkHo7MUAbSsDFahtvcvgCzBRbylSmGz4WbER7Q4KGPV4mPUIU3tKYYCgZmU9J+rwUL MiUICS5H5qObhjz81D/X/TyUadHRMWwsGBCKxhwbvL3HftFK7kfqySbJ7EKy0gJzn4ki KB0aU/bBlXDlg9suj/YeEF0EpobNDQ871btnagCNM8MfmttkotHFrNK36YhbeL6rHpH3 jWjUEdMoSc0f7y8E+5SS2EuNb64cfX1oy8fWDo+j4w8CF11bBg9boFEuDai55D56TCtI YIjzGgT3gF+milnjCnSmek7dLnGc6U5v8Jy0cUdxrvPM42qc1jtC9URLv5qMPbHcmgN4 JPyg== 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 j3si114368ejj.516.2021.09.15.07.36.50; Wed, 15 Sep 2021 07:37:16 -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 S237972AbhIOOdS (ORCPT + 99 others); Wed, 15 Sep 2021 10:33:18 -0400 Received: from pegase2.c-s.fr ([93.17.235.10]:40637 "EHLO pegase2.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237847AbhIOOdN (ORCPT ); Wed, 15 Sep 2021 10:33:13 -0400 Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4H8jMs4SmSz9sTD; Wed, 15 Sep 2021 16:31:53 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IkXJCSmkFJfn; Wed, 15 Sep 2021 16:31:53 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4H8jMs3YkKz9sT5; Wed, 15 Sep 2021 16:31:53 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 6A1818B77B; Wed, 15 Sep 2021 16:31:53 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id 1p8XSaBWBAN0; Wed, 15 Sep 2021 16:31:53 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (unknown [172.25.230.108]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 51F788B763; Wed, 15 Sep 2021 16:31:53 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (localhost [127.0.0.1]) by PO20335.IDSI0.si.c-s.fr (8.16.1/8.16.1) with ESMTPS id 18FEVeeq376582 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 15 Sep 2021 16:31:40 +0200 Received: (from chleroy@localhost) by PO20335.IDSI0.si.c-s.fr (8.16.1/8.16.1/Submit) id 18FEVeGm376581; Wed, 15 Sep 2021 16:31:40 +0200 X-Authentication-Warning: PO20335.IDSI0.si.c-s.fr: chleroy set sender to christophe.leroy@csgroup.eu using -f From: Christophe Leroy To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: Christophe Leroy , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Stan Johnson , Finn Thain Subject: [PATCH] powerpc: warn on emulation of dcbz instruction Date: Wed, 15 Sep 2021 16:31:40 +0200 Message-Id: <62b33ca839f3d1d7d4b64b6f56af0bbe4d2c9057.1631716292.git.christophe.leroy@csgroup.eu> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); r = emulate_dcbz(op.ea, regs); } else { if (type == LARX || type == STCX) -- 2.31.1