Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2517935pxy; Tue, 3 Aug 2021 08:16:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+WtfrxtoKxhvS+7qBI/TMy78gUr2bqdbszNl4pogZdRprSGh3Fp6VSV7o1Lc/BuoBbMu1 X-Received: by 2002:aa7:d4da:: with SMTP id t26mr25862920edr.42.1628003776791; Tue, 03 Aug 2021 08:16:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628003776; cv=none; d=google.com; s=arc-20160816; b=RzUF5q2bW33viM3DdFCD2VKKDMQ/ZFyXI320RMkbSkUk5cG20mYqbs7e7QZiJtSCAT Fp4M0fuJCXyQXW62R1oiqdTiJWz8wZGgARSyI2nDhE+q6+CcAHuABlvjdSZIBsHwzHo3 jUk0vTg71EUEOvHAq6YUquw9I7LDf2mJcDsu0LgPYMHlpEAAWO2TGcTRZ1s0qy0sVUHN VDnXVO+SDW1xF3cEtsvfrGF+gcrHe6UFDefvUlVsK6ZALPtJJ+64OiGJ2JOh9xfU40pR pnVcbkrw1e+0YjKHNkuBq1SU6fxQusQtuwZSsNDK3em9FbcwfdoV/JfPQePjbUAOEc8C tm5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:cc:to:subject:from:message-id; bh=obL6whcRyNaNleIuCb332ePZ7klzShtbv7fIYl2l1zE=; b=doHiglSZEjlBTu8kcaMRMa9j2JW6x9HHd0gW1oZoFzxy33qy2hEdbGXWaPIfStPuI3 sI2GnGyaH/0+TcQ60qoXWL+4yhtB1Y6Sh9WxEsFZx1TwZTCUVoEF1qUdKz+c6vK+M5Pf afskQk5seiOMM3VT73M8+q8QH4IoXH/r9rj8vjE2y4wpuh87l1HCVlWxKHbQcjPIynjZ uiTWZEdK9vlr2tImCi/19Er3eKXLFK8PPQ7PYdIS6NXi3YTOfrAGa6cKmxO3ei4mU7XZ jwjDYfn4NfXnnxz2xy1uU9zm6SG7pvwjwabMtq12bUNFbMiTl9ufmiOyITQdxvUQqe0W C9/w== 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 w24si13576964edr.159.2021.08.03.08.15.52; Tue, 03 Aug 2021 08:16: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 S236645AbhHCPOm (ORCPT + 99 others); Tue, 3 Aug 2021 11:14:42 -0400 Received: from pegase2.c-s.fr ([93.17.235.10]:44307 "EHLO pegase2.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236085AbhHCPOl (ORCPT ); Tue, 3 Aug 2021 11:14:41 -0400 Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4GfJLr687Hz9sTY; Tue, 3 Aug 2021 17:14:28 +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 pGJaOhC-Cw5t; Tue, 3 Aug 2021 17:14:28 +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 4GfJLr5C1Fz9sT6; Tue, 3 Aug 2021 17:14:28 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 8A3BE8B77D; Tue, 3 Aug 2021 17:14:28 +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 Fa2NBPNFxV5K; Tue, 3 Aug 2021 17:14:28 +0200 (CEST) Received: from po9473vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 533798B763; Tue, 3 Aug 2021 17:14:28 +0200 (CEST) Received: by po9473vm.idsi0.si.c-s.fr (Postfix, from userid 0) id F37EF662BA; Tue, 3 Aug 2021 15:14:27 +0000 (UTC) Message-Id: <731694e0885271f6ee9ffc179eb4bcee78313682.1628003562.git.christophe.leroy@csgroup.eu> From: Christophe Leroy Subject: [PATCH] powerpc/32s: Fix napping restore in data storage interrupt (DSI) To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Finn Thain , userm57@yahoo.com Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Tue, 3 Aug 2021 15:14:27 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When a DSI (Data Storage Interrupt) is taken while in NAP mode, r11 doesn't survive the call to power_save_ppc32_restore(). So use r1 instead of r11 as they both contain the virtual stack pointer at that point. Reported-by: Finn Thain Fixes: 4c0104a83fc3 ("powerpc/32: Dismantle EXC_XFER_STD/LITE/TEMPLATE") Cc: stable@vger.kernel.org Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_book3s_32.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/head_book3s_32.S b/arch/powerpc/kernel/head_book3s_32.S index 764edd860ed4..68e5c0a7e99d 100644 --- a/arch/powerpc/kernel/head_book3s_32.S +++ b/arch/powerpc/kernel/head_book3s_32.S @@ -300,7 +300,7 @@ ALT_MMU_FTR_SECTION_END_IFSET(MMU_FTR_HPTE_TABLE) EXCEPTION_PROLOG_1 EXCEPTION_PROLOG_2 INTERRUPT_DATA_STORAGE DataAccess handle_dar_dsisr=1 prepare_transfer_to_handler - lwz r5, _DSISR(r11) + lwz r5, _DSISR(r1) andis. r0, r5, DSISR_DABRMATCH@h bne- 1f bl do_page_fault -- 2.25.0